< Home

Configuring the MTU of an Interface

Context

The maximum transmission unit (MTU) determines the maximum number of bytes in IP packets each time a sender can send. The MTU of an IP packet is the number of bytes from the IP header to the data of the packet.

When the IP layer receives an IP packet to be sent, it checks to which local interface the packet needs to be sent and obtains the MTU configured on the interface. The IP layer then compares the MTU with the packet length. If the packet length is longer than the MTU, the IP layer fragments the packet into smaller packets, which are shorter than or equal to the MTU. If unfragmentation is configured, some packets may be discarded during data transmission at the IP layer. To ensure that large packets are not discarded during transmission, configure forcible fragmentation.

The size of data frames is limited at the network layer. Therefore, a proper MTU is a prerequisite for normal communication on a network.
  • If the configured MTU is excessively small and the packet size is larger, packets are discarded when being forwarded through the forwarding chip. Packets are broken into a great number of fragments when being forwarded through the CPU, affecting proper data transmission.
  • If the size of packets exceeds the MTU supported by a transit node or a receiver, the transit node or receiver fragments the packets or even discards them, aggravating the network transmission load.

The default MTU is recommended. When the size of packets to be transmitted or the device that receives packets changes, you can change the MTU based on the actual network.

The configured MTU takes effect for data packets on the control plane.

For S5720-HI, S5730-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S5731-H, S5731S-H, S5731-S, S5731S-S, and S6720-HI, the configured MTU takes effect for data packets on the forwarding plane only after you run the ipv4 fragment enable command to enable packet fragmentation. The configured MTU takes effect for GRE packets on the forwarding plane without the need to execute the ipv4 fragment enable command. For other switches, the configured MTU does not take effect for data packets on the forwarding plane.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The Ethernet interface view is displayed.

  3. Run undo portswitch

    The Ethernet interface is switched from Layer 2 mode to Layer 3 mode.

  4. Run mtu mtu

    The MTU of the interface is configured.

    By default, the MTU of an interface is 1500 bytes.

    Configuring the MTU of an interface affects the maximum number of bytes in IP packets to be sent by the interface at a time. This configuration also affects the maximum frame length of sent Ethernet packets. The Ethernet packet size cannot exceed the maximum frame length allowed by the peer interface, which can be set using the jumboframe enable command.

  5. Run restart

    The interface is restarted.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >