A nearby question has brought to my attention the ss utility on Linux, another utility to investigate sockets.

It would appear that it may be a great tool to monitor the performance of, say, an ssh session over a portable mobile hotspot, where using ping would be fruitless.

# sh -c 'date; while(true); do echo -n `date +%H%M%S`" "; ss -i |fgrep -A1 :ssh |fgrep rtt |cut -d" " -f3- ;sleep 10;done'
Tue Feb 11 09:16:08 PST 2014
091608 wscale:2,7 rto:603.333 rtt:230.833/93.333 ato:63.333 cwnd:9 ssthresh:6 send 436.7Kbps rcv_rtt:104953 rcv_space:779096
091618 wscale:2,7 rto:626.666 rtt:228.75/100 ato:63.333 cwnd:9 ssthresh:6 send 440.7Kbps rcv_rtt:104953 rcv_space:779096
091628 wscale:2,7 rto:676.666 rtt:244.166/105.833 ato:63.333 cwnd:5 ssthresh:6 send 229.4Kbps rcv_rtt:104953 rcv_space:779096
091638 wscale:2,7 rto:663.333 rtt:232.5/103.333 ato:63.333 cwnd:6 ssthresh:6 send 289.0Kbps rcv_rtt:104953 rcv_space:779096
091648 wscale:2,7 rto:643.333 rtt:226.666/89.166 ato:63.333 cwnd:6 ssthresh:6 send 296.5Kbps rcv_rtt:104953 rcv_space:779096
091658 wscale:2,7 rto:736.666 rtt:249.166/122.5 ato:40 cwnd:6 ssthresh:6 send 269.7Kbps rcv_rtt:104953 rcv_space:779096
091708 wscale:2,7 rto:693.333 rtt:232.083/106.666 ato:40 cwnd:7 ssthresh:6 send 337.8Kbps rcv_rtt:104953 rcv_space:779096
091718 wscale:2,7 rto:683.333 rtt:228.75/86.666 ato:40 cwnd:7 ssthresh:6 send 342.7Kbps rcv_rtt:104953 rcv_space:779096
091728 wscale:2,7 rto:680 rtt:242.916/110 ato:40 cwnd:8 ssthresh:6 send 368.9Kbps rcv_rtt:104953 rcv_space:779096
091738 wscale:2,7 rto:503.333 rtt:183.333/12.5 ato:40 cwnd:40 ssthresh:9 send 2.4Mbps rcv_rtt:104953 rcv_space:779096
091748 wscale:2,7 rto:823.333 rtt:269.583/80 ato:43.333 cwnd:40 ssthresh:45 send 1.7Mbps rcv_rtt:104953 rcv_space:779096

My understanding is that rtt is probably the most interesting parameter here.

Is there a way to monitor these parameters through some kind of non-pull-based API, or get even more info about the doings of an individual connection?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.