A Comparitive Introduction to IPv6
DiggBlinkRedditDeliciousTechnorati
article by Nakata
If you aren't familiar with what IPv6 is, I suggest you visit http://en.wikipedia.org/wiki/IPv6 for a brief overview. Since this documentation is as cryptic as it is accurate in many areas, I'd like to go over a few key principles of IPv6 from the perspective of somebody experienced with IPv4.
* Bitmasks
IPv6 uses bitmasks in preference to netmasks, or exclusive of netmasks entirely. The differences between a netmask and a bitmask are rather technical, so please consider the following very carefully.
Much like IPv4 netmasks, IPv6 bitmasks have common increments. Many applications which support IPv6 addressing have a need for providing a scope, (such as for an ACL,) and some of these (unfortunately) use the old IPv4 netmask system. Why is this a "bad thing" for IPv6? Consider the below examples, both using netmasks.
address: 192.168.10.15
netmask: 255.255.255.0
address: 2001:480:1f00:488:1::1
netmask: ffff:ffff:ffff:ffff:ffff::
And the same examples using bitmasks:
address: 192.168.10.15
bitmask: 24
address: 2001:470:1f00:488:1::1
bitmask: 80
Quite simply, stating a bitmask of "80" is shorter, and easier to read.
The math of this is (also) rather easy:
IPv4 Address: 32-bits
255 . 255 . 255 . 255
`--' `--' `--' `--'
Each quad is exactly 8-bits in size. Added together, this constitutes a single 32-bit IPv4 address.
IPv6 Address: 128-bits
2001 : 0470 : 1f00 : 0488 : 0001 : 0000 : 0000 : 0001
`--' `--' `--' `--' `--' `--' `--' `--'
Same arrangement, but in the above example each set of four is exactly 16-bits in size.
Using a program such as IPRoute2 for manual interface and routing meddling in Linux will allow you to use these simpler bitmasks in both IPv6 and IPv4 scenarios, which you may find preferable to other methods.
The smallest bit-border I suggest ever using under any circumstances outside of play would be 8-bits, or two hexadecimal characters in an address.
* IP Compression
By now, I suppose you're wondering why the address is so long. The reason for this is IP Compression. This means that an address can have no more than one segment (of any length) omitted from specification, and it will be filled in with a zero value. IPv6 uses this almost exclusive of uncompressed addresses, but many IPv4 applications seem to lack the support for this system, despite IPv4 supporting this exact implementation:
# ping 127.1
PING 127.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.040 ms
As you can see, the IP is expanded, likely by the C library upon a gethostbyname or getaddrinfo call.
* Autoconf
With IPv4 the standard for IP configuration tends to be DHCP. IPv6 has a similar mechanism integrated into the protocol itself, which allows for automatic configuration of a client. IPv6 autoconf uses a strange series of rules and algorithms to extrapolate an IPv6 suffix from the respective interface's MAC address on the affected client system, and by combining this with the advertised IPv6 network prefix, concludes and assigns the resultant address to the interface in question.
Indeed, this requires an IPv6 router within a single hop of the client node, which is actively sending "router advertisements" to provide this information to the client. If your system is connected to the internet directly, such as via a cable modem or DSL, you may have IPv6 connectivity working already without you even knowing it. If you are using a Windows-family operating system, simply installing the IPv6 stack (if not present) may enable IPv6 connectivity for you.
For the rest of us, IPv6 autoconf serves little purpose within the topic of border-gate connectivity, and the only practical and available method is static addressing.
Now you know the basics. Perhaps now you might care to set IPv6 connectivity up on your own network? See the other articles I have written in the Linux section for simple connection instructions (with explanation) for Debian Linux.
If you are a programmer or scripter, see the appropriate sections for information on developing IPv6-capable applications, or adapting your existing applications.