Another reserved IP address is 127.0.0.1. This address refers to the local machine, so a packet sent to 127.0.0.1 is delivered directly to the IP program on the sending machine itself.
This is illustrated by the following tracert command to 127.0.0.1
|
There were no hops through routers since the client and server software were both running on the same machine.
Similarly, we can ping 127.0.0.1:
|
Four 32-byte packets were delivered to the Ping server at 127.0.0.1. The time to deliver the packets and receive an acknowledgment from the Ping server was less than 1 millisecond because it was on the same machine. The time to live was still at the initial value of 128 when the packet arrived because it did not go through any intervening routers.
This loopback capability is important to developers. For example, a Web developer will typically keep an exact copy (a mirror) of his or her live Web site on a development machine. If the development machine is running a Web server as well as a Web client, the developer can test changes made on the local machine using http://127.0.0.1 as a URL. This will retrieve the home page from the local copy of the Web site.
Finally, if you have trouble remembering "127.0.0.1" you can use the key word localhost instead. So, for example, I could have replaced the ping and tracert commands shown above with:
Or, I could retrieve the home page from the Web server running on my machine using the URL: