Open In App

What is Maximum Segment Size?

Improve
Improve
Like Article
Like
Save
Share
Report

In the establishment of a TCP connection, Maximum Segment Size (MSS) is vital. MSS refers to a field in the TCP header, that denotes the largest amount of data, in Bytes, that the device can receive in TCP segment. Consider the structure of the frame in the data link layer.

What is Maximum Segment Size?

The maximum segment size, or MSS, sets a restriction on the size of data packets that can be sent over a network like the Internet. Every bit of data that moves across a network is divided up into packets. Multiple headers, each containing information about the contents and destination, are appended to packets. The payload, or non-header portion of a packet, is measured by MSS.

MSS is like a scale that measures only the trailer if a data packet is like a transport vehicle, where the payload is the trailer and freight and the header is the truck itself. The truck is not permitted to go to its destination if the trailer weighs too much.

Structure of frame format in Data link layer

Structure of frame format in Data link layer

  • The data link layer helps move frames from one node to the next. It consists of a head (which contains information on the number of packets), a tail (which denotes the end of packet flow), and a payload (a portion of the data packet, transmitted. This consists of actual information).
  • The payload is referred to as the ‘Maximum Transmission Unit’ (MTU). It is the biggest packet or size of frame, specified in Bytes, that can be sent over the network, like the Internet.

Example – Ethernet

Maximum Segment Size

  • In Ethernet, the MTU = 1500 Bytes. This is denoted in data link layer.
  • Payload of 1500 B, is received by Network layer and is denoted as 1480 B of datagram/payload and 20 B of header.
  • TPayload of 1480 B, when received by Transport layer, payload size is observed to be 1460 B and header size is seen to be 20 B. Payload here is referred to as ‘Maximum segment size’. For good communications, the number of bytes in data segment and header has to add up to lower than number of bytes in maximum transmission unit.

Note: Thus, Maximum Segment Size refers to highest payload size, an end device is ready to accept within single packet. The maximum Transmission Unit is highest size of packet that can flow through network without being divided.

Calculating Maximum Segment Size

Another measure of packet size that determines MSS is the maximum transmission unit (MTU), which includes the TCP and IP (Internet Protocol) headers. To keep the example going, MTU weighs the vehicle, trailer, and cargo combined, not just the trailer and cargo alone. In essence, the MSS is the MTU less the sizes of the IP and TCP headers:

MTU – (IP header + TCP header) = Maximum Segment Size (MSS)

A significant distinction between MTU and MSS is that a packet is “fragmented,” or divided into smaller pieces, if it exceeds a device’s MTU. On the other hand, a packet is dropped and not delivered if it exceeds the MSS.

What is TCP?

Transmission Control Protocol is referred to as TCP. It is a transport layer protocol that makes it easier for packets to travel from one place to another. Being a connection-oriented protocol, it creates the link before any communication takes place among the computer devices connected to the network.

TCP header is a facts structure this is brought to the beginning of each TCP phase to offer manage data about the transmitted data. The TCP header contains numerous fields that specify information inclusive of the supply and vacation spot ports, series numbers, acknowledgment numbers, window length, checksum, and flags. Here are the important thing fields discovered in a TCP header:

  • Source Port: Specifies the source port quantity, which identifies the sending utility at the supply tool.
  • Destination Port: Specifies the destination port wide variety, which identifies the receiving utility on the vacation spot tool.
  • Sequence Number: Specifies the sequence variety of the first information byte in the TCP section.
  • Acknowledgment Number: Specifies the subsequent sequence quantity predicted by means of the sender of the TCP phase.
  • Data Offset: Specifies the period of the TCP header in 32-bit phrases.
  • Reserved: Reserved for future use and need to be set to zero.
  • Flags: Various flags that manipulate the behavior of the TCP segment, consisting of SYN (synchronize), ACK (acknowledge), FIN (finish), RST (reset), and others.
  • Window Size: Specifies the size of the get hold of window, which shows the amount of records that may be received before requiring acknowledgment.
  • Checksum: Used for errors detection to make sure the integrity of the TCP section in the course of transmission.
  • Urgent Pointer: Specifies the offset from the series wide variety indicating the end of pressing statistics within the TCP segment.
  • Options: Optional fields which could encompass extra control records or parameters.

Size of TCP and IP Header

The length of a TCP header is typically 20 bytes*. IP headers are 20 bytes long and contain information like the source and destination IP addresses. Although optional header fields are available in both TCP and IP packets, they are hardly ever used.

A byte is a unit of memory size used in computer science that is equivalent to eight binary digits, or a combination of 8 ones and zeroes.

What Effects Does IPsec have on MSS?

The Maximum Segment Size (MSS) is a parameter in TCP (Transmission Control Protocol) that specifies the maximum amount of statistics that may be included in a unmarried TCP segment. It represents the biggest payload length that may be despatched in a single packet with out fragmentation. The MSS cost is negotiated during the TCP handshake manner and is generally determined with the aid of the maximum transmission unit (MTU) size of the community path. When IPsec (Internet Protocol Security) is used, it could effect the MSS within the following methods:

  • Encryption Overhead: IPsec provides additional headers and encryption overhead to IP packets, which could growth the overall size of TCP segments. This extra overhead reduces the available area for the TCP payload, doubtlessly lowering the powerful MSS value.
  • Fragmentation: In some instances, IPsec encapsulation may lead to packet fragmentation if the resulting packet size exceeds the MTU of the community course. Fragmentation can introduce inefficiencies and overall performance troubles, especially in networks with high latency or packet loss.
  • Path MTU Discovery (PMTUD): Path MTU Discovery is a mechanism used by TCP to dynamically decide the top-rated MSS value based totally at the MTU of the network path. When IPsec is used, PMTUD may also need to account for the additional overhead delivered by using IPsec encapsulation to make certain that packets aren’t fragmented unnecessarily.
  • Tunneling and Transport Mode: IPsec can be configured to perform in either tunnel mode or delivery mode. In tunnel mode, the entire IP packet (inclusive of the original IP header) is encapsulated within an IPsec header, that may effect the MSS through including extra overhead. In transport mode, simplest the payload of the authentic IP packet is encrypted, which may also have less impact on the MSS.

MSS Clamping

One way to make sure packets still get to their destination in this case is to make incoming packet payloads smaller. This can be accomplished by setting up the server to apply an MSS clamp, which allows the server to “clamp” the maximum payload size from the other server during the TCP handshake by signalling the MSS for packets it is willing to receive. When servers A and B initiate a TCP connection, for instance, and server B transmits a message with a maximum payload size of 1,436 bytes, server A will transmit packets with a maximum payload size of 1,436 bytes for the length of the connection.

Frequently Asked Questions on Maxmum Segment Size – FAQs

Why is MSS important in TCP/IP?

Network performance can be improved by allowing endpoints to negotiate the largest packet size that can be utilised for data transfer through the usage of the Maximum TCP segment size.

Can MSS be adjusted during a TCP connection?

To prevent truncation, set the MSS value on the intermediate router of the SYN packets using the ip tcp adjust-mss command in interface configuration mode.

What is the default MSS Size?

The default value of MSS for a PC is 1500 Bytes.



Last Updated : 23 Feb, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads