I've set up 3 boxes for testing. Dummynet node is the traffic shaper to help me
simulate traffic.
Setup:
Host A - sender (with proposed patch)
Host B - Dummynet (with r266941)
Host C - receiver (with proposed patch)
Connectivity:
Sender Dummynet Receiver
Host A Host B Host C
192.168.10.10 <---> 192.168.10.11
192.168.11.11 <--> 192.168.11.10
Sender Host A 192.168.10.10
Dummynet Host B 192.168.10.11, 192.168.11.11
Receiver Host C 192.168.11.10
On Sender/Receiver:
$ sysctl -w net.inet.tcp.cc.algorithm=dctcp
$ sysctl -w net.inet.tcp.ecn.enable=1
On Dummynet to setup forwarding:
$ sudo dn.sh add <src_ip> <src_iface> <dst_ip> <dst_iface> 1
$ sudo ./dn.sh add 192.168.10.10 192.168.11.10 1
Verify:
$ sudo ipfw show
09994 0 0 pipe 9994 ip from 192.168.10.10 not 2049,22,12865 to 192.168.11.10 not dst-port 2049,22,12865 out
09995 0 0 pipe 9995 ip from 192.168.11.10 not 2049,22,12865 to 192.168.10.10 not dst-port 2049,22,12865 out
65535 18476 3441803 allow ip from any to any
Start the traffic from sender (Host A):
$ sudo ./cap-netperf 192.168.10.10 igb0 192.168.11.10 bge1 192.168.10.11 1 dctcp
Check the o/p files generated by cap-netperf:
$ ls -lth
total 998
-rw-r--r-- 1 root users 54K May 30 00:00 192.168.10.10-192.168.11.10-fwd.pcap.gz
-rw-r--r-- 1 root users 27K May 30 00:00 192.168.10.10-192.168.11.10-fwd.sift.gz
Generate the graphs:
$ sudo ../../vis-netperf 192.168.10.10-192.168.11.10
1 TCP connection(s) in the fwd trace
Extracting data for connection 1, direction fwd
Plotting every 1 sample(s) of connection 1, direction fwd
$ ls -lth total 1174
-rw-r--r-- 1 root users 175K May 30 00:05 192.168.10.10-192.168.11.10-1-fwd.pdf
-rw-r--r-- 1 root users 54K May 30 00:00 192.168.10.10-192.168.11.10-fwd.pcap.gz
-rw-r--r-- 1 root users 27K May 30 00:00 192.168.10.10-192.168.11.10-fwd.sift.gz
Look at the graph plotted in pdf to make sure we see correct behavior.