当前位置:网站首页>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】
- 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 . - 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 ) - 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
- 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 .
- summary :UDP No segmentation , Just from IP Come to share ;TCP Will be segmented , Of course not IP Come to share .
- 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 .
- 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 .
边栏推荐
猜你喜欢
随机推荐
Unity3d:UGUI,UI与特效粒子层级,2018.2以上版本BakeMesh,粒子在两个Image之间且在ScrollView
Flask项目中创建数据库表db.create_all()
TeX or LaTeX or MikTeX or TeX Live or CTeX
C#:stack栈源码,数组栈,链栈
HCIP-第一次实验
HCIP---GRE协议和MGRE环境,以及OSPF协议的相关知识点
如何解决if语句太多
牛客面试必考真题【算法篇】高频Top200 题目汇总
OSPF和RIP的路由扩展配置
C# 自定义栈(Stack)
前缀和 LeetCode2100. 适合打劫银行的日子
Unity在URP管线下使用TriLib插件加载模型材质不正确的问题
Unity3D+moba+技能指示器(二)
GameFramework:资源热更代码分析,检查版本信息,下载版本文件,校验版本文件,得到更新文件数量,下载文件,TaskPool
数组 LeetCode977. 有序数组的平方
TeX or LaTeX or MikTeX or TeX Live or CTeX
《wireshark网络分析就是这么简单》知识点与技巧
2小时1000人吃饭,要多少台座椅?
如何用普通的文本编辑器写Web页面
0最短路径问题 LeetCode743. 网络延迟时间






![[AUTOSAR storage stack NVM]](/img/7a/15e01f8ace647b55e11e764dba1b64.png)


