GRE MTU Fragmentation

GRE MTU Definition

Before forwarding an IP packet through a GRE tunnel, the NetEngine 8000 F adds a GRE header and a transport protocol (IP header) before the packet's inner IP header. After the packet is encapsulated with a GRE header and transport protocol, its size may exceed the maximum size that the data link layer permits, resulting in a forwarding failure. A GRE MTU is the maximum size of a non-fragmented IP packet to be sent before it enters a GRE tunnel. After the packet enters the GRE tunnel, its maximum size must contain a GRE header and transport protocol, as shown in Figure 1.

Figure 1 GRE MTU

GRE MTU Fragmentation Principle

The GRE MTU fragmentation principle varies according to the types of packets entering a GRE tunnel.

  • IPv4 packet entering a GRE tunnel
    Before forwarding an IPv4 packet through a GRE tunnel, a device compares the packet's size with the GRE MTU. If the packet's size exceeds the GRE MTU, the device fragments the packet and then encapsulates a GRE header and transport protocol into each fragment. The fragments are not reassembled during transmission. After the fragments reach the tunnel's peer device, they are decapsulated and then reassembled. A GRE MTU can be manually configured or automatically learned.
    • MTU configuration for a tunnel interface

      If an MTU has been configured for a tunnel interface, a device checks whether the size of an IPv4 packet is greater than the configured MTU before forwarding it through the tunnel interface. If it is greater, the device fragments the packet and encapsulates a GRE header and transport protocol into each fragment. The fragments encapsulated with GRE headers and transport protocols may be fragmented again on the physical outbound interface.

    • Path MTU (PMTU) learning on a tunnel interface
      PMTU learning can be enabled on a tunnel interface to prevent TCP packets encapsulated with BGP messages from being fragmented multiple times during transmission, improving BGP message transmission efficiency. On the network shown in Figure 2, DeviceA sends a probe packet with the maximum length of 1500 bytes and DF value of 1. If the MTU of DeviceB is less than 1500 bytes, DeviceB discards the probe packet and returns an ICMP error message carrying its own MTU. When the message reaches DeviceA, DeviceA learns the new MTU. The final MTU (GRE MTU) learned by DeviceA is the minimum MTU of the entire path minus 32 (20-byte IP header + 12-byte GRE header). When the default MTU is 1500 bytes, the GRE MTU is 1468 (1500 – 32) bytes.

      After PMTU learning is enabled on a device's tunnel interface, the device sends probe packets carrying updated MTUs every 10 minutes.

      Figure 2 GRE MTU principle
  • IPv6 packet entering a GRE tunnel

    Before forwarding an IPv6 packet through a GRE tunnel, a device compares the packet's size with the GRE MTU. If the packet's size is greater than the GRE MTU, the device reports a Packet Too Big message and fragments the packet.

Effective GRE MTU Value

The effective GRE MTU value varies according to the types of packets entering a GRE tunnel.

  • IPv4 packet entering a GRE tunnel
    • If neither the tunnel pathmtu enable command nor the mtu command is run on a tunnel interface, the GRE MTU is 1468 (1500 – 32) bytes.
    • If the mtu command is run on a tunnel interface, the GRE MTU is the MTU configured for the tunnel interface minus 32.
    • If the mtu command is not run on a tunnel interface but the tunnel pathmtu enable command is run, the GRE MTU is the minimum MTU of the tunnel interface minus 32.
      • The tunnel pathmtu enable and mtu commands cannot both be run on a tunnel interface.
      • In a scenario where PMTU learning is enabled for an IPv4 GRE tunnel and the minimum IPv4 MTU of the tunnel is less than 1312 (1280 + 32) bytes, the IPv6 MTU learned by the corresponding IPv4 GRE tunnel interface is less than 1280 bytes. If the ingress sends an IPv6 packet longer than the learned IPv6 MTU, the packet is dropped. To address this issue, perform either of the following operations:
        • Disable PMTU learning for the IPv4 GRE tunnel.
        • If the IPv4 GRE tunnel needs to have PMTU learning enabled and carry IPv6 packets, ensure that the forwarding interfaces of the tunnel's transit nodes each have an IPv4 MTU of at least 1312 bytes.
  • IPv6 packet entering a GRE tunnel
    • If the mtu command is not run on a tunnel interface, the GRE MTU is 1468 (1500 – 32) bytes.
    • If the mtu command is run on a tunnel interface, the GRE MTU is the MTU configured for the tunnel interface minus 32.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >