Hi! ---- Before I start writing one myself... ... did anyone ever wrote a tool to measure the latency of a ssh connection, a la "ping" ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;)
That gets...really complicated... Because what exactly do you want to measure? Time to approx. beginning of the authentication exchange? Time to get authenticated? Time to get a command executed (echo hello? what shell?) ... anyway SmokePing has an SSH probe implemented by running ssh-keyscan and measuring the time taken, this gets (as I understand it) you time to roughly the beginning of authentication. https://oss.oetiker.ch/smokeping/probe/SSH.en.html On Thu, Jul 27, 2023 at 3:23?PM Roland Mainz <roland.mainz at nrubsig.org> wrote:> > Hi! > > ---- > > Before I start writing one myself... > ... did anyone ever wrote a tool to measure the latency of a ssh > connection, a la "ping" ? > > ---- > > Bye, > Roland > -- > __ . . __ > (o.\ \/ /.o) roland.mainz at nrubsig.org > \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer > /O /==\ O\ TEL +49 641 3992797 > (;O/ \/ \O;) > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev-- "Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds." -- Samuel Butler
Take a look at the metrics option in HPN-SSH. It does not, specifically, do a ping but it can get you a lot of information about what is happening in the TCP stack if that might help. It might be too microlevel for what you are looking to do though. Essentially, it gives you a periodic dump of the TCP_INFO struct (in Linux and BSD) on both sides of the connection. That doesn't give you latency metrics in and of itself though. The metrics option could probably be extended to get the send/recv times of the SSH_MSGs it sends out but, of course, that comes with the overhead of processing and I'm not sure how much latency that, in and of itself, would add. Anyway, source code is at https://github.com/rapier/openssh-portable. More information at https://psc.edu/hpn-ssh-home including ppas for rpms and debs. Chris On 7/27/23 5:14 PM, Roland Mainz wrote:> Hi! > > ---- > > Before I start writing one myself... > ... did anyone ever wrote a tool to measure the latency of a ssh > connection, a la "ping" ? > > ---- > > Bye, > Roland
Okay, so let me amend that. The metrics option does have RTT values in it. That's pretty close to what you'd get from a ping but I'm being overly pedantic because it's not a userspace measurement. So the answer is, sort of? On 7/27/23 5:14 PM, Roland Mainz wrote:> Hi! > > ---- > > Before I start writing one myself... > ... did anyone ever wrote a tool to measure the latency of a ssh > connection, a la "ping" ? > > ---- > > Bye, > Roland
Also, keep in mind that point uses ICMP which often uses a slow path through network hardware. So a ping implemented in SSH will likely be interacting with the hardware differently. While the two values will largely correspond there will be enough difference to cause comparisons between the two to have larger error bars than you might like. By the way, I'm assuming you're doing this to get latency overhead associated with ssh packet processing. If not can you even on what you'd like to find out? On 7/27/23 5:14 PM, Roland Mainz wrote:> Hi! > > ---- > > Before I start writing one myself... > ... did anyone ever wrote a tool to measure the latency of a ssh > connection, a la "ping" ? > > ---- > > Bye, > Roland