Running out of IP addresses?

by admin in Blog

At some point the world is going to run out of IP addresses.

At some point the world is going to run out of IP addresses. Depending who you believe, this could happen as soon as next year, or it could take a little longer.There's already a solution, known as IPV6 (the existing one is IPV4). http://en.wikipedia.org/wiki/IPV6 tells you more.

As an e107 user, you're unlikely to see much difference, except that IP addresses won't always be in the familiar 192.168.54.34 format - they'll be much longer! In the worst case they could look like this:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

but can typically be shortened a bit:

2001:db8:85a3::8a2e:370:7334

An address of the form ::ffff:0c22:384e is an IPV4 address mapped to IPV6 notation.

The most obvious effect of this on users is that IP addresses are going to be much longer than previously, which could mess up display (and, initially, maybe cause confusion). On 0.7 many of the storage spaces aren't big enough to hold a full IPV6 address, which could lead to partial addresses being stored.

0.8 is, of course, IPV6 ready - all core (and core plugin) database fields have been sized to hold a complete IPV6 address.

From the programmer's or themer's perspective, there are a few points to bear in mind:
  • Displayed strings will obviously be longer, so page layouts may need to be adjusted to take account of this.
  • Database fields may need to be extended - the 'new' requirement is 45 characters. IP addresses are stored in a 'normalised' form as per this example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 While the colons are not, strictly, necessary, they do assist with readability. (Its necessary to have a standard storage form to facilitate comparisons. IPV4 addresses are stored in their IPV6 format).
  • When reading the current IP address, $e107->getip() already returns it in normalised form. (and you can use $e107->ipEncode() to format other IP addresses).
  • IP addresses should be passed through the $e107->ipDecode() routine prior to display - this converts it into a minimum length string, and returns IPV4-format addresses where appropriate.


At this stage few people have access to systems using IPV6 for real (I certainly don't) so there's no real test platform yet. No doubt there will be a few things to tweak as IPV6 catches on - at least e107 is ready.


Social Links