TCP flags are the guiding beacons of our adventurous journey in communicating with the TCP protocol. Each flag possesses a different superpower, much like a superhero!
Here are the TCP flags:
SYN (Synchronization): It is the initial flag used for establishing a connection between two parties. The sender sets the SYN flag to initiate a connection request. The connection is established upon receiving a SYN/ACK response from the receiver. This process is known as the three-way handshake.
ACK (Acknowledgment): It is the flag used to acknowledge the receipt of data. The sender sets the ACK flag to indicate that the receiver has successfully received a specific sequence number and can proceed with the next data transmission.
FIN (Finish): It indicates the termination of a connection. It is used by the sender to signal the closure of the connection.
RST (Reset): It is used to abruptly terminate a connection. The RST flag is typically employed in error or incompatible situations, forcefully resetting a connection.
PSH (Push): It is used by the sender to request the immediate delivery of data to the receiver. The PSH flag ensures the prompt transfer of data without buffering.
URG (Urgent): It shows the presence of data that requires immediate attention. The URG flag is used to specify an urgent data segment.
TCP flags are used to control the reliable and sequential transmission of data in the TCP protocol. By setting the relevant flags, connections are established, data exchanges occur, and connections are terminated. In this way, the TCP protocol ensures security, accuracy, and reliability in data transmission.
Here are the binary and decimal values of TCP flags:
In some cases, flags are used together, and in such cases, we can obtain the binary and decimal values by summing up the values of the flags. Here are the binary and decimal values for the combined flags:
SYN-ACK (Synchronize-Acknowledgment):
Decimal: 18
Binary: 00010010
FIN-ACK (Finish-Acknowledgment):
Decimal: 17
Binary: 00010001
In the table, there are two additional values shown with the flags, even though they are not flags themselves. These values are CWR (Congestion Window Reduced) and ECE (Explicit Congestion Notification). Let’s briefly discuss these two values:
ECE (Explicit Congestion Notification) and CWR (Congestion Window Reduced) are different from TCP flags; they are control fields in the TCP header. These values are used to detect and manage network congestion in TCP flows. Here are the explanations for these values:
ECE (Explicit Congestion Notification): The ECE value is used in TCP segments in the presence of network congestion. It allows the TCP flow to detect network congestion and take appropriate measures. Although it is referred to as an ECE flag, it is actually a control field in the TCP header.
CWR (Congestion Window Reduced): The CWR value is used by the receiver to indicate to the sender that the flow should reduce its rate due to network congestion. Although it is called the CWR flag, it is also a control field in the TCP header.
ECE and CWR values are not part of the “Flags” field in the TCP header, and they are not considered flags. Instead, they are control fields used to determine network congestion and take appropriate measures in TCP traffic.
Authors: Ömer and Busra, for Turkish please visit Busra’s page.