TCP_INFO

A mechanism in the Linux kernel for accessing information about a TCP socket. It has been supported since Linux 2.4.

The interface uses the getsockopt() system call with the TCP_INFO option on a TCP socket. The system will then fill in a caller-provided struct tcp_info. The structure is defined in /usr/include/netinet/tcp.h.

Application Support

ss

The ss program can be used with the -i or --info option to look at this information for active sockets.

This example shows a single active TCP socket, which represents the sending end of an ongoing Iperf TCP test:

State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
ESTAB      0      2796088         10.0.0.247:36868           10.0.0.248:5001
         cubic wscale:7,7 rto:204 rtt:7.5/3 mss:1448 cwnd:414 ssthresh:388 send 639.4Mbps unacked:401 retrans:0/772 reordering:127 rcv_space:29200

(Note: In my tests, the send rate displayed by ss was always about 50% lower than what iperf reported.)

The socket on the receiving side looks like this:

State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
ESTAB      0      0              10.0.0.248:5001            10.0.0.247:36868
         cubic wscale:7,7 rto:204 rtt:4/2 ato:40 mss:1448 cwnd:10 send 29.0Mbps rcv_rtt:7.5 rcv_space:1826680

iperf

Recent versions of iperf can use TCP_INFO to extract detailed statistics from an ongoing TCP measurement.

References

-- SimonLeinen - 2014-12-26

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2014-12-27 - SimonLeinen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2004-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.