BBR: "ss" output

524 views
Skip to first unread message

vm finance

unread,
Jan 2, 2020, 7:12:09 AM1/2/20
to BBR Development
Happy New Year!

Is there a way to print BBR internal state machine mode on Linux kernel?
I am using "ss" command and it does provide great insights into various BBR variables..
But I would like to see how those variables translate into BBR states (startup, drain, etc.) and its transitions.

Any pointers highly appreciated.

Thanks!

vm finance

unread,
Jan 2, 2020, 8:55:11 AM1/2/20
to BBR Development
Let me elaborate a bit more:

I would like to analyze various fields shown by "ss" output below under various traffic scenarios, such as drops and delays etc, and try to map those to BBR internal state machine mode (startup, drain, etc.). Is it possible to do this using ss or any other available utility?
So if I can have a smart-excel or some kind of analytics tool to classify that as different parameter values change, it maps/translates into a particular  BBR internal state and so forth.

Thank you!

[manjaro-h1 logs]$ ss -tmoi dst 172.20.61.1
State    Recv-Q    Send-Q               Local Address:Port                Peer Address:Port
ESTAB    0         3651376       [::ffff:172.19.60.1]:http        [::ffff:172.20.61.1]:44426     timer:(on,017ms,0)
         skmem:(r0,rb131072,t22880,tb4036608,f415184,w3717680,o0,bl0,d0) ts sack bbr wscale:7,7 rto:206.666 rtt:4.42/0.23 ato:40 mss:1350 pmtu:1500 rcvmss:536 advmss:1448 cwnd:82 ssthresh:232 bytes_sent:94544550 bytes_acked:94447350 bytes_received:148 segs_out:70129 segs_in:12189 data_segs_out:70128 data_segs_in:1 bbr:(bw:243.6Mbps,mrtt:0.254,pacing_gain:0.75,cwnd_gain:2) send 200.4Mbps lastrcv:2327 pacing_rate 180.8Mbps delivery_rate 224.1Mbps delivered:70057 busy:2326ms rwnd_limited:49ms(2.1%) unacked:72 rcv_space:14600 rcv_ssthresh:64076 notsent:3866400 minrtt:0.254

Soheil Hassas Yeganeh

unread,
Jan 2, 2020, 9:20:44 AM1/2/20
to vm finance, BBR Development
Happy New Year!

The version of BBR1 and BBR2 available on github has debug logs, which
will be enabled by setting SO_DEBUG on the file descriptor you're
using:
https://github.com/google/bbr/blob/v2alpha/net/ipv4/tcp_bbr2.c#L575-L625

The log entry includes essentially everything about BBR's internal state.

Hope that helps,
Soheil
> --
> 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/CAKy-8%3Dj%3DgadvxxAWCEEti7c87Uoye6UmRXg-0FJmevR%2BrbdXHA%40mail.gmail.com.

vm finance

unread,
Jan 2, 2020, 2:18:00 PM1/2/20
to Soheil Hassas Yeganeh, BBR Development
Thanks Soheil!

Actually what I'm looking for is how to interpret various BBR fields to make any conclusions.
Printing is one aspect. However, if there are thumb rules to analyze to check if algo is really behaving the way it should be?
I came up with an internet post and please find it attached (after some edits).
Are these sufficient to check for various state transitions? Please let me know.

Thank you!
bbr.notes.txt.txt

Neal Cardwell

unread,
Jan 2, 2020, 2:48:52 PM1/2/20
to vm finance, Soheil Hassas Yeganeh, BBR Development
Hi,

Your attached summary of the BBR algorithm behavior in each state is
quite reasonable.

More specifically, if you are looking for a way to map ss output to
the BBR algorithm state (bbr->mode value of STARTUP, DRAIN, PROBE_BW,
PROBE_RTT)...

(1) We have some patches we are planning on sending upstream that
export the state directly. You can see the end result in the BBRv2
alpha code:
https://github.com/google/bbr/blob/v2alpha/net/ipv4/tcp_bbr2.c
So eventually this info will be directly available in the ss output,
at least for BBRv2.

(2) Until then, users can deterministically map from the cwnd_gain and
pacing_gain values exported by ss to the BBRv1 algorithm state, by
looking at the gain values set in bbr_update_gains():
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/net/ipv4/tcp_bbr.c

Specifically, the code there is currently:

case BBR_STARTUP:
bbr->pacing_gain = bbr_high_gain;
bbr->cwnd_gain = bbr_high_gain;
...
case BBR_DRAIN:
bbr->pacing_gain = bbr_drain_gain; /* slow, to drain */
bbr->cwnd_gain = bbr_high_gain; /* keep cwnd */
...
case BBR_PROBE_BW:
bbr->pacing_gain = (bbr->lt_use_bw ?
BBR_UNIT :
bbr_pacing_gain[bbr->cycle_idx]);
bbr->cwnd_gain = bbr_cwnd_gain;
...
case BBR_PROBE_RTT:
bbr->pacing_gain = BBR_UNIT;
bbr->cwnd_gain = BBR_UNIT;
...

You can see that each state has at least one gain value that is
completely unique to that state, so that the pair of gain values can
be unambiguously mapped to a given state.

Hope that helps,
neal
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbr-dev/CAKy-8%3Dgh5Ji5e5Dhn6ffyevzqF4bfVQ%3DTnD7mh01N4fEHvqgpw%40mail.gmail.com.

vm finance

unread,
Jan 3, 2020, 12:09:09 AM1/3/20
to Neal Cardwell, Soheil Hassas Yeganeh, BBR Development
Thanks Neal! I'd check this.
Reply all
Reply to author
Forward
0 new messages