IPv6 Addressing

We are in the midst of a large-scale change on the Internet. For many years now, many of us have worked to come to grips with the subtleties of IP addressing, subnetting, and more. Meanwhile, IP address space has approached exhaustion much sooner than anyone anticipated. When software and operating systems get outdated, what do we do? We upgrade them. The same goes for protocols that begin to show the signs of age and not being able to serve what is needed for the times. Classless IPv4 has helped, but it’s not enough. IP has now been upgraded to version 6—also called IP next generation (IPng)—and the great migration has begun.

Introduction to IPv6 Addressing

IP v6 is not built upon the building blocks of IP v4. Instead, it’s an entirely new mechanism for IP network addressing. Addresses are now 128 bits long rather than 32. This gives us a lot more room for individual hosts. There is also no broadcast address anymore in IP v6. Instead, you have a choice between unicast, multicast, or anycast. This last option allows for having more than one interface assigned the same IP address and sends the data meant for that address to the closest of these interfaces. The ability to assign more than one address to an interface also is built into IP v6.

IPng addresses are not displayed in IP v4 format. Instead, they’re broken into eight parts. Each part contains two bytes—or sixteen bits—separated by a colon.Therefore, bit-wise they look pretty ominous: xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx:xxxx xxxxxxxxxxxx:xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx, where “x” stands for one bit. Byte-wise, it isn’t as overwhelming: bb:bb:bb:bb:bb:bb:bb:bb, where “b” stands for one byte.

To complicate things even further, IP v6 addressing isn’t typically discussed in terms of bits and bytes. IP v6 addresses are written in hexadecimal—base 16, compared to a bit’s base 2 and decimal’s base 10. A single byte is equivalent to one hexadecimal pair, so what we end up with is something that looks more like the following in terms of placeholders: HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH, where H is one half of a hex pair.

Because the world of IP v6 is so different from IP v4, let’s take a moment to go over some of the basics that we didn’t need to look at for IP v4. These issues revolve around special numbers, what types of addresses all interfaces have to have, and how to recognize different address types. This chapter will not get into the many shortcuts for how to write IP v6 addresses, however. See RFC 2373 for more information on this front.

There are a few special host addresses in IP v6 just as there are in IP v4. One of these is the loopback address, 0:0:0:0:0:0:0:1, which is equivalent to IP v4’s 127.0.0.1—you also can write the IP v6 loopback address using a shorthand technique as ::1. Another is the unspecified address, 0:0:0:0:0:0:0:0, which is utilized when no address has been given yet.

There are, however, special IP v6 addresses for broader use. There are prefixes that mark addresses of note, which are called Format Prefixes. Many of these are reserved but don’t yet have a specific function—see section 2.4 in RFC 2373 for that set. Table 4.9 lists those that have already been assigned a meaning.

Table 4.9. IPv6 Reserved Prefixes That Have an Assigned Purpose
Decimal Prefix Hexadecimal Prefix Reserved Purpose
00000000 00 Not used.
00000010 02 For use by the Network Service Access Point (NSAP)—if you’re interested in learning more about NSAP, see RFC 1706.
00000100 04 For use by Internet Package eXchange (IPX), a Novell networking protocol.
00100000 40 For use by the new Unicast aggregation features available in IP v6—see RFC 2374.
11111110 10 FE8+ For local use by linking items such as routers.
11111110 11 FEC+ For local use within a site.
11111111 FF For multicast addressing.

Introduction to Hexadecimal Math

Notice that they have been given both binary and hexadecimal (hex) values in Table 4.9. Let’s see how to get between these two bases because you’ll require a solid foundation in this to work with IP v6. The things to remember when dealing with hex are

  • Hexadecimal math is base 16, as compared to binary’s base 2 and decimal’s base 10.

  • The digits you have available in hex are 0-9 and then A-F, as compared to binary’s choices of only 0 or 1, and decimal’s 0 through 9.

  • In our case, it’s easiest to think of a hexidecimal value as four bits, or half a byte.

  • Hexadecimal values aren’t typically discussed in singles, so we’ll be talking about pairs of hex values, which means a full byte.

So let’s see how we got at the numbers in Table 4.9. The first one is easy. 00000000 is decimal 0, and is hex 0000. For the second, we start with 00000010 binary. To convert this to decimal, we use the formula discussed in the section,“IP v4 Math Review”:

0x127 + 0x64 + 0x32 + 0x16 + 0x8 + 0x4 + 1x2 + 0x1 = 2

But let’s convert straight from binary to hexadecimal.We have two hex digits in this single byte, so we’re really looking at 0000 and 0010. The first, 0000 binary, just becomes 0 hex. For the second we have to do just a wee bit of math. In this case, we’ll use:

0x8 + 0x4 + 1x2 + 0x0 = 2

So, we get 02 in the end for this pair. For the rest we have:

00000100 = 0000 0100 
         = 0 | 0x8 + 1x4 + 0x2 + 0x1 
         = 04 
00100000 = 0010 0000 
         = 0x8 + 1x4 + 0x2 + 0x1 | 0 
         = 40 
11111110 10 = 1111 1110 10 
            = 1x8 + 1x4 + 1x2 + 1x1 | 1x8 + 1x4 + 1x2 + 0x1 
              | 1x8 + 0x4 + ?x2 + ?x1 
            = (15 decimal)(14 decimal)8? 
            = FE8+ 
11111110 11 = 1111 1110 11 = 1x8 + 1x4 + 1x2 + 1x1 | 1x8 + 
              1x4 + 1x2 + 0x1 | 1x8 + 1x4 + ?x2 + ?x1 
            = (15 decimal)(14 decimal) (12 decimal)? 
            = FEC+ 
11111111 = 1111 1111 
         = 1x8 + 1x4 + 1x2 + 1x1 | 1x8 + 1x4 + 1x2 + 1x1 
         = (15 decimal)(15 decimal) 
         = FF 

What do the plus signs—the ones up against the numbers, not the ones used for addition —represent? You must have four bytes to make a hex pair. The missing bits will determine what the final hex digit is. So the 8+ actually is 8 + ?x2 +_?x1 to give the actual hex digit.

Reading IPv6 Addresses

Most of us these days can read a Classful IP v4 address in our sleep. Sometimes when the first byte is near a boundary it’s necessary to look up the borders between classes A, B, and C but generally speaking, it’s usually a no-brainer. Those involved with Classful IP v4 multicasting know that any class D IP address is a multicast channel. Moving to Classless IP v4 wasn’t much of a change. Most folks were already familiar with the basics of the bit mask, so even that part wasn’t too traumatic.

Reading an IP v6 address does have a few similarities to reading an IP v4 address:

  • The prefix—the bits at the beginning—determine what type of address you’re talking about. (You might have already guessed this from the discussion in the previous section about reserved prefixes.)

  • There is still a bit mask notation available.

To read an IP v6 address, work from left to right. You’ll be pleased to see that it is much easier to distinguish multicast and unicast addresses from one another in IP v6. If the address begins with FF, you’re looking at a multicast address. Anything else is unicast or anycast. Both of these addressing designations—unicast and anycast—look the same at a glance.

Let’s focus on the unicast addresses because they’re more commonly used. The possibilities for a unicast address type are detailed in Table 4.9 but here they are quickly (plus the one additional type that isn’t there): aggregatable, IPX, link local, NSAP, site local, and—the new one—IP v4 capable. In general, host machines really don’t know anything about these distinctions. Routers have to, however, to direct data from place to place.

The IP v6 rules as laid out in RFC 2374 for aggregatable global unicast addresses are

  • The first three bits express the initial prefix. This prefix comes from Table 4.9, and for unicast is often 001. One more bit is required to complete the first hex digit.

  • The next 13 bits show the top level identification information required to initially tell routers where to send data. This value is assigned by the Internet Assigned Numbers Authority (IANA) or a designated registration organization to large, well-interconnected sites that carry a lot of data that’s going elsewhere.

  • The next eight bits don’t yet have a purpose. Their contents will be set when the time comes, but for now they are just 00000000.

  • The next 24 bits show the second level identification information. Each top level designate gets the full 24 bits to utilize when handing out identification numbers to the sites it serves—note that this space is almost the same as is available for the total number of IP v4 networks. Some top level designates might choose to break this space into subnet-like portions.

  • The next 16 bits show the identification information assigned by the individual sites to their networks. Notice that there’s plenty of hierarchy involved in IP v6. A site can choose to apply subnet-like sections to this address space if they wish.

  • The last 64 bits show identification (ID) information for the interface itself. This portion of the IP v6 address must be done in EUI-64 format, which is set by the Institute of Electrical and Electronics Engineers, Inc.’s (IEEE) Registration Authority Committee (RAC).

Remember once again that four bits is a single hex digit, eight bits is a hex pair, and 16 bits is a hex quad—which is the basic unit that makes up each portion of the IP v6 address.

Now, how does one build the interface ID according to the EUI-64 standard? The first thing to understand is that an interface ID can be either global or local. A global ID involves a unique set of numbers that represent the interface(s). We can have more than one interface with the same number in IP v6, if you remember, due to the anycast address type.

Another important concept is that an interface ID is typically built using the interface’s Media Access Control (MAC) address. In the case of an Ethernet card, the MAC is a 48-bit value. So that means there are another 16 bits available to identify the interface. How you manipulate this data depends on what kind of address you’re trying to create. For a global use interface ID, you take the 48-bit MAC address, split it in half, and then place the hex digits FF FE in the middle. You also take the EUI-64 standard 64-bit interface identifier and flip the very first bit. So if the first bit is a 0, make it a 1, or vice versa. It’s as simple as that.

Now, what about the local use addresses? There are two designations for these in IP v6: link-local, and site-local. Both of these are specifically utilized within subnets, where external routers are aware of how to send data to the subnetwork itself but know nothing of the structure within that subnetwork.

Every interface on a host machine utilizing IP v6 must have a link-local address. This identifier is used to transmit information between the host and another entity, usually a router, or for getting the interface’s global address information from a router automatically.You can recognize a link-local address by its first 10 bits, as given in Table 4.9: 11111110 10. No other machines aside from the router and the host need be aware of the link-local address.

The site-local address is a bit farther reaching. Each interface on a host gets one, and this value is useable by any machine in the network, including subnets. However, the router doesn’t advertise a site-local address to the outside world. Once again, it’s only for internal use. You’ll know a site-local address by its first 10 bits, as usual: 11111110 11.

You might even see IP v6 addresses that end in an obviously IP v4 address. IP v6 does have a built-in mechanism for piggybacking IP v4 data, which enables the powers that be on the Internet to slowly begin migrating from IP v4 to IP v6 without causing undue hardships.

IPv6 Routing Issues

One good thing about routing issues with IP v6 is that this new addressing scheme can work within the same routing protocols we’re used to: RIP-2, OSPF, and so on. There are some new features to IP v6 routing that definitely make an administrator’s life more interesting. Most of them allow a finer control over what’s happening with your data than you could get in IP v4.

An IP v6 packet contains a special header for routing instructions, unlike IP v4 packets. Each packet might, for example, contain information on every router it passed through on its way from one point to another. That information can actually be reversed to send data back exactly the way it came, if this is a feature you require. This feature can actually be utilized to track a mobile networking user’s location when they log on—something that some will like and others will be very uncomfortable with.

One of the best new features by far is the ability of an IP v6 router to auto-configure an interface’s address information. Once a host knows what an interface’s linklocal identifier is, that host sends an Internet Control Message Protocol for IP v6 (ICMPv6) neighbor request containing that information. If no other host responds claiming that it already has that address, the machine sends out an ICMPv6 router request message to find its router. When the network’s router responds, it includes the network’s IP v6 global prefix.

From here, the host builds the interface’s global IP v6 address all on its own using the interface ID. If for some reason another interface claims to already have the original link-local identifier, then you’ll have to configure that interface by hand.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset