IP-TCP_METRICS(8)

๐ŸŽ€ ip-tcp_metrics(8) ๐ŸŽ€

the TCP metrics manual, bestie ๐Ÿ’–

๐Ÿ’… NAME

okay so ip-tcp_metrics is all about managing TCP Metrics โœจ

๐Ÿ“œ SYNOPSIS

ip [ OPTIONS ] tcp_metrics { COMMAND | help }
ip tcp_metrics { show | flush } SELECTOR
ip tcp_metrics delete [ address ] ADDRESS
SELECTOR := [ [ address ] PREFIX ]

๐ŸŒธ DESCRIPTION

okay so ip tcp_metrics lets you mess with the entries the kernel keeps about TCP stuff for both IPv4 and IPv6 destinations ๐Ÿงš these entries show up when TCP sockets want to share info about a destination, and they get stored in a cache that's keyed by the destination address ๐Ÿ’œ

the saved info can include metric values (which start out coming from routes), a recent TSVAL for TIME-WAIT recycling, state for the Fast Open feature, and more, bestie ๐Ÿฆ‹

lowkey important: the cache is never allowed to grow past its configured limit ๐Ÿ™ˆ so the older entries get replaced with fresh info, and sometimes they get reclaimed and reused for brand new destinations ๐Ÿ’€

and the kernel never removes entries on its own ๐Ÿ˜ญ they can only be flushed with this tool, so this is literally your job now ๐Ÿ’…


๐Ÿฆ‹ ip tcp_metrics show - show cached entries

  • address PREFIX (default) โ€” the IPv4/IPv6 prefix or address you want to look at ๐Ÿ‘€ if you don't give a prefix, you get all the entries โœจ

when you show entries, the output might include:

  • age <S.MMM>sec โ€” how long ago the entry was created, reset, or updated with metrics from sockets โฐ the entry gets reset and refreshed when it's used with metrics from a route if those metrics haven't been updated in the last hour, and not every cached value resets the age when it gets updated, so don't be shook ๐Ÿซ 
  • cwnd <N> โ€” the CWND metric value ๐ŸŒˆ
  • fo_cookie <HEX-STRING> โ€” the cookie value that came in the SYN-ACK, which Fast Open uses for the next SYNs ๐Ÿ“
  • fo_mss <N> โ€” the MSS value that came in the SYN-ACK, which Fast Open uses for the next SYNs ๐Ÿ“
  • fo_syn_drops <N>/<S.MMM>sec ago โ€” the number of initial outgoing Fast Open SYNs-with-data that got dropped, spotted by watching the received SYN-ACK after a SYN retransmission ๐Ÿ˜ค the seconds show how long ago the last SYN drop happened, and you can use that along with the drop count to turn off Fast Open for a little while ๐Ÿซถ
  • reordering <N> โ€” the reordering metric value ๐Ÿ”„
  • rtt <N>us โ€” the RTT metric value โฑ๏ธ
  • rttvar <N>us โ€” the RTTVAR metric value ๐Ÿ“ˆ
  • ssthresh <SSTHRESH> โ€” the SSTHRESH metric value ๐Ÿ”ฅ
  • tw_ts <TSVAL>/<SEC>sec ago โ€” the recent TSVAL and how many seconds have passed since it got saved into a TIME-WAIT socket ๐Ÿงš

๐Ÿ—‘๏ธ ip tcp_metrics delete - delete single entry

  • address ADDRESS (default) โ€” the IPv4/IPv6 address ๐Ÿ’– this one is required, no skipping it bestie ๐Ÿ™…โ€โ™€๏ธ

๐ŸŒŠ ip tcp_metrics flush - flush entries

this command flushes the entries that match some criteria you pick ๐Ÿงน

it takes the same arguments as show โœจ


๐Ÿ“š EXAMPLES

ip tcp_metrics show address 192.168.0.0/24

shows the entries for destinations from that subnet ๐Ÿ‘€

ip tcp_metrics show 192.168.0.0/24

same thing, but the address keyword is optional so you can skip it ๐Ÿ’…

ip tcp_metrics

showing everything is the default action, iconic ๐Ÿ‘‘

ip tcp_metrics delete 192.168.0.1

removes the entry for 192.168.0.1 from the cache ๐Ÿ—‘๏ธ

ip tcp_metrics flush 192.168.0.0/24

removes the entries for destinations from that subnet ๐Ÿงน

ip tcp_metrics flush all

removes all the entries from the cache ๐Ÿ’€

ip -6 tcp_metrics flush all

removes all the IPv6 entries from the cache but keeps the IPv4 entries safe ๐Ÿซถ

๐Ÿ”— SEE ALSO

ip(8) ๐Ÿ’œ

๐Ÿซถ AUTHOR

Original Manpage by Julian Anastasov <ja@ssi.bg> ๐ŸŒท


that's the whole tea, bestie ๐Ÿฆ‹ this page came from iproute2, dated 23 Aug 2012, and it's still giving ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from