ONLamp.com
oreilly.comSafari Books Online.Conferences.

advertisement


Introduction to IPv6
Pages: 1, 2, 3

Multiple addresses

In IPv4, a host usually has one IP number per network interface -- or even per machine if the IP stack supports it. Only very rare applications like web servers result in machines having more than one IP number.



In IPv6, this is different. For each interface, there is not only a globally unique IP address, but there are two other addresses that are of interest: The link-local address, and the site-local address. The link-local address has a prefix of fe80::/64, and the host bits are built from the interface's EUI64 address. The link-local address is used for contacting hosts and routers on the same network only, the addresses are not visible or reachable from different subnets. If desired, there's the choice of either using global addresses (as assigned by a provider), or using site-local addresses.

Site-local addresses are assigned the network address fec0::/10, and subnets and hosts can be addressed just as for provider-assigned networks. The only difference is, that the addresses will not be visible to outside machines, as these are on a different network, and their site-local addresses are in a different physical net (if assigned at all). As with the 10/8 network in IPv4, site-local addresses can be used, but don't have to be. For IPv6, it's most common to have hosts assigned a local link and a global IP address. Site-local addresses are rather uncommon today, and is no substitute for globally unique adresses if global connectivity is required.

Multicasting

In IP land, there are three ways to talk to a host: unicast, broadcast, and multicast. The most common way to talk to a host is by talking to it directly using its unicast address. In IPv4, the unicast address is the "normal" IP address assigned to a single host, with all address bits assigned. The broadcast address used to address all hosts in the same IP subnet has the network bits set to the network address, and all host bits set to "1" (which can be easily done using the netmask and some bit operations). Multicast addresses are used to reach a number of hosts in the same multicast group, which can be machines spread across the Internet. Machines must join multicast groups explicitly to participate, and there are special IPv4 numbers used for multicast addresses, allocated from the 224/8 subnet. Multicast isn't used very much in IPv4, and only few applications like the MBone audio and video broadcast utilities use it.

In IPv6, unicast addresses are used the same as in IPv4, no surprise there -- all the network and host bits are assigned to identify the target network and machine. Broadcasts are no longer available in IPv6 in the way they were in IPv4, this is where multicasting comes into play. Addresses in the ff::/8 network are reserved for multicast applications, and there are two special multicast addresses that supersede the broadcast addresses from IPv4. One is the "all routers" multicast address, the others is for "all hosts". The addresses are specific to the subnet, for example, a router connected to two different subnets can address all hosts/routers on any of the subnets it's connected to. Addresses here are:

  • ff0X::1 for all hosts and
  • ff0X::2 for all routers,

where "X" is the scope ID of the link here, identifying the network. Usually this starts from "1" for the "node local" scope, "2" for the first link, etc. Note that it's perfectly OK for two network interfaces to be attached to one link, thus resulting in double bandwidth:

Several interfaces attached to a link result in only one scope ID for the link.
Several interfaces attached to a link result in only one scope ID for the link.

One use of the "all hosts" multicast is in the neighbor solicitation code of NDP, where any machine that wants to communicate with another machine sends out a request to the "all hosts" group, and the machine in question is expected to respond.

Name resolution

After all the talk about addressing in IPv6, it might make one wonder if there's a proper way to abstract all those long and ugly IPv6 addresses with nice host names as one can do in IPv4, and of course there is.

Host name to IP number resolution in IPv4 is usually done in one of three ways: through a simple table in /etc/hosts, by using the Network Information Service (NIS, formerly YP), or via the Domain Name System (DNS).

As of this writing, NIS/NIS+ over IPv6 is currently only available on Solaris 8, for both database contents and transport, using an RPC extension.

Having a simple address <-> name map like /etc/hosts is supported in all IPv6 stacks. Depending on the implementation, /etc/hosts either contains v6 addresses as well, or there will be a separate file that only maps v6 addresses to names. Examples for /etc/hosts that are capable of v6 addresses are the KAME-based IP stacks found in the BSD operating systems (NetBSD, FreeBSD, etc.) and /etc/ipnodes used by the USAGI Linux stack and Solaris. Other implementations may use different files.

For DNS, there are no fundamentally new concepts. IPv6 name resolution is done with AAAA records that -- as the name implies -- point to an entity that's four times the size of an A record. The AAAA record takes a hostname on the left side, just as A does; and on the right side, there's an IPv6 address, such as

noon       IN    AAAA  3ffe:400:430:2:240:95ff:fe40:4385

For the reverse resolution, IPv4 uses the in-addr.arpa zone, and below that it writes the bytes (in decimal) in reversed order (the most significant bytes are to the right). For IPv6 this is similar, only hex digits representing 4 bits are used instead of decimal numbers and resource records are also under a different domain, ip6.int.

So to have the reverse resolution performed for the above host, you would put a line like this into your /etc/named.conf file:

zone "0.3.4.0.0.0.4.0.e.f.f.3.IP6.INT" {
    type master;
    file "db.reverse";
};

and in the zone file db.reverse you put (besides the usual records like SOA and NS):

5.8.3.4.0.4.e.f.f.f.5.9.0.4.2.0.2.0.0.0 IN PTR noon.ipv6.example.com.

The address is reversed here and written down one hex digit after the other, starting with the least significant (right-most) one with the hex digits separated by dots, as in zone files.

One thing to note when setting up DNS for IPv6 is to take note of the DNS software version in use. BIND 8.x does understand AAAA records, but it does not offer name resolution via IPv6. You need BIND 9.x for that. Beyond that, BIND 9.x supports a number of resource records that are currently being discussed but not officially introduced yet. The most noticeable one here is the A6 record which makes it easier to change the provider or prefix.

In summary, this article talked about the technical differences between IPv4 and IPv6 for addressing and name resolution. Some details like IP header options, QoS, and flows were deliberately left out to simplify this explanation.

Hubert Feyrer works on operating systems, databases, and artificial intelligence at the Fachhochschule Regensburg.


Return to ONLamp.com.



Sponsored by: