written 7.9 years ago by |
Connection Establishment
- Transport protocols uses three way handshake for connection establishment.
- This establishment protocol does not require both sides to begin sending with the same sequence number, so it can be used with synchronization methods other than the global clock method.
- The normal setup procedure when host 1 initiates are shown in figure (a).
- Host 1 chooses a sequence number, x, and sends a CONNECTION REQUEST TPDU containing it to host 2.Host 2 replies with an ack TPDU acknowledging x and announcing its own initial sequence number, y. Finally, host 1 acknowledges host 2’s choice of an initial sequence number in the first data TPDU that it sends.
- Now let us see how the three-way handshake works in the presence of delayed duplicate control TPDUs.
- In figure (b),the first TPDU is a delayed duplicate CONNECTION REQUEST from an old connection.
- This TPDU arrives at host 2 without host 1’s knowledge. Host 2 reacts to this TPDU by sending host 1 an AC K TPDU, in effect asking for verification that host 1 was indeed trying to set up a new connection.
- When host 1 rejects host 2’s attempt to establish a connection, host 2 realizes that it was tricked by a delayed duplicate and abandons the connection.
- The worst case is when both a delayed CONNECTION REQUEST and an ACK are floating around in the subnet.
- This case is shown in figure(c).As in the previous example, host 2 gets a delayed CONNECTION REQUEST and replies to it.
- At this point it is crucial to realize that host 2 has proposed using y as the initial sequence number for host 2 to host 1 traffic, knowing full well that no TPDUs containing sequence number y or acknowledgement to y are still in existence.
- When the second delayed TPDU arrives at host 2,the fact that z has been acknowledged rather than y tells host 2 that this, too, is an old duplicate.
Connection Release
Connection Release using the three Way Handshake:
(a) Normal Case:
Step 1: Host 1 sends DISCONNECTION REQUEST TPDU (DU) to initiate connection release.
Step 2: When Host 2 receives this it also sends a DR to Host 1 and starts a timer.
Step 3: Now Host 1 releases the connection and sends an ACK TPDU to Host 2. When Host 2 receives the ACK TPDU it can also release its connection.
(b) ACK is Lost:
When ACK is lost, the timer started on Host 2 times out and Host 2 releases the connection anyway.
(c) DR from Host 2 is lost:
As Host 1 does not get the expected response it times out and resends the DR.
(d) Response Lost and Subsequent DRs Lost:
In this case after Host 1 times-out N number of times it will give up and simply release the connection. Meanwhile Host 2 will also timeout and release the connection. When the timer expires, the connection is released anyway.