Handshaking

automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins

Handshaking is the connection between the computer and a device. Handshaking is required in order to allow both the computer and device to send protocols to each other. During a handshake, the two devices make sure that they know certain connection requirements of each other. For instance, they will need to find out a suitable bit rate and latency for each other.

Examples of devices that use this method include a modem or another computer. Normally, handshaking happens between two devices. Although, a TCP three-way handshake is a special type of handshake that involves sending a connection from one computer to another, just done three times.

Examples

change

TCP three-way handshake

change

This method is used to connect two hosts on a computer network together, each host known as the client (the main host) and the server (a distant host), respectively. Once the client wants to make a connection to the server, the client can start a TCP three-way handshake with the server. This will allow the client computer (the main device) to send and receive messages to and from the server (a distant device) once the process is complete. Starting a normal TCP connection requires three separate steps:

  1. The first host (Alice) sends the second host (Bob) a "synchronize" (SYN) message with its own sequence number  . Bob will then receives Alice's sequence number.
  2. Bob replies with a synchronize-acknowledgment (SYN-ACK) message with its own sequence number   and acknowledgement number  . Alice will then receive Bob's message, which contains both his sequence number and his modified acknowledgement number.
  3. Alice replies with an acknowledgment (ACK) message with acknowledgement number  . Bob will receive this message, but at this stage he doesn't need to reply.

In this setup, a synchronize message will request a server to make a connection with each other, while the acknowledgement messages return to the requesting server to let it know the message was received. Letting both hosts send synchronize messages to each other will allow the two hosts to connect with each other in both directions. Each acknowledgement message sent to each other ensures they are still connected with each other.