[转载]TCP/IP参考模型
<P><SPAN class=tpc_content><FONT size=2>信息来源:zh.wikipedia.org</FONT></SPAN></P><SPAN class=tpc_content><FONT size=2><P><B>TCP/IP参考模型</B>是一个抽象的分层模型,这个模型中,所有的<A title=TCP/IP href="http://zh.wikipedia.org/wiki/TCP/IP">TCP/IP</A>系列<A title=网络协议 href="http://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE">网络协议</A>都被归类到4个抽象的"层"中。每一抽象层建立在低一层提供的服务上,并且为高一层提供服务。</P>
<P>完成一些特定的任务需要众多的协议协同工作,这些协议分布在参考模型的不同层中的,因此有时称它们为一个<I>协议栈</I>。</P>
<P>TCP/IP参考模型为<A title=TCP/IP href="http://zh.wikipedia.org/wiki/TCP/IP">TCP/IP</A>协议栈订身制作。其中IP协议只关心如何使得数据能够跨越本地网络边界的问题,而不关心如何利用传输媒体,数据如何传输。整个<A title=TCP/IP href="http://zh.wikipedia.org/wiki/TCP/IP">TCP/IP</A>协议栈则负责解决数据如何通过许许多多个点对点通路(一个点对点通路,也称为一"跳", 1 hop)顺利传输,由此不同的网络成员能够在许多"跳"的基础上建立相互的数据通路。</P>
<P>如想分析更普遍的网络通信问题,ISO的<A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型</A>也能起更好的帮助作用。</P>
<P>
<TABLE cellSpacing=2 cellPadding=2 width=320 border=0>
<CAPTION><B><A title=网络协议 href="http://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE">网络协议</A></B> </CAPTION>
<TBODY>
<TR align=left bgColor=#ccccff>
<TD bgColor=#ffeecc><A title=应用层 href="http://zh.wikipedia.org/wiki/%E5%BA%94%E7%94%A8%E5%B1%82">应用层</A></TD>
<TD><A title=域名 href="http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D">DNS</A>, <A title=文件传输协议 href="http://zh.wikipedia.org/wiki/%E6%96%87%E4%BB%B6%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE">FTP</A>, <A class=new title=ENRP href="http://zh.wikipedia.org/w/index.php?title=ENRP&action=edit">ENRP</A>,<A title=超文本传输协议 href="http://zh.wikipedia.org/wiki/%E8%B6%85%E6%96%87%E6%9C%AC%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE">HTTP</A>, <A title=IMAP href="http://zh.wikipedia.org/wiki/IMAP">IMAP</A>, <A class=new title=IIRC href="http://zh.wikipedia.org/w/index.php?title=IIRC&action=edit">IIRC</A>, <A title=NNTP href="http://zh.wikipedia.org/wiki/NNTP">NNTP</A>, <A title=POP3 href="http://zh.wikipedia.org/wiki/POP3">POP3</A>, <A title=会话发起协议 href="http://zh.wikipedia.org/wiki/%E4%BC%9A%E8%AF%9D%E5%8F%91%E8%B5%B7%E5%8D%8F%E8%AE%AE">SIP</A>, <A title=简单邮件传输协议 href="http://zh.wikipedia.org/wiki/%E7%AE%80%E5%8D%95%E9%82%AE%E4%BB%B6%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE">SMTP</A>, <A title=简单网络管理协议 href="http://zh.wikipedia.org/wiki/%E7%AE%80%E5%8D%95%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86%E5%8D%8F%E8%AE%AE">SNMP</A>, <A title=SSH href="http://zh.wikipedia.org/wiki/SSH">SSH</A>, <A title=Telnet href="http://zh.wikipedia.org/wiki/Telnet">Telnet</A>, <A title=BitTorrent href="http://zh.wikipedia.org/wiki/BitTorrent">BitTorrent</A>, <A title=DHCP href="http://zh.wikipedia.org/wiki/DHCP">DHCP</A> ...</TD></TR>
<TR align=left bgColor=#ccccff>
<TD bgColor=#ffeecc><A title=传输层 href="http://zh.wikipedia.org/wiki/%E4%BC%A0%E8%BE%93%E5%B1%82">传输层</A></TD>
<TD><A title=DCCP href="http://zh.wikipedia.org/wiki/DCCP">DCCP</A>, <A title=SCTP href="http://zh.wikipedia.org/wiki/SCTP">SCTP</A>, <A title=传输控制协议 href="http://zh.wikipedia.org/wiki/%E4%BC%A0%E8%BE%93%E6%8E%A7%E5%88%B6%E5%8D%8F%E8%AE%AE">TCP</A>, <A title=实时传输协议 href="http://zh.wikipedia.org/wiki/%E5%AE%9E%E6%97%B6%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE">RTP</A>, <A title=用户数据报协议 href="http://zh.wikipedia.org/wiki/%E7%94%A8%E6%88%B7%E6%95%B0%E6%8D%AE%E6%8A%A5%E5%8D%8F%E8%AE%AE">UDP</A>, <A class=new title=IL href="http://zh.wikipedia.org/w/index.php?title=IL&action=edit">IL</A>, <A class=new title=RUDP href="http://zh.wikipedia.org/w/index.php?title=RUDP&action=edit">RUDP</A>, ...</TD></TR>
<TR align=left bgColor=#ccccff>
<TD bgColor=#ffeecc><A title=网络层 href="http://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E5%B1%82">网络层</A></TD>
<TD><A title=IPv4 href="http://zh.wikipedia.org/wiki/IPv4">IPv4</A>, <A title=IPv6 href="http://zh.wikipedia.org/wiki/IPv6">IPv6</A>...</TD></TR>
<TR align=left bgColor=#eeeeff>
<TD bgColor=#ffffee><A title=数据链路层 href="http://zh.wikipedia.org/wiki/%E6%95%B0%E6%8D%AE%E9%93%BE%E8%B7%AF%E5%B1%82">数据链路层</A></TD>
<TD><A title=以太网 href="http://zh.wikipedia.org/wiki/%E4%BB%A5%E5%A4%AA%E7%BD%91">以太网</A>, <A title=Wi-Fi href="http://zh.wikipedia.org/wiki/Wi-Fi">Wi-Fi</A>, <A title=令牌环 href="http://zh.wikipedia.org/wiki/%E4%BB%A4%E7%89%8C%E7%8E%AF">令牌环</A>, <A class=new title=MPLS href="http://zh.wikipedia.org/w/index.php?title=MPLS&action=edit">MPLS</A>, <A title=点对点协议 href="http://zh.wikipedia.org/wiki/%E7%82%B9%E5%AF%B9%E7%82%B9%E5%8D%8F%E8%AE%AE">PPP</A> ...</TD></TR>
<TR align=left bgColor=#eeeeff>
<TD bgColor=#ffffee><A title=物理层 href="http://zh.wikipedia.org/wiki/%E7%89%A9%E7%90%86%E5%B1%82">物理层</A></TD>
<TD><A title=RS-232 href="http://zh.wikipedia.org/wiki/RS-232">RS-232</A>, <A title=EIA-422 href="http://zh.wikipedia.org/wiki/EIA-422">EIA-422</A>, <A title=RS-449 href="http://zh.wikipedia.org/wiki/RS-449">RS-449</A>, <A title=EIA-485 href="http://zh.wikipedia.org/wiki/EIA-485">EIA-485</A>, <A class=new title=10BASE2 href="http://zh.wikipedia.org/w/index.php?title=10BASE2&action=edit">10BASE2</A>, <A class=new title=10BASE-T href="http://zh.wikipedia.org/w/index.php?title=10BASE-T&action=edit">10BASE-T</A> ...</TD></TR></TBODY></TABLE></P></FONT></SPAN><SPAN class=tpc_content>
<P>The <B>Internet Protocol Suite</B> is the set of <A title=网络传输协议 href="http://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE">网络传输协议</A> that implement the <A class=new title="Protocol stack" href="http://zh.wikipedia.org/w/index.php?title=Protocol_stack&action=edit">protocol stack</A> on which the <A title=Internet href="http://zh.wikipedia.org/wiki/Internet">Internet</A> and most commercial networks run. It is sometimes called the <B>TCP/IP</B> <A class=new title="Protocol suite" href="http://zh.wikipedia.org/w/index.php?title=Protocol_suite&action=edit">protocol suite</A>, after the two most important protocols in it: the <A title=TCP href="http://zh.wikipedia.org/wiki/TCP">Transmission Control Protocol</A> (<A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>) and the <A title=IP href="http://zh.wikipedia.org/wiki/IP">Internet Protocol</A> (<A title=IP href="http://zh.wikipedia.org/wiki/IP">IP</A>), which were also the first two defined.</P>
<P>The <A class=new title=網絡傳輸協議 href="http://zh.wikipedia.org/w/index.php?title=%E7%B6%B2%E7%B5%A1%E5%82%B3%E8%BC%B8%E5%8D%94%E8%AD%B0&action=edit">网络传输协议</A> like many can be viewed as a set of layers, each layer solves a set of problems involving the transmission of data, and provides a well-defined service to the higher layers based on using services from some lower layers. Higher layers are logically closer to the user and deal with more abstract <A class=new title=Data href="http://zh.wikipedia.org/w/index.php?title=Data&action=edit">data</A>, relying on lower layers to translate data into forms that can eventually be physically manipulated.</P>
<P>The <A class=new title=網絡傳輸協議 href="http://zh.wikipedia.org/w/index.php?title=%E7%B6%B2%E7%B5%A1%E5%82%B3%E8%BC%B8%E5%8D%94%E8%AD%B0&action=edit">网络传输协议</A> can be roughly fitted to the <A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型</A> which describes a fixed set of 7 layers and some vendors like to use this model. However not all of these layers fit well with ip based networking (which really involves a varying number of layers depending on the design of the applications and the underlying network) and some believe that trying to fit the <A class=new title="Internet protocol suite" href="http://zh.wikipedia.org/w/index.php?title=Internet_protocol_suite&action=edit">internet protocol suite</A> to the <A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型</A> does more to confuse than to help.</P>
<P>
<TABLE class=toc id=toc summary=目录>
<TBODY>
<TR>
<TD>
<DIV id=toctitle>
<H2>目录</H2></DIV>
<UL>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#.E5.88.86.E5.B1.82"><SPAN class=tocnumber>1</SPAN> <SPAN class=toctext>分层</SPAN></A>
<UL>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#.E5.BA.94.E7.94.A8.E5.B1.82"><SPAN class=tocnumber>1.1</SPAN> <SPAN class=toctext>应用层</SPAN></A>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#.E4.BC.A0.E8.BE.93.E5.B1.82"><SPAN class=tocnumber>1.2</SPAN> <SPAN class=toctext>传输层</SPAN></A>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#.E7.BD.91.E7.BB.9C.E5.B1.82"><SPAN class=tocnumber>1.3</SPAN> <SPAN class=toctext>网络层</SPAN></A> </LI></UL>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#Layers_in_the_Internet_Protocol_stack"><SPAN class=tocnumber>2</SPAN> <SPAN class=toctext>Layers in the Internet Protocol stack</SPAN></A>
<UL>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#The_link_layer"><SPAN class=tocnumber>2.1</SPAN> <SPAN class=toctext>The link layer</SPAN></A>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#The_Internetwork_layer"><SPAN class=tocnumber>2.2</SPAN> <SPAN class=toctext>The Internetwork layer</SPAN></A>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#The_transport_layer"><SPAN class=tocnumber>2.3</SPAN> <SPAN class=toctext>The transport layer</SPAN></A>
<LI class=toclevel-2><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#The_application_layer"><SPAN class=tocnumber>2.4</SPAN> <SPAN class=toctext>The application layer</SPAN></A> </LI></UL>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#Development"><SPAN class=tocnumber>3</SPAN> <SPAN class=toctext>Development</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#How_IP_Kills_and_Eats_Competitive_Networks"><SPAN class=tocnumber>4</SPAN> <SPAN class=toctext>How IP Kills and Eats Competitive Networks</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#Implementations"><SPAN class=tocnumber>5</SPAN> <SPAN class=toctext>Implementations</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#See_also"><SPAN class=tocnumber>6</SPAN> <SPAN class=toctext>See also</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#References"><SPAN class=tocnumber>7</SPAN> <SPAN class=toctext>References</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#External_links"><SPAN class=tocnumber>8</SPAN> <SPAN class=toctext>External links</SPAN></A>
<LI class=toclevel-1><A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B#TCP.2FIP_.E5.8F.82.E8.80.83.E6.96.87.E7.8C.AE"><SPAN class=tocnumber>9</SPAN> <SPAN class=toctext>TCP/IP 参考文献</SPAN></A> </LI></UL></TD></TR></TBODY></TABLE></P>
<P>
<SCRIPT type=text/java script>
//<![CDATA[
if (window.showTocToggle) { var tocShowText = "显示"; var tocHideText = "隐藏"; showTocToggle(); }
//]]>
</SCRIPT>
</P>
<P><A name=.E5.88.86.E5.B1.82></A></P>
<H2>分层</H2>
<P>TCP/IP参考模型分为四层。应用层(Application Layer),传输层(Transport Layer),网络层(Internet Layer),链路层(Link Layer)。</P>
<CENTER>
<TABLE cellSpacing=3 border=0>
<TBODY>
<TR>
<TH>TCP/IP分层</TH>
<TH colSpan=5>协议</TH>
<TH>OSI 分层</TH></TR>
<TR>
<TD align=middle bgColor=#9999ff><B>应用层</B></TD>
<TD align=middle bgColor=#9999ff><A title=FTP href="http://zh.wikipedia.org/wiki/FTP">FTP</A></TD>
<TD align=middle bgColor=#9999ff><A title=SMTP href="http://zh.wikipedia.org/wiki/SMTP">SMTP</A></TD>
<TD align=middle bgColor=#9999ff><A title=Telnet href="http://zh.wikipedia.org/wiki/Telnet">Telnet</A></TD>
<TD align=middle bgColor=#9999ff><A title=域名服务 href="http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D%E6%9C%8D%E5%8A%A1">DNS</A></TD>
<TD align=middle bgColor=#9999ff><A title=SNMP href="http://zh.wikipedia.org/wiki/SNMP">SNMP</A></TD>
<TD align=middle bgColor=#ffff99>7</TD></TR>
<TR>
<TD align=middle bgColor=#ffcc99><B>传输层</B></TD>
<TD align=middle bgColor=#9999ff colSpan=3><B><A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A></B></TD>
<TD align=middle bgColor=#9999ff colSpan=2><A title=UDP href="http://zh.wikipedia.org/wiki/UDP">UDP</A></TD>
<TD align=middle bgColor=#ffff99>4</TD></TR>
<TR>
<TD align=middle bgColor=#ffcc99 rowSpan=2><B>网络层</B></TD>
<TD align=middle bgColor=#9999ff colSpan=5><B><A class=new title="Internet Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Protocol&action=edit">IP</A></B>, <A title=ICMP href="http://zh.wikipedia.org/wiki/ICMP">ICMP</A> (<A class=new title="Routing Information Protocol" href="http://zh.wikipedia.org/w/index.php?title=Routing_Information_Protocol&action=edit">RIP</A>, <A class=new title=OSPF href="http://zh.wikipedia.org/w/index.php?title=OSPF&action=edit">OSPF</A>)</TD>
<TD align=middle bgColor=#ffff99 rowSpan=2>3</TD></TR>
<TR>
<TD align=middle bgColor=#9999ff colSpan=5><A title=ARP href="http://zh.wikipedia.org/wiki/ARP">ARP</A>, <A title=RARP href="http://zh.wikipedia.org/wiki/RARP">RARP</A></TD></TR>
<TR>
<TD align=middle bgColor=#ffcc99 rowSpan=2><B>链路层</B></TD>
<TD align=middle bgColor=#cccccc rowSpan=2><A title=Ethernet href="http://zh.wikipedia.org/wiki/Ethernet">Ethernet</A></TD>
<TD align=middle bgColor=#cccccc rowSpan=2><A class=new title="Token Bus" href="http://zh.wikipedia.org/w/index.php?title=Token_Bus&action=edit">Token<BR>Bus</A></TD>
<TD align=middle bgColor=#cccccc rowSpan=2><A class=new title="Token Ring" href="http://zh.wikipedia.org/w/index.php?title=Token_Ring&action=edit">Token<BR>Ring</A></TD>
<TD align=middle bgColor=#cccccc rowSpan=2><A title=FDDI href="http://zh.wikipedia.org/wiki/FDDI">FDDI</A></TD>
<TD align=middle bgColor=#cccccc rowSpan=2><A title=WLAN href="http://zh.wikipedia.org/wiki/WLAN">WLAN</A></TD>
<TD align=middle bgColor=#ffff99>2</TD></TR>
<TR>
<TD align=middle bgColor=#ffff99>1</TD></TR></TBODY></TABLE></CENTER>
<P><A name=.E5.BA.94.E7.94.A8.E5.B1.82></A></P>
<H3>应用层</H3>
<P>该层包括所有和应用程序协同工作,利用基础网络交换应用程序专用的数据的协议。如,</P>
<UL>
<LI><A title=HTTPS href="http://zh.wikipedia.org/wiki/HTTPS">HTTPS</A>(Hypertext Transfer Protocol over Secure Socket Layer, or HTTP over SSL),安全超文本传输协议。
<LI><A title=HTTP href="http://zh.wikipedia.org/wiki/HTTP">HTTP</A>(Hypertext Transfer Protocol),超文本传输协议。
<LI><A title=TELNET href="http://zh.wikipedia.org/wiki/TELNET">TELNET</A> (Teletype over the Network, 网络电传) ,通过一个终端(terminal)登陆到网络(运行在<A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>协议上)。
<LI><A title=FTP href="http://zh.wikipedia.org/wiki/FTP">FTP</A> (File Transfer Protocol, 文件传输协议) ,由名知义(运行在<A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>协议上) 。
<LI><A title=SMTP href="http://zh.wikipedia.org/wiki/SMTP">SMTP</A> (Simple Mail Transfer Protocol,简单邮件传输协议) ,用来发送电子邮件(运行在<A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>协议上) 。
<LI><A title=DNS href="http://zh.wikipedia.org/wiki/DNS">DNS</A> (Domain Name Service,域名服务) ,用于完成地址查找,邮件转发等工作(运行在<A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>和<A title=UDP href="http://zh.wikipedia.org/wiki/UDP">UDP</A>协议上) 。
<LI><A class=new title=NTP href="http://zh.wikipedia.org/w/index.php?title=NTP&action=edit">NTP</A> (Network Time Protocol,网络时间协议) ,用于网络同步(运行在<A title=UDP href="http://zh.wikipedia.org/wiki/UDP">UDP</A>协议上) 。
<LI><A title=SNMP href="http://zh.wikipedia.org/wiki/SNMP">SNMP</A> (Simple Network Management Protocol, 简单网络管理协议) ,用于网络信息的收集和网络管理。 </LI></UL>
<P><A name=.E4.BC.A0.E8.BE.93.E5.B1.82></A></P>
<H3>传输层</H3>
<P>该层提供端对端的通信。最重要的传输层协议是<A title=传输控制协议 href="http://zh.wikipedia.org/wiki/%E4%BC%A0%E8%BE%93%E6%8E%A7%E5%88%B6%E5%8D%8F%E8%AE%AE">传输控制协议</A><A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A>。</P>
<UL>
<LI><A title=传输控制协议 href="http://zh.wikipedia.org/wiki/%E4%BC%A0%E8%BE%93%E6%8E%A7%E5%88%B6%E5%8D%8F%E8%AE%AE">传输控制协议</A><A title=TCP href="http://zh.wikipedia.org/wiki/TCP">TCP</A> (Transport Control Protocol) - 数据流传输(面向连接,可靠)
<LI><A class=new title=用户数据报文协议 href="http://zh.wikipedia.org/w/index.php?title=%E7%94%A8%E6%88%B7%E6%95%B0%E6%8D%AE%E6%8A%A5%E6%96%87%E5%8D%8F%E8%AE%AE&action=edit">用户数据报文协议</A><A title=UDP href="http://zh.wikipedia.org/wiki/UDP">UDP</A> (User Datagram Protocol) - 数据报文传输(无连接不可靠) </LI></UL>
<P><A name=.E7.BD.91.E7.BB.9C.E5.B1.82></A></P>
<H3>网络层</H3>
<P>该层负责数据转发和路由。从该层上面往下看,可以认为底下存在的是一个不可靠无连接的端对端的数据通路。最核心的协议当然是IP协议。此外还有<A title=ICMP href="http://zh.wikipedia.org/wiki/ICMP">ICMP</A>,<A title=RIP href="http://zh.wikipedia.org/wiki/RIP">RIP</A>,<A class=new title=OSPF href="http://zh.wikipedia.org/w/index.php?title=OSPF&action=edit">OSPF</A>,<A class=new title=IS-IS href="http://zh.wikipedia.org/w/index.php?title=IS-IS&action=edit">IS-IS</A>,<A class=new title=BGP href="http://zh.wikipedia.org/w/index.php?title=BGP&action=edit">BGP</A>,<A title=ARP href="http://zh.wikipedia.org/wiki/ARP">ARP</A>,<A title=RARP href="http://zh.wikipedia.org/wiki/RARP">RARP</A>等。</P>
<P><A id=Layers_in_the_Internet_Protocol_stack name=Layers_in_the_Internet_Protocol_stack></A></P>
<H2>Layers in the Internet Protocol stack</H2>
<P>There is some discussion about how to map the <STRONG>TCP/IP参考模型</STRONG> onto the <A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型</A>. Since the <A title=TCP/IP href="http://zh.wikipedia.org/wiki/TCP/IP">TCP/IP</A> and <A class=new title="Open Systems Interconnection" href="http://zh.wikipedia.org/w/index.php?title=Open_Systems_Interconnection&action=edit">OSI</A> protocol suites do not match precisely, there is no one correct answer.</P>
<P>In addition, the <A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型</A> is not really rich enough at the lower layers to capture the true layering; there needs to be an extra layer (the Internetworking layer) between the Transport and Network layers. Protocols specific to a particular network type, but which are run on top of the basic hardware framing, ought to be at the Network layer. Examples of such protocols are <A class=new title="Address resolution protocol" href="http://zh.wikipedia.org/w/index.php?title=Address_resolution_protocol&action=edit">ARP</A> and the <A class=new title="Spanning Tree Protocol" href="http://zh.wikipedia.org/w/index.php?title=Spanning_Tree_Protocol&action=edit">Spanning Tree Protocol</A> (used to keep redundant <A class=new title="Network bridge" href="http://zh.wikipedia.org/w/index.php?title=Network_bridge&action=edit">bridges</A> idle until they are needed). However, they are local protocols and operate beneath the internetwork functionality. Admittedly, placing both groups (not to mention protocols which are logically part of the internetwork layer, but run on top of the internetwork protocol, such as <A title=ICMP href="http://zh.wikipedia.org/wiki/ICMP">ICMP</A>) all at the same layer can be confusing, but the OSI model is not complex enough to do a better job.</P>
<P>The following diagram attempts to show where various TCP/IP and other protocols would reside in the original <A title=OSI模型 href="http://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B">OSI模型l</A>:</P>
<P>
<TABLE cellSpacing=1 cellPadding=5>
<TBODY>
<TR>
<TD>7</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Application</B></TD>
<TD>e.g. <A title=HTTP href="http://zh.wikipedia.org/wiki/HTTP">HTTP</A>, <A class=new title="Simple Mail Transfer Protocol" href="http://zh.wikipedia.org/w/index.php?title=Simple_Mail_Transfer_Protocol&action=edit">SMTP</A>, <A class=new title="Simple Network Management Protocol" href="http://zh.wikipedia.org/w/index.php?title=Simple_Network_Management_Protocol&action=edit">SNMP</A>, <A class=new title="File transfer protocol" href="http://zh.wikipedia.org/w/index.php?title=File_transfer_protocol&action=edit">FTP</A>, <A title=Telnet href="http://zh.wikipedia.org/wiki/Telnet">Telnet</A>, <A class=new title="Session Initiation Protocol" href="http://zh.wikipedia.org/w/index.php?title=Session_Initiation_Protocol&action=edit">SIP</A>, <A class=new title="Secure Shell" href="http://zh.wikipedia.org/w/index.php?title=Secure_Shell&action=edit">SSH</A>, <A class=new title="Network File System" href="http://zh.wikipedia.org/w/index.php?title=Network_File_System&action=edit">NFS</A>, <A class=new title=RTSP href="http://zh.wikipedia.org/w/index.php?title=RTSP&action=edit">RTSP</A>, <A title=XMPP href="http://zh.wikipedia.org/wiki/XMPP">XMPP</A>, <A class=new title=Whois href="http://zh.wikipedia.org/w/index.php?title=Whois&action=edit">Whois</A>, <A class=new title="Endpoint Handlespace Redundancy Protocol" href="http://zh.wikipedia.org/w/index.php?title=Endpoint_Handlespace_Redundancy_Protocol&action=edit">ENRP</A></TD></TR>
<TR>
<TD>6</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Presentation</B></TD>
<TD>e.g. <A class=new title="External Data Representation" href="http://zh.wikipedia.org/w/index.php?title=External_Data_Representation&action=edit">XDR</A>, <A class=new title="Abstract Syntax Notation 1" href="http://zh.wikipedia.org/w/index.php?title=Abstract_Syntax_Notation_1&action=edit">ASN.1</A>, <A class=new title="Server message block" href="http://zh.wikipedia.org/w/index.php?title=Server_message_block&action=edit">SMB</A>, <A class=new title="Apple Filing Protocol" href="http://zh.wikipedia.org/w/index.php?title=Apple_Filing_Protocol&action=edit">AFP</A>, <A class=new title="NetWare Core Protocol" href="http://zh.wikipedia.org/w/index.php?title=NetWare_Core_Protocol&action=edit">NCP</A></TD></TR>
<TR>
<TD>5</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Session</B></TD>
<TD>e.g. <A class=new title="Aggregate Server Access Protocol" href="http://zh.wikipedia.org/w/index.php?title=Aggregate_Server_Access_Protocol&action=edit">ASAP</A>, <A class=new title="Transport Layer Security" href="http://zh.wikipedia.org/w/index.php?title=Transport_Layer_Security&action=edit">TLS</A>, <A title=SSH href="http://zh.wikipedia.org/wiki/SSH">SSH</A>, ISO 8327 / CCITT X.225, <A class=new title="Remote procedure call" href="http://zh.wikipedia.org/w/index.php?title=Remote_procedure_call&action=edit">RPC</A>, <A class=new title=NetBIOS href="http://zh.wikipedia.org/w/index.php?title=NetBIOS&action=edit">NetBIOS</A>, <A class=new title=AppleTalk href="http://zh.wikipedia.org/w/index.php?title=AppleTalk&action=edit">ASP</A>, <A class=new title=Winsock href="http://zh.wikipedia.org/w/index.php?title=Winsock&action=edit">Winsock</A>, <A class=new title="Berkeley sockets" href="http://zh.wikipedia.org/w/index.php?title=Berkeley_sockets&action=edit">BSD sockets</A></TD></TR>
<TR>
<TD>4</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Transport</B></TD>
<TD>e.g. <A class=new title="Transmission Control Protocol" href="http://zh.wikipedia.org/w/index.php?title=Transmission_Control_Protocol&action=edit">TCP</A>, <A class=new title="User Datagram Protocol" href="http://zh.wikipedia.org/w/index.php?title=User_Datagram_Protocol&action=edit">UDP</A>, <A class=new title="Real-time Transport Protocol" href="http://zh.wikipedia.org/w/index.php?title=Real-time_Transport_Protocol&action=edit">RTP</A>, <A class=new title="Stream Control Transmission Protocol" href="http://zh.wikipedia.org/w/index.php?title=Stream_Control_Transmission_Protocol&action=edit">SCTP</A>, <A class=new title="Sequenced packet exchange" href="http://zh.wikipedia.org/w/index.php?title=Sequenced_packet_exchange&action=edit">SPX</A>, <A class=new title=AppleTalk href="http://zh.wikipedia.org/w/index.php?title=AppleTalk&action=edit">ATP</A>, <A class=new title="IL Protocol" href="http://zh.wikipedia.org/w/index.php?title=IL_Protocol&action=edit">IL</A></TD></TR>
<TR>
<TD>3</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Network</B></TD>
<TD>e.g. <A class=new title="Internet Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Protocol&action=edit">IP</A>, <A class=new title="Internet control message protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_control_message_protocol&action=edit">ICMP</A>, <A class=new title="Internet group management protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_group_management_protocol&action=edit">IGMP</A>, <A title=IPX href="http://zh.wikipedia.org/wiki/IPX">IPX</A>, <A class=new title="Border Gateway Protocol" href="http://zh.wikipedia.org/w/index.php?title=Border_Gateway_Protocol&action=edit">BGP</A>, <A class=new title=OSPF href="http://zh.wikipedia.org/w/index.php?title=OSPF&action=edit">OSPF</A>, <A class=new title="Routing information protocol" href="http://zh.wikipedia.org/w/index.php?title=Routing_information_protocol&action=edit">RIP</A>, <A class=new title=IGRP href="http://zh.wikipedia.org/w/index.php?title=IGRP&action=edit">IGRP</A>, <A class=new title=EIGRP href="http://zh.wikipedia.org/w/index.php?title=EIGRP&action=edit">EIGRP</A>, <A class=new title="Address resolution protocol" href="http://zh.wikipedia.org/w/index.php?title=Address_resolution_protocol&action=edit">ARP</A>, <A title=RARP href="http://zh.wikipedia.org/wiki/RARP">RARP</A>, <A title=X.25 href="http://zh.wikipedia.org/wiki/X.25">X.25</A></TD></TR>
<TR>
<TD>2</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Data Link</B></TD>
<TD>e.g. <A title=Ethernet href="http://zh.wikipedia.org/wiki/Ethernet">Ethernet</A>, <A class=new title="Token ring" href="http://zh.wikipedia.org/w/index.php?title=Token_ring&action=edit">Token ring</A>, <A title=HDLC href="http://zh.wikipedia.org/wiki/HDLC">HDLC</A>, <A class=new title="Frame relay" href="http://zh.wikipedia.org/w/index.php?title=Frame_relay&action=edit">Frame relay</A>, <A class=new title="Integrated Services Digital Network" href="http://zh.wikipedia.org/w/index.php?title=Integrated_Services_Digital_Network&action=edit">ISDN</A>, <A class=new title="Asynchronous Transfer Mode" href="http://zh.wikipedia.org/w/index.php?title=Asynchronous_Transfer_Mode&action=edit">ATM</A>, <A title="IEEE 802.11" href="http://zh.wikipedia.org/wiki/IEEE_802.11">802.11 WiFi</A>, <A class=new title="Fiber distributed data interface" href="http://zh.wikipedia.org/w/index.php?title=Fiber_distributed_data_interface&action=edit">FDDI</A>, <A class=new title="Point-to-Point Protocol" href="http://zh.wikipedia.org/w/index.php?title=Point-to-Point_Protocol&action=edit">PPP</A></TD></TR>
<TR>
<TD>1</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Physical</B></TD>
<TD>e.g. <A class=new title=Wire href="http://zh.wikipedia.org/w/index.php?title=Wire&action=edit">wire</A>, <A class=new title=Radio href="http://zh.wikipedia.org/w/index.php?title=Radio&action=edit">radio</A>, <A class=new title="Fiber optic" href="http://zh.wikipedia.org/w/index.php?title=Fiber_optic&action=edit">fiber optic</A>, <A class=new title="IP over Avian Carriers" href="http://zh.wikipedia.org/w/index.php?title=IP_over_Avian_Carriers&action=edit">Carrier pigeon</A></TD></TR></TBODY></TABLE></P>
<P>Commonly, the top three layers of the OSI model (Application, Presentation and Session) are considered as a single Application Layer in the TCP/IP suite. Because the TCP/IP suite has a comparatively lightweight session layer, consisting of opening and closing connections under TCP and RTP and providing different port numbers for different applications under TCP and UDP, these functions may be augmented by individual applications (or libraries used by those applications). Similarly, IP is designed around the idea of treating the network below it as a black box so it can be considered as a single layer for the purposes of discussing TCP/IP.</P>
<P>
<TABLE cellSpacing=1 cellPadding=5>
<TBODY>
<TR>
<TD>4</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Application</B><BR><I>(OSI layers<BR>5 through 7)</I></TD>
<TD>e.g. <A title=HTTP href="http://zh.wikipedia.org/wiki/HTTP">HTTP</A>, <A class=new title="File transfer protocol" href="http://zh.wikipedia.org/w/index.php?title=File_transfer_protocol&action=edit">FTP</A>, <A title=DNS href="http://zh.wikipedia.org/wiki/DNS">DNS</A><BR><I>(routing protocols like <A class=new title="Border Gateway Protocol" href="http://zh.wikipedia.org/w/index.php?title=Border_Gateway_Protocol&action=edit">BGP</A> and <A class=new title="Routing information protocol" href="http://zh.wikipedia.org/w/index.php?title=Routing_information_protocol&action=edit">RIP</A>, which for a variety of reasons run over TCP and UDP respectively, may also be considered part of the Internetwork layer)</I></TD></TR>
<TR>
<TD>3</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Transport</B><BR><I>(OSI layers<BR>4 and 5)</I></TD>
<TD>e.g. <A class=new title="Transmission Control Protocol" href="http://zh.wikipedia.org/w/index.php?title=Transmission_Control_Protocol&action=edit">TCP</A>, <A class=new title="User Datagram Protocol" href="http://zh.wikipedia.org/w/index.php?title=User_Datagram_Protocol&action=edit">UDP</A>, <A class=new title="Real-time Transport Protocol" href="http://zh.wikipedia.org/w/index.php?title=Real-time_Transport_Protocol&action=edit">RTP</A>, <A class=new title="Stream Control Transmission Protocol" href="http://zh.wikipedia.org/w/index.php?title=Stream_Control_Transmission_Protocol&action=edit">SCTP</A><BR><I>(routing protocols like <A class=new title="Open shortest path first" href="http://zh.wikipedia.org/w/index.php?title=Open_shortest_path_first&action=edit">OSPF</A>, which run over IP, may also be considered part of the Internetwork layer)</I></TD></TR>
<TR>
<TD>2</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Internetwork</B><BR><I>(OSI<BR>layer 3)</I></TD>
<TD>For TCP/IP this is the <A class=new title="Internet Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Protocol&action=edit">Internet Protocol</A> (IP)<BR><I>(required protocols like <A class=new title="Internet control message protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_control_message_protocol&action=edit">ICMP</A> and <A class=new title="Internet group management protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_group_management_protocol&action=edit">IGMP</A> run over IP, but may still be considered part of the Internetwork layer; <A class=new title="Address resolution protocol" href="http://zh.wikipedia.org/w/index.php?title=Address_resolution_protocol&action=edit">ARP</A> does not run over IP)</I></TD></TR>
<TR style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid">
<TD>1</TD>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"><B>Link</B><BR><I>(OSI layers<BR>1 and 2)</I></TD>
<TD>e.g. <A title=Ethernet href="http://zh.wikipedia.org/wiki/Ethernet">Ethernet</A>, <A title=Wi-Fi href="http://zh.wikipedia.org/wiki/Wi-Fi">Wi-Fi</A>, <A class=new title="Multiprotocol Label Switching" href="http://zh.wikipedia.org/w/index.php?title=Multiprotocol_Label_Switching&action=edit">MPLS</A>, etc.</TD></TR></TBODY></TABLE></P>
<P><A id=The_link_layer name=The_link_layer></A></P>
<H3>The link layer</H3>
<P>The Link layer is not really part of the Internet protocol suite, but is the method used to pass packets from the Internet layer of one device to the Internet layer of another. This process can be controlled both in the <A class=new title=Software href="http://zh.wikipedia.org/w/index.php?title=Software&action=edit">software</A> <A class=new title="Device driver" href="http://zh.wikipedia.org/w/index.php?title=Device_driver&action=edit">device driver</A> for the <A class=new title="Network card" href="http://zh.wikipedia.org/w/index.php?title=Network_card&action=edit">network card</A>, as well as on <A title=Firmware href="http://zh.wikipedia.org/wiki/Firmware">firmware</A> or specialist <A class=new title=Chipsets href="http://zh.wikipedia.org/w/index.php?title=Chipsets&action=edit">chipsets</A>. These will perform <A class=new title="Data link layer" href="http://zh.wikipedia.org/w/index.php?title=Data_link_layer&action=edit">data link</A> functions such as adding a <A class=new title="Packet header" href="http://zh.wikipedia.org/w/index.php?title=Packet_header&action=edit">packet header</A> to prepare it for transmission, then actually transmit the frame over a <A class=new title="Physical layer" href="http://zh.wikipedia.org/w/index.php?title=Physical_layer&action=edit">physical</A> <A class=new title="Transmission medium" href="http://zh.wikipedia.org/w/index.php?title=Transmission_medium&action=edit">medium</A>. On the other end, the link layer will receive data frames, strip off the packet headers, and hand the received packets to the Internet layer.</P>
<P>However, the link layer is not always so simple. It may also be a <A class=new title="Virtual private network" href="http://zh.wikipedia.org/w/index.php?title=Virtual_private_network&action=edit">Virtual private network</A> (VPN) or tunnel, where packets from the Internet layer, instead of being sent over a physical interface, are sent using a <A class=new title="Tunneling protocol" href="http://zh.wikipedia.org/w/index.php?title=Tunneling_protocol&action=edit">tunneling protocol</A> and another (or the same) protocol suite. The VPN or tunnel is usually established ahead of time, and has special characteristics that direct transmission out a physical interface does not (for example, it may encrypt the data going over it). This <A class=new title=Recursion href="http://zh.wikipedia.org/w/index.php?title=Recursion&action=edit">recursive</A> use of the protocol suite can be confusing since the link "layer" is now an entire network. But it is an elegant method for implementing often complex functions. (though care is needed to prevent a packet that is wrapped and sent through a tunnel being repeatedly re-wrapped and sent down the tunnel again).</P>
<P><A id=The_Internetwork_layer name=The_Internetwork_layer></A></P>
<H3>The Internetwork layer</H3>
<P>As originally defined, the <A class=new title="Network layer" href="http://zh.wikipedia.org/w/index.php?title=Network_layer&action=edit">Network layer</A> solves the problem of getting packets across a single network. Examples of such protocols are <A title=X.25 href="http://zh.wikipedia.org/wiki/X.25">X.25</A>, and the <A class=new title=ARPANET href="http://zh.wikipedia.org/w/index.php?title=ARPANET&action=edit">ARPANET</A>'s <A class=new title="Host/IMP Protocol" href="http://zh.wikipedia.org/w/index.php?title=Host/IMP_Protocol&action=edit">Host/IMP Protocol</A>.</P>
<P>With the advent of the concept of <A title=Internet href="http://zh.wikipedia.org/wiki/Internet">internetworking</A>, additional functionality was added to this layer, namely getting data from the source <A class=new title="Computer network" href="http://zh.wikipedia.org/w/index.php?title=Computer_network&action=edit">network</A> to the destination network. This generally involves routing the packet across a network of networks, known as an <A title=Internet href="http://zh.wikipedia.org/wiki/Internet">internet</A>.</P>
<P>In the internet protocol suite, <A class=new title="Internet Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Protocol&action=edit">IP</A> performs the basic task of getting packets of data from source to destination. IP can carry data for a number of different higher level protocols; these protocols are each identified by a unique <I>IP Protocol Number</I>. ICMP and IGMP are protocols 1 and 2, respectively.</P>
<P>Some of the protocols carried by IP, such as <A class=new title="Internet Control Message Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Control_Message_Protocol&action=edit">ICMP</A> (used to transmit diagnostic information about IP transmission) and <A class=new title="Internet Group Management Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Group_Management_Protocol&action=edit">IGMP</A> (used to manage <A class=new title=Multicast href="http://zh.wikipedia.org/w/index.php?title=Multicast&action=edit">multicast</A> data) are layered on top of IP but perform internetwork layer functions, illustrating an incompatibility between the internet and OSI models. All routing protocols, such as <A class=new title="Border Gateway Protocol" href="http://zh.wikipedia.org/w/index.php?title=Border_Gateway_Protocol&action=edit">BGP</A>, <A class=new title=OSPF href="http://zh.wikipedia.org/w/index.php?title=OSPF&action=edit">OSPF</A>, and <A class=new title="Routing information protocol" href="http://zh.wikipedia.org/w/index.php?title=Routing_information_protocol&action=edit">RIP</A> are also really part of the internetwork layer, although they might seem to belong higher in the stack.</P>
<P><A id=The_transport_layer name=The_transport_layer></A></P>
<H3>The transport layer</H3>
<P>The protocols at the <A class=new title="Transport layer" href="http://zh.wikipedia.org/w/index.php?title=Transport_layer&action=edit">Transport layer</A> can solve problems like reliability ("did the data reach the destination?") and ensure that data arrives in the correct order. In the TCP/IP protocol suite, transport protocols also determine which application any given data is intended for.</P>
<P>The dynamic routing protocols which technically fit at this layer in the TCP/IP Protocol Suite (since they run over IP) are generally considered to be part of the Network layer; an example is <A class=new title=OSPF href="http://zh.wikipedia.org/w/index.php?title=OSPF&action=edit">OSPF</A> (IP protocol number 89).</P>
<P><A class=new title="Transmission control protocol" href="http://zh.wikipedia.org/w/index.php?title=Transmission_control_protocol&action=edit">TCP</A> (IP protocol number 6) is a "reliable", <A class=new title=Connection-oriented href="http://zh.wikipedia.org/w/index.php?title=Connection-oriented&action=edit">connection-oriented</A>, transport mechanism providing a <A class=new title="Reliable byte stream" href="http://zh.wikipedia.org/w/index.php?title=Reliable_byte_stream&action=edit">reliable byte stream</A>, which makes sure data arrives complete, undamaged, and in order. TCP tries to continuously measure how loaded the network is and throttles its sending rate in order to avoid overloading the network. Furthermore, TCP will attempt to deliver all data correctly in the specified sequence. These are its main differences from UDP, and can become disadvantageous in real-time streaming or routing applications with high <A class=new title="Internetwork layer" href="http://zh.wikipedia.org/w/index.php?title=Internetwork_layer&action=edit">internetwork layer</A> loss rates.</P>
<P>The newer <A class=new title="Stream Control Transmission Protocol" href="http://zh.wikipedia.org/w/index.php?title=Stream_Control_Transmission_Protocol&action=edit">SCTP</A> is also a "reliable", <A class=new title=Connection-oriented href="http://zh.wikipedia.org/w/index.php?title=Connection-oriented&action=edit">connection-oriented</A>, transport mechanism. It is record rather than byte oriented, and provides multiple sub-streams multiplexed over a single connection. It also provides multi-homing support, in which a connection end can be represented by multiple IP addresses (representing multiple physical interfaces), such that if one fails the connection is not interrupted. It was developed initially for telephony applications (to transport <A class=new title=SS7 href="http://zh.wikipedia.org/w/index.php?title=SS7&action=edit">SS7</A> over <A class=new title="Internet Protocol" href="http://zh.wikipedia.org/w/index.php?title=Internet_Protocol&action=edit">IP</A>), but can also be used for other applications.</P>
<P><A class=new title="User datagram protocol" href="http://zh.wikipedia.org/w/index.php?title=User_datagram_protocol&action=edit">UDP</A> (IP protocol number 17) is a <A class=new title=Connectionless href="http://zh.wikipedia.org/w/index.php?title=Connectionless&action=edit">connectionless</A> datagram protocol. It is a "best effort" or "unreliable" protocol - not because it is particularly unreliable, but because it does not verify that packets have reached their destination, and gives no guarantee that they will arrive in order. If an Application requires these characteristics, it must provide them itself, or use <A class=new title="Transmission Control Protocol" href="http://zh.wikipedia.org/w/index.php?title=Transmission_Control_Protocol&action=edit">TCP</A>.</P>
<P>UDP is typically used for applications such as streaming media (audio and video, etc) where on-time arrival is more important than reliability, or for simple query/response applications like <A title=DNS href="http://zh.wikipedia.org/wiki/DNS">DNS</A> lookups, where the overhead of setting up a reliable connection is disproportionately large.</P>
<P><A title=DCCP href="http://zh.wikipedia.org/wiki/DCCP">DCCP</A> is currently under development by IETF. It provides TCP's flow control semantics, while keeping UDP's datagram service model visible to the user.</P>
<P>Both TCP and UDP are used to carry a number of higher-level applications. The applications at any given network address are distinguished by their TCP or UDP <I><A class=new title="Port number" href="http://zh.wikipedia.org/w/index.php?title=Port_number&action=edit">port number</A></I>. By convention certain <I>well known ports</I> are associated with specific applications.</P>
<P><A class=new title="Real-time Transport Protocol" href="http://zh.wikipedia.org/w/index.php?title=Real-time_Transport_Protocol&action=edit">RTP</A> is a datagram protocol that is designed for real-time data such as streaming audio and video. RTP is a session layer that uses the UDP packet format as a basis yet is said to sit within the transport layer of the Internet protocol stack.</P>
<P><A id=The_application_layer name=The_application_layer></A></P>
<H3>The application layer</H3>
<P>The <A class=new title="Application layer" href="http://zh.wikipedia.org/w/index.php?title=Application_layer&action=edit">Application layer</A> is the layer that most common network-aware programs use in order to communicate across a network with other programs. Processes that occur in this layer are application specific; data is passed from the network-aware program, in the format used internally by this application, and is encoded into a standard protocol.</P>
<P>Some specific programs are considered to run in this layer. They provide services that directly support user applications. These programs and their corresponding protocols include <A title=HTTP href="http://zh.wikipedia.org/wiki/HTTP">HTTP</A> (The World Wide Web), <A class=new title="File Transfer Protocol" href="http://zh.wikipedia.org/w/index.php?title=File_Transfer_Protocol&action=edit">FTP</A> (File transport), <A class=new title="Simple Mail Transfer Protocol" href="http://zh.wikipedia.org/w/index.php?title=Simple_Mail_Transfer_Protocol&action=edit">SMTP</A> (Email), <A class=new title="Secure shell" href="http://zh.wikipedia.org/w/index.php?title=Secure_shell&action=edit">SSH</A> (Secure remote login), <A title=DNS href="http://zh.wikipedia.org/wiki/DNS">DNS</A> (Name <-> IP Address lookups) and many others.</P>
<P>Once the data from an application has been encoded into a standard application layer protocol it will be passed down to the next layer of the IP stack.</P>
<P>At the Transport Layer, applications will most commonly make use of TCP or UDP, and server applications are often associated with a <A class=new title="TCP and UDP port numbers" href="http://zh.wikipedia.org/w/index.php?title=TCP_and_UDP_port_numbers&action=edit">well-known port number</A>. Ports for server applications are officially allocated by the <A class=new title="Internet Assigned Numbers Authority" href="http://zh.wikipedia.org/w/index.php?title=Internet_Assigned_Numbers_Authority&action=edit">Internet Assigned Numbers Authority</A> (IANA) but developers of new protocols today often choose the port numbers themselves. As it is rare to have more than a few server applications on the same system, problems with port conflicts are rare. Application software also generally allows users to specify arbitrary port numbers as <A class=new title=Runtime href="http://zh.wikipedia.org/w/index.php?title=Runtime&action=edit">runtime</A> <A class=new title=Parameters href="http://zh.wikipedia.org/w/index.php?title=Parameters&action=edit">parameters</A>.</P>
<P>Client applications connecting out generally use a random port number assigned by the operating system. Applications that listen on a port and then send that port to another copy of the application via a server to set up a peer-peer link (e.g. <A class=new title="Direct Client-to-Client" href="http://zh.wikipedia.org/w/index.php?title=Direct_Client-to-Client&action=edit">dcc</A> file transfers on <A class=new title="Internet Relay Chat" href="http://zh.wikipedia.org/w/index.php?title=Internet_Relay_Chat&action=edit">IRC</A>). may also use a random port but the applications usually allow specification of a specific port range to allow the ports to be mapped inwards through a router that implements <A class=new title="Network address translation" href="http://zh.wikipedia.org/w/index.php?title=Network_address_translation&action=edit">network address translation</A>.</P>
<P><BR></P>
<P><A id=Development name=Development></A></P>
<H2>Development</H2>
<P>The Internet protocol suite came from work done by <A class=new title=DARPA href="http://zh.wikipedia.org/w/index.php?title=DARPA&action=edit">DARPA</A> in the early <A class=new title=1970s href="http://zh.wikipedia.org/w/index.php?title=1970s&action=edit">1970s</A>. After building the pioneering <A class=new title=ARPANET href="http://zh.wikipedia.org/w/index.php?title=ARPANET&action=edit">ARPANET</A>, DARPA started work on a number of other data transmission technologies. In 1972, <A class=new title="Robert E. Kahn" href="http://zh.wikipedia.org/w/index.php?title=Robert_E._Kahn&action=edit">Robert E. Kahn</A> was hired at the DARPA <A class=new title="Information Processing Technology Office" href="http://zh.wikipedia.org/w/index.php?title=Information_Processing_Technology_Office&action=edit">Information Processing Technology Office</A>, where he worked on both satellite packet networks and ground-based radio packet networks, and recognized the value of being able to communicate across them. In the spring of 1973, <A class=new title="Vinton Cerf" href="http://zh.wikipedia.org/w/index.php?title=Vinton_Cerf&action=edit">Vinton Cerf</A>, the developer of the existing ARPANET Network Control Program (NCP) protocol, joined Kahn to work on open-architecture interconnection models with the goal of designing the next protocol for the ARPANET.</P>
<P>By the summer of <A class=new title=1973 href="http://zh.wikipedia.org/w/index.php?title=1973&action=edit">1973</A>, Kahn and Cerf had soon worked out a fundamental reformulation, where the differences between network protocols were hidden by using a common <A class=new title="Internetwork protocol" href="http://zh.wikipedia.org/w/index.php?title=Internetwork_protocol&action=edit">internetwork protocol</A>, and instead of the network being responsible for reliability, as in the ARPANET, the hosts became responsible. (Cerf credits <A class=new title="Hubert Zimmerman" href="http://zh.wikipedia.org/w/index.php?title=Hubert_Zimmerman&action=edit">Hubert Zimmerman</A> and <A class=new title="Louis Pouzin" href="http://zh.wikipedia.org/w/index.php?title=Louis_Pouzin&action=edit">Louis Pouzin</A> (designer of the <A class=new title=CYCLADES href="http://zh.wikipedia.org/w/index.php?title=CYCLADES&action=edit">CYCLADES</A> network) with important influences on this design.)</P>
<P>With the role of the network reduced to the bare minimum, it became possible to join almost any networks together, no matter what their characteristics were, thereby solving Kahn's initial problem. (One popular saying has it that <A title=TCP/IP href="http://zh.wikipedia.org/wiki/TCP/IP">TCP/IP</A>, the eventual product of Cerf and Kahn's work, will run over "two tin cans and a string", and it has in fact been <A class=new title="IP over Avian Carriers" href="http://zh.wikipedia.org/w/index.php?title=IP_over_Avian_Carriers&action=edit">implemented using homing pigeons</A>.) A computer called a <I>gateway</I> (later changed to <I><A class=new title=Router href="http://zh.wikipedia.org/w/index.php?title=Router&action=edit">router</A></I> to avoid confusion with <A class=new title=Gateway href="http://zh.wikipedia.org/w/index.php?title=Gateway&action=edit">other types of <I>gateway</I></A>) is provided with an interface to each network, and forwards <A class=new title=Packet href="http://zh.wikipedia.org/w/index.php?title=Packet&action=edit">packets</A> back and forth between them.</P>
<P>The idea was worked out in more detailed form by Cerf's networking research group at Stanford in the <A class=new title=1973 href="http://zh.wikipedia.org/w/index.php?title=1973&action=edit">1973</A>–<A class=new title=1974 href="http://zh.wikipedia.org/w/index.php?title=1974&action=edit">74</A> period. (The early networking work at <A title="Xerox PARC" href="http://zh.wikipedia.org/wiki/Xerox_PARC">Xerox PARC</A>, which produced the <A class=new title="PARC Universal Packet" href="http://zh.wikipedia.org/w/index.php?title=PARC_Universal_Packet&action=edit">PARC Universal Packet</A> protocol suite, much of which was contemporaneous, was also a significant technical influence; people moved between the two.)</P>
<P>DARPA then contracted with BBN, Stanford, and The University College London to develop operational versions of the protocol on different hardware platforms. Four versions were developed -- TCP v1, TCP v2, a split into TCP v3 and IP v3 in the spring of 1978, and then stability with TCP/IP v4 -- the standard protocol still in use on the Internet today.</P>
<P>In 1975, a two-network TCP/IP communications test was performed between Stanford and University College London (UCL). In November, 1977, a three-network TCP/IP test was conducted between the U.S., U.K., and Norway. Between 1978 and 1983, several other TCP/IP prototypes were developed at multiple research centres. A full switchover to TCP/IP on the ARPANET took place January 1, 1983. <A class="external autonumber" title=http://www.livinginternet.com/i/ii.htm href="http://www.livinginternet.com/i/ii.htm" rel=nofollow>[1]</A></P>
<P>In 1984, the US Department of Defense made TCP/IP the standard for all military computer networking. In 1985, the Internet Architecture Board held a three day workshop on TCP/IP for the computer industry, attended by 250 vendor representatives, helping popularize the protocol and leading to its increasing commercial use.</P>
<P>On <A class=new title="9 November" href="http://zh.wikipedia.org/w/index.php?title=9_November&action=edit">9 November</A> <A class=new title=2005 href="http://zh.wikipedia.org/w/index.php?title=2005&action=edit">2005</A> Kahn and Cerf were presented with the <A class=new title="Presidential Medal of Freedom" href="http://zh.wikipedia.org/w/index.php?title=Presidential_Medal_of_Freedom&action=edit">Presidential Medal of Freedom</A> for their contribution to American culture. <A class="external autonumber" title=http://news.bbc.co.uk/1/hi/technology/4415326.stm href="http://news.bbc.co.uk/1/hi/technology/4415326.stm" rel=nofollow>[2]</A></P>
<P><A id=How_IP_Kills_and_Eats_Competitive_Networks name=How_IP_Kills_and_Eats_Competitive_Networks></A></P>
<H2>How IP Kills and Eats Competitive Networks</H2>
<P>In the long term, IP appears to replace other networks. Here's a brief explanation. IP transmits generic data. The data can serve any purpose, and can easily replace data previously provided by proprietary data networks. Here's the usual sequence:</P>
<OL>
<LI>A proprietary data network is developed for a specialized purpose. If it works well, users will adopt it.
<LI>IP service is provided as a convenience, often to get e-mail or chat, usually tunneling through the proprietary data service in some fashion. The tunneling method may be quite inefficient at first, because e-mail and chat require only low bandwidth.
<LI>IP infrastructure is emplaced by gradual investment at the edges of the proprietary data network.
<LI>A substitute for the proprietary service is developed using IP, often by a user.
<LI>The IP substitute spreads over the entire internet, making the IP substitute more valuable (because of <A class=new title="Network effect" href="http://zh.wikipedia.org/w/index.php?title=Network_effect&action=edit">network effects</A>) than the original proprietary network.
<LI>The proprietary network is deprecated. Most users begin maintaining a duplicate facility that uses the IP substitute.
<LI>IP packets have very low overheads, less than 1%, and therefore compete very effectively on cost. An inexpensive transmission medium is developed that can carry IP to most of the users of the proprietary network.
<LI>The proprietary network is removed by most users to cut costs.
<LI>Die-hard users of the proprietary network are therefore forced to adopt. </LI></OL>
<P><A id=Implementations name=Implementations></A></P>
<H2>Implementations</H2>
<UL>
<LI><A class=new title=KA9Q href="http://zh.wikipedia.org/w/index.php?title=KA9Q&action=edit">KA9Q</A> PPJ
<LI><A class=new title=LwIP href="http://zh.wikipedia.org/w/index.php?title=LwIP&action=edit">lwIP</A> </LI></UL>
<P>Today, most commercial operating systems include and install the TCP/IP stack by default, For most users, there is no need to look for implementations. TCP/IP is included in all commercial Unix and Linux distributions as well as with Mac OS X and Microsoft Windows and Windows Server.</P>
<P><A id=See_also name=See_also></A></P>
<H2>See also</H2>
<UL>
<LI><A class=new title="OSI Model" href="http://zh.wikipedia.org/w/index.php?title=OSI_Model&action=edit">OSI Model</A>
<LI><A class=new title="DoD Model" href="http://zh.wikipedia.org/w/index.php?title=DoD_Model&action=edit">DoD Model</A>
<LI><A class=new title="TCP and UDP port numbers" href="http://zh.wikipedia.org/w/index.php?title=TCP_and_UDP_port_numbers&action=edit">TCP and UDP port numbers</A> </LI></UL>
<P><A id=References name=References></A></P>
<H2>References</H2>
<UL>
<LI><A class="external text" title=http://www.livinginternet.com/i/ii.htm href="http://www.livinginternet.com/i/ii.htm" rel=nofollow>Internet History</A> -- Pages on Robert Kahn, Vinton Cerf, and TCP/IP (reviewed by Cerf and Kahn). </LI></UL>
<P><A id=External_links name=External_links></A></P>
<H2>External links</H2>
<UL>
<LI><A class=external title=http://www.ietf.org/rfc/rfc1180.txt href="http://www.ietf.org/rfc/rfc1180.txt">RFC 1180</A> A TCP/IP Tutorial - from the Internet Engineering Task Force (January 1991)
<LI><A class="external text" title=http://www.itprc.com/tcpipfaq/ href="http://www.itprc.com/tcpipfaq/" rel=nofollow>TCP/IP FAQ</A>
<LI><A class="external text" title=http://www.columbia.edu/~rh120/other/tcpdigest_paper.txt href="http://www.columbia.edu/~rh120/other/tcpdigest_paper.txt" rel=nofollow>A Study of the ARPANET TCP/IP Digest</A>
<LI><A class="external text" title=http://www.eventhelix.com/RealtimeMantra/Networking/ href="http://www.eventhelix.com/RealtimeMantra/Networking/" rel=nofollow>TCP/IP Sequence Diagrams</A>
<LI><A class="external text" title=http://www.searchandgo.com/articles/internet/internet-practice-4.php href="http://www.searchandgo.com/articles/internet/internet-practice-4.php" rel=nofollow>The Internet in Practice</A>
<LI><A class="external text" title=http://cng.ateneo.edu/cng/wyu/classes/cs197/ href="http://cng.ateneo.edu/cng/wyu/classes/cs197/" rel=nofollow>Ateneo Network Research Group</A> TCP/IP research at the <A class=new title="Ateneo de Manila University" href="http://zh.wikipedia.org/w/index.php?title=Ateneo_de_Manila_University&action=edit">Ateneo de Manila University</A>
<LI><A class="external text" title=http://www.venu4u.info/network/tcpip.html href="http://www.venu4u.info/network/tcpip.html" rel=nofollow>TCP/IP Directory & Informational Resource.</A> </LI></UL>
<P><A id=TCP.2FIP_.E5.8F.82.E8.80.83.E6.96.87.E7.8C.AE name=TCP.2FIP_.E5.8F.82.E8.80.83.E6.96.87.E7.8C.AE></A></P>
<H2>TCP/IP 参考文献</H2>
<UL>
<LI><A class=external title=http://www.ietf.org/rfc/rfc1122.txt href="http://www.ietf.org/rfc/rfc1122.txt">RFC 1122</A> - Requirements for Internet Hosts -- Communication Layers
<LI><A class=new title="Joseph G. Davies" href="http://zh.wikipedia.org/w/index.php?title=Joseph_G._Davies&action=edit">Joseph G. Davies</A> and <A class=new title="Thomas F. Lee" href="http://zh.wikipedia.org/w/index.php?title=Thomas_F._Lee&action=edit">Thomas F. Lee</A>. Microsoft Windows Server 2003 TCP/IP Protocols and Services. <A class=internal href="http://zh.wikipedia.org/w/index.php?title=Special:Booksources&isbn=0735612919">ISBN 0735612919</A>
<LI><A class=new title="Craig Hunt" href="http://zh.wikipedia.org/w/index.php?title=Craig_Hunt&action=edit">Craig Hunt</A> TCP/IP Network Administration. O'Reilly (1998) <A class=internal href="http://zh.wikipedia.org/w/index.php?title=Special:Booksources&isbn=1565923227">ISBN 1565923227</A>
<LI><A class=new title="W. Richard Stevens" href="http://zh.wikipedia.org/w/index.php?title=W._Richard_Stevens&action=edit">W. Richard Stevens</A>. The Protocols (TCP/IP Illustrated, Volume 1). Addison-Wesley Professional; 1st edition (December 31, 1993). <A class=internal href="http://zh.wikipedia.org/w/index.php?title=Special:Booksources&isbn=0201633469">ISBN 0201633469</A> </LI></UL><!-- Saved in parser cache with key zhwiki:pcache:idhash:11021-0!1!0!0!!zh-cn!2!zh-cn and timestamp 20060316121605 -->
<DIV class=printfooter>取自"<A href="http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B">[url]http://zh.wikipedia.org/wiki/TCP/IP%E5%8F%82%E8%80%83%E6%A8%A1%E5%9E%8B[/url]</A>"</DIV></SPAN>
页:
[1]
