Fetching the TCP RTT in Linux

后端 未结 3 1040
眼角桃花
眼角桃花 2021-01-01 00:30

I need to fetch the RTT for TCP flow. I have looked into the proc file system but not able to get the RTT value of TCP .If any one having any idea regarding it that, in whic

3条回答
  •  轮回少年
    2021-01-01 01:18

    Maybe the ss (socket statistics) util available in the iproute utils 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 want more information what the rtt field is i think it is best to take a look at ss.c.

提交回复
热议问题