3 Way Handshakes TCP
3 Way Handshakes TCP
What is TCP Handshake ? Components of 3 Way Handshake mechanism. ISN ( Initial Sequence Number ) Window Sizing
The synchronization of two TCP computers has to follow a defined process, a handshake. Both machines must inform the other of communication specific settings vital to the successful transmission of data. These settings are used so that each machine knows of the others capabilities in handling TCP packets. The 3 way handshake, as the name suggests, has 3 parts. The following diagram shows the 3 steps in establishing a handshake, and therefore a TCP session.
The computer wishing to initiate the TCP session, the Client in the above example, transmits a packet with the SYN control bit set, a synchronize packet. This packet includes the clients Initial Sequence Number (ISN) and Window size (WIN).
The ISN is a pseudo-randomly generated number. It is essential to remember that the actual sequence number space is finite, although very large. This space ranges from 0 to 2^32 1, which equates to 4,294,967,295 (over 4 Billion) possible combinations. Every TCP terminal has a Window size that tells the sender how many bytes it can send before the receiver will have to toss it away due to fixed input buffer size. Imagine it as a bucket of water, if you pour too much water into my bucket, it will overflow. The Window size tells both machines what the size of bucket the other has. You may have noticed that the acknowledgement (ACK) by each machine is the received packet sequence number plus one increment. This method of acknowledgement will tell the sender the next expected TCP packet sequence number. When within the 3 way handshake, the increment value is literally 1. When inside normal data communications, the increment valueis that of the data size in bytes, e.g. you transmit 38 bytes of data, the increment goes up by 38 to ACK the 38 bytes.