A process used in TCP to establish a connection between a Client and a server. It is a three-step procedure that ensures both parties are ready to exchange data before any data is transmitted.
Procedure
- The client sends a TCP Segments with the
SYNflag, to indicate the request to establish connection. This segment includes a randomly generated sequence number, which is usually a hash of source and destination IPs and ports and is used to defend against Syn Flood attacks. - When the server receives the Segment with the
SYNflag, it responds with a TCP segment containingSYNandACKflag set, to indicate that it also wants to establish a connection. This segment also includes its own randomly generated sequence number and an acknowledgement of the received segments’ sequence number. - Finally the client responds to the server’s
SYN-ACKsegment with a segment containing theACKflag set, to communicate that it is now ready to receive data. This segment acknowledges the server’s sequence number and may carry a segment payload.
Examples
