Domanda

It's easy to map IPv4 addresses to their controlling RIR (ARIN, RIPE, etc.) since v4 addresses are handed out by IANA in blocks of /8 . I can write a function that takes an arbitrary IPv4 address and figures out the proper RIR simply by examining the first eight bits of that address.

According to http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.txt though, global unicast IPv6 addresses are being handed out in blocks of different sizes. I can't see any rhyme or reason for why these blocks have been allocated in the sizes they have. This might make it a chore to write an IPv6 version of the above function.

Is there an easy way to tell which (global unicast) IPv6 address belongs to which RIR? Or will I have to iterate over all assigned netblocks and see if my address is covered by one of them?

thanks!

È stato utile?

Soluzione

The only way is to match with the list you mentionned: parse the list and match your address with the entries. There should be exactly one entry which matches; this is your result.

Why the blocks have different sizes? Well, I think that has historical reasons. First, only 2001: addresses were handed out; the block sizes assigned was probably die to varying needs of the customers. Soon, they noticed that a /23 is too small. Eventually (at around 2006), they assigned a /12 to every RIR which now must look how to get along with that. That should last for a while; if they all are used, new blocks will be assigned.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top