I'm using NPing (NMap's pinging tool) to measure latency on specific servers that may not respond to ICMP. Also, servers do not usually run HTTP(S) and I only check latency on a specific TCP port related to the game counter-strike.
I always try ICMP, TCP, and TCP-Connect and I perform them separately. My method is:
- Try ICMP (
nping --icmp dstip -p dstport
) - Then, try TCP (
nping --tcp dstip -p dstport
) - Then, try TCP-CONNECT (
nping --tcp-connect dstip -p dstport
). - Get the lowest latency from all of them.
In my intuition, expected behavior should be
ICMP latency >= TCP-Connect latency >= TCP latency
What actually happens is that
ICMP latency >= TCP latency >>> TCP-Connect latency
(where >>> stands for "a lot greater")
To give you an idea, in one server ICMP yields a timeout, TCP gets around 180ms
, and TCP-Connect only gives around 3ms
.
Any ideas on why this could happen?
EDIT1:
The tcptraceroute
tool also gives me 3ms
. Both are very close and connect via an IXP. See below:
~$ sudo tcptraceroute dstip dstport
Selected device ens3, address 172.16.1.6, port 58803 for outgoing packets
Tracing the path to dstip on TCP port dstport, 30 hops max
1 my_localip (172.16.1.6) 0.139 ms 0.131 ms 0.155 ms
2 my_isp_globalip 0.288 ms 0.233 ms 0.264 ms
3 my_isp_bordergw 1.855 ms 0.311 ms 0.257 ms
4 IXP_router_name (IXP_router_ip) 0.570 ms 0.420 ms 0.482 ms
5 dst_bordergw 2.820 ms 2.967 ms 3.145 ms
6 dst_internalrouter 2.736 ms 3.665 ms 2.331 ms
7 dstname (dstip) [open] 3.095 ms 3.088 ms 3.145 ms
Still... Why would NPing's TCP mode give such a long delay?
EDIT2:
According to tcpdump
, in TCP mode, TCP Syn response comes in around 3 to 6ms
. So why would NPing inform me a 180ms
latency?