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.