Saturday, August 12, 2006

Why loopback having so long range?

I talked about this issue with a friend today. It is an interesting topic, though most professionals usually never think about it.

I actually answered the exact same question a few years ago, at Experts-Exchange. I just re-post the original question and my answer as follows. Loopback's Wikipedia article also explains this a bit.

Question asked by xqzme_plz - Date: 12/03/2003 06:54PM EST

I have a question in mind hope anybody will answer. The question is why Loopback testing is being assigned a big range of IP addresses 127.x.y.z? As we can do this testing with the single IP address then what could be the reason to assign this big range?

Comment from bbao - Date: 12/03/2003 09:26PM EST

Good question. Quoted from RFC 1166:

"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."

As for the reasons of why use a class A network number, IMO, 3 reasons:

1. Historical limitation
2. Easy implementation
3. Reserved for future use

Hope it helps,
bbao

Accepted Answer from bbao - Date: 12/05/2003 03:42AM EST

Hi, let me try explaining more for my first post. Again, as I said it is IMO, which means, it is my personal viewpoint:

1. Historical limitation: There was NO mask in the first implementation of TCP/IP, which meant, network nodes used the first number to distinguish network size and host ID. Moreover, since class A is determined by its first octet, the higher-order bit is 0, so 127.x.x.x (01111111.x.x.x) is the latest segment of class A addresses. People often use all zero or all one numbers for special usages, reserving a class A segment is for maximum flexibility. Hmm, so we can not see a class B loopback segment nowadays, hehe. ;-)

2. Easy implementation: As what I said above, there was no mask concept in early days, segment address 01111111.00000000.00000000.00000000 was easy to be determined by AND/XOR operations quickly and easily. Even nowadays, such pattern is still easy for matching subnets by applying XOR operation.

3. Reserved for future use: Class A has 1,677,216 hosts, so it allows people have more space to divide it into a lot of reasonable zones for specific usages, different devices, systems and applications.

4. Another reason: Maybe those people used TCP/IP early never thought that TCP/IP based network could span all over the world, and the addressing space would be so limited for today's applications. Hmm, it sounds that this point should be one of historical limitations too. :)

Hope it helps,
bbao

No comments: