cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Relationship between Sequence Numbers and Acknolowledgement numbers

280
Views
5
Helpful
0
Comments

<pre>

For the sequence/acknowledgment system to work, the computers must synchronize their sequence numbers. In other words, Computer B must know what initial sequence number (ISN) Computer A used to start the sequence. Computer A must know what ISN Computer B will use to start the sequence for any data Computer B will transmit.

This synchronization of sequence numbers is called a three-way handshake. The three-way handshake always occurs at the beginning of a TCP connection. The three steps of a three-way handshake are as follows:
Computer A sends a segment with

[
SYN = 1 indicates that this is an announcement that this Synchronization is in progress
SYN = 0 indicates that this is an announcement that this Synchronization is NOT in progress
ACK = 1 indicates that this is an acknowledgement
ACK = 0 indicates that this is NOT an acknowledgement
]

SYN = 1
ACK = 0

Sequence Number = X (where X is Computer A's ISN)

The active open computer (Computer A) sends a segment with the SYN flag set to 1 and the ACK flag set to 0. SYN is short for synchronize. This flag, as described earlier, announces an attempt to open a connection. This first segment header also contains the initial sequence number (ISN), which marks the beginning of the sequence numbers for data that Computer A will transmit. The first byte transmitted to Computer B will have the sequence number ISN+1.

Computer B receives Computer A's segment and returns a segment with

SYN = 1 (still in synchronization phase)

ACK = 1 (the Acknowledgment Number field will contain a value)

Sequence number = Y, where Y is Computer B's ISN

Acknowledgment number = M + 1, where M is the last sequence number received from Computer A

Computer A sends a segment to Computer B that acknowledges receipt of Computer B's ISN:

SYN = 0
ACK = 1

Sequence number = next sequence number in series (M+1)

Acknowledgment number = N + 1 (where N is the last sequence number received from Computer B)

 

</pre>