
A MORE COMPLEX NETWORK 87
To use it, open up the command-line application on your
computer (Terminal on Mac OS X, the Command Prompt
on Windows, and xterm or similar on Linux/Unix). On Mac
OS X or Linux, type the following:
ping -c 10 127.0.0.1
On Windows, type this:
ping -n 10 127.0.0.1
This sends a message to address 127.0.0.1 and waits for a
reply. Every time it gets a reply, it tells you how long it took,
like this:
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.166 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.157 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.182 ms
After counting ten packets (that’s what the –c 10 on Mac
and -n 10 on Windows means), it stops and gives you a
summary like this:
--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.143/0.164/0.206/0.015 ms
It gives you a good picture not only of how many packets
got through, but also how long they took. It’s a useful
way to learn quickly if a given device on the Internet is
reachable or not, and how reliable the network is between
you and that device. Later on, you’ll be using devices that
have no physical interface that you can see activity on, so
you’ll need ping to know whether they’re working or not.
NOTE: 127.0.0.1 is a special address called the loopback address
or localhost address. Whenever you use it, the computer you’re ...