Monday, September 8, 2008

My jouney with IPv6

IPv6 is cool. Very cool. Way cooler than IPv4. There are some shortcomings but none that serious past that VERY LONG ADDRESS which, I admit, is there for a reason. Last week I had intended on configuring a 6to4 network at the condo with the end goal to have my behind-the-NAT-firewall devices addressable on the IPv6 Internet even though they remain uncontactable behind the NAT device on the IPv4 Internet. It worked and took all of three minutes to configure. Apple, in this case, makes things far too easy.

At the condo I use an Apple Airport Extreme as my Internet router. It works well and I have no complaints. The Airport Extreme, like all the other Apple routers, do 6to4 addressing automatically, and that's a nice touch. Just what is 6to4? As the name implies it converts IPv4 addresses (sort-of) into IPv6 addresses.

What it really does is it takes any routable IPv4 address and creates a network in the IPv6 space of 2002::/16. This is a special space and there are routers on the Internet that listen for routes destined for networks within this range. The 6to4 gateway routers takes packets destined for your IPv4 network and snaps the IPv6 packets into the IPv4 packets. Your home router then receives the IPv4 snap packet which it disassembles and routes to the device with the destination matching the address in the packet. Very simple and elegant. Transmissions from your machine and network work the same way, only in reverse. It is a fantastically elegant way to make IPv6 hosts addressable to IPv4 networks.

What about address overlap? There isn't any. And this is where you head will explode when you try to wrap your mind around the size of the IPv6 address space. One single routed IPv4 address will translate into an IPv6 network with prefix length of 48 bits, a network length of 16 bits (just in case you want to run a couple million hosts behind your single IPv4 address) and 64 bits just for the device address (which turns out to be the hexadecimal equivalent of your NIC MAC address.) Nice. Easy. Elegant. For the record, for each IPv4 address we're talking about an address space of 65,536 networks, each with up to 18,446,744,073,709,551,616 hosts. Yeah, IPv6 has a large address space and remember, ALL THE IPv4 ADDRESSES all fit inside the 2002::/16 network range each capable of that many networks and hosts. Sweet.

I've got my network working but what to do with it now? I suppose I can run services to the IPv6 Internet. What will NOT work is IPv4 ONLY devices being able to contact my IPv6 hosts. For that the end host would have to run IPv6 either under and assigned network range or via 6to4.

So go forth all! Join the geekery and let's get those 6to4 networks turned up! Even if you still block incoming IPv6 packets directly to your end host at least you can allow your devices to communicate with other IPv6 devices on the Internet.

1 comment:

Tanner Lovelace said...

How do you get IPv6 addresses? Would this work, say, as sort of a VPN where both your laptop and home network have IPv6 addresses and you could connect to them while the laptop is elsewhere?