This configuration was built using CentOS 6.5. Sometimes I am unable to test network latency because ICMP is blocked. Under those circumstances Hping2, is useful because it uses TCP to measure network latency. However, one capability that hping lacks is a time stamp associated with each measurement. Using BASH scripting we are able to add a time stamp.
STEP 1. Install hping2
yum install hping2
STEP 2. create script which adds a time stamp to each measurement
while true; do \ hping2 www.google.com -S -p 443 -i 1 -c 1 | grep "len=" \ | sed -e "s/^/`date` /g"; \ sleep 1; \ done
--- www.google.com hping statistic --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 15.9/15.9/15.9 ms Mon Mar 9 07:08:15 CDT 2015 len=46 ip=18.104.22.168 ttl=50 id=50666 sport=443 flags=SA seq=0 win=42900 rtt=15.9 ms --- www.google.com hping statistic --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 18.5/18.5/18.5 ms Mon Mar 9 07:08:16 CDT 2015 len=46 ip=22.214.171.124 ttl=50 id=1590 sport=443 flags=SA seq=0 win=42900 rtt=18.5 ms