当前位置:网站首页>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
边栏推荐
- The e-book "action guide for large organizations to further promote zero code application platform" was officially released!
- 3-7sql injection website instance step 3: attack type and attack strategy
- Data7202 statistical analysis
- Day22 send request and parameterization using JMeter
- Gb28181 protocol -- timing
- CST8227
- Digitalization, transformation?
- Tail command – view the contents at the end of the file
- Why study discrete mathematics
- Explain @builder usage
猜你喜欢

Personal blog system graduation project opening report

What elements are indispensable for the development of the character? What are the stages
Wind farm visualization: wind farm data

Pre knowledge of asynchronous operation

Distributed solar photovoltaic inverter monitoring

Tablespace free space

MySQL uses the where condition to find strange results: solve

Digitalization, transformation?
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
Yunda's cloud based business in Taiwan construction 𞓜 practical school
随机推荐
IQ debugging of Hisilicon platform ISP and image (1)
Understanding the dynamic mode of mongodb document
Report on the application prospect and investment potential of global and Chinese cell therapy industry 2022-2028
Global and Chinese kaolin market operation scale and investment development proposal report 2022
SAP ui5 tutorial for beginners part XXVI - detailed steps for using OData service with mock server trial version
Websocket in the promotion of vegetable farmers
Data7202 statistical analysis
Lesson 9: workspace introduction
Notes on dashboard & kuboard installation in kubernetes cluster
Yunda's cloud based business in Taiwan construction 𞓜 practical school
SAP ui5 beginner tutorial No. 27 - unit test tool quNit introduction trial version for SAP ui5 application
[network security] sharing of experience and ideas of an emergency battle
Grep command – powerful text search tool
How often should you refactor- How often should you refactor?
Lesson 8: FTP server setup and loading
BGP - basic concept
You can't specify target table for update in from clause error in MySQL
Day22 send request and parameterization using JMeter
Research Report on global and Chinese vaccine market profit forecast and the 14th five year plan development strategy 2022-2028
Why study discrete mathematics