Handshaking: TCP Three-Way Handshake
Handshaking: TCP Three-Way Handshake
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.[3][4][5]
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 receive or for the receiver to reply with a negative
acknowledgement meaning "I did not receive your last message correctly, please resend it" (e.g., if the data
was corrupted en route).[6]
Contents
Example
TCP three-way handshake
SMTP
TLS handshake
WPA2 wireless
Dial-up access modems
Serial "Hardware Handshaking"
References
Example
"synchronize" (SYN) message with its own sequence number , which Bob receives.
2. Bob replies with a synchronize-acknowledgment (SYN-ACK) message with its own
sequence number and acknowledgement number , which Alice receives.
3. Alice replies with an acknowledgment (ACK) message with acknowledgement number
, 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.
The reason for the client and server not using a default sequence number such as 0 for establishing the
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 is used to exchange all the
information required by both sides for the exchange of the 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 up the
connection. This initial exchange results in a successful TLS connection (both parties ready to transfer
application data with TLS) or an alert message (as specified below).
The protocol is used to negotiate the secure attributes of a session. (RFC 5246, p. 37)[7]
WPA2 wireless
The WPA2 standard for wireless uses a four-way handshake defined in IEEE 802.11i-2004.
One classic example of handshaking is that of dial-up modems, which typically negotiate communication
parameters for a brief period when a connection is first established, and there after use those parameters to
provide optimal information transfer over the channel as a function of its quality and capacity. The
"squealing" (which is actually a sound that changes in pitch 100 times every second) noises made by some
modems with speaker output immediately after a connection is established are in fact the sounds of modems
at both ends engaging in a handshaking procedure; once the procedure is completed, the speaker might be
silenced, depending on the settings of operating system or the application controlling the modem.
This frequently used term describes the use of RTS and CTS signals over a serial interconnection. It is,
however, not quite correct; it's not a true form of handshaking, and is better described as flow control.
References
1. "What is handshaking? - Definition from WhatIs.com" (http://searchnetworking.techtarget.co
m/definition/handshaking). SearchNetworking. Retrieved 2018-02-19.
2. Ware, Peter; Chivers, Bill; Cheleski, Paul (2001). Jacaranda Information Processes and
Technology: HSC Course. Australia: John Wiley & Sons Australia. pp. 92–93. ISBN 978-
0701634728.
3. TCP RFC 793, 2581
4. SMTP RFC 821,5321, 2821, 1869,6531, 2822
5. FTP 959, 3659 (conversation), 2228,4217 (TLS handshake),5797
6. "handshaking" (http://encyclopedia2.thefreedictionary.com/Hand+shake+signal).
TheFreeDictionary's Encyclopedia.
7. The Transport Layer Security (TLS) Protocol, version 1.2 (https://tools.ietf.org/html/rfc5246).
IETF. August 2008. doi:10.17487/RFC5246 (https://doi.org/10.17487%2FRFC5246). RFC
5246 (https://tools.ietf.org/html/rfc5246).
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using
this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia
Foundation, Inc., a non-profit organization.