Junior — Middle
How is the connection established in the TCP protocol?
sobes.tech AI
Answer from AI
The connection establishment in the TCP protocol occurs through a three-way handshake:
- The client sends a segment with the SYN (synchronize) flag to the server to initiate the connection and synchronize the initial sequence number.
- The server responds with a segment with SYN and ACK (acknowledge) flags, confirming receipt of SYN and sending its initial sequence number.
- The client sends a segment with the ACK flag, confirming receipt of the server's SYN.
After this, the connection is considered established, and data transfer begins.
Example sequence of flags:
Client -> Server: SYN
Server -> Client: SYN + ACK
Client -> Server: ACK