|  | 9.1 | The TCP/IP Protocol Suite
| 9.1.6 | TCP three-way handshake/open connection
For a connection to be established, the two end stations must synchronize on each other's initial TCP sequence numbers (ISNs). Sequence numbers are used to track the order of packets and to ensure that no packets are lost in transmission. The initial sequence number is the starting number used when a TCP connection is established. Exchanging beginning sequence numbers during the connection sequence ensures that lost data can be recovered. Synchronization is accomplished by exchanging segments carrying the ISNs and a control bit called SYN, which stands for synchronize. (Segments carrying the SYN bit are also called SYNs.) Successful connection requires a suitable mechanism for choosing an initial sequence and a slightly involved handshake to exchange the ISNs. Synchronization requires that each side send its own ISN and receive a confirmation and ISN from the other side of the connection. Each side must receive the other side's ISN and send a confirming acknowledgment (ACK) in a specific order, outlined in the following steps: A ->B SYN -- My sequence number is X. A <- B ACK --Your sequence number is X. A <- B SYN -- My sequence number is Y. A ->B ACK -- Your sequence number is Y. Because the second and third steps can be combined in a single message, the exchange is called a three-way handshake/open connection. As illustrated in the Figure, both ends of a connection are synchronized with a three-way handshake/open connection sequence. A three-way handshake is necessary because TCPs may use different mechanisms for picking the ISN. The receiver of the first SYN has no way of knowing if the segment was an old delayed one unless it remembers the last sequence number used on the connection, which is not always possible, and so it must ask the sender to verify this SYN. At this point, either side can begin communicating, and either side can break the communication because TCP is a peer-to-peer (balanced) communication method.