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 sizeIn 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.