45

I'm confused as to the difference between maximum segment size and a maximum transmission unit.

Can someone please explain in relation to layers 2 and 3?

If I had a packet of 800 bytes in the payload. Would it be correct to say that the MSS would be 800 bytes (If I set it to be that) and the MTU would be 840? TCP 20 and IP 20 bytes. Would it be any different if I was doing PPPoE?

Ron Maupin
  • 98,218
  • 26
  • 115
  • 191
NetworkNinja
  • 631
  • 1
  • 6
  • 9
  • While this isn't strictly speaking a duplicate [the answer to this question](http://networkengineering.stackexchange.com/q/5057/33) may also answer your question. – YLearn Jun 08 '14 at 06:27

3 Answers3

38

The MTU is the Maximum IP packet size for a given link. Packets bigger than the MTU is fragmented at the point where the lower MTU is found and reassembled further down the chain.

If no fragmentation is wanted, either you have to check the MTU at each hop or use a helper protocol for that (Path MTU Discovery).

Note that IPv6 does NOT support packet fragmentation by routers, hence PMTUD with ICMPv6 is mandatory if you don't want to lose a packet somewhere because of small MTU. Endpoints can fragment, but not routers Also, IPv6 has a much higher MINIMUM MTU.

MSS is Maximum TCP segment Size. Unlike MTU, packet exceeding MSS aren't fragmented, they're simply discarded. MSS is normally decided in the TCP three-way handshake, but some setup might yield path where the decided upon MSS is still too big, leading to dropped packets. The MSS isn't negotiated packet per packet, but for a complete TCP session, nor does it take into account TCP/IP headers

When using PPPoE, all the overhead means you needs to reduce the MSS on the way, normally by specifying it on the router where the chokepoint is found, which will then replace the MSS of passing threeway handshake by the correct lower value if it's higher. PPPoE is simply adding 8 bytes (6 bytes PPPoE + 2 bytes PPP) on top of everything (IP+TCP) and is meant to be run over Ethernet at 1500 bytes MTU, hence the 1492 MSS normally configured to make it go through.

Your IP stack will chop off data to be sent up to the MSS, put it in a TCP segment, then put it in one or more IP packets (depending if it's bigger than local MTU settings) before sending it. Intermediate router could chop it down further if they have lower MTU, but they're only affecting the IP Packet itself, not playing into the TCP segment/header.

maxywb
  • 103
  • 4
Remi Letourneau
  • 2,174
  • 12
  • 13
26

In addition, MSS value is derived from the MTU. Consider that you have data of 2260 bytes to be sent to a remote device. If MTU is 1500, and we consider IP header + TCP header to be 40 bytes, then only 1460 bytes of data can be sent in the first IP packet. The remaining 800 bytes will be sent in the second IP packet. So, for MSS = 800, the MTU should be at least 840.

As PPPoE overhead is 8 bytes, and therefore MTU = 1492 bytes, and MSS = 1492-40 = 1452 bytes.

Jayanth
  • 27
  • 5
t3mp
  • 710
  • 6
  • 8
2

MTU is maximum IP packet size of a given link. MSS is Maximum TCP segment size.

MTU is used for fragmentation i.e packet larger than MTU is fragmented.But in case of MSS, packet larger than MSS is discarded.

MSS is specified during TCP handshake basically in SYN and its value can't be changed after the connection is established.

MSS=MTU-40(IP header(20 bytes) + TCP header(20 bytes) )

metadata
  • 121
  • 1