Hacker News new | ask | show | jobs
by svet_0 1252 days ago
On Windows DNS/UDP/WiFi to 8.8.8.8 with query=www.google.com is 3-4ms

TCP is around ~10ms including overhead, 3ms excluding.

TLS is ~100ms including overhead, 5ms excluding.

1.1.1.1:

udp - 5ms

tcp - 15ms / 10ms

tls - 70ms / 4ms

Use a sniffer (e.g. wireshark) to get a better idea for timing, I wouldn't count on dig for that.

1 comments

That's why I think it may be a problem on Macs, because I don't see the same issue on Linux either. I am not familiar with Wireshark. What should I be looking for? I tried but there's a lot of information for each packet.
Filter by "ip.addr == 1.1.1.1" and look at the "Time" column. With UDP you'll see 2 datagrams - request and response. TCP you'll see a SYN,SYNACK,ACK handshake and then 2 segments. TLS you'll see a longer handshake and then (encrypted) request and response (2 segments).
Wow now I am even more confused. The Time column shows 3.67 for UDP and 7.32 for TCP. This seems to suggest that UDP is faster, but dig commands show the opposite. Why is that?