TCP_CONGCTL(9)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… TCP_CONGCTL(9) πŸ’…

okay so bestie, welcome to the Kernel Developer's Manual page for tcp_congctl β€” yes that's the section 9 one, kernel dev territory, put your big-girl hat on πŸŽ€


✨ NAME ✨

tcp_congctl β€” the TCP congestion control API, aka the plug-and-play system for congestion control algorithms πŸ¦‹


✨ SYNOPSIS ✨

#include <netinet/tcp_congctl.h>

int
tcp_congctl_register(const char *, struct tcp_congctl *);

int
tcp_congctl_unregister(const char *);

✨ DESCRIPTION ✨

so the tcp_congctrl API is literally the whole vibe for adding or removing TCP congestion control algorithms on-the-fly and for modularizing them πŸ’« it's giving hot-swappable networking, no cap. it includes basically two functions:

  • tcp_congctl_register(const char *, struct tcp_congctl *) β€” registers a new congestion control algorithm, slay πŸ‘‘ the struct tcp_congctl argument must contain a list of callbacks like the following:
struct tcp_congctl {
        int  (*fast_retransmit)(struct tcpcb *,
            struct tcphdr *);
        void (*slow_retransmit)(struct tcpcb *);
        void (*fast_retransmit_newack)(struct tcpcb *,
            struct tcphdr *);
        void (*newack)(struct tcpcb *,
            struct tcphdr *);
        void (*cong_exp)(struct tcpcb *);
};
  • tcp_congctl_unregister(const char *) β€” if found, unregisters the selected TCP congestion control algorithm. bye bestie πŸ‘‹

✨ RETURN VALUES ✨

tcp_congctl_register() and tcp_congctl_unregister() both return 0 when there is no error πŸ’– zero means iconic, zero means we ate.

  • if the name is already registered, tcp_congctl_register() will return EEXIST πŸ™ˆ (bestie that name is taken)
  • tcp_congctl_unregister() can return ENOENT if there is no congestion control algorithm by that name 😭 (ghosted, doesn't exist)
  • and it can return EBUSY if the matched algorithm is being used by userspace applications πŸ’€ (can't unregister it, it's literally in a relationship with a userspace app right now)

✨ FILES ✨

  • implementation is in sys/netinet/tcp_congctl.c 🌸
  • the interface is in sys/netinet/tcp_congctl.h 🌸

✨ SEE ALSO ✨


and that's the whole page, no notes 🫢 this one's from Debian, dated October 15, 2006 β€” yes she's an older queen but she still slays, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from