Commands / Speed and link quality

Speed and link quality

ip tcp_metrics

Also tcp metrics, route metrics cache, ssthresh cache

Shows and clears what Linux remembers about each destination from earlier TCP connections.

When a connection closes, Linux keeps what it learned about the destination: the round trip and its variation, and after losses the window where slow start should end (ssthresh). The next connection to the same address starts from them, so a second test can behave differently from the first. ip tcp_metrics flush forgets everything: each measurement starts fresh.

ip tcp_metrics command usage

ip tcp_metrics [show [ADDRESS]]
ip tcp_metrics flush [ADDRESS]
ip tcp_metrics delete ADDRESS

Options

show
what is remembered, per destination
flush
forget it all (or one address)
delete 10.0.2.10
forget one destination

ip tcp_metrics examples

ip tcp_metrics show
Lists what is remembered about each destination.
ip tcp_metrics flush
Forgets it, so the next connection starts from scratch.

Reading the output

$ ip tcp_metrics show
10.0.2.10 age 0.954sec cwnd 10 rtt 60440us rttvar 45487us source 10.0.1.10
  • age: how long ago a connection last updated it.
  • rtt / rttvar: the remembered round trip and how much it varied, in microseconds: they set the next connection's first retransmission timer.
  • ssthresh, when shown: where the next connection's slow start will stop doubling.

Pitfalls

  • Two runs of the same test differ: the second starts from what the first left behind. Flush between them.

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Start free