IPv6 intro for IPv4 admin [closed]

TechNet has an interesting IPV6 page.


I wrote this up last year as an internal reference document when some of our engineers became confused when asked to put IPv6 addresses into DNS. I didn't address DNS specifically, but most of the concern seemed to be around the format of the addresses and not "getting" how they worked. Maybe it will be useful for others also:


So, the first thing to acknowledge is that IPv6 addrs look ugly. They do.

But I think that's just because we aren't used to dealing with them and we don't understand what they mean at a very low level as we do with IPv4 addresses. I think it will take a while to get comfortable with them but we have to start somewhere.

Another important thing to remember is that IPv4 addresses are 32 bit numbers and IPv6 addresses are 128 bit numbers. When a router routes or a firewall filters, they do it based on that number. How a human being chooses to display that number is totally arbitrary and is mostly just tradition. So this entire email explains how humans choose to represent these numbers - the machines don't care, it's all bits to them.

An IPv4 address is 32 bits, or four bytes. What we think of as a "real" ip addresses is just the method that has become standard for representing that bit string, seperating the bits into 4 8-bit groups, representing each 8 bits as a decimal number, and seperating those decimal numbers this a period. So, take the random IP address 172.30.154.249. When a router "thinks" about this IP address, it really thinks of it like this:

10101100000111101001101011111001

Which we can translate down into our own form:

10101100 = 172

00011110 = 30

10011010 = 154

11111001 = 249

Sometimes you might also see these written as a pure decimal number:

10101100000111101001101011111001 = 2,887,686,905

Hardly anyone uses this form on purpose(*), but it's a historically valid way to write an IPv4 address. In fact, this form is used in RFC821 which defined SMTP in 1982. If you wanted to manually route mail to a specific machine instead of using DNS, you could use two different types of literals. The first was the familiar "dotted quad" form in brackets ("user@[172.30.154.249]"). The second was using the decimal form of the IP prefixed with a pound sign ("user@#2887686905").

All of the above was just to provide a framework for translating your knowledge of how IPv4 addresses work to IPv6 addresses. Just as an IPv4 is a 32 bit number, IPv6 addresses are 128 bit numbers. ARIN assigned MY AWESOME COMPANY(**) the IP range 2311:FD67/32. For the sake of having an example to work with I'm going to use the IP 2311:FD67::AC1E:9AF9.

So, here's the bit string representing that ip6:

00100011000100011111110101100111000000000000000000000000000000000000000000000000000000000000000010101100000111101001101011111001

If we represented these bit strings the way we do IPv4 bit strings (convert each 1-byte chunk into decimal, seperate each with a period), we would get the following:

35.17.253.103.0.0.0.0.0.0.0.0.172.30.154.249

That has a couple of problems. The first is that it kind of looks like a funky IPv4 number, which isn't good, you want a solid way to differentiate between them. The other is that it's a lot of information, a lot of number, and a lot of blank space. So, both problems are solved by using a different seperator (colon(:) instead of period(.)) and by repesenting bytes in hexadecimal instead of decimal. Where IPv4 seperated 8-bit chunks, represented in decimal, with periods, IPv6 seperates 16-bit chunks, seperated with colons. So here's the breakdown of our IPv6 example IP:

0010001100010001 = 2311

1111110101100111 = FD67

0000000000000000 = 0

0000000000000000 = 0

0000000000000000 = 0

0000000000000000 = 0

1010110000011110 = AC1E

1001101011111001 = 9AF9



2311:FD67:0:0:0:0:AC1E:9AF9

This still has a lot of white space in it, so there's an allowance that the largest string of zeros can be ommitted and represented with a double colon. So, the above IP can be written:

2311:FD67::AC1E:9AF9

I haven't seen this a lot, but as I understand it there's also a neat convention to allow the last 32-bit to be written as a prefixed dotted-quad, allowing for easy recognition of legacy addresses as you migrate from IPv4 to IPv6. So, as you probably noticed my IPv6 example address ends with the same 32 bits that entirely comprises my IPv4 example. That is especially useful when you write in this style. In that case, my IPv6 addr would look like:

2311:FD67::172.30.145.249

To loop back around to where I started with IPv6, I mentioned that we had been assigned 2311:FD67/32. The /32 is a bit mask just like it is in IPv4 addresses. It means in essence that we have been statically assigned the first 32 of the 128 bits in an IPv4 address we could create. Since 2311:FD67 is 32 bits, that means every IP address we create from that range will start with that.

To put another way, just as 172.17/16 can be thought of as "every IP between 172.17.0.0 and 172.17.255.255", 2311:FD67/32 can be thought of as "every IP between 2311:FD67:0:0:0:0:0:0 and 2311:FD67:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF".

I think it will be a long time before we start migrating to IPv6 but I hope this explanation will help you feel more comfortable using them and referring to them.

Again, it's really important to understand the only thing I'm talking about here is literally how to write down an IPv6 address. There seems to be a lot of intelligence built into the numbering scheme for routing, etc, that I don't really have a grasp on yet, so all I can address right now is what it looks like =).

(*) I've seen the decimal IPv4 representation in some software debug before, but I'm almost positive it was a mistake or laziness, I think it was much esier in the C code to print the 32bit integer quickly than it was to format a dotted quad for printing.

(**) I munged my company name and the prefix


Check this out:

Hurricane Electric Free IPv6 Certification


The following links have been pretty informative (about IPv6):

  • http://www.personal.psu.edu/dvm105/blogs/ipv6/ (First person account on IPv6 - Blog)

  • http://www.tcpipguide.com/free/t_InternetProtocolVersion6IPv6IPNextGenerationIPng.htm

  • http://www.cisco.com/web/about/ac123/ac147/archived_issues/ipj_9-3/ipv6_internals.html

  • http://www.spirentcom.cn/download/Poster/ProtocolPoster_IPv6.pdf (a printable IPv6 poster)