Examples of Operation: Connections and Lost Segments
5.1 Connection Establishment
This is an example of a connection being established between Host A and Host B. Host B has done a passive Open and is in LISTEN state. Host A does an active Open to establish the connection.
Host A Host B
Time State State
1. CLOSED LISTEN
2. SYN-SENT <SEQ=100><SYN> --->
3. <--- <SEQ=200><ACK=100><SYN,ACK>
SYN-RCVD
4. OPEN <SEQ=101><ACK=200> ---> OPEN
5. <SEQ=101><ACK=200><Data> --->
6. <--- <SEQ=201><ACK=101>
5.2 Simultaneous Connection Establishment
This is an example of two hosts trying to establishing connections to each other at the same time. Host A sends a SYN request to Host B at the same time Host B sends a SYN request to Host A.
Host A Host B
Time State State
1. CLOSED CLOSED
2. SYN-SENT <SEQ=100><SYN> --->
<--- <SEQ=200><SYN> SYN-SENT
3. SYN-RCVD SYN-RCVD
<SEQ=100><ACK=200><SYN,ACK> --->
<--- <SEQ=200><ACK=100><SYN,ACK>
4. OPEN OPEN
5.3 Lost Segments
This is an example of what happens when a segment is lost. It shows how segments can be acknowledged out of sequence and that only the missing segment need be retransmitted. Note that in this and the following examples "EA" stands for "Out of Sequence Acknowledgement."
Time Host A Host B
1. <SEQ=100><ACK=200><Data> --->
2. <--- <SEQ=201><ACK=100>
3. <SEQ=101><ACK=200><Data> (segment lost)
4.
5. <SEQ=102><ACK=200><Data> --->
6. <-- <SEQ=201><ACK=100><EA=102>
7. <SEQ=103><ACK=200><Data> --->
8. <--- <SEQ=201><ACK=100>
<EA=102,103>
9. <SEQ=101><ACK=200><Data> --->
10. <--- <SEQ=201><ACK=103>
11. <SEQ=104><ACK=200><Data> --->
12. <--- <SEQ=201><ACK=104>
5.4 Segments Received Out of Order
This an example of segments received out of order. It further illustrates the use of acknowledging segments out of order to prevent needless retransmissions.
Time Host A Host B
1. <SEQ=100><ACK=200><Data> --->
2. <--- <SEQ=201><ACK=100>
3. <SEQ=101><ACK=200><Data> (delayed)
4.
5. <SEQ=102><ACK=200><Data> --->
6. <--- <SEQ=201><ACK=100><EA=102>
7. <SEQ=103><ACK=200><Data> --->
---> (delayed segment 101 arrives)
8. <--- <SEQ=201><ACK=103>
9. <SEQ=104><ACK=200><Data> --->
10. <--- <SEQ=201><ACK=104>