Description

This article provides information about maximum segment size (MSS) calculation with mtu-discovery.

Symptoms

Customers may report that Junos OS is not setting the correct MSS. A discrepancy will be noticed in the MSS value being negotiated between peers and the MSS value set under show system connection extensive . For example:

In the following topology, there is an IBGP connection between R1 and R2. On both of the routers, the connected interfaces have 4034 as the inet mtu.

R1 xe-0/0/3---ibgp----xe-1/0/3 R2
[edit]
lab@R1# show protocols bgp | display set 
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 45.45.45.2
set protocols bgp group ibgp mtu-discovery
set protocols bgp group ibgp neighbor 45.45.45.1
lab@R1# run show interfaces xe-0/0/3 extensive | match mtu 
  Link-level type: Ethernet, MTU: 4048, LAN-PHY mode, Speed: 10Gbps,
    FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
    Protocol inet, MTU: 4034, Generation: 180, Route table: 0
    Protocol multiservice, MTU: Unlimited, Generation: 181, Route table: 0

In the following packet capture on R1, the negotiated MSS is 3994; but under the show system connections extensive MSS, it is set as 2048.

05:50:01.575218 Out 
        Juniper PCAP Flags [Ext], PCAP Extension(s) total length 16
          Device Media Type Extension TLV #3, length 1, value: Ethernet (1)
          Logical Interface Encapsulation Extension TLV #6, length 1, value: Ethernet (14)
          Device Interface Index Extension TLV #1, length 2, value: 137
          Logical Interface Index Extension TLV #4, length 4, value: 69
        -----original packet-----
        00:21:59:e1:e8:03 > 00:19:e2:20:79:01, ethertype IPv4 (0x0800), length 78: (tos 0xc0, ttl 64, id 53193, offset 0, flags [DF], proto: TCP (6), length: 64) 45.45.45.2.62840 > 45.45.45.1.bgp: S 2939345813:2939345813(0) win 16384 <mss <span class="error" style="color:red">3994,nop,wscale 0,nop,nop,timestamp 70559970 0,sackOK,eol>
05:50:01.575875 In 
        Juniper PCAP Flags [Ext, no-L2, In], PCAP Extension(s) total length 16
          Device Media Type Extension TLV #3, length 1, value: Ethernet (1)
          Logical Interface Encapsulation Extension TLV #6, length 1, value: Ethernet (14)          
          Device Interface Index Extension TLV #1, length 2, value: 137
          Logical Interface Index Extension TLV #4, length 4, value: 69
        -----original packet-----
		PFE proto 2 (ipv4): (tos 0xc0, ttl 255, id 37709, offset 0, flags [DF], proto: TCP (6), length: 64) 45.45.45.1.bgp > 45.45.45.2.62840: S 2634967984:2634967984(0) ack 2939345814 win 16384 <mss <span class="error" style="color:red">3994,nop,wscale 0,nop,nop,timestamp 174167273 70559970,sackOK,eol>
[edit]
lab@R1# run show system connections extensive | find 45.45 
tcp4       0      0  45.45.45.2.62840                              45.45.45.1.179                                ESTABLISHED
   sndsbcc:          0 sndsbmbcnt:          0  sndsbmbmax:     131072
sndsblowat:       2048 sndsbhiwat:      16384
   rcvsbcc:          0 rcvsbmbcnt:          0  rcvsbmbmax:     131072
rcvsblowat:          1 rcvsbhiwat:      16384
   proc id:      19725  proc name:        rpd
       iss: 2939345813      sndup: 2939345972
    snduna: 2939345991     sndnxt: 2939345991      sndwnd:      16384
    sndmax: 2939345991    sndcwnd:      10240 sndssthresh: 1073725440
       irs: 2634967984      rcvup: 2634968162
    rcvnxt: 2634968162     rcvadv: 2634984546      rcvwnd:      16384
       rtt:          0       srtt:       1538        rttv:       1040
    rxtcur:       1200   rxtshift:          0       rtseq: 2939345972
    rttmin:       1000  mss:        2048  

Solution

This is expected behavior with Junos. The MSS value is equal to the MTU value minus the IP or IPv6 and TCP headers. This means that the MSS value is generally 40 bytes less than the MTU (for IPv4) and 60 bytes less than the MTU (for IPv6).

This value is negotiated between the peers; in this example, it is 4034-40=3994. Junos OS then rounds this value to a multiple of 2KB; the value is 3994/2048*2048=2048 . So it is not necessary to see the same MSS value with show system connection .

  • 3994/2048=1.95

  • 1.95 is rounded to 1.

  • 1*2048= 2048

Modification History

2020-07-30: Article checked for accuracy and no changes required; article still relevant and valid
2022-06-28: Checked technical accuracy, added link for related documentation.

Related Information

MSS Calculation with MTU Discovery