Maximum segment size vs. Max IP datagram size

Yohhan

Senior member
May 17, 2002
263
0
0
I'm a little confused how all of this fits together.

Here's what I know.

IP datagrams have a maximum size of 65535 bytes, TCP segments have a MSS of 65535 as well. IPv4 has a minimum reassembly buffer size of 576 bytes. Max MTU's for Ethernet are 1500. MSS sizes are often set to 1460 (MTU - TCP and IP headers).

So I know all of these numbers, but not really how it's fitting together. Only one TCP segment gets sent with each IP datagram, correct? So if I have a 1 MB of TCP data to send, and my MSS is 576... then the IP datagram size will be 576 or less plus the header lengths? And then these, in turn, will be transmitted as one unit over my Ethernet network assuming the MTU is 1500 bytes?

What happens if the TCP MSS is smaller than the IP datagram size, and vice versa? Multiple TCP segments cannot be put into one IP datagram, correct?

And what about pings? If I ping someone with a datagram size of 65535, then this just gets fragmented into the correct sized MTU?


If someone could help me put the pieces together on this one, I'd greatly appreciate it.
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
The TCP MSS value specifies the maximum amount of TCP data in a single IP datagram that the local system can accept (reassemble). - from Cisco

So in this verse this should mean that the MSS value is the value you are setting as being the largest IP datagram size (not including the IP Headers).

When any segment or datagram begins its journey on the ethernet highway it is put into frames transmission units agreed upon when the TCP connection is established. Usually this transmission unit or frame is agreed set to the MTU.

If the datagram or segment is larger than what the media can handle then it will get fragmented. And also if it enters a media along the way that has smaller MTU then it will get fragmented again.

At each end of the media the reconstruction of the fragmented datagram is what will reassemble your segment.

As long as you don't have the Do Not Fragment (DF) flag set when pinging and along the way no routers/firewalls add this flag then it should just continue to divide the datagram up into the necessary transmission units to ride on the different media between your computer and thiers.
 

Yohhan

Senior member
May 17, 2002
263
0
0
Okay, so technically I could have a MSS of 65355 (or whatever 2^16 is), but that's pointless because IP would end up having to fragment that anyways to meet the MTU?
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
Its all about tweaking the data and segment sizes to get the most performance out of the fixed network as possible.

If you can't change the MTU then work with it by manipulating the data or frame size.

In most cases the defaults should be fine but if you need to squeeze in more performance you can play with all these values.