7

This doubt has been bugging me for a while now.

Upon reading numerous articles i have found that the client and the server exchange their mss value during the tcp 3 way handshake and the lower of the two values is selected as the mss for the connection. Since both client and server are using the same mss value isn't this negotiation?

Manav Garg
  • 73
  • 1
  • 1
  • 6

2 Answers2

15

It is NOT considered a negotiation, it is a statement of an known maximum, and there is not back and forth. It can be different bidirectionally. So one TCP flow can have a different MSS each way.

RFC 879 states:

HOSTS MUST NOT SEND DATAGRAMS LARGER THAN 576 OCTETS UNLESS THEY HAVE SPECIFIC KNOWLEDGE THAT THE DESTINATION HOST IS PREPARED TO ACCEPT LARGER D ATAGRAMS.

thus:

THE TCP MAXIMUM SEGMENT SIZE IS THE IP MAXIMUM DATAGRAM SIZE MINUS FORTY.

The default IP Maximum Datagram Size is 576.

The default TCP Maximum Segment Size is 536.

And continuing:

TCP provides an option that may be used at the time a connection is established (only) to indicate the maximum size TCP segment that can be accepted on that connection. This Maximum Segment Size (MSS) announcement (often mistakenly called a negotiation) is sent from the data receiver to the data sender and says "I can accept TCP segments up to size X". The size (X) may be larger or smaller than the default. The MSS can be used completely independently in each direction of data flow. The result may be quite different maximum sizes in the two directions.

You can find a lot more information on MSS in RFC 6691 and RFC 1122 section 4.2.2.6

zevlag
  • 622
  • 6
  • 15
0

You cannot call it a negotiation because each side STATES the MSS it can accept. This value, is the lowest of values between the tcp buffer and the egress interface mtu size. Once a host knows its MSS and the far end host's MSS, he will choose the lowest one. Thus, in essence, both hosts will send data with the same MSS.