Real time embedded FreeRTOS RSS feed 
Homepage FreeRTOS+ Products FreeRTOS Labs Support Forum Contact / Enquiries

MSS

MSS stands for Maximum Segment Size. It defines the maximum amount of data that can be sent or received in a TCP or UDP packet. It differs from the MTU value in that its value only applies to the data size, not the frame size, so it excludes the Ethernet, IP, TCP or UDP protocol headers. The MSS is dependent on the MTU and the maximum number of options bytes.

The following is an example MSS calculation starting from an MTU of 1526 bytes. The number of bytes consumed by the various headers contained within the frame are subtracted to get the MSS size:

1526  MTU size
 -14  Ethernet header size
 -20  IP protocol header size
 -20  TCP protocol header size
 -12  TCP options bytes
----
1460  MSS size
					
In FreeRTOS+TCP the MSS value is set by the ipconfigTCP_MSS setting in FreeRTOSIPConfig.h. If ipconfigTCP_MSS is not defined then it will be set to a default value of 1460.

In the above example the calculated MSS value of 1460 bytes is suitable for a local area network (LAN), but is probably too large for use across the Internet, where the MSS should be restricted to 1400 bytes for maximum reliability. Therefore if the IP address of a remote node is outside of the local network (see netmask), then FreeRTOS+TCP will automatically set the MSS to the smallest of either 1400 or the configured ipconfigTCP_MSS value.


Useful links:


Other networking basics pages:



[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ FreeRTOS Labs Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.