Why is so large a range of IPv4 addresses assigned to localhost, ( through

  • 9
    Just my two cents. I've found having more than a single loopback address useful. You can bind services to any address in On one occaision, I was testing/comparing different builds of our server code. Unfortunately, the proprietary client I had to test with, had no facility for connecting to a different port. Our server code, though, could bind() to specific addresses. I was able to start different instances/versions to different loopback IPs. Ie, first one bound to, next to, and
    – etherfish
    Jan 21 '14 at 17:54
  • 3
    It looks like a bad choice from a time IPv4 address was not a scarce resource.
    – Everton
    Jan 4 '16 at 13:44

It comes from RFC 990, pg 5, under "Special Addresses":

The class A network number 127 is assigned the "loopback" function, that is, a datagram sent by a higher level protocol to a network 127 address should loop back inside the host. No datagram "sent" to a network 127 address should ever appear on any network anywhere.

At the time (1986), the internet was completely classful and nobody really gave much thought to allocating this much space to the loopback address. Thus, the loopback got an entire Class A network.

  • 2
    By RFC 990 it seems the the concept of classes B and C had existed for some time. Is there any information out there on why loopback got a class A rather than a class B or C. Oct 24 '16 at 23:14
  • 2
    @PeterGreen while not a definitive answer, note this: in RFC776 (January 1981), no mention of 127., nor classes A/B/C but in the next one, RFC790 (September 1981), classes appear and note that B and C classes are empty then (no real allocations yet). I suppose the idea was 2 points: at that time not all hosts were updated to understand classes B and C (different routing than for A), so it was better to stick with the only existing one at that time, A, that had already some assignments, and just use the last spot (127.) in the A block, in order to leave room for the future... Jun 28 '18 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.