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

📄 glossary.html

📁 SDK FAQ集
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p>An example might help to show why this is important. First, themost basic TCP/IP protocol header is 40 bytes, and it can be larger ifoptional fields are used. Now, consider a program that sends many small,two-byte packets. Without the Nagle algorithm, each of these packetswould be transmitted separately, with at least 20 bytes of overheadfor every byte of data. Obviously, this is quite wasteful. The Naglealgorithm counteracts this effect by delaying the transmission of smallpackets for some short time, such as 200 milliseconds. A packet is sentwhen this Nagle timer times out, or when a full <a href="#MTU">MTU</a>is accumulated.</p><p>This option is on by default in Winsock, but it can be turned off withthe TCP_NODELAY option of <code>setsockopt()</code>. This option should<a href="intermediate.html#nagle">not be turned off</a> except in avery few situations.</p><a name="non-blocking"><p><b>non-blocking</b> - This mode of operation is a sortof hybrid between <a href="#blocking">blocking</a> and<a href="#asynchronous">asynchronous</a> modes. Like calls on anasynchronous socket, non-blocking calls return immediately. Unlikeasynchronous sockets, Winsock does not tell you when that operationcompletes, or when it is safe to try another similar operation. Instead,you have to either use a "spin loop" to repeatedly re-try a function untilit succeeds (a Very Bad Thing), or use <code>select()</code> which will blockuntil the socket(s) you pass to it are ready to do something. (You makea socket non-blocking in Winsock by calling the <code>ioctlsocket()</code>function with the <code>FIONBIO</code> option.)</p><a name="osi-model"> <p><b>OSI model</b> - Of all the standards to come out of the OpenSystems Interconnect specifications, the OSI network model is the mostcommon and enduring. The OSI model is a seven-layer view of looking atthe network. It is presented below, with rough analogues from TCP/IPand Winsock.</p><ul><table border=1 cellspacing=0 cellpadding=5><tr bgcolor="#FBFDB0"><td><b>Layer 7</b></td><td align=center>Application (e.g. an FTP or email client)</td></tr><tr bgcolor="#F4D7AA"><td><b>Layer 6</b></td><td align=center>Presentation (formats data, such as encrypting or compressing it)</td></tr><tr bgcolor="#FBFDB0"><td><b>Layer 5</b></td><td align=center>Session (manages the logical client/server connection; e.g. the FTP protocol)</td></tr><tr bgcolor="#F4D7AA"><td><b>Layer 4</b></td><td align=center>Transport (understands low-level client/server association; e.g. UDP or TCP)</td></tr><tr bgcolor="#FBFDB0"><td><b>Layer 3</b></td><td align=center>Network (routable packet level of the protocol; e.g. IP)</td></tr><tr bgcolor="#F4D7AA"><td><b>Layer 2</b></td><td align=center>Data Link (e.g. packet driver)</td></tr><tr bgcolor="#FBFDB0"><td><b>Layer 1</b></td><td align=center>Physical (e.g. Ethernet hardware)</td></tr></table></ul><p>Layers 1 through 4 are the hardware and network <ahref="#stack">stack</a> (including the Winsock layer). Layers 5 through7 are all under the application's control.</p><a name="rfc"> <p><b>RFC</b> - Request for Comments. RFCs are the Internet's standardsmechanism; they document most of the "open" aspects of the Internet. Seealso the entry in <a href="http://www.netmeg.net/jargon/terms/r/RFC.html">TNHD</a>.</p><a name="router"><p><b>router</b> - A router is a <a href="#multi-homed">multi-homed</a>host that operates at OSI layer 3. A router moves packets between twoor more networks, usually based on configurable rules, based on thecontents of layer 3 (e.g. the IP addresses in a packet). Most modernnetwork hosts have at least some rudimentary routing capability. Asimplistic example: Consider a PC on a LAN that also has a modem forconnecting to the Internet. It might have a "LAN route" so that alltraffic destined for the LAN goes out the LAN adapter, and a "defaultroute" so that all other traffic goes out the modem. Try the "route"and "netstat -r" commands on a Windows 95 or Windows NT machine.</p><a name="server"><p><b>server</b> - A program that passively waits for network connectionson a well-known port. A typical server program has no user interface, andit usually can handle multiple network connections at once. In a typicalclient/server protocol, the server is passive: it usually only sendsdata as a result of data sent by the <a href="#client">client</a>.</p><a name="stack"><p><b>stack</b> - In network parlance, a stack is a set of layeredprograms, each of which talks to the ones above and below it. Below isan illustration of the most common kind of network stack, showing how anapplication program talks through the stack to the low-level network:</p><ul><table border=1 cellspacing=0 cellpadding=5><tr bgcolor="#FBFDB0"><td align=center><b>Winsock application</b></td></tr><tr bgcolor="#F4D7AA"><td align=center>Winsock API</td></tr><tr bgcolor="#FBFDB0"><td align=center>Proprietary Winsock DLL (WINSOCK.DLL, WSOCK32.DLL, WS2-32.DLL)</td></tr><tr bgcolor="#F4D7AA"><td align=center>Protocol stack API</td></tr><tr bgcolor="#FBFDB0"><td align=center>Protocol stack (TCP/IP, IPX/SPX, DECnet, etc.)</td></tr><tr bgcolor="#F4D7AA"><td align=center>Hardware driver API (packet driver, NDIS, ODI, etc.)</td></tr><tr bgcolor="#FBFDB0"><td align=center>Hardware driver</td></tr><tr bgcolor="#F4D7AA"><td align=center>Hardware API (specific to the networking hardware)</td></tr><tr bgcolor="#FBFDB0"><td align=center>Networking hardware (network interface card, modem, CSU/DSU)</td></tr><tr bgcolor="#F4D7AA"><td align=center><b>The network (Ethernet, DEC LAT, serial line)</b></td></tr></table></ul><p>You might have noticed that there is a stack within the stack: theprotocol stack. Just like the network stack, the protocol stack is alayered architecture, where higher-level components talk to lower-levelcomponents, and vice versa. In TCP/IP, for example, TCP is the high-levelnetwork transport that most applications use, while IP is the lower-levelpacket protocol that TCP uses.</p><a name="stream"><p><b>stream protocol</b> - A stream protocol, such as TCP, delivers datain variable-length packets whose size have no necessary relationshipwith the size of the packets that were sent. For example, if one hostsends two 50-byte packets to the other host, that host may receive themas 100 single-byte packets, as a single 100-byte packet, or as a handfulof smaller packets. Compare <a href="#datagram">datagram protocol</a>.</p>		</td>	</tr></table><!--  ---- Document Footer ----  --><hr noshade size=1 color=#404040><table cellpadding=5 cellspacing=0 border=0 width=95% align=center> 	<tr>		<td align=left>		    <a href="reviews/unp-v1.html">&lt;&lt; Unix Network Programming</a>		</td>		<td align=right>		</td>	</tr>	<tr>		<td align=left>			<i>Last modified on 29 April 2000 at 15:52 UTC-7</i>		</td>		<td align=right>			<font size=-1>Please send corrections to <a href="mailto:tangent@cyberport.com">tangent@cyberport.com</a>.</font>		</td>	</tr>	</table>	<table cellpadding=5 cellspacing=0 border=0 width=95% align=center> 	<tr>		<td align=left width=33%>			<font size=-1>				<a href="index.html"><b>&lt;</b> Go to the main FAQ page</a>			</font>		</td>		<td width=33%>			<font size=-1>			<center>				<a href="http://www.cyberport.com/~tangent/programming"><b>&lt;&lt;</b> Go to my Programming pages</a>			</center>			</font>		</td>		<td align=right width=33%>			<font size=-1>				<a href="http://www.cyberport.com/~tangent/"><b>&lt;&lt;&lt;</b> Go to my Home Page</a>			</font>		</td>	</tr>	</table>	</body></html>

⌨️ 快捷键说明

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