Is the snd_cwnd_clamp in bbr_set_cwnd() configurable?

140 views
Skip to first unread message

Tao Tse

unread,
Jul 30, 2020, 11:13:55 PM7/30/20
to BBR Development
Hi,

According to the source code of bbr_set_cwnd() in tcp_bbr.c, the final cwnd value is being limited by the snd_cwnd_clamp parameter. 

       tp->snd_cwnd = min(cwnd, tp->snd_cwnd_clamp); /* apply global cap */  

Does anyone know that is the snd_cwnd_clamp configurable in userspace? If yes, how? If no, how and where does the value be decided?

Thanks!
--
xtao

Neal Cardwell

unread,
Jul 31, 2020, 11:05:35 AM7/31/20
to Tao Tse, BBR Development
That cwnd clamp can be set from user space using the "ip" tool, using
the "route" command, which sets the maximum cwnd for a particular
route.

The documentation for this is in the man page for ip-route, e.g.:
https://www.systutorials.com/docs/linux/man/8-ip-route/
cwnd NUMBER (Linux 2.3.15+ only)
the clamp for congestion window. It is ignored if the lock flag
is not used.

From your source code cross-reference:
https://elixir.bootlin.com/linux/latest/C/ident/snd_cwnd_clamp

...the references to focus on are the ones in tcp_metrics.c, where
snd_cwnd_clamp comes from the TCP_METRIC_CWND:
tp->snd_cwnd_clamp = tcp_metric_get(tm, TCP_METRIC_CWND);

...and TCP_METRIC_CWND comes from the routing attribute RTAX_CWND
tm->tcpm_vals[TCP_METRIC_CWND] = dst_metric_raw(dst, RTAX_CWND);

...and that routing attribute is set from the "ip" tool, using the
"route" command using the "cwnd" attribute:
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/ip/iproute.c?h=v5.7.0#n47
[RTAX_CWND] = "cwnd",

best,
neal
> --
> 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/a3d506b2-cdfd-41d1-a4f5-dd3bc27211c9n%40googlegroups.com.

Tao Tse

unread,
Aug 3, 2020, 4:23:35 AM8/3/20
to BBR Development
Thank you, neal!

Further more, what's the default value of  [RTAX_CWND]? I can't find the code about it, where is it defined?

--
xtao

Neal Cardwell

unread,
Aug 3, 2020, 9:04:06 AM8/3/20
to Tao Tse, BBR Development
My quick reading is that the default for RTAX_CWND is to not have an RTAX_CWND set. There does not seem to be a specific default value of RTAX_CWND.

best,
neal


Reply all
Reply to author
Forward
0 new messages