Get the App
SLTechnology News&Howtos  ›  Database  › 

Modify the MTU value under linux

Shulou Source: shulou.com Published: 2022-06-01 06:08:38 09月30日 Update

Jumbo frames related

1 What are Jumbo Frames?

Jumbo frames refer to frames longer than standard Ethernet Frames, i.e. frames larger than 1518/1522 bits. The size of Jumbo frames is specified by each device manufacturer and does not belong to IEEE standards. Jumbo frames run on full-duplex Ethernet networks. Jumbo frames define a "link negotiation" protocol to negotiate with peer devices whether the peer devices support Jumbo frames. The standard Ethernet IP packet size is: 1500 bits, 18 bits (6+6+2+4) excluding Ethernet header and FCS, 1518 bits if Ethernet header and FCS are included;Jumbo frame generally refers to the message with the value of Layer 2 encapsulation Layer 3 IP message greater than 9000 bits.

Jumbo frames Background: In 1998, Alteon Networks proposed to increase the maximum data transmission capacity of the Data Link Layer from 1500 bits to 9000 bits. Although this proposal was not approved by the IEEE 802.3 Working Group, most equipment manufacturers already supported it.

Advantages of Jumbo Frames

In data transmission, since IEEE regulations specify a maximum frame size of 1,500 bits (hosts in early half-duplex networks), the number of bits required for transmission must go through the process of data importance-transmission-data combination. The smaller the maximum frame used, the larger the amount of packets transmitted and the corresponding amount of computation, and the consequences are:

a: Increase the calculation amount of the host computer and consume CPU resources;

b: Affects the speed of network transmission.

The advantages of using large frames are naturally self-evident--reducing CPU calculations and speeding up data transmission.

Second, modify the MTU value

The actual operation required to modify the frame size is to modify the MTU (Maximum Transmission Unit) value, that is, to modify the Maximum Transmission Unit. The modifications are as follows:

1. ifconfig command modification

ifconfig ${Interface} mtu ${SIZE} upifconfig eth2 mtu 9000 up

This is the most common method and works with all linux distributions. The disadvantage is that it fails after restarting and needs to be loaded in the boot item.

2. Modify the configuration file

CentOS / RHEL / Fedora Linux

# vi /etc/sysconfig/network-scripts/ifcfg-eth0#Add the following content MTU="9000"#Restart the network card after saving # service network restart#Enable IPv6 address, modify the parameter of IPv6 mtu to IPV6_MTU="1280"

Debian / Ubuntu Linux

# vi /etc/network/interfaces#Add the following value mtu 9000 #After saving, restart the network to take effect # /etc/init.d/networking restart III. Why is the maximum MTU value 9000 bytes

Theoretically, a 4-bit CRC can support up to 12000 bytes, and there is no way to check it beyond that. There are also limitations of other protocols such as NFS.

Finally, it should be noted that when switching network devices, it is not possible to modify the MTU value of the host side only, and it is also necessary to enable the jumbo frames function on the switching network devices.

IV. MTU test

Use ping command, -l specifies packet size, -f option informs operating system that packet size cannot be changed without permission

Packet needs to be fragmented but DF set .

Tags: Transmission maximum size data network device host message standard Ethernet support operating system advantage command byte that is data transmission method end system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Huawei Linux macOS MySQL