Junior — Middle
Can you list the main TCP protocol flags and explain their purposes?
sobes.tech AI
Answer from AI
The main setup flags (control flags) in the TCP header and their purposes:
- SYN (Synchronize) — used to establish a connection. Marks the beginning of the three-way handshake.
- ACK (Acknowledgment) — confirms receipt of data. Indicates that the acknowledgment field is valid.
- FIN (Finish) — signals the end of data transmission and connection closure.
- RST (Reset) — resets the connection, used in case of errors or inability to establish a connection.
- PSH (Push) — requests immediate data transfer to the recipient application without buffering.
- URG (Urgent) — indicates that the data has high priority and should be processed first.
Example: when establishing a connection, the client sends a packet with the SYN flag, the server responds with SYN+ACK, and the client confirms with ACK — this is the TCP three-way handshake.