0Pricing
Linux Networking & TCP/IP for Developers · Lezione

Ottimizzazione del controllo della congestione TCP

Comprenda e ottimizzi gli algoritmi Linux di controllo della congestione TCP, come CUBIC e BBR, per migliorare throughput e latenza nelle reti reali.

Ottimizzazione del controllo della congestione TCP è una lezione Linux Networking & TCP/IP for Developers gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Linux Networking & TCP/IP for Developers, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Linux Networking & TCP/IP for Developers include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

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_control

Checking the Current Algorithm

CUBIC is the Linux default. Confirm what is active.

sysctl net.ipv4.tcp_congestion_control

Enabling 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=fq

Making 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=bbr

Tuning 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 16777216

The 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 -tin

Measuring 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 30

Quick 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 fq qdisc and persist it
  • Size tcp_rmem/tcp_wmem buffers correctly
  • Verify with ss -tin and benchmark with iperf3

This extends your kernel parameter and benchmarking lessons.

Domande Frequenti

La lezione «Ottimizzazione del controllo della congestione TCP» è gratuita?

Sì — il testo completo di «Ottimizzazione del controllo della congestione TCP» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Linux Networking & TCP/IP for Developers, passa a CoddyKit PRO. Il corso Linux Networking & TCP/IP for Developers include 4 lezioni in totale.

Cosa imparerò in «Ottimizzazione del controllo della congestione TCP»?

Comprenda e ottimizzi gli algoritmi Linux di controllo della congestione TCP, come CUBIC e BBR, per migliorare throughput e latenza nelle reti reali. Eserciti Linux Networking & TCP/IP for Developers con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Linux Networking & TCP/IP for Developers?

Non è richiesta alcuna esperienza precedente. Linux Networking & TCP/IP for Developers su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.

Quanto tempo richiede la lezione «Ottimizzazione del controllo della congestione TCP»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Linux Networking & TCP/IP for Developers?

Sì. Ogni lezione Linux Networking & TCP/IP for Developers include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Parametri di rete del kernel
  2. Ottimizzazione delle NIC
  3. Benchmark del throughput di rete
  4. Ottimizzazione del controllo della congestione TCP
← Torna a Linux Networking & TCP/IP for Developers