1. Connection Request By Client: The client chooses an ISN for its transmissions of 4,567. It sends a SYN with the Sequence Number field set to 4,567.
2. Acknowledgment and Connection Request By Server: The server chooses an ISN for its transmissions of 12,998. It receives the client's SYN. It sends a SYN+ACK with an Acknowledgment Number field value of 4,568 (one more than the client's ISN). This message has a Sequence Number field value of 12,998.
3. Acknowledgment By Client: The client sends an ACK with the Acknowledgment Number field set to 12,999.
This diagram illustrates the same three-way handshake connection establishment procedure introduced in Figure 211, except this time I have shown the Sequence Number and Acknowledgment Number fields in each message so you can see how they are used by each of the two devices to establish initial sequence numbers for data exchange.
With the connection now established, the client will send data whose first byte will be given sequence number 4,568. The server's first byte of data will be numbered 12,999.
Connection Termination
TCP Connection Termination is implemented as follows:
1. One computer sends a FIN packet to the other computer including an ACK for the last data received (N).
2. The other computer sends an ACK number of N+1
3. It also sends a FIN with the sequence number of X.
4. The originating computer sends a packet with an ACK number of N+1. The connection is closed.
Another way to close the connection is for one computer to send a packet with the RST (reset) bit set which will tell the other computer to immediately terminate the connection.
No comments:
Post a Comment