TCP/IP四層模型和OSI七層模型的概念

<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="https://img-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;">建立七層模型的主要目的是爲解決異種網絡互連時所遇到的兼容性問題。它的最大優點是將服務、接口和協議這三個概念明確地區分開來:服務說明某一層爲上一層提供一些什麼功能,接口說明上一層如何使用下層的服務,而協議涉及如何實現本層的服務;這樣各層之間具有很強的獨立性,互連網絡中各實體採用什麼樣的協議是沒有限制的,只要向上提供相同的服務並且不改變相鄰層的接口就可以了。網絡七層的劃分也是爲了使網絡的不同功能模塊(不同層次)分擔起不同的職責,從而帶來如下好處:   <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';">● </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;">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;">O S I <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>P C <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>與物理層之間的通信。它的主要功能是如何在不可靠的物理線路上進行數據的可靠傳遞。爲了保證傳輸,從網絡層接收到的數據被分割成特定的可被物理層傳輸的幀。幀是用來移動數據的結構包,它不僅包括原始數據,還包括髮送方和接收方的物理地址以及檢錯和控制信息。其中的地址確定了幀將發送到何處,而糾錯和控制信息則確保幀無差錯到達。 如果在傳送數據時,接收點檢測到所傳數據中有差錯,就要通知發送方重發這一幀。   數據鏈路層的功能獨立於網絡和它的節點和所採用的物理層類型,它也不關心是否正在運行 <span style="font-family: 'Times New Roman';">Wo r d </span><span style="font-family: 宋體;">、</span><span style="font-family: 'Times New Roman';">E x c e l </span><span style="font-family: 宋體;">或使用</span><span style="font-family: 'Times New Roman';">I n t e r n e t </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>,由於它們要對幀解碼並使用幀信息將數據發送到正確的接收方,所以它們是工作在數據鏈路層的。   數據鏈路層(<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><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;">O S I <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><span style="font-family: 'Times New Roman';">D L L</span><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><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;">O S I <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="color: rgb(202, 0, 0); text-decoration: none;"><span style="color: rgb(19, 110, 194);">數據分割</span></a>成較小的數據片,同時對每一數據片安排一序列號,以便數據到達接收方節點的傳輸層時,能以正確的順序重組。該過程即被稱爲排序。   工作在傳輸層的一種服務是 <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="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 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;">負責在網絡中的兩節點之間建立、維持和終止通信。 會話層的功能包括:建立通信鏈接,保持會話過程通信鏈接的暢通,同步兩個節點之間的對話,決定通信是否被中斷以及通信中斷時決定從何處重新發送。   你可能常常聽到有人把會話層稱作網絡通信的<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><span style="font-family: 'Times New Roman';">2.</span><span style="font-family: 宋體;">數據鏈路層:定義瞭如何讓格式化數據以進行傳輸,以及如何讓控制對物理介質的訪問。這一層通常還提供錯誤檢測和糾正,以確保數據的可靠傳輸。   </span><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><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><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><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><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>
發佈了27 篇原創文章 · 獲贊 5 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章