TCP/IP四层模型和OSI七层模型

来源:互联网 发布:方志敏杀害传教士 知乎 编辑:程序博客网 时间:2024/04/30 04:50
<span style="font-size: 24px; color: rgb(255, 0, 0);"><strong>TCP/IP四层模型</strong></span>
TCP/IP是一组协议的代名词,它还包括许多协议,组成了TCP/IP协议簇。TCP/IP协议簇分为四层,IP位于协议簇的第二层(对应OSI的第三层),TCP位于协议簇的第三层(对应OSI的第四层)。
TCP/IP通讯协议采用了4层的层级结构,每一层都呼叫它的下一层所提供的网络来完成自己的需求。这4层分别为: 应用层:应用程序间沟通的层,如简单电子邮件传输(SMTP)、文件传输协议(FTP)、网络远程访问协议(Telnet)等。 传输层:在此层中,它提供了节点间的数据传送服务,如传输控制协议(TCP)、用户数据报协议(UDP)等,TCP和UDP给数据包加入传输数据并把它传输到下一层中,这一层负责传送数据,并且确定数据已被送达并接收。 网络层:负责提供基本的数据封包传送功能,让每一块数据包都能够到达目的主机(但不检查是否被正确接收),如网际协议(IP)。 网络接口层:对实际的网络媒体的管理,定义如何使用实际网络(如Ethernet、Serial Line等)来传送数据。
</pre><pre id="best-answer-content" class="reply-text mb10" name="code" style="white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);"><strong><span style="font-size: 24px; color: rgb(255, 0, 0);">OSI七层模型</span></strong>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">OSI<span style="font-family: 宋体;">(</span><span style="font-family: Arial;">Open System Interconnection</span><span style="font-family: 宋体;">,开放系统互连)七层网络模型称为开放式系统互联参考模型 ,是一个逻辑上的定义,一个规范,它把网络从逻辑上分为了</span><span style="font-family: Arial;">7</span><span style="font-family: 宋体;">层。每一层都有相关、相对应的物理设备,比如路由器,交换机。</span><span style="font-family: Arial;">OSI </span><span style="font-family: 宋体;">七层模型是一种框架性的设计方法 ,建立七层模型的主要目的是为解决异种网络互连时所遇到的兼容性问题,其最主要的功能使就是帮助不同类型的主机实现数据传输。它的最大优点是将服务、接口和协议这三个概念明确地区分开来,通过七个层次化的结构模型使不同的系统不同的网络之间实现可靠的通讯。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">                          </p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">                                               图1 osi<span style="font-family: 宋体;">七层结构</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: 宋体;"></span></p><p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; padding-top: 0px; padding-bottom: 0px;"> </p>                                                <img src="http://my.csdn.net/uploads/201208/07/1344351176_4808.jpg" alt="" style="border: none; max-width: 100%;" /><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">模型优点</span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">建立七层模型的主要目的是为解决异种网络互连时所遇到的兼容性问题。它的最大优点是将服务、接口和协议这三个概念明确地区分开来:服务说明某一层为上一层提供一些什么功能,接口说明上一层如何使用下层的服务,而协议涉及如何实现本层的服务;这样各层之间具有很强的独立性,互连网络中各实体采用什么样的协议是没有限制的,只要向上提供相同的服务并且不改变相邻层的接口就可以了。网络七层的划分也是为了使网络的不同功能模块(不同层次)分担起不同的职责,从而带来如下好处:   </p>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">● </span><span style="font-family: 宋体;">减轻问题的复杂程度,一旦网络发生故障,可迅速定位故障所处层次,便于查找和纠错;   </span></p>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">● </span><span style="font-family: 宋体;">在各层分别定义标准接口,使具备相同对等层的不同网络设备能实现互操作,各层之间则相对独立,一种高层协议可放在多种低层协议上运行;   </span></p>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">● </span><span style="font-family: 宋体;">能有效刺激网络技术革新,因为每次更新都可以在小范围内进行,不需对整个网络动大手术;   </span></p>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">● </span><span style="font-family: 宋体;">便于研究和教学。</span></p>
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">一.物理层(<span style="font-family: Arial;">Physical Layer</span></span><span style="font-family: 宋体;">)</span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  OSI<span style="font-family: 宋体;">模型的最低层或第一层,该层包括物理连网媒介,如电缆连线连接器。物理层的协议产生并检测电压以便发送和接收携带数据的信号。在你的</span><a target=_blank href="http://baike.baidu.com/view/79807.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">桌面</span></a>PC<span style="font-family: 宋体;">上插入</span><a target=_blank href="http://baike.baidu.com/view/547393.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">网络接口卡</span></a>,你就建立了计算机连网的基础。换言之,你提供了一个物理层。尽管物理层不提供纠错服务,但它能够设定<a target=_blank href="http://baike.baidu.com/view/434019.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">数据传输速率</span></a>并监测数据出错率。网络物理问题,如电线断开,将影响物理层。用户要传递信息就要利用一些物理媒体,如双绞线、同轴电缆等,但具体的物理媒体并不在<span style="font-family: "Times New Roman";">OSI</span><span style="font-family: 宋体;">的</span><span style="font-family: "Times New Roman";">7</span><span style="font-family: 宋体;">层之内,有人把物理媒体当做第</span><span style="font-family: "Times New Roman";">0</span><span style="font-family: 宋体;">层,物理层的任务就是为它的上一层提供一个物理连接,以及它们的机械、电气、功能和过程特性。如规定使用电缆和接头的类型、传送信号的电压等。在这一层,数据还没有被组织,仅作为原始的位流或电气电压处理,单位是</span><span style="font-family: "Times New Roman";">bit</span><span style="font-family: 宋体;">比特。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-size: 18px;"><strong>二.数据链路层(<span style="font-family: Arial;">Datalink Layer</span><span style="font-family: 宋体;">)</span></strong></span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  OSI<span style="font-family: 宋体;">模型的第二层,它控制</span><a target=_blank href="http://baike.baidu.com/view/239600.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">网络层</span></a>与物理层之间的通信。它的主要功能是如何在不可靠的物理线路上进行数据的可靠传递。为了保证传输,从网络层接收到的数据被分割成特定的可被物理层传输的帧。帧是用来移动数据的结构包,它不仅包括原始数据,还包括发送方和接收方的物理地址以及检错和控制信息。其中的地址确定了帧将发送到何处,而纠错和控制信息则确保帧无差错到达。 如果在传送数据时,接收点检测到所传数据中有差错,就要通知发送方重发这一帧。数据链路层的功能独立于网络和它的节点和所采用的物理层类型,它也不关心是否正在运行Word<span style="font-family: "Times New Roman";"> </span><span style="font-family: 宋体;">、Excel</span><span style="font-family: "Times New Roman";"> </span><span style="font-family: 宋体;">或使用</span><span style="font-family:Times New Roman;">Internet</span><span style="font-family: 宋体;">。有一些连接设备,如</span><a target=_blank href="http://baike.baidu.com/view/1077.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">交换机</span></a>,由于它们要对帧解码并使用帧信息将数据发送到正确的接收方,所以它们是工作在数据链路层的。   </p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  数据链路层(<span style="font-family: "Times New Roman";">DataLinkLayer):</span><span style="font-family: 宋体;">在物理层提供比特流服务的基础上,建立相邻结点之间的数据链路,通过差错控制提供数据帧(</span><span style="font-family: "Times New Roman";">Frame</span><span style="font-family: 宋体;">)在信道上无差错的传输,并进行各电路上的动作系列。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: 宋体;">  数据链路层在不可靠的物理介质上提供可靠的传输。该层的作用包括:物理地址寻址、数据的</span><a target=_blank href="http://baike.baidu.com/view/3871125.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">成帧</span></a>、流量控制、数据的检错、重发等。   数据链路层协议的代表包括:<a target=_blank href="http://baike.baidu.com/view/206610.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">SDLC</span></a>、<a target=_blank href="http://baike.baidu.com/view/89174.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">HDLC</span></a>、<a target=_blank href="http://baike.baidu.com/view/30514.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">PPP</span></a>、<a target=_blank href="http://baike.baidu.com/view/28816.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">STP</span></a>、<a target=_blank href="http://baike.baidu.com/view/21773.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">帧中继</span></a>等。</p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">三.网络层(<span style="font-family: Arial;">Network Layer</span><span style="font-family: 宋体;">)</span></span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  OSI<span style="font-family: 宋体;">模型的第三层,其主要功能是将网络地址翻译成对应的物理地址,并决定如何将数据从发送方路由到接收方。网络层通过综合考虑发送优先权、</span><a target=_blank href="http://baike.baidu.com/view/1452069.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">网络拥塞</span></a>程度、服务质量以及可选路由的花费来决定从一个网络中节点<span style="font-family: "Times New Roman";">A </span><span style="font-family: 宋体;">到另一个网络中节点</span><span style="font-family: "Times New Roman";">B </span><span style="font-family: 宋体;">的最佳路径。由于网络层处理,并智能指导数据传送,</span><a target=_blank href="http://baike.baidu.com/view/1360.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">路由器</span></a>连接网络各段,所以路由器属于网络层。在网络中,<span style="font-family: "Times New Roman";">“</span><span style="font-family: 宋体;">路由</span><span style="font-family: "Times New Roman";">”</span><span style="font-family: 宋体;">是基于编址方案、使用模式以及可达性来指引数据的发送。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: 宋体;">  网络层负责在源机器和目标机器之间建立它们所使用的路由。这一层本身没有任何错误检测和修正机制,因此,网络层必须依赖于端端之间的由</span><span style="font-family: "Times New Roman";">D L L</span><span style="font-family: 宋体;">提供的可靠传输服务。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: 宋体;">  网络层用于本地</span><span style="font-family: "Times New Roman";">L A N</span><span style="font-family: 宋体;">网段之上的</span><a target=_blank href="http://baike.baidu.com/view/1130583.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">计算机系统</span></a>建立通信,它之所以可以这样做,是因为它有自己的路由地址结构,这种结构与第二层机器地址是分开的、独立的。这种协议称为路由或可路由协议。路由协议包括<span style="font-family: "Times New Roman";">I P</span><span style="font-family: 宋体;">、</span><span style="font-family: "Times New Roman";">N o v e l l</span><span style="font-family: 宋体;">公司的</span><span style="font-family: "Times New Roman";">I P X</span><span style="font-family: 宋体;">以及</span><span style="font-family: "Times New Roman";">A p p l e Ta l k</span><span style="font-family: 宋体;">协议。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: 宋体;">  网络层是可选的,它只用于当两个计算机系统处于不同的由路由器分割开的网段这种情况,或者当通信应用要求某种网络层或传输层提供的服务、特性或者能力时。例如,当两台主机处于同一个</span><span style="font-family: "Times New Roman";">L A N</span><span style="font-family: 宋体;">网段的直接相连这种情况,它们之间的通信只使用</span><span style="font-family: "Times New Roman";">L A N</span><span style="font-family: 宋体;">的通信机制就可以了</span><span style="font-family: "Times New Roman";">(</span><span style="font-family: 宋体;">即</span><span style="font-family: "Times New Roman";">OSI </span><span style="font-family: 宋体;">参考模型的一二层</span><span style="font-family: "Times New Roman";">)</span><span style="font-family: 宋体;">。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">四.传输层(<span style="font-family: Arial;">Transport Layer</span><span style="font-family: 宋体;">)</span></span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  OSI<span style="font-family: 宋体;">模型中最重要的一层。传输协议同时进行流量控制或是基于接收方可接收数据的快慢程度规定适当的发送速率。除此之外,传输层按照网络能处理的最大尺寸将较长的数据包进行强制分割。例如,以太网无法接收大于</span><span style="font-family: "Times New Roman";">1 5 0 0 </span><span style="font-family: 宋体;">字节的数据包。发送方节点的传输层将</span><a target=_blank href="http://baike.baidu.com/view/4466818.htm" style="font-family: Arial, Helvetica, sans-serif; color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">数据分割</span></a><span style="font-family: Arial, Helvetica, sans-serif;">成较小的数据片,同时对每一数据片安排一序列号,以便数据到达接收方节点的传输层时,能以正确的顺序重组。该过程即被称为排序。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">  工作在传输层的一种服务是 </span><span style="font-family: "Times New Roman";">T C P / I P </span><span style="font-family: 宋体;">协议套中的</span><span style="font-family: "Times New Roman";">T C P </span><span style="font-family: 宋体;">(</span><a target=_blank href="http://baike.baidu.com/view/544903.htm" style="font-family: Arial, Helvetica, sans-serif; color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">传输控制协议</span></a><span style="font-family: Arial, Helvetica, sans-serif;">),另一项传输层服务是</span><span style="font-family: "Times New Roman";">I P X / S P X </span><span style="font-family: 宋体;">协议集的</span><span style="font-family: "Times New Roman";">S P X </span><span style="font-family: 宋体;">(序列包交换)。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">五.会话层(<span style="font-family: Arial;">Session Layer</span><span style="font-family: 宋体;">)</span></span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  负责在网络中的两节点之间建立、维持和终止通信。 会话层的功能包括:建立通信链接,保持会话过程通信链接的畅通,同步两个节点之间的对话,决定通信是否被中断以及通信中断时决定从何处重新发送。   </p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  你可能常常听到有人把会话层称作网络通信的<span style="font-family: "Times New Roman";">“</span><span style="font-family: 宋体;">交通警察</span><span style="font-family: "Times New Roman";">”</span><span style="font-family: 宋体;">。当通过拨号向你的 </span><span style="font-family: "Times New Roman";">ISP </span><span style="font-family: 宋体;">(</span><a target=_blank href="http://baike.baidu.com/view/275701.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">因特网服务提供商</span></a>)请求连接到因特网时,<span style="font-family: "Times New Roman";">ISP </span><span style="font-family: 宋体;">服务器上的会话层向你与你的 </span><span style="font-family: "Times New Roman";">PC </span><span style="font-family: 宋体;">客户机上的会话层进行协商连接。若你的电话线偶然从墙上插孔脱落时,你终端机上的会话层将检测到连接中断并重新发起连接。会话层通过决定节点通信的优先级和通信时间的长短来设置通信期限</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">六.表示层(<span style="font-family: Arial;">Presentation Layer</span><span style="font-family: 宋体;">)</span></span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  应用程序和网络之间的翻译官,在表示层,数据将按照网络能理解的方案进行格式化;这种格式化也因所使用网络的类型不同而不同。   表示层管理数据的解密与加密,如系统口令的处理。例如:在 <span style="font-family: "Times New Roman";">Internet</span><span style="font-family: 宋体;">上查询你银行账户,使用的即是一种安全连接。你的账户数据在发送前被加密,在网络的另一端,表示层将对接收到的数据解密。除此之外,表示层协议还对图片和</span><a target=_blank href="http://baike.baidu.com/view/1066926.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">文件格式</span></a>信息进行解码和编码。</p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">七.应用层(<span style="font-family: Arial;">Application Layer</span><span style="font-family: 宋体;">)</span></span></strong></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  应用层也称为<a target=_blank href="http://baike.baidu.com/view/3456117.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">应用实体</span></a>(<span style="font-family: "Times New Roman";">AE</span><span style="font-family: 宋体;">),它由若干个特定应用服务元素(</span><span style="font-family: "Times New Roman";">SASE</span><span style="font-family: 宋体;">)和一个或多个公用应用服务元素(</span><span style="font-family: "Times New Roman";">CASE</span><span style="font-family: 宋体;">)组成。每个</span><span style="font-family: "Times New Roman";">SASE</span><span style="font-family: 宋体;">提供特定的应用服务,例如文件运输访问和管理(</span><span style="font-family: "Times New Roman";">FTAM</span><span style="font-family: 宋体;">)、电子文电处理(</span><span style="font-family: "Times New Roman";">MHS</span><span style="font-family: 宋体;">)、</span><a target=_blank href="http://baike.baidu.com/view/694267.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">虚拟终端</span></a>协议(<span style="font-family: "Times New Roman";">VAP</span><span style="font-family: 宋体;">)等。</span><span style="font-family: "Times New Roman";">CASE</span><span style="font-family: 宋体;">提供一组公用的应用服务,例如联系控制服务元素(</span><span style="font-family: "Times New Roman";">ACSE</span><span style="font-family: 宋体;">)、可靠运输服务元素(</span><span style="font-family: "Times New Roman";">RTSE</span><span style="font-family: 宋体;">)和远程操作服务元素(</span><span style="font-family: "Times New Roman";">ROSE</span><span style="font-family: 宋体;">)等。主要负责对</span><a target=_blank href="http://baike.baidu.com/view/37.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">软件</span></a>提供接口以使程序能使用网络服务。术语<span style="font-family: "Times New Roman";">“</span><span style="font-family: 宋体;">应用层</span><span style="font-family: "Times New Roman";">”</span><span style="font-family: 宋体;">并不是指运行在网络上的某个特别应用程序 ,应用层提供的服务包括</span><a target=_blank href="http://baike.baidu.com/view/543341.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">文件传输</span></a>、文件管理以及<a target=_blank href="http://baike.baidu.com/view/1524.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">电子邮件</span></a>的信息处理。</p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><strong><span style="font-size: 18px;">简版: </span></strong>  </p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">  1.<span style="font-family: 宋体;">物理层:主要定义物理设备标准,如网线的接口类型、光纤的接口类型、各种传输介质的传输速率等。它的主要作用是传输比特流(就是由</span><span style="font-family: "Times New Roman";">1</span><span style="font-family: 宋体;">、</span><span style="font-family: "Times New Roman";">0</span><span style="font-family: 宋体;">转化为电流强弱来进行传输</span><span style="font-family: "Times New Roman";">,</span><span style="font-family: 宋体;">到达目的地后在转化为</span><span style="font-family: "Times New Roman";">1</span><span style="font-family: 宋体;">、</span><span style="font-family: "Times New Roman";">0</span><span style="font-family: 宋体;">,也就是我们常说的数模转换与模数转换)。这一层的数据叫做比特。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  2.</span><span style="font-family: 宋体;">数据链路层:定义了如何让格式化数据以进行传输,以及如何让控制对物理介质的访问。这一层通常还提供错误检测和纠正,以确保数据的可靠传输。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  3.</span><span style="font-family: 宋体;">网络层:在位于不同地理位置的网络中的两个主机系统之间提供连接和路径选择。</span><span style="font-family: "Times New Roman";">Internet</span><span style="font-family: 宋体;">的发展使得从世界各站点访问信息的用户数大大增加,而网络层正是管理这种连接的层。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  4.</span><span style="font-family: 宋体;">传输层:定义了一些传输数据的协议和端口号(</span><span style="font-family: "Times New Roman";">WWW</span><span style="font-family: 宋体;">端口</span><span style="font-family: "Times New Roman";">80</span><span style="font-family: 宋体;">等),如:</span><span style="font-family: "Times New Roman";">TCP</span><span style="font-family: 宋体;">(传输控制协议,传输效率低,可靠性强,用于传输可靠性要求高,数据量大的数据),</span><span style="font-family: "Times New Roman";">UDP</span><span style="font-family: 宋体;">(</span><a target=_blank href="http://baike.baidu.com/view/468464.htm" style="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">用户数据报协议</span></a>,与<span style="font-family: "Times New Roman";">TCP</span><span style="font-family: 宋体;">特性恰恰相反,用于传输可靠性要求不高,数据量小的数据,如</span><span style="font-family: "Times New Roman";">QQ</span><span style="font-family: 宋体;">聊天数据就是通过这种方式传输的)。 主要是将从下层接收的数据进行分段和传输,到达目的地址后再进行重组。常常把这一层数据叫做段。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  5.</span><span style="font-family: 宋体;">会话层:通过传输层(端口号:传输端口与接收端口)建立数据传输的通路。主要在你的系统之间发起会话或者接受会话请求(设备之间需要互相认识可以是</span><span style="font-family: "Times New Roman";">IP</span><span style="font-family: 宋体;">也可以是</span><span style="font-family: "Times New Roman";">MAC</span><span style="font-family: 宋体;">或者是主机名)   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  6.</span><span style="font-family: 宋体;">表示层:可确保一个系统的应用层所发送的信息可以被另一个系统的应用层读取。例如,</span><span style="font-family: "Times New Roman";">PC</span><span style="font-family: 宋体;">程序与另一台计算机进行通信,其中一台计算机使用扩展二一十进制交换码(</span><span style="font-family: "Times New Roman";">EBCDIC</span><span style="font-family: 宋体;">),而另一台则使用美国信息交换标准码(</span><span style="font-family: "Times New Roman";">ASCII</span><span style="font-family: 宋体;">)来表示相同的字符。如有必要,表示层会通过使用一种通格式来实现多种数据格式之间的转换。   </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;"><span style="font-family: "Times New Roman";">  7.</span><span style="font-family: 宋体;">应用层:是最靠近用户的</span><span style="font-family: "Times New Roman";">OSI</span><span style="font-family: 宋体;">层。这一层为用户的应用程序(例如电子邮件、文件传输和终端仿真)提供网络服务。</span></p>
0 0