当前位置:网站首页>Understand what MTU is
Understand what MTU is
2022-06-25 06:21:00 【Programmer community】
The link layer of Ethernet has a limit on the length of data frames , Its maximum value defaults to 1500 byte , This feature of the link layer is called MTU, That is, the largest transmission unit
MTU
MTU
Maximum Transmission Unit, Maximum transmission unit , It refers to the maximum of the data link layer payload, Set by the hardware network card MTU, It's a hard limit
Effective data of data link layer , Minimum 46byte, Maximum general 1500byte, The biggest thing here is MTU,MTU Indicates that the network layer must send to the network card API My bag <= 1500byte, Otherwise, the call fails
MTU It is the restriction of the link layer to the network layer , Ethernet link MTU The default is 1500byte, It means effective data of Ethernet data link layer payload The maximum number of bytes of cannot exceed 1500, What about this 1500 Does the byte contain the head and tail of the link layer ?
Of course, it doesn't include !
Here comes the question , Some Ethernet network cards are configured with VLAN tag, Data frames passing through this network card will carry VLAN tag,VLAN tag It should be counted in the link layer payload Li ? Or we can say MTU = 1500 It contains 802.1Q The head of VLAN tag Do you ?
contain !
When the network card is configured VLAN tag when ,VLAN tag + Data <= MTU, Sometimes VLAN tag Not just one , It could be a double label , So this one VLAN tag Namely 8 Bytes . By this time MTU If still 1500, Link layer payload It can't be 1500 了
What do I do ?
You can add 802.1Q Interface settings for MTU=1504 or 1508
Why would there be MTU
Ethernet initially had no limit on message length , The network layer can receive at most 65535 Bytes , But Ethernet can not reliably transmit long messages , And retransmission after loss will also occupy a lot of network resources , And limit the message to a certain length , Ethernet can transmit the message to the destination , So there was MTU
IP Fragmentation
Since the link layer payload Yes MTU Limit , This means that the data sent from the network layer to the link layer cannot exceed MTU, If you exceed , You need to partition in the network layer , Cut into pieces <=MTU Of IP Data packets
If the network layer finds the link layer MTU Less than IP The size of the bag ( The network layer can call functions to obtain link layer information ), It doesn't start dividing immediately , I still need to see IP Whether the packet is allowed to be partitioned DF(Don’t Fragment), If slicing is allowed , It will be divided into several ID Same IP package
The network layer of the host can be partitioned , The network layer of the router can also be partitioned , That is to say, the network interface of the router also has MTU Limit
Just like the barrel theory , How much water a barrel can hold depends on the shortest piece , The path of network communication IP Package size , Depending on the source host 、 Destination host 、 In router MTU The youngest one
UDP transmission
about UDP package , If MTU = 1500, that udp payload What is the maximum , So you don't have to split it ?
MTU(1500) = IPHeader(20) + UDPHeader(8) + Data
Data = 1500 -20 - 8 = 1472
If UDP Bag Data <= 1472 Bytes ,UDP package (UDPHeader+Data) In the network layer, there is no need to partition , Directly on the package IPHeader To the link layer
If UDP Bag payload > 1472, that UDP package (UDPHeader + Data) The network layer needs to be partitioned , How to slice ?
The network layer does not replicate once in each partition UDP head , It is a complete UDP Pericardiotomy , add IP Send your hair out , Except for the first segment UDP head , None of the following pieces contain UDP head
The network layer of the destination host receives multiple messages UDP After slicing , The network layer must be reorganized before it can be handed over to the upper layer , Why? ?
Because only the first of multiple partition packages has UDP The head of the , It can be based on UDP The port number in the header informs the corresponding application to take away , However, there is no such thing as UDP head , The transport layer is unable to deliver the fragment package to the correct application . therefore UDP Fragmented packets must be reassembled into a complete network layer UDP package , Give it to the transport layer for processing
According to what is the network layer reorganized ? Remember what it said , It will be divided into multiple pieces ID Same IP Is it a bag ?
If some fragmentation packets are not received by the network layer of the destination host , cause UDP Package reorganization failed , The receiver discards the entire packet , This is a UDP An indication of unreliable transmission . and TCP When a packet error occurs , The packet will be retransmitted , Ensure reliable transmission
about UDP Come on , General choice 576 Bytes of communication
边栏推荐
- Cat command – display the file contents on the terminal device
- Handling skills of SQL optimization (2)
- [Suanli network] problems and challenges faced by the development of Suanli network
- John
- JS implementation mouse can achieve the effect of left and right scrolling
- MySQL uses the where condition to find strange results: solve
- Huawei machine test question: splicing URL
- JSON. toJSONString(object, SerializerFeature.WriteMapNullValue); Second parameter action
- SAP ui5 beginner tutorial 25 - using proxy server to solve the cross domain problem of SAP ui5 application accessing remote OData service trial version
- Noi Mathematics: Dirichlet convolution
猜你喜欢
Tablespace free space
What is the slice flag bit
Linus' speech recordings, which were lost in 1994, were made public
At the age of 26, I was transferred to software testing with zero foundation. Now I have successfully entered the job with a monthly salary of 12K. However, no one understands my bitterness
Gavin's insight on transformer live class - line by line analysis and field experiment analysis of insurance BOT microservice code of insurance industry in the actual combat of Rasa dialogue robot pro
@Detailed explanation of valid annotation usage
Folding mobile phones are expected to explode, or help Samsung compete with apple and Chinese mobile phones
What is the IP address
SAP ui5 beginner tutorial No. 28 - Introduction to the integration test tool OPA for SAP ui5 applications
After five years of software testing in ByteDance, I was dismissed in December to remind my brother of paddling
随机推荐
China rehabilitation hospital industry operation benefit analysis and operation situation investigation report 2022
Analysis report on global and Chinese pharmaceutical excipients industry competition and marketing model 2022-2028
Echo command – output a string or extract the value of a shell variable
Observation configuring wmic
Global and Chinese benzoic acid market competition strategy and demand scale forecast report 2022
Personal blog system graduation project opening report
D compile time reflection
JS implementation mouse can achieve the effect of left and right scrolling
[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
Find command – find and search for files
The e-book "action guide for large organizations to further promote zero code application platform" was officially released!
BGP - basic concept
DF command – displays disk space usage
Curl command – file transfer tool
Research Report on investment share and application prospect of 1,3-propanediol (PDO) industry in the world and China 2022
[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management
Distributed solar photovoltaic inverter monitoring
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
Explain @builder usage
Count the grid