Options Field in TCP Header


TCP users send packets with data and TCP header information. The header contains source, destination, and other variables. TCP header is processed at each network device during transmission. Data remains unchanged, but header details like IP address may change.

Options Field in TCP Header

The TCP header has an optional options field for enhancements. It can be 0-320 bits, depending on data offset size. Options field holds various types: maximum segment size, window scaling, timestamps, etc. This field shows total option length, including kind and length. Option-data field has option details like numerical value or timestamp.

This field improves performance, reliability, and security of TCP connections. It adjusts packet and window size based on network conditions. It detects and prevents packet reordering and spoofing. Options field negotiates features between sender and receiver during connection establishment. In IPv4 packets, options field follows headers, containing extra info. It can be up to 40 bytes, but actual size varies per packet. Not all packets have the options field; it depends on usage and purpose.

Importance of Option Field in TCP Header

The options field in the TCP header was created for future improvements to the TCP protocol. But, it is not used as much and its contents are not standardized.

When TCP was first created, the internet was smaller and less complicated. The original TCP header worked well for communication between two devices. But as the internet grew, new needs arose, like transferring larger data and ensuring more reliable and secure communication.

The options field was meant to meet these new needs without changing the TCP protocol entirely. However, it hasn't been widely adopted, and using it is not recommended. Here are some reasons why:

  • The options field is not mandatory, so not all TCP implementations support it.

  • The contents of the options field are not standardized, causing compatibility issues.

  • The options field adds extra information to each TCP packet, which can slow down performance.

Because of these reasons, the options field is rarely used nowadays. If you require new features that are not supported by the standard TCP header, it's better to use TCP protocol extensions like the Selective Acknowledgment (SACK) option.

Various Options in TCP Options Field

The TCP options field makes data transmission faster, safer, and reliable. It helps TCP choose data size, detect and fix issues. Options field enables agreeing on features with other computers. TCP has 35 options with different names and numbers. Some are common and known, while others are new or unused.

Common Options

  • End of Option List: Marks end of options field.

  • No-Operation: Fills empty space to align options.

  • Maximum Segment Size (MSS): Tells the biggest data size to send.

  • Window Scale: Makes window size bigger for faster transfer.

  • SACK Permitted: Allows selective acknowledgments to fix data issues.

  • SACK: Provides selective acknowledgment parts to avoid data retransmission.

  • Timestamps: Measures packet time and improves connection efficiency.

TCP adapts to Internet needs, works with old computers, and goes faster, safer, and more reliable.

Data Offset Field

The data offset field in TCP header specifies header size in words. A word is 32 bits or 4 bytes of data. Data offset shows TCP header size.

  • Minimum size: 5 words (20 bytes) with no options, only mandatory fields.

  • Maximum size: 15 words (60 bytes) with 10 words (40 bytes) of options.

Data offset helps receivers locate data in the TCP segment.It prevents confusion between options and data, improving efficiency.

Fragmentation and MSS

Fragmentation happens when a large packet can't fit a network link's limit. Each fragment has its IP header with position and length info. Fragments reassemble at destination using this information.

Fragmentation affects TCP performance in various ways:

  • Overhead increases with additional IP headers for each fragment.

  • Packet loss risk rises as fragments are transmitted and acknowledged separately.

  • Latency increases as fragments are processed at each hop.

TCP avoids fragmentation with the MSS option to set max data size. MSS is negotiated during connection establishment (SYN packets). Default MSS: 536 bytes for IPv4, 1220 bytes for IPv6. MSS helps TCP send smaller segments, avoiding fragmentation. It improves throughput, reliability, and latency of TCP connections.

Window Size and Window Scaling

Window size controls data flow between two computers in TCP. It limits how much data can be sent or received. The TCP header has a 16-bit window size field. Maximum size is 65535 bytes, not always enough for fast or distant networks. TCP uses window scaling option to increase window size. At connection start, scaling factor determines real window size. Scaling factor can be 0 to 14, allowing up to 1 GB window. Window scaling helps TCP use larger window sizes, going faster over long or busy networks.

Packet Losses and SACKs

Packet losses occur when packets never reach their destination due to various reasons. TCP uses sequence numbers to track sent and received packets. The acknowledgment number tells the sender which packets were received. Sometimes, some packets are lost, leading to retransmissions of already received data. TCP uses selective acknowledgments (SACKs) to avoid resending received data. SACKs tell the sender which parts of data were received and which are missing. SACKs help TCP fix lost data issues faster and improve reliability.

Old Duplicate Segments and Timestamps

Old duplicate segments occur when packets are sent multiple times by mistake. TCP uses timestamps to differentiate between old and new packets. Timestamps record sender and receiver times to check packet freshness. By using timestamps, TCP ensures only new packets are processed, improving safety and speed.

Conclusion

The options field in TCP header is an extra part that lets TCP do more things and work better. The options field can have many options that can help TCP send and receive data faster, safer and more reliably. Some of the common and important options are:

  • MSS: tells the biggest size of data that can be sent in one piece.

  • Window scaling: tells how to make the window size bigger.

  • SACKs: tells which parts of data are well and which are missing.

  • Timestamps: tells two times for each packet.

The options field also depends on some other parts of the TCP header, such as:

  • Data offset: tells how big the TCP header is in words.

  • Sequence number: tells which packets are sent and received.

  • Acknowledgment number: tells which packets are well.

The options field is a way that TCP can change and get better over time. By using the options field, TCP can do what the internet needs and wants, while still working with old computers. The options field can also let TCP do new things that can make TCP go faster, safer and more reliably.

Updated on: 31-Aug-2023

782 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements