Régler le contrôle de congestion TCP
Comprenez et réglez les algorithmes de contrôle de congestion TCP de Linux, tels que CUBIC et BBR, afin d’améliorer le débit et la latence sur des réseaux réels.
Régler le contrôle de congestion TCP est une leçon Linux Networking & TCP/IP for Developers gratuite sur CoddyKit. Ceci est la leçon 4 sur 4. Tu peux lire la leçon complète ci-dessous gratuitement — puis la pratiquer en direct dans le navigateur avec un éditeur de code intégré et un tuteur IA 24/7. Elle fait partie du parcours d'apprentissage Linux Networking & TCP/IP for Developers, et ta progression se synchronise sur le web et l'application CoddyKit. Le cours Linux Networking & TCP/IP for Developers comprend 4 leçons au total.
Certaines parties de cette leçon n'ont pas encore été traduites et s'affichent en anglais.
What Congestion Control Does
TCP congestion control decides how fast a sender may transmit without overwhelming the network.
It governs the trade-off between throughput and latency, and the right algorithm can dramatically change performance.
The Congestion Window
The congestion window (cwnd) limits how many unacknowledged bytes are in flight. Algorithms grow and shrink cwnd in response to ACKs and loss signals.
Too small wastes bandwidth; too large causes loss and bufferbloat.
Loss-Based vs Latency-Based
Two families exist:
- Loss-based (CUBIC, Reno) grow until packets drop
- Latency/model-based (BBR) estimate bandwidth and RTT to avoid filling buffers
BBR often wins on long-distance, lossy links.
Listing Available Algorithms
See which algorithms the kernel has loaded.
sysctl net.ipv4.tcp_available_congestion_controlChecking the Current Algorithm
CUBIC is the Linux default. Confirm what is active.
sysctl net.ipv4.tcp_congestion_controlEnabling BBR
Load the BBR module, then set it as the default. BBR pairs best with the fq queue discipline.
sudo modprobe tcp_bbr
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr
sudo sysctl -w net.core.default_qdisc=fqMaking Changes Persistent
Runtime sysctl changes are lost on reboot. Persist them in /etc/sysctl.d/.
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbrTuning Buffer Sizes
Congestion control can only fill a window the buffers allow. For high bandwidth-delay-product paths, raise the autotuning maximums.
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216The Bandwidth-Delay Product
Optimal window size = bandwidth x round-trip time. A 1 Gbps link with 100 ms RTT needs about 12.5 MB of buffer to stay full.
Undersized buffers cap throughput regardless of the algorithm.
Observing Connections
Inspect live socket state, cwnd, and RTT with ss to confirm tuning is taking effect.
ss -tinMeasuring the Impact
Benchmark before and after with a tool like iperf3 across a real path. Always measure both throughput and latency, since aggressive tuning can trade one for the other.
iperf3 -c remote-host -t 30Quick Check
Test your congestion control knowledge.
Recap
You can now tune TCP congestion control:
- Understand cwnd and the bandwidth-delay product
- Compare loss-based (CUBIC) vs model-based (BBR)
- Enable BBR with the
fqqdisc and persist it - Size
tcp_rmem/tcp_wmembuffers correctly - Verify with
ss -tinand benchmark withiperf3
This extends your kernel parameter and benchmarking lessons.
Questions Fréquemment Posées
La leçon « Régler le contrôle de congestion TCP » est-elle gratuite ?
Oui — le texte complet de « Régler le contrôle de congestion TCP » est gratuit à lire ici sur le web. Pour la pratiquer de manière interactive (un éditeur de code intégré et un tuteur IA 24/7) et déverrouiller le reste du cours Linux Networking & TCP/IP for Developers, passe à CoddyKit PRO. Le cours Linux Networking & TCP/IP for Developers comprend 4 leçons au total.
Qu'est-ce que j'apprendrai dans « Régler le contrôle de congestion TCP » ?
Comprenez et réglez les algorithmes de contrôle de congestion TCP de Linux, tels que CUBIC et BBR, afin d’améliorer le débit et la latence sur des réseaux réels. Tu pratiques Linux Networking & TCP/IP for Developers avec du code pratique que tu exécutes directement dans le navigateur, et un tuteur IA 24/7 répond à tes questions au fur et à mesure que tu avances dans la leçon.
Dois-je avoir de l'expérience pour commencer Linux Networking & TCP/IP for Developers ?
Aucune expérience préalable n'est requise. Linux Networking & TCP/IP for Developers sur CoddyKit est structuré pour les débutants jusqu'aux apprenants avancés, donc tu peux commencer ici ou depuis le début et avancer à ton rythme. Ceci est la leçon 4 sur 4.
Combien de temps prend la leçon « Régler le contrôle de congestion TCP » ?
La plupart des leçons CoddyKit prennent environ 5–10 minutes. Chacune est courte et interactive, tu progresses régulièrement et tu repiques exactement où tu t'es arrêté sur le web et l'app.
Peux-tu écrire et exécuter du code dans cette leçon Linux Networking & TCP/IP for Developers ?
Oui. Chaque leçon Linux Networking & TCP/IP for Developers inclut un éditeur de code intégré, tu écris et exécutes du vrai code directement dans ton navigateur et tu reçois des retours IA instantanés — aucune configuration locale requise.
Toutes les leçons de ce cours
- Paramètres réseau du noyau
- Réglage et optimisation des NIC
- Évaluation du débit réseau
- Régler le contrôle de congestion TCP