Hi,
By my quick calculations, the gradual draining of the queue over the 2-second period between t=42 and t=44 secs in this test is exactly expected if the pacing rate is, on average, 2% below the delivery rate. (The Python simulation script I used, and a portion of its output are pasted below.)
I'm not sure why that early version of Linux TCP BBRv1 had a de facto behavior of pacing at 2% below the delivery rate, rather than the expected 1%. I suspect it could be deduced from auditing the pacing rate and pacing implementations of that era of the code. Since the pacing rate and pacing implementation for Linux TCP have switched to a very different model, EDT, in Fall 2018, it probably makes sense to focus any investigation in that area on a more recent version of BBR.
best,
neal
ps: Python script and excerpt of output:
$ cat ./q_drain_sim.py
#!/usr/bin/python
link_rate_pps = 10*1000*1000 / (1514*8)
pacing_haircut = 0.98
pacing_rate_pps = link_rate_pps * pacing_haircut
bdp_packets = link_rate_pps * .040
inflight_packets = 2 * bdp_packets
queue_packets = inflight_packets - bdp_packets
round_trip = 0
elapsed = .010 # simulate 10ms at a time
t = 0
while queue_packets > 0:
# How many packets does the link forward in this interval?
link_forwarded = link_rate_pps * elapsed
# How many packets does the sender send in this interval?
pacing_released = pacing_rate_pps * elapsed
# Update the queue occupancy:
queue_packets += pacing_released
queue_packets -= link_forwarded
print 't=', t, ' queue_packets=', queue_packets
t = t + elapsed
$./q_drain_sim.py
t= 0 queue_packets= 32.835
t= 0.01 queue_packets= 32.67
t= 0.02 queue_packets= 32.505
t= 0.03 queue_packets= 32.34
t= 0.04 queue_packets= 32.175
t= 0.05 queue_packets= 32.01
...
t= 1.96 queue_packets= 0.495
t= 1.97 queue_packets= 0.33
t= 1.98 queue_packets= 0.165
t= 1.99 queue_packets= 1.70530256582e-13
Hi Neal, Thank you very much. I have the same question of "Tong", and I have another
problem:
In second 40~42s, the rtt is about 160ms, I think the time “160ms” can be computed as following:
1. inflight = 2 * Estimated_BDP = 2 * BtlBw * RTprop = 2 * 20Mbps * 40ms = 200KByte, so seq1 will send when ack1
arrived , then seq1 - ack1 = inflight = 200KB, then ack1 and delived1 is both D1,seq1 is D1 + 200KB
2. deliverd is D2 when seq1‘s ack
arrive,D2 = D1 + 10Mbps*rtt, then rate = (D2 - D1)/rtt = 10Mbps.
3.(seq1 - D1)/rtt = 200KB/rtt = rate = 10Mbps, then rtt = 160ms.
Is there a problem with this calculation?