Hi All,
I am reaching out to discuss an observation I've made while experimenting with the BBRv1 algorithm, specifically regarding the behavior of the bbr_set_pacing_rate function within the tcp_bbr1.c file from your BBRv3 branch on GitHub.
For context, I have compiled the BBRv1 and v3 kernels as loadable modules to facilitate repeated modifications and debugging of the source code. My current focus is on the original BBRv1 version. During my experiments, which involved dynamically adjusting the environment's bandwidth, I noted that the pacing rate computed by BBRv1, and assigned to the sk_pacing_rate in the socket structure, does not decrease immediately following a significant drop in the available bandwidth. This behavior aligns with my understanding, given BBRv1's reliance on the maximum bandwidth observed over the past 10 RTTs.
However, when analyzing the actual send rate through pcap files captured with tcpdump, I observed a rapid decline in the send rate concurrent with the bandwidth reduction. This was unexpected, as I assumed the send rate should be primarily dictated by the sk_pacing_rate, which remained at a higher value indicative of previous bandwidth conditions.
To illustrate my point more clearly, I've included a graph below that visualizes my observations. In this graph:
- The red line represents the pacing_rate as determined by BBRv1. I get this value using printk in the bbr_set_pacing_rate function.
- The orange line corresponds to the send rate calculated from pcap files captured with tcpdump.
- The blue line illustrates the changes in the actual available bandwidth.
Could you please provide insights or clarifications on why there's a substantial discrepancy between the maintained sk_pacing_rate and the actual send rate observed through pcap analysis? Is there an underlying mechanism or factor that could explain this rapid adjustment in send rate despite the sk_pacing_rate not showing a corresponding decrease?
In pondering this discrepancy, I wonder if, after BBR sets the sk_pacing_rate using the calculated pacing_rate, there might be some internal TCP mechanisms that subsequently adjust the sk_pacing_rate, leading to the significant difference between the actual send rate and the sk_pacing_rate. I sincerely inquire whether your engineering team has previously encountered this issue or can provide any insights into such behavior within the TCP stack.
Your expertise and any guidance on this matter would be greatly appreciated, as it would significantly aid in my understanding and further experimentation with BBR.
Best Regards,
Zonglun Li
Hi All,
I am reaching out to discuss an observation I've made while experimenting with the BBRv1 algorithm, specifically regarding the behavior of the bbr_set_pacing_rate function within the tcp_bbr1.c file from your BBRv3 branch on GitHub.
For context, I have compiled the BBRv1 and v3 kernels as loadable modules to facilitate repeated modifications and debugging of the source code. My current focus is on the original BBRv1 version. During my experiments, which involved dynamically adjusting the environment's bandwidth, I noted that the pacing rate computed by BBRv1, and assigned to the sk_pacing_rate in the socket structure, does not decrease immediately following a significant drop in the available bandwidth. This behavior aligns with my understanding, given BBRv1's reliance on the maximum bandwidth observed over the past 10 RTTs.
However, when analyzing the actual send rate through pcap files captured with tcpdump, I observed a rapid decline in the send rate concurrent with the bandwidth reduction. This was unexpected, as I assumed the send rate should be primarily dictated by the sk_pacing_rate, which remained at a higher value indicative of previous bandwidth conditions.
To illustrate my point more clearly, I've included a graph below that visualizes my observations. In this graph:
- The red line represents the pacing_rate as determined by BBRv1. I get this value using printk in the bbr_set_pacing_rate function.
- The orange line corresponds to the send rate calculated from pcap files captured with tcpdump.
- The blue line illustrates the changes in the actual available bandwidth.
Could you please provide insights or clarifications on why there's a substantial discrepancy between the maintained sk_pacing_rate and the actual send rate observed through pcap analysis? Is there an underlying mechanism or factor that could explain this rapid adjustment in send rate despite the sk_pacing_rate not showing a corresponding decrease?
In pondering this discrepancy, I wonder if, after BBR sets the sk_pacing_rate using the calculated pacing_rate, there might be some internal TCP mechanisms that subsequently adjust the sk_pacing_rate, leading to the significant difference between the actual send rate and the sk_pacing_rate. I sincerely inquire whether your engineering team has previously encountered this issue or can provide any insights into such behavior within the TCP stack.
Your expertise and any guidance on this matter would be greatly appreciated, as it would significantly aid in my understanding and further experimentation with BBR.
Best Regards,
Zonglun Li
--
You received this message because you are subscribed to the Google Groups "BBR Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbr-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbr-dev/fa9e4dcc-0a5f-4320-9d0a-ff7555f72186n%40googlegroups.com.
If you find packets_in_flight (unacked - sacked - lost + retrans) is >= cwnd, then that indicates cwnd is constraining behavior.
--
You received this message because you are subscribed to the Google Groups "BBR Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbr-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbr-dev/CAHb6LvoFRq9mWGLn_k9iMuR30RBWWSOv-Azb%2BQGbEGdzq41f2g%40mail.gmail.com.
If you find packets_in_flight (unacked - sacked - lost + retrans) is >= cwnd, then that indicates cwnd is constraining behavior.A bit of a tangent - would it be useful for a tool like iperf 2 to output this inflight calculation? It would be sampled at the report interval rate.
t - would it be useful for a tool like iperf 2 to output this inflight calculation? It would be sampled at the report interval rate.Sure, for any tool that outputs cwnd, the number of packets in flight is also interesting to output. Particularly for BBR, which prefers to try to control sending with the pacing rate, and thus often does not use the full cwnd.
If you want cwnd and packets in the same units (sounds good to me), then for Linux TCP you would probably want to use the units of packets. Both cwnd and inflight are natively in units of packets in Linux TCP. So if you are printing the cwnd in bytes you are presumably multiplying the cwnd by the MSS? So I guess you could just print the inflight and cwnd values directly in units of packets, and not multiply the cwnd by the MSS. :-)
I would like to express my gratitude for your prompt and insightful response so quickly. Following your advice, I have utilized ss to gather statistics on the inflight features. As you mentioned , the formula for calculating inflight was delineated as unacked - sacked - lost + retrans. Based on the ss output, which includes bytes_sent, bytes_acked, bytes_sacked, lost, and bytes_retrans, my initial understanding led me to formulate inflight as bytes_sent - bytes_acked - bytes_sacked - lost + bytes_retrans. However, upon observing significant discrepancies between the inflight curve(yellow one) and the cwnd curve (as provided by ss, gray one) in the latter stages of my experiment,
I revised the formula to inflight = bytes_sent - bytes_acked - bytes_sacked - lost. This adjustment brought the inflight and cwnd curves closer, yet, the inflight values remained consistently higher than cwnd in the mid to late phases of the experiment.
Given this context, I seek your expertise in clarifying which of these approaches to inflight calculation is more accurate, or if perhaps neither is correct and there exists a more appropriate method. By the way, to show the corresponding perfomance of rate and inflight more explicitly, here are two graphs sharing the same x axis:
- figure one: orange line --- send rate; blue line --- environment actual bandwidth; red line --- bbr pacing rate
- figure two: yellow line --- inflight num; gray line --- cwnd from the ss output
Furthermore, I find myself puzzled by the assertion that when inflight >= cwnd, it is the cwnd and not the pacing_rate that constrains BBR's sending rate. I would greatly appreciate a more detailed explanation on this matter. Specifically, how does the BBR algorithm utilize cwnd and pacing_rate for data transmission upon receiving a new ACK, especially when inflight exceeds cwnd? My current understanding is that the reception of a new ACK prompts BBR to dispatch a new packet, with the rate of ACK reception dictating the pace of packet transmission. Therefore, even with a higher pacing_rate, the actual sending rate cannot surpass the limits imposed when inflight > cwnd.
I hope my interpretations are on the right track, but I am open to corrections and further enlightenment on these topics.
Thank you for your time and assistance.
Best regards,
Zonglun Li
To view this discussion on the web visit https://groups.google.com/d/msgid/bbr-dev/7e9babc6-d328-49cc-8b3d-9f134b6b3644n%40googlegroups.com.