当前位置:网站首页>Explain TCP segmentation and IP fragmentation in detail

Explain TCP segmentation and IP fragmentation in detail

2022-07-23 12:42:00 Maybe I'm dissolute

  1. MTU(Maximum Transmission Unit Maximum transmission unit )
    MTU It is a limitation of the network in the link layer to the data frame , Ethernet MTU yes 1500 Bytes . One IP Datagrams are transmitted over Ethernet , If it's longer than that MTU value , It's going to be transmitted in pieces , So that the length of each datagram is less than MTU. The research of slice transmission IP Datagrams do not necessarily arrive in order , but IP The information in the header allows these datagrams to be assembled in sequence .IP The fragmentation and reorganization of datagrams are completed at the network layer .
  2. MSS(Maximum Segment Size Maximum segment size )
    MSS yes TCP A concept in ( In the options field in the header ).MSS yes TCP The maximum number of data segments a packet can transmit at a time ,TCP The length of message segment is larger than MSS when , To transmit in segments .TCP When establishing the connection, the agreement usually needs to negotiate the MSS value , Each party has information to inform it of what it expects to receive MSS Options (MSS Options only appear in SYN In the message segment , namely TCP The first two of the three handshakes ).MSS The value of is usually MTU Value minus two header sizes ( Need to subtract IP Packet header 20 Byte and TCP Header of data segment 20 byte ). So if you use link layer Ethernet ,MSS The value of is often 1460 byte . and Internet Standard MTU( The smallest MTU, The link layer network is x2.5 when ) by 576, So if you don't set , be MSS The default value of is 536 byte . A lot of times ,MSS The best value is 512 Multiple .(TCP The segmentation and reorganization of message segments are completed at the transport layer )
  3. TCP And the reason for the segmentation is MSS,IP The reason for fragmentation is MTU, Because there has always been MSS<=MTU, Each paragraph after the segment TCP Message segment plus IP The length behind the head cannot exceed MTU, Therefore, there is no need to do... At the network layer IP It's split . therefore TCP Message segments rarely occur IP Fragmentation
  4. because UDP Datagrams do not segment themselves , So when the length exceeds MTU when , At the network layer IP Fragmentation . Again ,ICMP It also appears in the network layer IP Fragmentation .
  5. summary :UDP No segmentation , Just from IP Come to share ;TCP Will be segmented , Of course not IP Come to share .
  6. IP After the data is submitted for slicing , Only the first one has UDP Head or ICMP The first one , The remaining pieces are only IP Head . After reaching the endpoint, according to IP The information in the header is reorganized at the network layer . and TCP There are TCP The first one , After reaching the endpoint, according to TCP The first information is reorganized at the transport layer .IP After the data is submitted for slicing , Only after arriving at the destination will the reorganization be carried out , Not like other network protocols , At the next stop, it will be reorganized .
  7. about IP For fragmented datagrams , Even if only one piece of data is lost, the whole datagram must be retransmitted ( Since there is retransmission , It shows that the transport layer uses a protocol with retransmission function , Such as TCP). This is because IP The layer itself has no timeout retransmission mechanism —— The higher level is responsible for overtime and retransmission . When it comes from TCP A segment of a message segment ( stay IP In a piece of datagram ) After loss ,TCP It will resend the whole after the timeout TCP Message segment , This message segment corresponds to a IP The datagram ( There may be more than one IP Fragmentation ), There is no way to retransmit only one piece of data in the datagram .
原网站

版权声明
本文为[Maybe I'm dissolute]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230540092156.html