Media MTU and Protocol MTU
Learn about media maximum transmission unit (MTU) and protocol MTU to optimize traffic for the network.
MTU Overview
A maximum transmission unit (MTU) is the largest data unit forwarded on a link without fragmentation. Packets exceeding the MTU are fragmented or dropped, leading to slower networks and packet loss. Protocols like IS-IS do not support fragmentation and drop oversized packets. Configure media MTU for physical interfaces and protocol MTU to prevent packet loss and optimize traffic.
Use Feature Explorer to confirm platform and release support for specific features.
Review the Platform-Specific MTU Behavior section for notes related to your platform.
The default media MTU depends on the encapsulation used on that interface and the Layer 3 (L3) MTU. The L3 MTU depends on whether the protocol used is IP version 4 (IPv4) or International Organization for Standardization (ISO).
The default media MTU for a physical interface depends on the Layer 2 (L2) overhead and is calculated as follows:
Default media MTU = Default protocol MTU + L2 overhead
The actual frames transmitted contain cyclic redundancy check (CRC) bits, which are not part of the media MTU. For example, the media MTU for a Gigabit Ethernet Version 2 interface is specified as 1514 bytes, but the largest possible frame size is actually 1518 bytes. Consider the extra bits when you calculate MTUs for interoperability.
Configure the Media MTU
Consider the following when you configure the media MTU:
- The MTU size must be the same on both sides of a point-to-point connection.
- All interfaces in the subnet of point-to-multipoint connections must use the same MTU size.
- The physical MTU for Ethernet interfaces does not include the 4-byte frame check sequence (FCS) field of the Ethernet frame.
- The maximum number of data-link connection identifiers (DLCIs) is determined by the MTU on the interface. If you have keepalives enabled with the MTU set to 5012, the maximum number of DLCIs is 1000.
If you change the size of the media MTU, you must ensure that the size is equal to or greater than the sum of the protocol MTU and the encapsulation overhead.
Minimum media MTU = protocol MTU + encapsulation overhead
The maximum media MTU size that you can configure depends on your device and the type of interface.
Changing the media MTU or protocol MTU causes an interface to be deleted and added again. This causes the link to flap. Review the Platform-Specific MTU Behavior section for notes related to your platform.
The tunnel services interfaces are considered logical interfaces, you cannot configure the MTU setting for the associated physical interface. This means that you cannot configure the MTU size for the following interface types:
- Loopback (lo-)
To configure the media MTU:
Protocol MTU
Overview
The default protocol MTU depends on your device and the interface type. During initial interface configuration, the protocol MTU is calculated automatically.
Changing the media MTU updates the protocol MTU for existing address families. When you reduce the media MTU size with active address families, you must reduce the protocol MTU size. Increasing the protocol MTU size requires the media MTU to be equal to or greater than the protocol MTU and encapsulation overhead.
You can configure the protocol MTU on all tunnel interfaces.
Protocol MTU for MPLS
If you do not configure an MPLS MTU, Junos OS Evolved derives the MPLS MTU from the physical interface MTU. From this value, the software subtracts the encapsulation overhead and space for the maximum number of labels that might be pushed in the Packet Forwarding Engine. The software provides for three labels of four bytes each, for a total of 12 bytes.
The formula used to determine the MPLS MTU is as follows:
MPLS MTU = physical interface MTU – encapsulation overhead – 12
Encapsulation Overhead
The following table lists the encapsulation overhead by interface encapsulation type.
Interface Encapsulation |
Encapsulation Overhead (Bytes) |
|---|---|
802.1Q/Ethernet 802.3 |
21 |
802.1Q/Ethernet Subnetwork Access Protocol (SNAP) |
26 |
802.1Q/Ethernet version 2 |
18 |
ATM Cell Relay |
4 |
ATM permanent virtual connection (PVC) |
12 |
Cisco HDLC |
4 |
Ethernet 802.3 |
17 |
Ethernet circuit cross-connect (CCC) and virtual private LAN service (VPLS) |
4 |
Ethernet over ATM |
32 |
Ethernet SNAP |
22 |
Ethernet translational cross-connect (TCC) |
18 |
Ethernet version 2 |
14 |
Extended virtual local area network (VLAN) CCC and VPLS |
4 |
Extended VLAN TCC |
22 |
Frame Relay |
4 |
PPP |
4 |
VLAN CCC |
4 |
VLAN VPLS |
4 |
VLAN TCC |
22 |
MTU and MACsec
Media Access Control security (MACsec) is a Layer 2 (L2) security protocol that provides point-to-point security. MACsec adds a header to packets on enabled interfaces. If the packet is near the protocol MTU limit and the MTU isn't adjusted for the MACsec header, the packet may exceed the MTU and get dropped.
Before enabling MACsec, ensure the protocol MTU accommodates the 32-byte MACsec overhead. The MACsec header can be smaller than 32 bytes when there is no Secure Channel Identifier (SCI) field. We recommend assuming the MACsec header is 32 bytes to ensure the device transmits the MACsec packet.
- Overview of Automatic MTU Adjustment for MACsec
- Configure Automatic MTU Adjustment for MACsec
- Behavior of Automatic MTU Adjustment for MACsec
Overview of Automatic MTU Adjustment for MACsec
This feature ensures the interface and protocol MTU are adjusted properly to account for the MACsec overhead when the MTU is left as the default. Without this feature, you (the network administrator) need to adjust the interface and protocol MTU manually.
When MACsec is enabled on a physical or logical interface without a custom MTU, the device can automatically adjust the MTU to include the MACsec header. If the default MTU is in use, the device increases it to accommodate the header. Logical interfaces with MACsec adjust their MTU for protocol families.
This feature works on physical interfaces within aggregated Ethernet interfaces, not directly on aggregated Ethernet interfaces or link aggregation groups (LAGs). Enabling MACsec on one member interface applies the adjusted MTU to all members. LAG flaps occur when you add or remove the only MACsec-enabled interface.
Configure Automatic MTU Adjustment for MACsec
Automatic MTU adjustment is disabled by default. To enable automatic MTU adjustment for MACsec:
Configure MACsec at both the
[edit interfaces interface-name]and the[edit security macsec interfaces interface-name]hierarchy levels. See Configuring MACsec for more information.Configure the
enable-auto-mtu-updatestatement at the[edit security macsec]hierarchy level.[edit] user@device# set security macsec enable-auto-mtu-update
When the media MTU or protocol MTU changes, even automatically, it causes an interface to be deleted and added again. This causes the link to flap.
Behavior of Automatic MTU Adjustment for MACsec
Factors that affect the behavior of the MTU automatic adjustment include:
-
Where MACsec is configured. MACsec can be configured at the physical interface (IFD) level or the logical interface (IFL) level.
-
Whether the MTU is for an interface or for a protocol.
-
For the protocol MTU, whether the protocol belongs to a Layer 2 (L2) or Layer 3 (L3) protocol family.
If you have manually configure the MTU, the device uses the configured MTU instead and does not automatically update the MTU. The following tables show how devices that support this feature automatically adjust the MTU when the MTU has not been configured.
| MACsec Enabled At: | IFD MTU Configured? | IFD MTU (in bytes) | Protocol MTU Configured? | Protocol MTU (in bytes) |
|---|---|---|---|---|
| Physical interface (IFD) level | No | IFD MTU + 32 | No | (Adjusted IFD MTU) − (32 + L2 overhead) |
| Physical interface (IFD) level | No | IFD MTU + 32 | Yes | Uses configured protocol MTU |
| Logical interface (IFL) level | No | IFD MTU remains unchanged. | No | (IFD MTU) − (32 + L2 overhead) |
| Logical interface (IFL) level | No | IFD MTU remains unchanged. | Yes | Uses configured protocol MTU |
This feature functions differently for L2 protocol families such as CCC, VPLS, BRIDGE, or TCC:
| MACsec Enabled At: | IFD MTU Configured? | Where L2 Protocol Is Configured | Protocol MTU Configured? | Protocol MTU Behavior |
|---|---|---|---|---|
| Physical interface (IFD) level | No | Any logical interface under the physical interface uses an L2 protocol | No | The device skips protocol MTU adjustment for all logical interfaces under that physical interface hierarchy. |
| Logical interface (IFL) level | No | Only the logical interface where MACsec is enabled uses an L2 protocol | No | The device skips MTU adjustment only for the protocol configured under that logical interface. |
| MACsec Enabled At: | IFD MTU Configured? | IFD MTU (in bytes) | Protocol MTU Configured? | Protocol MTU (in bytes) |
|---|---|---|---|---|
| Physical interface (IFD) level | No | IFD MTU + 32 | No |
Original IFD MTU (Adjusted IFD MTU - 32 = IFD MTU + 32 - 32) |
| Physical interface (IFD) level | No | IFD MTU + 32 | Yes | Uses configured protocol MTU |
| Logical interface (IFL) level | No | IFD MTU remains unchanged. | No | Same as the IFD MTU |
| Logical interface (IFL) level | No | IFD MTU remains unchanged. | Yes | Uses configured protocol MTU |
Platform-Specific MTU Behavior
Use Feature Explorer to confirm platform and release support for specific features.
Use the following table to review platform-specific behavior for your platform:
| Platform | Difference |
|---|---|
|
ACX Series |
|
|
MX Series |
|
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
enable-auto-mtu-update statement
at the [edit security macsec]
hierarchy level.