This is an old revision of the document!
Project: TCP/IP Regression Test Suite
Nanjun Li
Email: nanjun.li(at)hpi.uni-potsdam.de
In this project N. Li coded on a FreeBSD machine with raw socket and libpcap for packets sniffing on MAC layer and sending crafted ones to test the perform-ability of a target machine. The test suite covers TCP state machine and reliability in transmission, by sending handmade TCP segments with varying flags, options, in-order and out-of-order. (Mentor: George V. Neville-Neil)
1. Tasks
1) state machine test covers connection establishment / keepalive / abort / disconnect by timing the response and checking the validity of returned packets. Status: done
2) transmission reliability test covers target machine reliability by sending packets with in-order and out-of-order sequence numbers, records the returned packets. Status: done
3) TCP variants inferring covers inferring the congestion control mechanism that the target machine employs (Tahoe, Reno, SACK etc) by sending duplicated ACKs and out-of-order data and counting the packet rate. Status: ongoing
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.
3. Design
TCP/IP Regression Test Suite (TIRTS ) is currently a C-based 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).
www-fgks.hpi.uni-potsdam.de/fileadmin/user_upload/Nanjun/tirts.PNG
Figure 1 Design of TIRTS
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 communicates with sniffer via a pipe to get TCP connection's context (seq and ack numbers)
5) main sends in-order data via TCP socket and crafted packets via Raw socket
4. Samples
0: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=64 id=51925 SYN , seq=2215017082 ack=0 rwnd=65535 urg=0 MSS=1460 NOP WS=1 NOP NOP Timestamp(1404572029, 0) SACK=on EOL EOL (no payload)
1: 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:59999 ttl=63 id=0 SYN ACK , seq=1460371524 ack=2215017083 rwnd=5792 urg=0 MSS=1460 SACK=on Timestamp(266714943, 1404572029) NOP WS=2 (no payload)
2: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=64 id=51926 ACK , seq=2215017083 ack=1460371525 rwnd=33304 urg=0 NOP NOP Timestamp(1404572030, 266714943) (no payload)
3: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=64 id=51927 PSH ACK , seq=2215017083 ack=1460371525 rwnd=33304 urg=0 NOP NOP Timestamp(1404572030, 266714943) payload(51): [these bytes are in-order and sent via a tcp socket.]
4: 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:59999 ttl=63 id=16133 ACK , seq=1460371525 ack=2215017134 rwnd=1448 urg=0 NOP NOP Timestamp(266714944, 1404572030) (no payload)
5: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=127 id=1 PSH ACK , seq=2215017152 ack=1460371525 rwnd=65535 urg=0 MSS=1460 WS=1 Timestamp(4257854057, 0) NOP NOP EOL payload(76): [these bytes are out-of-order and sent in a handmade packet via a…]
6: 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:59999 ttl=63 id=16135 ACK , seq=1460371525 ack=2215017134 rwnd=1448 urg=0 NOP NOP Timestamp(266715194, 1404572030) (no payload)
7: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=64 id=51928 FIN ACK , seq=2215017134 ack=1460371525 rwnd=33304 urg=0 NOP NOP Timestamp(1404575032, 266715194) (no payload)
8: 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:59999 ttl=63 id=16137 FIN ACK , seq=1460371525 ack=2215017135 rwnd=1448 urg=0 NOP NOP Timestamp(266715694, 1404575032) (no payload)
9: s_mac=0:c:db:dd:ba:0, d_mac=0:18:8b:c:aa:9c
172.16.31.21:59999 > 141.89.224.208:80 ttl=64 id=51929 ACK , seq=2215017135 ack=1460371526 rwnd=33303 urg=0 NOP NOP Timestamp(1404575032, 266715694) (no payload)