Handshaking
Handshaking
In information technology, telecommunications, and related fields, handshaking is an automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins. If follows the physical establishment of the channel and precedes normal information transfer.
The handshaking process usually takes place in order to establish rules for communication when a computer sets about communicating with a foreign device. When a computer communicates with another device like a modem, printer, or network server, it needs to handshake with it to establish a connection.
Handshaking can negotiate parameters that are acceptable to equipment and systems at both ends of the communication channel, including information transfer rate, coding alphabet, parity, interrupt procedure, and other protocol or hardware features. Handshaking is a technique of communication between two entities. However, within TCP/IP RFCs, the term “handshake” is most commonly used to reference the TCP three-way handshake. For example, the term “handshake” is not present in RFCs covering FTP or SMTP. One exception is Transport Layer Security, TLS, setup, FTP RFC 4217. In place of the term “handshake”, FTP RFC 3659 substitutes the term “conversation” for the passing of commands.
A simple handshaking protocol might only involve the receiver sending a message meaning “I received your last message and I am ready for you to send me another one.” A more complex handshaking protocol might allow the sender to ask the receiver if it is ready to receiveor for the receiver to reply with a negative acknowledgement meaning “I did not receive your last message correctly, please resend it”.
Handshaking facilitates connecting relatively heterogeneous systems or equipment over a communication channel without need for human intervention to set parameter.
- TCP three-way handshake: Establishing a normal TCP connection requires three separate steps:
1. The first host (Alice) sends the second host (Bob) a “synchronize” (SYZ) message with its own sequence number x, which Bob receives.
2. Bob replies with a synchronize-acknowledgement (SYZ+ACK) message with its own sequence number Y and acknowledgement numberx+1, which Alice receives.
3. Alice replies with an acknowledgment message with acknowledgement number y+1, which Bob receives and to which he doesn’t need to reply.
In this setup, the synchronize messages act as service requests from one server to the other, while the acknowledgement messages return to the requesting server to let it know the message was received.
One of the most important factors of three-way handshake is that, in order to exchange the starting sequence number the two sides plan to use, the client first sends a segment with its own initial sequence number x, then the server responds by sending a segment with its own sequence number y and the acknowledgement number x+1, and finally the client responds by sending a segment with acknowledgement number y+1.
The reason for the client and server not using the default sequence number such as 0 for establishing connection is to protect against two incarnations of the same connection reusing the same sequence number too soon, which means a segment from an earlier incarnation of a connection might interfere with a later incarnation of the connection.
- SMTP: The Simple Mail Transfer Protocol (SMTP) is the key Internet standard for email transmission. It includes handshaking to negotiate authentication, encryption and maximum message size.
- TLS handshake: When a Transport Layer Security (SSL or TLS) connection starts, the record encapsulates a “control” protocol – the handshake messaging protocol (content type 22). This protocol isused to exchange all the information required by both sides for the exchange ofthe actual application data by TLS. It defines the messages formatting or containing this information and the order of their exchange. These may vary according to the demands of the client and server – i.e., there are several possible procedures to set ip the connection. This initial exchange results in a successful TLS connection (both parties ready to transfer application datawith TLS) or an alert message (as specified below).
The protocol is used to negotiate the secure attributes of a session.
Handshaking
In telephone communication, handshaking is the exchange of information between two modems and the resulting agreement about which protocol to use that precedes each telephone connection. You can hear the handshaking in those crunching and other sounds when you make a dial-out call from your computer.
From: https://en.wikipedia.org/wiki/Handshaking
From: http://searchnetworking.techtarget.com/definition/ handshaking