<s>
The	O
maximum	B-Protocol
segment	I-Protocol
size	I-Protocol
(	O
MSS	O
)	O
is	O
a	O
parameter	O
of	O
the	O
options	O
field	O
of	O
the	O
TCP	B-Protocol
header	I-Protocol
that	O
specifies	O
the	O
largest	O
amount	O
of	O
data	O
,	O
specified	O
in	O
bytes	B-Application
,	O
that	O
a	O
computer	O
or	O
communications	O
device	O
can	O
receive	O
in	O
a	O
single	O
TCP	B-Protocol
segment	O
.	O
</s>
<s>
It	O
does	O
not	O
count	O
the	O
TCP	B-Protocol
header	I-Protocol
or	O
the	O
IP	B-Protocol
header	I-Protocol
(	O
unlike	O
,	O
for	O
example	O
,	O
the	O
MTU	B-Protocol
for	O
IP	O
datagrams	O
)	O
.	O
</s>
<s>
The	O
IP	O
datagram	O
containing	O
a	O
TCP	B-Protocol
segment	O
may	O
be	O
self-contained	O
within	O
a	O
single	O
packet	O
,	O
or	O
it	O
may	O
be	O
reconstructed	O
from	O
several	O
fragmented	B-Protocol
pieces	O
;	O
either	O
way	O
,	O
the	O
MSS	O
limit	O
applies	O
to	O
the	O
total	O
amount	O
of	O
data	O
contained	O
in	O
the	O
final	O
,	O
reconstructed	O
TCP	B-Protocol
segment	O
.	O
</s>
<s>
To	O
avoid	O
fragmentation	O
in	O
the	O
IP	B-Protocol
layer	I-Protocol
,	O
a	O
host	O
must	O
specify	O
the	O
maximum	B-Protocol
segment	I-Protocol
size	I-Protocol
as	O
equal	O
to	O
the	O
largest	O
IP	O
datagram	O
that	O
the	O
host	O
can	O
handle	O
minus	O
the	O
IP	O
and	O
TCP	B-Protocol
header	I-Protocol
sizes	O
.	O
</s>
<s>
Therefore	O
,	O
IPv4	B-Protocol
hosts	O
are	O
required	O
to	O
be	O
able	O
to	O
handle	O
an	O
MSS	O
of	O
536	O
octets	O
(=	O
576	O
-	O
20	O
-	O
20	O
)	O
and	O
IPv6	B-Protocol
hosts	O
are	O
required	O
to	O
be	O
able	O
to	O
handle	O
an	O
MSS	O
of	O
1220	O
octets	O
(=	O
1280	O
-	O
40	O
-	O
20	O
)	O
.	O
</s>
<s>
Small	O
MSS	O
values	O
will	O
reduce	O
or	O
eliminate	O
IP	B-Protocol
fragmentation	I-Protocol
but	O
will	O
result	O
in	O
higher	O
overhead	O
.	O
</s>
<s>
For	O
most	O
computer	O
users	O
,	O
the	O
MSS	O
option	O
is	O
established	O
by	O
the	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
The	O
default	O
TCP	B-Protocol
Maximum	B-Protocol
Segment	I-Protocol
Size	I-Protocol
is	O
536	O
.	O
</s>
<s>
Where	O
a	O
host	O
wishes	O
to	O
set	O
the	O
maximum	B-Protocol
segment	I-Protocol
size	I-Protocol
to	O
a	O
value	O
other	O
than	O
the	O
default	O
,	O
the	O
maximum	B-Protocol
segment	I-Protocol
size	I-Protocol
is	O
specified	O
as	O
a	O
TCP	B-Protocol
option	O
,	O
initially	O
in	O
the	O
TCP	B-Protocol
SYN	B-Protocol
packet	I-Protocol
during	O
the	O
TCP	B-Protocol
handshake	O
.	O
</s>
<s>
The	O
Network	O
Driver	O
(	O
ND	O
)	O
or	O
interface	O
should	O
know	O
the	O
Maximum	B-Protocol
Transmission	I-Protocol
Unit	I-Protocol
(	O
MTU	B-Protocol
)	O
of	O
the	O
directly	O
attached	O
network	O
.	O
</s>
<s>
The	O
IP	O
should	O
ask	O
the	O
Network	O
Driver	O
for	O
the	O
Maximum	B-Protocol
Transmission	I-Protocol
Unit	I-Protocol
.	O
</s>
<s>
The	O
TCP	B-Protocol
should	O
ask	O
the	O
IP	O
for	O
the	O
Maximum	O
Datagram	O
Data	O
Size	O
(	O
MDDS	O
)	O
.	O
</s>
<s>
This	O
is	O
the	O
MTU	B-Protocol
minus	O
the	O
IP	B-Protocol
header	I-Protocol
length	O
(	O
MDDS	O
=	O
MTU	B-Protocol
-	O
IPHdrLen	O
)	O
.	O
</s>
<s>
When	O
opening	O
a	O
connection	O
,	O
TCP	B-Protocol
can	O
send	O
an	O
MSS	O
option	O
with	O
the	O
value	O
equal	O
to	O
:	O
MDDS	O
-	O
TCPHdrLen	O
.	O
</s>
<s>
While	O
sending	O
TCP	B-Protocol
segments	O
to	O
the	O
other	O
end	O
,	O
an	O
inter-layer	O
communication	O
is	O
done	O
as	O
follows	O
:	O
</s>
<s>
TCP	B-Protocol
should	O
determine	O
the	O
Maximum	O
Segment	O
Data	O
Size	O
(	O
MSDS	O
)	O
from	O
either	O
the	O
default	O
or	O
the	O
received	O
value	O
of	O
the	O
MSS	O
option	O
.	O
</s>
<s>
TCP	B-Protocol
should	O
determine	O
if	O
source	O
fragmentation	O
is	O
possible	O
(	O
by	O
asking	O
the	O
IP	O
)	O
and	O
desirable	O
.	O
</s>
<s>
If	O
so	O
,	O
TCP	B-Protocol
may	O
hand	O
to	O
IP	O
,	O
segments	O
(	O
including	O
the	O
TCP	B-Protocol
header	I-Protocol
)	O
up	O
to	O
MSDS	O
+	O
TCPHdrLen	O
.	O
</s>
<s>
If	O
not	O
,	O
TCP	B-Protocol
may	O
hand	O
to	O
IP	O
,	O
segments	O
(	O
including	O
the	O
TCP	B-Protocol
header	I-Protocol
)	O
up	O
to	O
the	O
lesser	O
of	O
(	O
MSDS	O
+	O
TCPHdrLen	O
)	O
and	O
MDDS	O
.	O
</s>
<s>
IP	O
checks	O
the	O
length	O
of	O
data	O
passed	O
to	O
it	O
by	O
TCP	B-Protocol
.	O
</s>
<s>
If	O
the	O
length	O
is	O
less	O
than	O
or	O
equal	O
MDDS	O
,	O
IP	O
attaches	O
the	O
IP	B-Protocol
header	I-Protocol
and	O
hands	O
it	O
to	O
the	O
ND	O
.	O
</s>
<s>
MSS	O
is	O
sometimes	O
conflated	O
with	O
MTU/PMTU	B-Protocol
,	O
which	O
is	O
a	O
characteristic	O
of	O
the	O
underlying	O
link	B-Protocol
layer	I-Protocol
,	O
while	O
MSS	O
applies	O
specifically	O
to	O
TCP	B-Protocol
and	O
hence	O
the	O
transport	B-Architecture
layer	I-Architecture
.	O
</s>
<s>
The	O
two	O
are	O
similar	O
in	O
that	O
they	O
limit	O
the	O
maximum	O
size	O
of	O
the	O
payload	O
carried	O
by	O
their	O
respective	O
protocol	B-Protocol
data	I-Protocol
unit	I-Protocol
(	O
frame	O
for	O
MTU	B-Protocol
,	O
TCP	B-Protocol
segment	O
for	O
MSS	O
)	O
,	O
and	O
related	O
since	O
MSS	O
cannot	O
exceed	O
the	O
MTU	B-Protocol
for	O
its	O
underlying	O
link	O
(	O
taking	O
into	O
account	O
the	O
overhead	O
of	O
any	O
headers	O
added	O
by	O
the	O
layers	O
below	O
TCP	B-Protocol
)	O
.	O
</s>
<s>
However	O
,	O
the	O
difference	O
,	O
in	O
addition	O
to	O
applying	O
to	O
different	O
layers	O
,	O
is	O
that	O
MSS	O
can	O
have	O
a	O
different	O
value	O
in	O
either	O
direction	O
and	O
also	O
that	O
frames	O
exceeding	O
the	O
MTU	B-Protocol
may	O
cause	O
packets	O
(	O
which	O
encapsulate	O
segments	O
)	O
to	O
be	O
fragmented	B-Protocol
by	O
the	O
network	B-Application
layer	I-Application
,	O
while	O
segments	O
exceeding	O
the	O
MSS	O
are	O
simply	O
discarded	O
.	O
</s>
