Measuring Latency on Debian Linux Clusters HOWTO
Network latency is the time it takes for a small packet to travel from a sender to a receiver and back (the round-trip time). Latency is partly due to the time the signal travels within the copper wires or the fiberoptics (close to the speed of light), although such is generally small (about 0.005 $\mu$s per meter of cable). A more significant source of latency is the encoding of the packets (around 20 $\mu$s for RJ45 encoding and less for SFP+ encoding). A third source of latency is not related to the network itself but to the bus and IP stack — such can amount to as much as 20$\mu$s of waiting time. Low latency — more so than high network bandwith — leads to better parallelization efficiency of CFDWARP. Total latency (network, encoding, bus, etc) between two hosts on your cluster can be measured through netperf (accurately) or ping (approximately).
 Netperf
Clone the latest netperf source from Hewlett-Packard on github:
git clone https://github.com/HewlettPackard/netperf
Within the netperf directory, do the following to generate the Makefiles:
./autogen.sh
./configure
Then, compile netperf:
make
This will create the netperf and netserver executables within netperf/src. On the receiving machine (192.168.1.101), start the network server:
./netserver
On the sending machine (192.168.1.100), run the program netperf as follows:
./netperf -H 192.168.1.101 -l 10 -t TCP_RR -w 10ms -b 1 -v 2 -- -O min_latency,mean_latency,max_latency,stddev_latency,transaction_rate
where TCP_RR can be substituted for UDP_RR. Note that netperf gives an accurate reading of the latency even when the network is under load.
 08.24.20
 Ping
Another way to find the latency is using the ping utility using root access. Type the following to send packets every 10 ms:
sudo ping 192.168.1.101 -c 1000 -i 0.010
Note that ping will not give an accurate reading of the latency especially when the network is under load.
 $\pi$