超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優惠信息
衡天云優惠活動
熱網互聯2026年促銷活動
hostkvm優惠促銷活動
zji優惠促銷活動
QQGNET優惠促銷活動
QQGNET優惠促銷活動

TCP/IP協議族

主機參考:VPS測評參考推薦/專注分享VPS服務器優惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情!
我們發布的部分優惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作

TCP/IP網絡協議棧分為應用層(Application)、傳輸層( Transport)、網絡層(Network)和鏈路層(Link)四層。

1.數據鏈路層

實現了網卡接口的網絡驅動程序。

協議:ARP協議和RARP協議

ARP協議:目標機器IP地址—(ARP協議)→

目標機器MAC地址→

目標機器

RARP協議:(無盤工作站)MAC地址—(RARP協議)→IP地址

2.網絡層

實現數據包的選路和轉發。負責點對點(point to point)的傳輸(“點”:主機或路由器)。網絡層向上層協議隱藏了網絡拓撲連接的細節,在傳輸層和應用層看來通信雙方是直接相連的。

協議:IP協議,ICMP協議。

IP協議根據數據包的目的IP地址來決定如何投遞它。如果數據包不能直接發給目的主機,那么IP協議就為它尋找合適的下一跳路由器,并將數據包交付給該路由器來轉發。IP協議使用逐跳的方式確定通信路徑。

ICMP協議是IP協議重要的補充,用于檢測網絡連接。

3.傳輸層

傳輸層為兩臺主機上的應用程序提供端到端(end to end)的通信。傳輸層只關心通信的起始端和目的端,而不在乎數據包的中轉過程。

協議:TCP協議、UDP協議、SCTP協議

TCP協議

為應用層提供可靠的、面向連接和基于流(stream)的服務;

TCP協議使用超時重傳、數據確定等方式確認數據報被正確地發送至目的端

使用TCP協議通信的雙方必須先建立TCP連接,并在內核中為該連接維持一些必要的數據結構。通信結束時,雙方必須關閉連接以釋放這些內核數據。

TCP協議是基于流的,數據沒有邊界(長度)限制。發送端可以逐個字節地向數據流中寫入數據,接收端也可以逐個字節將其讀出

UDP協議

為應用層提供不可靠、無連接、基于數據報的服務。

UPD協議無法保證數據從發送端正確地傳到目的端。使用UDP協議的應用程序通常要自己處理數據確認、超時重傳等邏輯。

UDP協議是無連接的,因此應用程序每次發送數據都要明確指定接收端的地址(IP地址等信息)。

每個UPD數據報都有一個長度,接收端必須以該長度為最小單位將其所有內容一次性讀出,否則數據將被截斷。

TCP是一種面向連接的,開放的協議,有點像打電話,雙方拿起電話互通身份后就建立了連接,然后說話就行了,這邊說話那邊保證聽得到,并且是按說話的順序聽到的,說完話掛機斷開連接。也就是說TCP傳輸的雙方需要首先建立連接,之后由TCP協議保證數據收發的可靠性,丟失的數據包自動重發,上層應用程序收到的總是可靠的數據流,通訊之后關閉連接。

UDP協議不面向連接,也不保證可靠性,有點像寄信,寫好信放進郵筒里,既不能保證信件在郵遞過程中不會丟失, 也不能保證信件是按順序寄到目的地的。使用UDP協議的應用程序需要自己完成丟包重發、消息排序等工作。

SCTP協議是為了在因特網上傳輸電話信號而設計的。

4.應用層

負責處理應用程序的邏輯

應用層協議(或程序)可能跳過傳輸層直接使用網絡層提供的服務,比如ping程序和OSPF協議。

應用層協議(或程序)通常既可以使用TCP服務,又可以使用UDP服務,比如DNS協議。

TCP/IP數據包的封裝

以太網幀使用6字節(48位)的目的物理地址和6字節(48位)的源物理地址(MAC地址)來表示通信的雙方。

協議類型字段有三種值,分別對應IP、ARP、RAPP。

以太網幀的數據長度規定最小46字節,最大1500字節,ARP和RARP數據包的長度不夠46字節,要在后面補充填位。最大值1500稱為以太網最大傳輸單元(MTU),不同的網絡類型有不同的MTU,如果一個數據包從以太網路由到撥號鏈路上,數據包的長度大于撥號鏈路的MTU,則需要對數據包進行分片(fragment)傳輸。

幀末尾的4字節CRC字段對幀的其他部分提供循環冗余校驗。

幀才是最終在網絡上傳送的字節序列。

TCP/IP數據包跨路由器通訊過程

數據鏈路層(驅動程序)封裝了物理網絡的電氣細節;

網絡層封裝了網絡連接的細節;

傳輸層則為應用程序封裝了一條端對端的邏輯通信鏈路,它負責數據的收發、鏈路的超時重連等。

分用

?當幀到達目的主機時 ,將沿著協議棧自底向上依次傳遞。各層協議依次處理幀中本層負責的頭部數據,以獲取所需的信息,并將處理后的幀交給目的應用程序。這個過程稱為分用( demultiplexing)。

分用是依靠頭部信息中的類型字段實現的。

整理自《Linux高性能服務器編程》第1章,《Linux C一站式學習》第36章


TCP / IP network protocol stack is divided into application layer, transport layer, network layer and link layer.

1. Data link layer

The network driver of network card interface is implemented.

Protocol: ARP protocol and RARP protocol

ARP protocol: target machine IP address - (ARP Protocol) →

MAC address of target machine →

Target machine

RARP protocol: (diskless workstation) MAC address - (RARP protocol) → IP address

2. network layer

Realize packet routing and forwarding. Responsible for point-to-point transmission ("point": host or router). The network layer hides the details of the network topology connection from the upper layer protocol. In the view of the transmission layer and the application layer, the communication parties are directly connected.

Protocol: IP protocol, ICMP Protocol.

IP protocol determines how to deliver a packet according to its destination IP address. If the packet can not be sent directly to the destination host, the IP protocol will find a suitable next hop router for it, and deliver the packet to the router for forwarding. IP protocol uses hop by hop method to determine the communication path.

ICMP Protocol is an important supplement of IP protocol, which is used to detect network connection.

3. transport layer

The transport layer provides end-to-end communication for applications on both hosts. The transport layer only cares about the start and destination of communication, but not the transfer process of packets.

Protocol: TCP, UDP, SCTP

TCP protocol

Provide reliable, connection oriented and stream based services for the application layer;

TCP protocol uses time-out retransmission, data determination and other methods to confirm that the datagram is correctly sent to the destination

The two sides who use TCP protocol to communicate must first establish a TCP connection and maintain some necessary data structures for the connection in the kernel. At the end of the communication, both parties must close the connection to release the kernel data.

The TCP protocol is stream based, and the data has no boundary (length) limit. The sender can write data to the data stream byte by byte, and the receiver can read it out byte by byte

UDP protocol

Provide unreliable, connectionless, datagram based services for the application layer.

UPD protocol can not guarantee the data from the sender to the destination correctly. Applications using UDP protocol usually need to process data confirmation, timeout retransmission and other logic by themselves.

UDP protocol is connectionless, so every time the application sends data, it must specify the address of the receiver (IP address and other information).

Each UPD datagram has a length, and the receiver must read all its contents at one time in the minimum unit of the length, otherwise the data will be truncated.

TCP is a connection oriented and open protocol. It's a bit like making a phone call. After both parties pick up the phone to exchange identities, they establish a connection, and then talk. This way, you can hear it, and you can hear it in the order of speaking. When you finish speaking, hang up and disconnect. In other words, the two sides of TCP transmission need to establish a connection first, and then the TCP protocol ensures the reliability of data receiving and sending. The lost data packets are automatically retransmitted. The upper application receives always reliable data flow, and the connection is closed after communication.

UDP protocol is not connection oriented and does not guarantee reliability. It's a bit like sending a letter. Writing a letter and putting it in the mailbox can neither guarantee that the letter will not be lost in the process of mailing nor that the letter will be sent to the destination in order. Applications using UDP protocol need to complete packet loss retransmission, message sorting, etc.

SCTP is designed to transmit telephone signals over the Internet.

4. application layer

Responsible for handling the logic of the application

Application layer protocol (or program) may skip the transport layer and directly use the services provided by the network layer, such as ping program and OSPF protocol.

Application layer protocols (or programs) can usually use both TCP services and UDP services, such as DNS protocol.

Encapsulation of TCP / IP packets

Ethernet frames use a 6-byte (48 bit) destination physical address and a 6-byte (48 bit) source physical address (MAC address) to represent both sides of the communication.

There are three values in the protocol type field, corresponding to IP, ARP and Rapp respectively.

The data length of Ethernet frame specifies the minimum 46 bytes and the maximum 1500 bytes. The length of ARP and RARP packets is not enough 46 bytes, so it is necessary to fill in the following bits. The maximum value 1500 is called the Ethernet maximum transmission unit (MTU). Different network types have different MTUs. If a packet is routed from Ethernet to the dial-up link, and the length of the packet is larger than the MTU of the dial-up link, the packet needs to be transmitted in segments.

The 4-byte CRC field at the end of the frame provides cyclic redundancy checking for the rest of the frame.

Frame is the last byte sequence transmitted over the network.

Communication process of TCP / IP packets across routers

The data link layer (driver) encapsulates the electrical details of the physical network;

The network layer encapsulates the details of network connection;

The transport layer encapsulates an end-to-end logical communication link for the application program, which is responsible for data sending and receiving, link timeout reconnection, etc.

Separate use

When the frame reaches the destination host, it will pass from bottom to top along the protocol stack. Each layer protocol processes the header data in the frame in order to obtain the required information, and hands the processed frame to the target application program. This process is called de multiplexing.

The allocation is realized by the type field in the header information.

Organized from Chapter 1 of Linux high performance server programming, chapter 36 of Linux C one stop learning

--------------------------------------------------------------
主機參考,收集國內外VPS,VPS測評,主機測評,云服務器,虛擬主機,獨立服務器,國內外服務器,高性價比建站主機相關優惠信息@www.k2270.com
詳細介紹和測評國外VPS主機,云服務器,國外服務器,國外主機的相關優惠信息,商家背景,網絡帶寬等等,也是目前國內最好的主機云服務器VPS參考測評資訊優惠信息分享平臺

這幾篇文章你可能也喜歡:

本文由主機參考刊發,轉載請注明:TCP/IP協議族 http://www.k2270.com/12681.html

【騰訊云】領8888元采購禮包,搶爆款云服務器 每月 9元起,個人開發者加享折上折!
打賞
轉載請注明原文鏈接:主機參考 » TCP/IP協議族
主機參考僅做資料收集,不對商家任何信息及交易做信用擔保,購買前請注意風險,有交易糾紛請自行解決!請查閱:特別聲明

相關推薦

評論 搶沙發

評論前必須登錄!