This is an old revision of the document!
TCP/IP Regression Test Suite
Author: Nanjun Li
Mentor: George Neville-Neil
Update: 2007-08-19
1. Tasks
1) State Machine Test covers connection establishment / abort /disconnect by sending TCP segment with control flags (SYN, FIN etc), timing the response and checking the validity of returned packets. Status: done
2) Transmission Reliability Test covers target machine’s reliability in data delivery by sending segments with in-order and out-of-order sequence numbers. Status: done 2.
2. Problems to Solve
1) TCP options vary the header's length;
2) Checksum in TCP is strict (also tricky);
3) Test suite must automate the packet decoding and sending because the target side is timing the response, e.g., if an ACK is not sent on time after SYN_ACK arrival, the target will drop the half-open connection;
4) To emulate a TCP endpoint, we need to silence source’s TCP module (by installing firewall and recompile the kernel to ban outgoing packets), or employ other tricks let the target believe all packets are from one source (I choose the latter approach for user’s convenience).
3. Design
https://www-fgks.hpi.uni-potsdam.de/fileadmin/user_upload/Nanjun/tirts.PNG
Figure 1 Design of TCP Regression Test Suite (TCPts)
TCP/IP Regression Test Suite (TIRTS) is currently a C program. Its architecture is presented in Figure 1, comprising of three functions: main, packet sniffer and decoder (callback function to decode packets from binary to human readable format).
TIRTS tests a target machine following these steps:
1) main forks a sniffer after start-up
2) sniffer employs libpcap for packet sniffing and triggering decoder_cb on packet arrival and departure
3) main initiates a TCP socket to establish a normal TCP connection with target machine
4) main gets TCP connection's context (seq and ack numbers) from sniffer via pipes
5) main sends in-order data via TCP socket and out-of-data in crafted packets
6) main closes the connection
All packets in this test will saved in a output file “dump”
4. Output Sample
1: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=64 id=52854 SYN , seq=3904759064 ack=0 rwnd=65535 urg=0 MSS=1460 NOP WS=1 NOP NOP Timestamp(1472778031, 0) SACK=on EOL EOL (no payload)
2: s_mac=0:18:8b:c:aa:9c, d_mac=0:c:db:dd:ba:0
- 141.89.224.208:80 > 172.16.31.21:64264 ttl=63 id=0 SYN ACK , seq=457550929 ack=3904759065 rwnd=5792 urg=0 MSS=1460 SACK=on Timestamp(283764083, 1472778031) NOP WS=2 (no payload)
3: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=64 id=52855 ACK , seq=3904759065 ack=457550930 rwnd=33304 urg=0 NOP NOP Timestamp(1472778035, 283764083) (no payload)
4: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=64 id=52856 PSH ACK , seq=3904759065 ack=457550930 rwnd=33304 urg=0 NOP NOP Timestamp(1472778035, 283764083) payload(51): [these bytes are in-order and sent via a tcp socket.]
5: s_mac=0:18:8b:c:aa:9c, d_mac=0:c:db:dd:ba:0
- 141.89.224.208:80 > 172.16.31.21:64264 ttl=63 id=18726 ACK , seq=457550930 ack=3904759116 rwnd=1448 urg=0 NOP NOP Timestamp(283764084, 1472778035) (no payload)
6: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=127 id=1 PSH ACK , seq=3904759134 ack=457550930 rwnd=65535 urg=0 MSS=1460 WS=1 Timestamp(3767255917, 0) NOP NOP EOL payload(76): [these bytes are out-of-order and sent in a handmade packet via a…]
7: s_mac=0:18:8b:c:aa:9c, d_mac=0:c:db:dd:ba:0
- 141.89.224.208:80 > 172.16.31.21:64264 ttl=63 id=18728 ACK , seq=457550930 ack=3904759116 rwnd=1448 urg=0 NOP NOP Timestamp(283764334, 1472778035) (no payload)
8: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=64 id=52857 FIN ACK , seq=3904759116 ack=457550930 rwnd=33304 urg=0 NOP NOP Timestamp(1472781037, 283764334) (no payload)
9: s_mac=0:18:8b:c:aa:9c, d_mac=0:c:db:dd:ba:0
- 141.89.224.208:80 > 172.16.31.21:64264 ttl=63 id=18730 FIN ACK , seq=457550930 ack=3904759117 rwnd=1448 urg=0 NOP NOP Timestamp(283764834, 1472781037) (no payload)
10: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
- 172.16.31.21:64264 > 141.89.224.208:80 ttl=64 id=52858 ACK , seq=3904759117 ack=457550931 rwnd=33303 urg=0 NOP NOP Timestamp(1472781037, 283764834) (no payload)
Packet 1, 2 and 3 were sent in connection establishment (SYN, SYN ACK and ACK)
Packet 4 is in-order data, to which the target machine responds with Packet 5 and advances its ack
Packet 6 is out-of-order data (seq=3904759134, artificially right-shift seq 18 bytes), to which the target machine responds with duplicate ACK (3904759116)
Packet 8-10 present the disconnect process (FIN, FIN ACK and ACK)
Conclusion:
The target machine (141.89.224.208) meets the basic TCP as RFC793 required.