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 Resumé Status
0 20 bytes <TCP: ACK, FIN, SEQ: 3405899002, ACK: 2186540617>
1 21 bytes <TCP: ACK, PSH, SEQ: 3405899001, ACK: 2186540617>
2 24 bytes <TCP: ACK, SYN, SEQ: 2186540616, ACK: 3405899001, MSS>
3 24 bytes <TCP: SYN, SEQ: 3405899000, ACK: 0, MSS>
4 20 bytes <TCP: ACK, FIN, SEQ: 2186540617, ACK: 3405899003>
5 20 bytes <TCP: ACK, SEQ: 3405899003, ACK: 2186540618>
6 20 bytes <TCP: ACK, SEQ: 3405899001, ACK: 2186540617>
7 20 bytes <TCP: ACK, SEQ: 2186540617, ACK: 3405899002>

0000  d1d404d2cb01e4fa  8253f64950117080  
0010  4f8c0000                            

0000  ÑÔ.ÒË.äú.SöIP.p.
0010  O...            
  • TCP:
    • Source Port: 53716
    • Destination Port: 1234
    • Sequence Number: 3405899002
    • Acknowledgment Number: 2186540617
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 0
    • FIN: 1
    • Window: 28800
    • Checksum: 20364
    • Urgent Pointer: 0
0000  d1d404d2cb01e4f9  8253f64950187080  
0010  4f8d00000a                          

0000  ÑÔ.ÒË.äù.SöIP.p.
0010  O....           
  • TCP:
    • Source Port: 53716
    • Destination Port: 1234
    • Sequence Number: 3405899001
    • Acknowledgment Number: 2186540617
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 1
    • RST: 0
    • SYN: 0
    • FIN: 0
    • Window: 28800
    • Checksum: 20365
    • Urgent Pointer: 0
    • Data: bytearray(b'\n')
0000  04d2d1d48253f648  cb01e4f960127080  
0010  4f900000020405a0                    

0000  .ÒÑÔ.SöHË.äù`.p.
0010  O.......        
  • TCP:
    • Source Port: 1234
    • Destination Port: 53716
    • Sequence Number: 2186540616
    • Acknowledgment Number: 3405899001
    • Data Offset: 6
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 1
    • FIN: 0
    • Window: 28800
    • Checksum: 20368
    • Urgent Pointer: 0
    • Options: Maximum Segment Size
      • Kind: 2
      • Length: 4
      • Max Seg Size: 1440
0000  d1d404d2cb01e4f8  0000000060027080  
0010  4f900000020405a0                    

0000  ÑÔ.ÒË.äø....`.p.
0010  O.......        
  • TCP:
    • Source Port: 53716
    • Destination Port: 1234
    • Sequence Number: 3405899000
    • Acknowledgment Number: 0
    • Data Offset: 6
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 0
    • PSH: 0
    • RST: 0
    • SYN: 1
    • FIN: 0
    • Window: 28800
    • Checksum: 20368
    • Urgent Pointer: 0
    • Options: Maximum Segment Size
      • Kind: 2
      • Length: 4
      • Max Seg Size: 1440
0000  04d2d1d48253f649  cb01e4fb50117080  
0010  4f8c0000                            

0000  .ÒÑÔ.SöIË.äûP.p.
0010  O...            
  • TCP:
    • Source Port: 1234
    • Destination Port: 53716
    • Sequence Number: 2186540617
    • Acknowledgment Number: 3405899003
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 0
    • FIN: 1
    • Window: 28800
    • Checksum: 20364
    • Urgent Pointer: 0
0000  d1d404d2cb01e4fb  8253f64a50107080  
0010  4f8c0000                            

0000  ÑÔ.ÒË.äû.SöJP.p.
0010  O...            
  • TCP:
    • Source Port: 53716
    • Destination Port: 1234
    • Sequence Number: 3405899003
    • Acknowledgment Number: 2186540618
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 0
    • FIN: 0
    • Window: 28800
    • Checksum: 20364
    • Urgent Pointer: 0
0000  d1d404d2cb01e4f9  8253f64950107080  
0010  4f8c0000                            

0000  ÑÔ.ÒË.äù.SöIP.p.
0010  O...            
  • TCP:
    • Source Port: 53716
    • Destination Port: 1234
    • Sequence Number: 3405899001
    • Acknowledgment Number: 2186540617
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 0
    • FIN: 0
    • Window: 28800
    • Checksum: 20364
    • Urgent Pointer: 0
0000  04d2d1d48253f649  cb01e4fa50107080  
0010  4f8c0000                            

0000  .ÒÑÔ.SöIË.äúP.p.
0010  O...            
  • TCP:
    • Source Port: 1234
    • Destination Port: 53716
    • Sequence Number: 2186540617
    • Acknowledgment Number: 3405899002
    • Data Offset: 5
    • Reserved: 0
    • NS: 0
    • CWR: 0
    • ECE: 0
    • URG: 0
    • ACK: 1
    • PSH: 0
    • RST: 0
    • SYN: 0
    • FIN: 0
    • Window: 28800
    • Checksum: 20364
    • Urgent Pointer: 0

Information

Author(s) Olivier Bonaventure
Deadline No deadline
Submission limit No limitation
Category Tags TCP

Sign in