TCP 3-Way Handshake
A three-way handshake, also known as the TCP (Transmission
Control Protocol) handshake, is the process used to establish a reliable, secure
connection between two devices in a network. It is a key part of the TCP/IP
protocol suite and helps ensure that data is transmitted accurately and
securely between the devices.
Here’s how the three-way handshake works:
Initial Connection
Request (SYN): The initiating device sends a synchronization (SYN) message
to the receiving device to request that a connection be established. This
message contains a sequence number that will be used to keep track of the data
being transmitted.
Connection Acknowledgment (SYN/ACK): The receiving device receives
the SYN message and sends back an acknowledgment (SYN/ACK) message. This
message contains its own sequence number, which will be used to keep track of
the data it receives, and a copy of the sequence number from the initial SYN
message.
Final Acknowledgment (ACK): The initiating device receives the
SYN/ACK message and sends back a final acknowledgment (ACK) message to confirm
that the connection has been established.
Once the three-way handshake is complete, the devices can start exchanging
data securely and reliably, with each message having a unique sequence number
that ensures that data is transmitted in the correct order and without
duplication.
Benefits of 3-way handshake:
Reliability: By establishing a unique sequence number for each
message transmitted between the devices, the three-way handshake ensures that
data is transmitted reliably and in the correct order.
Security: The three-way handshake helps
prevent unauthorized access to a network by requiring that a connection be
established before data can be transmitted.
Error detection: If a device does not
receive an expected acknowledgment, it can assume that the connection has
failed and terminate the attempt.
Flow control: The three-way handshake
helps ensure that the flow of data between devices is controlled and does not
exceed the capacity of the network.
Efficient resource utilization: By
establishing a reliable, secure connection, the three-way handshake helps
ensure that network resources are used efficiently and effectively.