Information

Author(s) Olivier Bonaventure
Deadline No deadline
Submission limit No limitation
Category tags tcp

Tags

Sign in

Reordering the segments exchanged on a connection

A TCP connection, as explained in the TCP chapter of Computer Networking: Principles, Protocols and Practice starts with a three-way-handshake and ends with the exchange of segments with the FIN flag set.


Reorder the entire connection

During this connection, the client opens a connection to the server that listens on port 1234. It then sends a single byte of data that was acknowledged by the server and then decided to terminate the connection. Can you reorder all the segments exchanged on this connection ?

# Length Summary Status
0 20 bytes Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899002, Ack: 2186540617, Len: 0
1 20 bytes Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540617, Ack: 3405899002, Len: 0
2 24 bytes Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899000, Len: 0
3 20 bytes Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540617, Ack: 3405899003, Len: 0
4 20 bytes Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899001, Ack: 2186540617, Len: 0
5 20 bytes Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899003, Ack: 2186540618, Len: 0
6 21 bytes Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899001, Ack: 2186540617, Len: 1
7 24 bytes Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540616, Ack: 3405899001, Len: 0

0000  d1d404d2cb01e4fa  8253f64950117080  
0010  00000000                            

0000  ÑÔ.ÒË.äú.SöIP.p.
0010  ....            
  • Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899002, Ack: 2186540617, Len: 0
    • Source Port: 53716
      • Destination Port: 1234
        • Sequence number: 3405899002
          • Acknowledgment number: 2186540617
            • 0101 .... = Header Length: 20 bytes (5)
              • Flags: 0x011 (FIN, ACK)
                • 000. .... .... = Reserved: Not set
                  • ...0 .... .... = Nonce: Not set
                    • .... 0... .... = Congestion Window Reduced (CWR): Not set
                      • .... .0.. .... = ECN-Echo: Not set
                        • .... ..0. .... = Urgent: Not set
                          • .... ...1 .... = Acknowledgment: Set
                            • .... .... 0... = Push: Not set
                              • .... .... .0.. = Reset: Not set
                                • .... .... ..0. = Syn: Not set
                                  • .... .... ...1 = Fin: Set
                                  • Window size value: 28800
                                    • Urgent pointer: 0
                                    0000  04d2d1d48253f649  cb01e4fa50107080  
                                    0010  00000000                            

                                    0000  .ÒÑÔ.SöIË.äúP.p.
                                    0010  ....            
                                    • Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540617, Ack: 3405899002, Len: 0
                                      • Source Port: 1234
                                        • Destination Port: 53716
                                          • Sequence number: 2186540617
                                            • Acknowledgment number: 3405899002
                                              • 0101 .... = Header Length: 20 bytes (5)
                                                • Flags: 0x010 (ACK)
                                                  • 000. .... .... = Reserved: Not set
                                                    • ...0 .... .... = Nonce: Not set
                                                      • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                        • .... .0.. .... = ECN-Echo: Not set
                                                          • .... ..0. .... = Urgent: Not set
                                                            • .... ...1 .... = Acknowledgment: Set
                                                              • .... .... 0... = Push: Not set
                                                                • .... .... .0.. = Reset: Not set
                                                                  • .... .... ..0. = Syn: Not set
                                                                    • .... .... ...0 = Fin: Not set
                                                                    • Window size value: 28800
                                                                      • Urgent pointer: 0
                                                                      0000  d1d404d2cb01e4f8  0000000060027080  
                                                                      0010  00000000020405a0                    

                                                                      0000  ÑÔ.ÒË.äø....`.p.
                                                                      0010  ........        
                                                                      • Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899000, Len: 0
                                                                        • Source Port: 53716
                                                                          • Destination Port: 1234
                                                                            • Sequence number: 3405899000
                                                                              • Acknowledgment number: 0
                                                                                • 0110 .... = Header Length: 24 bytes (6)
                                                                                  • Flags: 0x002 (SYN)
                                                                                    • 000. .... .... = Reserved: Not set
                                                                                      • ...0 .... .... = Nonce: Not set
                                                                                        • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                          • .... .0.. .... = ECN-Echo: Not set
                                                                                            • .... ..0. .... = Urgent: Not set
                                                                                              • .... ...0 .... = Acknowledgment: Not set
                                                                                                • .... .... 0... = Push: Not set
                                                                                                  • .... .... .0.. = Reset: Not set
                                                                                                    • .... .... ..1. = Syn: Set
                                                                                                      • .... .... ...0 = Fin: Not set
                                                                                                      • Window size value: 28800
                                                                                                        • Urgent pointer: 0
                                                                                                          • Options: (4 bytes), Maximum segment size
                                                                                                            • TCP Option - Maximum segment size: 1440 bytes
                                                                                                              • Kind: Maximum Segment Size (2)
                                                                                                                • Length: 4
                                                                                                                  • MSS Value: 1440
                                                                                                              0000  04d2d1d48253f649  cb01e4fb50117080  
                                                                                                              0010  00000000                            

                                                                                                              0000  .ÒÑÔ.SöIË.äûP.p.
                                                                                                              0010  ....            
                                                                                                              • Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540617, Ack: 3405899003, Len: 0
                                                                                                                • Source Port: 1234
                                                                                                                  • Destination Port: 53716
                                                                                                                    • Sequence number: 2186540617
                                                                                                                      • Acknowledgment number: 3405899003
                                                                                                                        • 0101 .... = Header Length: 20 bytes (5)
                                                                                                                          • Flags: 0x011 (FIN, ACK)
                                                                                                                            • 000. .... .... = Reserved: Not set
                                                                                                                              • ...0 .... .... = Nonce: Not set
                                                                                                                                • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                                                                  • .... .0.. .... = ECN-Echo: Not set
                                                                                                                                    • .... ..0. .... = Urgent: Not set
                                                                                                                                      • .... ...1 .... = Acknowledgment: Set
                                                                                                                                        • .... .... 0... = Push: Not set
                                                                                                                                          • .... .... .0.. = Reset: Not set
                                                                                                                                            • .... .... ..0. = Syn: Not set
                                                                                                                                              • .... .... ...1 = Fin: Set
                                                                                                                                              • Window size value: 28800
                                                                                                                                                • Urgent pointer: 0
                                                                                                                                                0000  d1d404d2cb01e4f9  8253f64950107080  
                                                                                                                                                0010  00000000                            

                                                                                                                                                0000  ÑÔ.ÒË.äù.SöIP.p.
                                                                                                                                                0010  ....            
                                                                                                                                                • Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899001, Ack: 2186540617, Len: 0
                                                                                                                                                  • Source Port: 53716
                                                                                                                                                    • Destination Port: 1234
                                                                                                                                                      • Sequence number: 3405899001
                                                                                                                                                        • Acknowledgment number: 2186540617
                                                                                                                                                          • 0101 .... = Header Length: 20 bytes (5)
                                                                                                                                                            • Flags: 0x010 (ACK)
                                                                                                                                                              • 000. .... .... = Reserved: Not set
                                                                                                                                                                • ...0 .... .... = Nonce: Not set
                                                                                                                                                                  • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                                                                                                    • .... .0.. .... = ECN-Echo: Not set
                                                                                                                                                                      • .... ..0. .... = Urgent: Not set
                                                                                                                                                                        • .... ...1 .... = Acknowledgment: Set
                                                                                                                                                                          • .... .... 0... = Push: Not set
                                                                                                                                                                            • .... .... .0.. = Reset: Not set
                                                                                                                                                                              • .... .... ..0. = Syn: Not set
                                                                                                                                                                                • .... .... ...0 = Fin: Not set
                                                                                                                                                                                • Window size value: 28800
                                                                                                                                                                                  • Urgent pointer: 0
                                                                                                                                                                                  0000  d1d404d2cb01e4fb  8253f64a50107080  
                                                                                                                                                                                  0010  00000000                            

                                                                                                                                                                                  0000  ÑÔ.ÒË.äû.SöJP.p.
                                                                                                                                                                                  0010  ....            
                                                                                                                                                                                  • Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899003, Ack: 2186540618, Len: 0
                                                                                                                                                                                    • Source Port: 53716
                                                                                                                                                                                      • Destination Port: 1234
                                                                                                                                                                                        • Sequence number: 3405899003
                                                                                                                                                                                          • Acknowledgment number: 2186540618
                                                                                                                                                                                            • 0101 .... = Header Length: 20 bytes (5)
                                                                                                                                                                                              • Flags: 0x010 (ACK)
                                                                                                                                                                                                • 000. .... .... = Reserved: Not set
                                                                                                                                                                                                  • ...0 .... .... = Nonce: Not set
                                                                                                                                                                                                    • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                                                                                                                                      • .... .0.. .... = ECN-Echo: Not set
                                                                                                                                                                                                        • .... ..0. .... = Urgent: Not set
                                                                                                                                                                                                          • .... ...1 .... = Acknowledgment: Set
                                                                                                                                                                                                            • .... .... 0... = Push: Not set
                                                                                                                                                                                                              • .... .... .0.. = Reset: Not set
                                                                                                                                                                                                                • .... .... ..0. = Syn: Not set
                                                                                                                                                                                                                  • .... .... ...0 = Fin: Not set
                                                                                                                                                                                                                  • Window size value: 28800
                                                                                                                                                                                                                    • Urgent pointer: 0
                                                                                                                                                                                                                    0000  d1d404d2cb01e4f9  8253f64950187080  
                                                                                                                                                                                                                    0010  000000000a                          

                                                                                                                                                                                                                    0000  ÑÔ.ÒË.äù.SöIP.p.
                                                                                                                                                                                                                    0010  .....           
                                                                                                                                                                                                                    • Transmission Control Protocol, Src Port: 53716, Dst Port: 1234, Seq: 3405899001, Ack: 2186540617, Len: 1
                                                                                                                                                                                                                      • Source Port: 53716
                                                                                                                                                                                                                        • Destination Port: 1234
                                                                                                                                                                                                                          • Sequence number: 3405899001
                                                                                                                                                                                                                            • Acknowledgment number: 2186540617
                                                                                                                                                                                                                              • 0101 .... = Header Length: 20 bytes (5)
                                                                                                                                                                                                                                • Flags: 0x018 (PSH, ACK)
                                                                                                                                                                                                                                  • 000. .... .... = Reserved: Not set
                                                                                                                                                                                                                                    • ...0 .... .... = Nonce: Not set
                                                                                                                                                                                                                                      • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                                                                                                                                                                        • .... .0.. .... = ECN-Echo: Not set
                                                                                                                                                                                                                                          • .... ..0. .... = Urgent: Not set
                                                                                                                                                                                                                                            • .... ...1 .... = Acknowledgment: Set
                                                                                                                                                                                                                                              • .... .... 1... = Push: Set
                                                                                                                                                                                                                                                • .... .... .0.. = Reset: Not set
                                                                                                                                                                                                                                                  • .... .... ..0. = Syn: Not set
                                                                                                                                                                                                                                                    • .... .... ...0 = Fin: Not set
                                                                                                                                                                                                                                                    • Window size value: 28800
                                                                                                                                                                                                                                                      • Urgent pointer: 0
                                                                                                                                                                                                                                                        • TCP payload (1 byte)
                                                                                                                                                                                                                                                        0000  04d2d1d48253f648  cb01e4f960127080  
                                                                                                                                                                                                                                                        0010  00000000020405a0                    

                                                                                                                                                                                                                                                        0000  .ÒÑÔ.SöHË.äù`.p.
                                                                                                                                                                                                                                                        0010  ........        
                                                                                                                                                                                                                                                        • Transmission Control Protocol, Src Port: 1234, Dst Port: 53716, Seq: 2186540616, Ack: 3405899001, Len: 0
                                                                                                                                                                                                                                                          • Source Port: 1234
                                                                                                                                                                                                                                                            • Destination Port: 53716
                                                                                                                                                                                                                                                              • Sequence number: 2186540616
                                                                                                                                                                                                                                                                • Acknowledgment number: 3405899001
                                                                                                                                                                                                                                                                  • 0110 .... = Header Length: 24 bytes (6)
                                                                                                                                                                                                                                                                    • Flags: 0x012 (SYN, ACK)
                                                                                                                                                                                                                                                                      • 000. .... .... = Reserved: Not set
                                                                                                                                                                                                                                                                        • ...0 .... .... = Nonce: Not set
                                                                                                                                                                                                                                                                          • .... 0... .... = Congestion Window Reduced (CWR): Not set
                                                                                                                                                                                                                                                                            • .... .0.. .... = ECN-Echo: Not set
                                                                                                                                                                                                                                                                              • .... ..0. .... = Urgent: Not set
                                                                                                                                                                                                                                                                                • .... ...1 .... = Acknowledgment: Set
                                                                                                                                                                                                                                                                                  • .... .... 0... = Push: Not set
                                                                                                                                                                                                                                                                                    • .... .... .0.. = Reset: Not set
                                                                                                                                                                                                                                                                                      • .... .... ..1. = Syn: Set
                                                                                                                                                                                                                                                                                        • .... .... ...0 = Fin: Not set
                                                                                                                                                                                                                                                                                        • Window size value: 28800
                                                                                                                                                                                                                                                                                          • Urgent pointer: 0
                                                                                                                                                                                                                                                                                            • Options: (4 bytes), Maximum segment size
                                                                                                                                                                                                                                                                                              • TCP Option - Maximum segment size: 1440 bytes
                                                                                                                                                                                                                                                                                                • Kind: Maximum Segment Size (2)
                                                                                                                                                                                                                                                                                                  • Length: 4
                                                                                                                                                                                                                                                                                                    • MSS Value: 1440