Hi All,
I've sent so much time on this that my head is pounding. Here is some context:
I am running FreeBSD on a box with two ethernet NICs, re0 and re1. I have a second machine connected to the first ethernet interface and a third machine connected to the second ethernet interface. My goal is to use FreeBSD to act as a router between the two, using dummynet to introduce additional bandwidth, latency and packet loss restrictions.
Now as far as I can tell, I have successfully set everything up, including ipfw and dummynet. My two machines grab IP addresses from the FreeBSD machine using DHCP supplied by DNSMASQ. I have also configured a bridge between the two interface on the FreeBSD machine. Iperf3 runs successfully both ways, up to 940 Mbit/s since I'm using gigabit connections.
Now the issue. First I create a pipe using the following:
Running iperf3 between the two machines, I get the expected bandwidth of around 95Mbit/s as show below:
I then configure the pipe with a 15ms delay, creating a 30ms RTT between the two machines running iperf.
For some reason, the bandwidth decreases to around 70Mbit/s. This huge decrease in bandwidth is not explainable by anything I understand, including the TCP slow start period and the different congestion control periods. I've even tried an interval of up to 90s to check the maximum transfer speed. The result is below.
This has been extremely perplexing for me. The only thing different between the two iperf3 outputs is the consistency of the Retr column, which I believe indicates how many retransmission there were. The consistency of Retr without the 15ms delay is higher, averaging around 10 retransmissions per second. The Retr of the pipe with a 15ms delay confusingly averages 0 retransmissions, but every time there is any, even if it is 3 per second, the speed immediately decreases.
Any help in understanding what is happening is greatly appreciated.
I've sent so much time on this that my head is pounding. Here is some context:
I am running FreeBSD on a box with two ethernet NICs, re0 and re1. I have a second machine connected to the first ethernet interface and a third machine connected to the second ethernet interface. My goal is to use FreeBSD to act as a router between the two, using dummynet to introduce additional bandwidth, latency and packet loss restrictions.
Now as far as I can tell, I have successfully set everything up, including ipfw and dummynet. My two machines grab IP addresses from the FreeBSD machine using DHCP supplied by DNSMASQ. I have also configured a bridge between the two interface on the FreeBSD machine. Iperf3 runs successfully both ways, up to 940 Mbit/s since I'm using gigabit connections.
Now the issue. First I create a pipe using the following:
Code:
ipfw add 3000 pipe 1 ip from any to any in
ipfw config pipe 1 bw 100Mbit/s
Running iperf3 between the two machines, I get the expected bandwidth of around 95Mbit/s as show below:
Code:
iperf3 -c 192.168.0.106 -t 30
Connecting to host 192.168.0.106, port 5201
[ 4] local 192.168.0.93 port 41774 connected to 192.168.0.106 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 12.0 MBytes 101 Mbits/sec 37 83.4 KBytes
[ 4] 1.00-2.00 sec 11.4 MBytes 95.4 Mbits/sec 15 74.9 KBytes
[ 4] 2.00-3.00 sec 11.4 MBytes 95.4 Mbits/sec 7 74.9 KBytes
[ 4] 3.00-4.00 sec 11.4 MBytes 95.4 Mbits/sec 10 74.9 KBytes
[ 4] 4.00-5.00 sec 11.4 MBytes 95.4 Mbits/sec 6 82.0 KBytes
[ 4] 5.00-6.00 sec 11.4 MBytes 95.9 Mbits/sec 9 89.1 KBytes
[ 4] 6.00-7.00 sec 11.4 MBytes 95.4 Mbits/sec 7 70.7 KBytes
[ 4] 7.00-8.00 sec 11.3 MBytes 94.9 Mbits/sec 13 67.9 KBytes
[ 4] 8.00-9.00 sec 11.4 MBytes 95.4 Mbits/sec 5 79.2 KBytes
[ 4] 9.00-10.00 sec 11.3 MBytes 94.9 Mbits/sec 13 72.1 KBytes
[ 4] 10.00-11.00 sec 11.4 MBytes 95.4 Mbits/sec 8 83.4 KBytes
[ 4] 11.00-12.00 sec 11.4 MBytes 95.9 Mbits/sec 17 74.9 KBytes
[ 4] 12.00-13.00 sec 11.4 MBytes 95.4 Mbits/sec 12 67.9 KBytes
[ 4] 13.00-14.00 sec 11.4 MBytes 95.9 Mbits/sec 8 74.9 KBytes
[ 4] 14.00-15.00 sec 11.3 MBytes 94.9 Mbits/sec 13 73.5 KBytes
[ 4] 15.00-16.00 sec 11.4 MBytes 95.4 Mbits/sec 18 65.0 KBytes
[ 4] 16.00-17.00 sec 11.4 MBytes 95.9 Mbits/sec 6 76.4 KBytes
[ 4] 17.00-18.00 sec 11.4 MBytes 95.4 Mbits/sec 6 80.6 KBytes
[ 4] 18.00-19.00 sec 11.4 MBytes 95.4 Mbits/sec 12 70.7 KBytes
[ 4] 19.00-20.00 sec 11.4 MBytes 95.4 Mbits/sec 12 74.9 KBytes
[ 4] 20.00-21.00 sec 11.4 MBytes 95.4 Mbits/sec 15 76.4 KBytes
[ 4] 21.00-22.00 sec 11.4 MBytes 95.4 Mbits/sec 12 74.9 KBytes
[ 4] 22.00-23.00 sec 11.4 MBytes 95.9 Mbits/sec 17 72.1 KBytes
[ 4] 23.00-24.00 sec 11.4 MBytes 95.4 Mbits/sec 12 69.3 KBytes
[ 4] 24.00-25.00 sec 11.4 MBytes 95.4 Mbits/sec 10 73.5 KBytes
[ 4] 25.00-26.00 sec 11.4 MBytes 95.4 Mbits/sec 12 66.5 KBytes
[ 4] 26.00-27.00 sec 11.4 MBytes 95.4 Mbits/sec 6 70.7 KBytes
[ 4] 27.00-28.00 sec 11.4 MBytes 95.4 Mbits/sec 14 66.5 KBytes
[ 4] 28.00-29.00 sec 11.4 MBytes 95.4 Mbits/sec 8 70.7 KBytes
[ 4] 29.00-30.00 sec 11.4 MBytes 95.4 Mbits/sec 10 69.3 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-30.00 sec 342 MBytes 95.6 Mbits/sec 350 sender
[ 4] 0.00-30.00 sec 341 MBytes 95.4 Mbits/sec receiver
iperf Done.
I then configure the pipe with a 15ms delay, creating a 30ms RTT between the two machines running iperf.
Code:
ipfw config pipe 1 bw 100Mbit/s delay 15ms
For some reason, the bandwidth decreases to around 70Mbit/s. This huge decrease in bandwidth is not explainable by anything I understand, including the TCP slow start period and the different congestion control periods. I've even tried an interval of up to 90s to check the maximum transfer speed. The result is below.
Code:
iperf3 -c 192.168.0.106 -t 30
Connecting to host 192.168.0.106, port 5201
[ 4] local 192.168.0.93 port 41770 connected to 192.168.0.106 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 6.82 MBytes 57.2 Mbits/sec 101 189 KBytes
[ 4] 1.00-2.00 sec 6.03 MBytes 50.6 Mbits/sec 0 211 KBytes
[ 4] 2.00-3.00 sec 6.71 MBytes 56.3 Mbits/sec 0 233 KBytes
[ 4] 3.00-4.00 sec 7.39 MBytes 62.0 Mbits/sec 0 256 KBytes
[ 4] 4.00-5.00 sec 8.02 MBytes 67.2 Mbits/sec 0 280 KBytes
[ 4] 5.00-6.00 sec 8.51 MBytes 71.4 Mbits/sec 0 303 KBytes
[ 4] 6.00-7.00 sec 9.26 MBytes 77.7 Mbits/sec 0 325 KBytes
[ 4] 7.00-8.00 sec 9.69 MBytes 81.3 Mbits/sec 0 348 KBytes
[ 4] 8.00-9.00 sec 8.14 MBytes 68.3 Mbits/sec 1 286 KBytes
[ 4] 9.00-10.00 sec 7.77 MBytes 65.2 Mbits/sec 4 226 KBytes
[ 4] 10.00-11.00 sec 7.15 MBytes 59.9 Mbits/sec 0 247 KBytes
[ 4] 11.00-12.00 sec 7.64 MBytes 64.1 Mbits/sec 0 267 KBytes
[ 4] 12.00-13.00 sec 8.14 MBytes 68.3 Mbits/sec 0 290 KBytes
[ 4] 13.00-14.00 sec 6.96 MBytes 58.4 Mbits/sec 1 239 KBytes
[ 4] 14.00-15.00 sec 7.71 MBytes 64.6 Mbits/sec 0 267 KBytes
[ 4] 15.00-16.00 sec 8.26 MBytes 69.3 Mbits/sec 0 284 KBytes
[ 4] 16.00-17.00 sec 8.64 MBytes 72.5 Mbits/sec 0 291 KBytes
[ 4] 17.00-18.00 sec 8.95 MBytes 75.1 Mbits/sec 0 314 KBytes
[ 4] 18.00-19.00 sec 8.26 MBytes 69.3 Mbits/sec 2 250 KBytes
[ 4] 19.00-20.00 sec 8.08 MBytes 67.8 Mbits/sec 0 287 KBytes
[ 4] 20.00-21.00 sec 8.76 MBytes 73.5 Mbits/sec 0 308 KBytes
[ 4] 21.00-22.00 sec 9.26 MBytes 77.7 Mbits/sec 0 320 KBytes
[ 4] 22.00-23.00 sec 9.45 MBytes 79.2 Mbits/sec 0 327 KBytes
[ 4] 23.00-24.00 sec 9.82 MBytes 82.4 Mbits/sec 0 351 KBytes
[ 4] 24.00-25.00 sec 9.45 MBytes 79.2 Mbits/sec 1 270 KBytes
[ 4] 25.00-26.00 sec 8.64 MBytes 72.5 Mbits/sec 0 314 KBytes
[ 4] 26.00-27.00 sec 8.51 MBytes 71.4 Mbits/sec 9 242 KBytes
[ 4] 27.00-28.00 sec 7.64 MBytes 64.1 Mbits/sec 0 266 KBytes
[ 4] 28.00-29.00 sec 8.14 MBytes 68.3 Mbits/sec 0 284 KBytes
[ 4] 29.00-30.00 sec 6.90 MBytes 57.9 Mbits/sec 1 238 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-30.00 sec 245 MBytes 68.4 Mbits/sec 120 sender
[ 4] 0.00-30.00 sec 243 MBytes 67.9 Mbits/sec receiver
iperf Done.
This has been extremely perplexing for me. The only thing different between the two iperf3 outputs is the consistency of the Retr column, which I believe indicates how many retransmission there were. The consistency of Retr without the 15ms delay is higher, averaging around 10 retransmissions per second. The Retr of the pipe with a 15ms delay confusingly averages 0 retransmissions, but every time there is any, even if it is 3 per second, the speed immediately decreases.
Any help in understanding what is happening is greatly appreciated.