• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H19-Mar-2018-54

doc/H19-Mar-2018-205148

ext/H19-Mar-2018-2,8321,141

src/H19-Mar-2018-795658

LICENSEH A D19-Mar-20181.1 KiB2317

MakefileH A D19-Mar-2018580 2313

README.mdH A D19-Mar-20183.9 KiB12091

README.md

1# sshping
2ssh-based ping: measure character-echo latency and bandwidth for an interactive ssh session
3
4## Description
5
6Use this utility to test the performance of interactive ssh sessions
7or scp file transfers.  It uses ssh to log into a remote system, then
8runs two tests: the first test sends one character at a time, waiting
9for each character to be returned while it records the latency time
10for each.  The second test sends a dummy file over scp to /dev/null
11on the remote system.
12
13For the echo test, you may specify a character count limit (-c) or a test
14time limit (-t), and also the command (-e) used on the remote system that
15echoes characters back.
16
17For the speed test, you may specify the number of megabytes to send (-s)
18and the target location for the copies (-z).
19
20## Usage
21```
22Usage: sshping [options] [user@]addr[:port]
23
24  SSH-based ping that measures interactive character echo latency
25  and file transfer throughput.  Pronounced "shipping".
26
27Options:
28  -b  --bindaddr IP    Bind to this source address
29  -c  --count NCHARS   Number of characters to echo, default 1000
30  -d  --delimited      Use delimiters in big numbers, eg 1,234,567
31  -e  --echocmd CMD    Use CMD for echo command; default: cat > /dev/null
32  -h  --help           Print usage and exit
33  -i  --identity FILE  Identity file, ie ssh private keyfile
34  -p  --password PWD   Use password PWD (can be seen, use with care)
35  -r  --runtests e|s   Run tests e=echo s=speed; default es=both
36  -s  --size MB        For speed test, send/recv MB megabytes; default=8 MB
37  -t  --time SECS      Time limit for echo test
38  -T  --connect-time S Time limit for ssh connection; default 10 sec
39  -v  --verbose        Show more output, use twice for lots: -vv
40  -z  --remote FILE    Remote file for up/download tests;
41                           default=/tmp/sshping-PID.tmp
42```
43
44### Example
45
46```
47# bin/sshping -d cheyenne.example.com
48ssh-Login-Time:    1,733,748,227 nsec
49Minimum-Latency:         847,107 nsec
50Median-Latency:          996,029 nsec
51Average-Latency:         992,186 nsec
52Average-Deviation:        67,079 nsec
53Maximum-Latency:       1,289,470 nsec
54Echo-Count:                1,000 Bytes
55Upload-Size:           8,000,000 Bytes
56Upload-Rate:           4,732,718 Bytes/second
57Download-Size:         8,000,000 Bytes
58Download-Rate:         3,781,725 Bytes/second
59```
60
61## Building
62
63Install the libssh-dev (or libssh-devel) package, version 0.6 or later:
64
65    sudo apt-get instal libssh-dev
66      ...or
67    sudo yum install libssh-devel
68      ...or whatever works on your platform
69
70From the main directory (where this README.md file is located), run 'make':
71
72    cd sshping
73    make
74
75The resultant binary will be in the bin/ directory.  You may copy this to
76your system binary location, for example:
77
78    sudo cp bin/sshping /usr/local/bin/
79    sudo chown root.root /usr/local/bin/sshping
80    sudo chmod 555 /usr/local/bin/sshping
81
82To build the man pages, install the pod2man utility (you may already
83have it installed, it's often part of standard Perl). Then run 'make man'.
84The resulting uncompressed man page will be in the doc/ directory.
85You can view it from there (man doc/sshping.8) but normally it's placed
86in /usr/share/man/man8 in gzip'd format:
87
88    sudo cp doc/sshping.8 /usr/share/man/man8/
89    sudo gzip /usr/share/man/man8/sshping.8
90    sudo chown root.root /usr/share/man/man8/sshping.8.gz
91    sudo chmod 644 /usr/share/man/man8/sshping.8.gz
92
93That's it!
94
95### Building with CMake
96
97You can build this with CMake, which includes creating .deb
98or .rpm packages.  Here's how:
99
100First, install libssh as above.  It's a prerequisite.
101And of course you need CMake.
102Then from the main directory (where this README.md file is located):
103
104    mkdir build
105    cd build
106    cmake ..
107    make
108    make package
109
110You will find the binary `sshping` as well as the .deb and/or .rpm
111file in the current (build) directory.  Install those as you
112would any other package.
113
114Or you can directly install on the current system with:
115
116    sudo make install
117
118Enjoy!
119
120