⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 495-497.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Special Edition Using Linux, Fourth Edition:Configuring a TCP/IP Network</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789717468//-->

<!--TITLE=Special Edition Using Linux, Fourth Edition//-->

<!--AUTHOR=Jack Tackett//-->

<!--AUTHOR=Jr.//-->

<!--AUTHOR=Steve Burnett//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=24//-->

<!--PAGES=495-497//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="493-495.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="497-499.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>The second section displays active UNIX domain sockets. UNIX domain sockets are an IPC (interprocess communication) mechanism that uses the UNIX file system as the rendezvous system. Processes create special files in the file system that are then opened by other processes on the machine that wants to communicate. The preceding <TT>netstat</TT> listing shows two sockets listening: one on /dev/printer and the other on /dev/log. There are also two currently connected sockets: one to /dev/log and one which has no specified path associated with it. Table 24.8 describes the fields in the Active UNIX Domain Sockets listing.</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 24.8</B> Fields in the Active UNIX Domain Sockets Listing

<TR>

<TH COLSPAN="3"><HR>

<TR>

<TH WIDTH="20%" ALIGN="LEFT">Field

<TH WIDTH="80%" ALIGN="LEFT" COLSPAN="2">Description

<TR>

<TD COLSPAN="3"><HR>

<TR>

<TD><TT>Proto</TT>

<TD COLSPAN="2">The protocol in use on this socket. This will usually be <TT>unix.</TT>

<TR>

<TD><TT>RefCnt</TT>

<TD COLSPAN="2">The number of processes attached to this socket.

<TR>

<TD VALIGN="TOP"><TT>Flags</TT>

<TD COLSPAN="2">The flags for this socket. Now, the only known flag is <TT>SO_ACCEPTON</TT> (<TT>ACC</TT> ), which indicates that the socket is unconnected and the process that made the socket is waiting for a connection request.

<TR>

<TD VALIGN="TOP"><TT>Type</TT>

<TD COLSPAN="2">The mode in which the socket is accessed. This field will contain one of the following keywords:

<TR>

<TD>

<TD WIDTH="25%"><TT>OCK_DGRAM</TT>

<TD WIDTH="55%">Datagram, connectionless mode

<TR>

<TD>

<TD><TT>OCK_STREAM</TT>

<TD>Connection-oriented stream mode

<TR>

<TD>

<TD><TT>OCK_RAW</TT>

<TD>Raw mode

<TR>

<TD>

<TD><TT>OCK_RDM</TT>

<TD>Reliably delivered message mode

<TR>

<TD>

<TD><TT>OCK_SEQPACKET</TT>

<TD>Sequential packet mode

<TR>

<TD>

<TD><TT>NKNOWN</TT>

<TD>Mode not known to <TT>netstat</TT> program

<TR>

<TD><TT>State</TT>

<TD COLSPAN="2">The current state of the socket. The following keywords are used:

<TD>

<TR>

<TD>

<TD><TT>FREE</TT>

<TD>The socket isn&#146;t allocated.

<TR>

<TD>

<TD><TT>LISTENING</TT>

<TD>The socket is waiting for a connection request.

<TR>

<TD>

<TD><TT>UNCONNECTED</TT>

<TD>There&#146;s no current connection on the socket.

<TR>

<TD>

<TD VALIGN="TOP"><TT>CONNECTING</TT>

<TD>The socket is attempting to make a connection.

<TR>

<TD>

<TD><TT>CONNECTED</TT>

<TD>The socket has a current connection.

<TR>

<TD>

<TD VALIGN="TOP"><TT>DISCONNECTING</TT>

<TD>The socket is attempting to shut down a connection.

<TR>

<TD>

<TD VALIGN="TOP"><TT>UNKNOWN</TT>

<TD>The state of the socket is unknown. You won&#146;t see this under normal operating conditions.

<TR>

<TD VALIGN="TOP"><TT>Path</TT>

<TD COLSPAN="2">This is the path name used by other processes to connect to the socket.

<TR>

<TD COLSPAN="3"><HR>

</TABLE>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>TIP:&nbsp;&nbsp;</B>Network interfaces that drop many packets or are getting many overrun errors can be a symptom of an overloaded machine or network. Checking the network interface statistics is a quick way of diagnosing this problem.<HR></FONT>

</BLOCKQUOTE>

<P>Invoking <TT>netstat</TT> with the <TT>-o</TT> option adds the internal state information to the Active Internet Connections listing. The following is an example of this:</P>

<!-- CODE SNIP //-->

<PRE>

$ <B>netstat -o</B>

Active Internet connections

Proto Recv-Q Send-Q Local Address       Foreign Address       (State)

tcp        0      0 localhost:1121      localhost:telnet      ESTABLISHED

off (0.00/0)

tcp        0      0 localhost:telnet    localhost:1121        ESTABLISHED

on  (673.69/0)

</PRE>

<!-- END CODE SNIP //-->

<P>The added data is at the end of each line and includes receiver retransmission byte count, transmitter retransmission byte count, timer state (on/off), and time/backoff values (in parentheses). The time displayed is the time left before the timer expires. The backoff is the retry count for the current data transmission. This data is useful in diagnosing network problems by making it easy to see which connection is having problems.

</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>Because the <TT>-o</TT> option outputs the state of internal TCP/IP data, the format of this data may change or this option may be removed in a later release of the networking software.<HR></FONT>

</BLOCKQUOTE>

<H4 ALIGN="LEFT"><A NAME="Heading15"></A><FONT COLOR="#000077">Examining the Kernel Routing Table</FONT></H4>

<P>Invoking <TT>netstat</TT> with the <TT>-r</TT> option prints out the kernel routing table. The format is the same as for the <TT>route</TT> command.</P>

<H4 ALIGN="LEFT"><A NAME="Heading16"></A><FONT COLOR="#000077">Displaying Network Interface Statistics</FONT></H4>

<P>Invoking <TT>netstat</TT> with the <TT>-i</TT> option prints out usage statistics for each active network interface&#151;another excellent tool for debugging network problems. With this command, it&#146;s very easy to see when packets are being dropped, overrun, and so on.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="493-495.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="497-499.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -