CC_VEGAS(4)

πŸ’– cc_vegas β€” the Vegas Congestion Control Algorithm πŸ’–

okay bestie, so this is CC_VEGAS(4), a kernel interfaces manual page (section 4, the ✨kernel✨ section, iykyk), and we're about to get into how TCP decides it's been a little too much. buckle up. πŸŽ€


✨ NAME ✨

cc_vegas β€” the Vegas Congestion Control Algorithm, no cap. it's a whole vibe and it's literally named after a city. iconic.


🌸 DESCRIPTION 🌸

so the Vegas congestion control algorithm is that girl who doesn't just guess β€” she does the math. it uses what the authors call the actual and expected transmission rates to figure out whether there's congestion somewhere along the network path. and it looks like this:

actual rate = (total data sent in a RTT) / RTT

expected rate = cwnd / RTTmin

diff = expected - actual

where RTT is the measured instantaneous round trip time, and RTTmin is the smallest round trip time observed during the whole connection. she's keeping receipts. πŸ’…

the algorithm's whole goal is to keep diff nestled between two little parameters called alpha and beta, so that:

alpha < diff < beta

and here's the drama:

  • if diff > beta, congestion is inferred 😭 and cwnd gets decremented by one packet (or the maximum TCP segment size).
  • if diff < alpha, then cwnd gets incremented by one packet πŸŽ‰.

alpha and beta govern the amount of buffering along the path, so basically they're the ones setting the boundaries of the relationship.

also, very important: this implementation was done in a clean-room fashion, and it's based on the paper referenced down in the SEE ALSO section. no peeking at anyone else's homework. 🫢


πŸ’œ IMPLEMENTATION NOTES πŸ’œ

the time from the transmission of a marked packet until the receipt of an acknowledgement for that packet is measured once per RTT. once. per RTT. she's not clingy.

this implementation does not implement Brakmo's and Peterson's original duplicate ACK policy, because clock ticks in today's machines are not as coarse as they were (i.e. 500ms) back when Vegas was originally designed. times changed, bestie, and the algorithm adapted. 🌈

heads up though β€” modern TCP recovery processes such as fast retransmit and SACK are enabled by default in the TCP stack. so that's just happening, in the background, the whole time. πŸ¦‹

🧚 MIB Variables 🧚

the algorithm exposes these tunable variables in the net.inet.tcp.cc.vegas branch of the sysctl(3) MIB:

  • alpha β€” query or set the Vegas alpha parameter as a number of buffers on the path. when you're setting alpha, the value must satisfy: 0 < alpha < beta. default is 1.
  • beta β€” query or set the Vegas beta parameter as a number of buffers on the path. when you're setting beta, the value must satisfy: 0 < alpha < beta. default is 3.

πŸ”₯ SEE ALSO πŸ”₯

go read these next, they're the friend group:

cc_chd(4), cc_cubic(4), cc_hd(4), cc_htcp(4), cc_newreno(4), h_ertt(4), mod_cc(4), tcp(4), khelp(9), mod_cc(9)

and the origin story paper πŸ“–:

L. S. Brakmo and L. L. Peterson, β€œTCP Vegas: end to end congestion avoidance on a global internet”, IEEE J. Sel. Areas Commun., 8, 13, 1465-1480, October 1995.


🫢 ACKNOWLEDGEMENTS 🫢

development and testing of this software were made possible in part by grants from the FreeBSD Foundation and the Cisco University Research Program Fund at Community Foundation Silicon Valley. thank u to the funders, fr fr. πŸ’–


πŸ‘‘ HISTORY πŸ‘‘

the cc_vegas congestion control module first appeared in FreeBSD 9.0.

the module was first released in 2010 by David Hayes, whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. and if you want more details, they're right here:

http://caia.swin.edu.au/urp/newtcp/

⭐ AUTHORS ⭐

the cc_vegas congestion control module and this manual page were written by David Hayes <david.hayes@ieee.org>. absolute main character energy, we love to see it. πŸŽ€


and that's the whole page bestie!! this one came to you from Debian, dated September 15, 2011 β€” so it's a lil vintage, a lil classic, and it still ate. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from