Getting TCP RTT on Linux

I need to get RTT for a TCP stream. I looked at the proc file system but could not get the RTT value for TCP. If anyone has any idea on this in which the RTT file will be stored, pleae share.

Thanks in advance.

+4
source share
2 answers

Maybe ss (socket statistics) available in iproute utilities can help you with this.

 # ss -i 'src 1.1.1.1:1234 and dst 2.2.2.2:1234' State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 1.1.1.1:1234 2.2.2.2:1234 reno wscale:2,7 rto:3380 rtt:855/602.5 ato:40 ssthresh:2 send 27.3Kbps rcv_space:5840 

If you need more information on the rtt field, I think that it is best to take a look at ss.c.

+7
source

You can do this with tcpprobe (inserts a hook into the tcp_recv processing path with kprobe and writes the status of the TCP connection in response to incoming packets).

Clarification here: Extract TCP rounding time estimates (RTT) on Linux

+1
source

Source: https://habr.com/ru/post/1241063/


All Articles