Why do I need to consider the interface MTU when setting the MSS of TCP packets


The maximum segment size (MSS) is negotiated during TCP connection setup. The MSS determines the maximum length of a TCP packet. Some upper-layer applications such as HTTP reset the Don't fragment (DF) field of IP packets to prevent TCP packets from being fragmented. If the DF field is reset and the interface MTU is smaller than the MSS, the router discards TCP packets because TCP packets cannot be fragmented.

A TCP packet has the TCP header and IP header; therefore, the MSS value plus all the header lengths cannot exceed the MTU. The MTUs supported by Ethernet and PPPoE are 1500 bytes and 1492 bytes respectively. You are advised to set the MSS to 1200 bytes. If the interface MTU is changed or encapsulation packets of some special applications cannot be fragmented in PPPoE, L3VPN, and IPSec scenarios, note the MSS setting.

Other related questions:
How is the TCP MSS of an AR interface changed
The TCP MSS specifies the maximum length of TCP packets that can be received by a device. When setting up a TCP connection, the local and peer devices negotiate an MSS value to determine the maximum data length of TCP packets. If the length of TCP packets sent from the peer device exceeds the MSS value, the packets are fragmented. To prevent TCP packets from being fragmented, you must configure a proper MSS based on the maximum transmission unit (MTU). The MTU determines whether IP packets will be fragmented. If the size of an IP packet exceeds the MTU, the IP packet will be fragmented. To ensure that a complete packet is transmitted properly, the MSS value plus all the header lengths (TCP header and IP header) cannot exceed the MTU. For example, if the default MTU value of an Ethernet interface is 1500 bytes, to ensure that packets are not fragmented, the maximum MSS value can be 1460 bytes. 1460 = 1500 �?20 (TCP header) �?20 (IP header) You are advised to set the MSS value to 1200 bytes. An improper TCP MSS value may lead to slow network access. To set the TCP MSS, run the following commands: [Huawei] interface gigabitethernet1/0/0 [Huawei-GigabitEthernet1/0/0] tcp adjust-mss 1200

How do I set the MTU value for the MCU?
By default, the MTU value of the MCU is 1500 bytes, which can be changed and be valid for only signaling packets. Generally, you are advised not to change the MTU value. Instead, change the MTU value of the network device to the same as the MTU value of the MCU or endpoint. The method for changing the MTU value is as follows: Run the sys setMTU command, press Enter, enter the new value, press Enter, save the setting, and restart the network device.

Can we change MTU for vlan interface ?
yes, we can. For example: [HUAWEI] interface Vlanif 100 [HUAWEI-Vlanif100] mtu 1492

The speed of Internet access through PPPoE dialup is slow
The MTU of the PPPoE dialer interface is 1492 bytes. When the length of Layer 3 packets sent from this interface is larger than the MTU and non-fragmentation is configured, packets cannot be sent out and the Internet access speed is low. You can run the tcp adjust-mss value command on the dialer interface to modify the MSS (Max Segment Size) during TCP negotiation so that the packet length is shorter than the MTU of the dialer interface. Then packets can be properly processed and Internet access is smooth.
For example, change the MSS of the dialer interface to 1200.
<Huawei> system-view
[Huawei] interface dialer 0
[Huawei-Dialer0] tcp adjust-mss 1200

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top