# There is a number of diagnostic utilities for IP networks, mostly # based on the ICMP protocol. The most basic of those is ‹ping›, # which asks another computer whether it's alive. The packets it # sends are ICMP echo request, and the target host is supposed to # send an ICMP echo reply back. # Given no switches, ping will send a packet every second or so, # forever. But we don't have that much time, so we request it only # sends 5 and then stops, like this: ping -c 5 1.1.1.1 # The ‹1.1.1.1› above is an IP address. This one is particularly # easy to remember -- it's a recursive DNS server operated by # cloudflare. Notice the numbers that ping prints: those are # statistics about how long it took for the packet to get there and # back (rtt = round-trip time). Notice that it's only a few # milliseconds -- that means the server is not very far from us. # Magic is involved (and IP addresses that belong to different # computers depending on where you are) # Anyway, to prevent Google getting jealous, let's also ping their # recursive DNS server, which lives at the address 8.8.8.8 (not as # flashy as the cloudflare one, but not bad either): ping -c 5 8.8.8.8 # Let's just round it off with my favourite public recursive # resolver, ran by Level3, living at the address 4.2.2.2 (I don't # actually recommend using it for DNS... I just like to ping it): ping -c 5 4.2.2.2 # That's it for ping (with IP addresses), let's look at ‹traceroute› # now, which is a little more interesting. The script lives in # ‹traceroute.sh›.