Networking – Why is there more than one loopback IP address

iplocalhostloopbacknetworking

Most applications only need the one loopback IP address of 127.0.0.1. However, not only is the address block 127.0.0.1/32 provided, and even 127.0.0.0/24 is provided as well but in fact the whole range 127.0.0.0/8 is provided. Clearly, this is a totally and completely unconscionable waste of space as there is no purpose what so ever to having multiple loopback IP addresses. Or maybe not. Why is there more than one loopback IP address?

Best Answer

127/8 (shorthand for 127.0.0.0/8) is reserved by IANA.

Win95 supported 127.0.0.1 but not other 127/8 addresses. WinXP supported 127/8. Cisco IOS supports no loopback addresses by default, but does support the loopback concept, and addresses can be manually assigned. If a computer has no need for more than one loopback address, or zero of them, there's no reason it has to support all those addresses. But, since IANA has now reserved all of them for that purpose, there is no compelling reason for a TCP/IP stack to not support them.

For the most part, there's no compelling need for multiple addresses; I often use multiple loopback connections, but can do so simply by specifying different TCP ports. (I do it for SSH port forwarding. Other VPN software may also be a frequent user for such things, as Isaac Hanson referred to in his answer.) Whether you use different TCP ports on one address (there are 65,535 of them), or multiple IP addresses, makes little technical difference. (However, having unique addresses might be easier in some cases, like if you had multiple servers that could listen to the same "default" port number.)

totally and completely unconscionable waste of space

Ah, such strong language. Allow me to rile you up further :)

Actually, the much bigger waste of IPv4 addresses is 224/3, which contains 224/4 (minimally used for multicast) and 240/4 (almost entirely wasted, with just one address as the exception). So, don't think that we're almost out of IPv4 addresses. IANA has just been handing out the addresses from the former Class A, Class B, and Class C. But don't think for a minute that every last address has been used in the most effective way possible. To see some others: IETF BCP 153 (currently points to RFC 6890). The older RFC 5735 had much of the same information in a different format, e.g. section 4 on page 6. Poke around those, or some other standards, and I'm pretty sure you can find some other large amounts of addresses that are not being super-efficiently used/allocated.

It was decided that supporting some standards may be more desirable than helping IPv4 to limp along even more. One key reason for this may be that some people really were wanting to help push people towards IPv6 adoption.

Related Question