Menu-Submenu

IPv6 DHCP


Introducing IPv6

Understanding IPv6 Addresses



IPv6 addresses are quite different than IPv4 addresses.

The primary difference between IPv4 and IPv6 addresses is length. IPv4 addresses are 32 bits long and IPv6 addresses are 128 bits long.
This massive length forces IPv6 addresses to be written using a different notation than IPv4 addresses and thus makes them very easy to distinguish from IPv4 addresses.

IPv6 addresses are into 8, 16-bit sections; with hexadecimal (HEX) notation

to compress the address into a more human-readable format.
A 128-bit IPv6 address uses a maximum of 48 digits when written in decimal notation but only 32 digits or less are needed when hex notation is used
Once converted to hex, each 16-bit segment is delimited by colons (:), this is of course different from IPv4 addresses which use periods (.) to delimit each 8-bit segment when written in decimal format.

Shortening the addresses

When an IPv6 address is written in hex notation, provide the flexibility to shorten the address considerably by reducing the number of zeros displayed. This can be accomplished in two ways:
  1. Zero Suppression: Because it is known that all 8 segments consist of 16 bits it is possible to remove leading zeros from each section without making the address ambiguous.
For example – 0db8 can be written as db8; and therefore a segment as db8 is concluded same as 0db8.
This idea of zero suppression is really not all that foreign; in IPv4 the same method is used. Instead of writing 192.000.002.001, all of the leading zeros are suppressed to 192.0.2.1.
  1. Zero Compression: Similarly, because it is known that each address must be made up of 8 segments, it is possible to compress multiple contiguous segments of all zeros without confusing the address, as long as it is only done once within a single address. When compressing segments a double colon (::) is used.
For example, in address 2001:0db8::3f6c, the :: represents 5 contiguous segments of all zeros, since the address must contain 8 segments in total.
After all possible zero suppression and compression (removing unneeded zeros), makes it much easier to read address.
2001:0db8:0000:0000:0000:0000:0000:0001   → 2001:db8::1

IPv6 Prefixes

Much like IPv4 with CIDR (Classless Inter-Domain Routing), one of the great advantages of IPv6 addressing is its hierarchical structure. IPv6 addresses can be broken into prefixes of varying length and these subnet prefixes are represented with the same “<ip-address>/<prefix-length>” notation used for IPv4 CIDR prefixes. In the case of IPv6:
  • ip-address is an IPv6 address in any of the hex notations listed above.
  • prefix-length is a decimal value specifying the number of the leftmost bits in the address that make up the prefix.

For example, assuming that the IPv6 address used above is part of a 64-bit prefix, it could be represented in the following ways:
  • 2001:0db8:0000:0000:0000:0000:0000:0001/64
  • 2001:db8:0:0:0:0:0:1/64
  • 2001:db8::1/64
  • The prefix itself is represented as 2001:db8::/64, with the double colon (for consideration of only the first 64 bits)

Classifying IPv6 Addresses



As with IPv4, an IPv6 address serves as an identifier for an interface or group of interfaces. Also like IPv4, IPv6 addresses come in several types, based on how they represent those interfaces.

IPv6 has three types of addresses

  • Unicast: An IPv6 unicast address is used to identify a single interface. Packets sent to a unicast address are delivered to that specific interface.

  • Anycast: IPv6 anycast addresses identify groups of interfaces, which typically belong to different nodes. Packets destined to an anycast address are sent to the nearest interface in the group (to single interface in the group), as determined by the active routing protocols.

  • Multicast: An IPv6 a multicast address also identifies a group of interfaces, again typically belonging to different nodes. Packets sent to a multicast address are delivered to all interfaces in the group.
There are no broadcast addresses in IPv6. The functions served by broadcast addresses in IPv4 are provided by multicast addresses in IPv6.

The high-order (left-most) bits of an IPv6 address are used to identify its type, as shown here:

Address Type
Binary Prefix
Hex Prefix
Unspecified
0000...0000 (128 bits)
::/128
Loopback
0000…0001 (128 bits)
::1/128
IPv4 Mapped
0000...0000 1111 1111 1111 1111 (96 bits)
::FFFF/96
Multicast
1111 1111
FF00::/8
Link-Local Unicast
1111 1110 10
FE80::/10
Unique Local Unicast (ULA)
1111 110
FC00::/7
Global Unicast
(everything else)
Anycast addresses are taken from the global unicast pool.
Anycast and Unicast addresses cannot be distinguished based on format.

Multicast Addresses

One of the primary changes from IPv4 to IPv6 is that multicast addressing support is improved and expanded in IPv6.
Here’s a figure that illustrates the format for IPv6 multicast addresses:

Examples of multicast addresses,
FF02::1
All nodes on the same link as the sender, this address replaces the broadcast function in IPv4
FF02::6
All OSPF DRs on the same link as the sender
FF05::101
All NTP servers on the same site as the sender.


More details about IPv6 multicast addresses at,
RFC 2375 “IPv6 Multicast Address Assignments”
RFC 3306 “Unicast-Prefix-based IPv6 Multicast Addresses” and
RFC 3307 “Allocation Guidelines for IPv6 Multicast Addresses.”

Global Unicast Addresses

As with IPv4, Unicast addresses are the most common type of IPv6 address. Because of the abundance of addresses available with IPv6, it is very likely that virtually every machine attached to a network will have at least one Global Unicast Address assigned to each interface.

Because of this, all IPv6 address space ‘not currently specified for another purpose’ is reserved for use as Global Unicast Addresses. Only a single /3 is currently allocated for use however. The IETF (Internet Engineering Task Force) has assigned binary prefix 001 (hex prefix 2000::/3) to IANA (Internet Assigned Numbers Authority) for use on the Internet. This means that all valid global unicast addresses begin with the 2000::/3 prefix, for now.

There are several special addresses and address groups within IPv6. Some of these are similar to that in IPv4 addressing, and some are new in IPv6.

Unspecified address (::/128)

This all-zeros address refers to the host itself when the host does not know it’s own address. The unspecified address is typically used in the source field by a device seeking to have its IPv6 address assigned.

Loopback address (::1/128)

IPv6 has a single address for the loopback function, instead of a whole block as is the case in IPv4.

IPv4-Mapped addresses (::FFFF/96)

A /96 prefix leaves 32 bits, exactly enough to hold an embedded IPv4 address. IPv4-Mapped IPv6 addresses are used to represent an IPv4 node’s address as an IPv6 address. This address type was defined to help with the transition from IPv4 to IPv6. [RFC 4038 “Application Aspects of IPv6 Transition”]
There may be security risks associated with using IPv4-mapped addresses. [draft-itojun-v6ops-v4mapped-harmful-02, “IPv4-Mapped Addresses on the Wire Considered Harmful”]

Link-Local unicast addresses (FE80::/10)

As the name implies, Link-Local addresses are Unicast Addresses to be used on a single link. Packets with a Link-Local source or destination address will not be forwarded to other links. These addresses are used for neighbor discovery, automatic address configuration and in circumstances when no routers are present.

Unique local unicast addresses (FC00::/7)

Commonly known as ULA, this group of addresses is for use locally, within a site or group of sites. Although globally unique, these addresses are not routable on the global Internet. [RFC 4193 “Unique Local IPv6 Unicast Addresses”]

IPv6 Headers



IPv6 DHCP


Evolution of DHCPv6

  • To boot the machines in a LAN, needs lot of network parameters to be configured in each machine.
  • In order to avoid this manual process, all the network parameters are put in a server; and when a machine in LAN is booting, it will contact the server for the configuration parameters.  This is called BOOTP server.
  • Later it is extended to DHCP with additional features.
  • IP configuration in IPV6 is carried out by IPV6 auto-configuration

IPv6 auto-configuration

1) Stateless 
  • nodes configure addresses themselves with information from routers (if available)
  • no managed addresses
2) Stateful 
  • nodes use DHCPv6 to obtain addresses
  • Duplicate Address Detection (DAD) used to avoid duplicated addresses

DHCPv6

  • The Dynamic Host Configuration Protocol for IPv6 (DHCP) enables DHCP servers to pass configuration  parameters such as IPv6 network addresses to IPv6 nodes. 
  • DHCPv6 protocol (RFC 3315) is a Stateful counterpart to "IPv6 Stateless Address Autoconfiguration" (RFC 2462).
  • Used separately or concurrently with the latter to obtain configuration parameters. 
  • DHCPv6 is a method of providing stateful IPv6 address configuration/assignment. It also provides “other” network information such as DNS servers and NIS information

DHCP allows centralized control and auditing of IP address assignments
  • Central point of control for resources
  • Dynamic DNS updates
  • More security versus Stateless

DHCPv6 v/s DHCPv4

  • Unlike DHCPv4, IPv6 address allocation in DHCPv6 is handled using a message option.
  • The message types, such as DHCPDISCOVER and DHCPOFFER supported by DHCPv4 are removed in DHCPv6. Instead, DHCPv6 servers are located by a client SOLICIT message followed by a server ADVERTISE message
  • Unlike DHCPv4 clients, DHCPv6 clients can request multiple IPv6 addresses.

DHCP Messages, Format and Types


  • Messages exchanged using UDP
  • Client port – udp/546
  • Server Port – udp/547
  • Client uses Link-Local address or addresses determined using other methods to transmit and receive DHCP messages
  • Server receives messages from clients using a reserved, Link-Scoped multicast address

Message type

option meaning
SOLICIT
from Client to Server
to locate Server
ADVERTISE
from Server to Client
to indicate availability of DHCP service
in response to SOLICIT message
REQUEST
from Client to Server
to request configuration parameters including IP addresses
REPLY
from Server to Client
response to REQUEST, RENEW, REBIND message containing assigned addresses and configuration parameters
RENEW
from Client to Server
to extend the lifetimes on the assigned addresses to Server that originally provided the Client’s addresses and configuration parameters
REBIND
from Client to Server
to extend the lifetimes on the assigned, to any available Server
RELEASE
from Client to Server
releases address
CONFIRM
DECLINE
RECONFIGURE
INFORMATION-REQUEST
RELAY-FORWARD
RELAY-REPLY



DHCP Multicast Addresses

  • All_DHCP_Relay_Agents_and_Servers FF02::1:2 Link-scoped multicast address used by a client to communicate with on-link relay agents and servers
  • All_DHCP_Servers FF05::1:3 Site-scoped multicast address used by a relay agent to communicate with servers

DHCP Unique Identifier (DUID)

  • Each DHCP client and server has a DUID.  DHCP servers use DUIDs to identify clients for the selection of configuration parameters and in client Identity Associations.
  • Unique across all clients and servers
  • Should not change over time (if possible)
  • Must be < 128 octets long

Identity Association (IA)

  • It is a construct through which a server and client can identify, group, and manage a set of related IP addresses.
  • Client must associate at least one distinct IA with each network interface requesting assignment of IP addresses from DHCP server (IAID)
  • Must be associated with exactly one interface
  • Must be consistent across restarts by the client

Dhcpv6 operation

  • Client sends messages to link-local multicast address
  • Server unicasts response to client
  • Information-Request / Reply : provide client configuration information but no addresses
  • Confirm / Reply : assist in determining whether client moved
  • Reconfigure : allow servers to initiate a client reconfiguration
  • Basic client/server authentication capabilities in base standard.
  • DHCP Unique Identifier (DUID) used to identify clients & servers
  • Identity Association ID (IAID) used to identify a collection of addresses
  • Relay Agents used when server not on-link
  • Relay Agents may be chained

 Projects

  1. http://docs.hp.com Previously DHCPv6 v1.001 and now  DHCPv6 2.001 available for the HP-UX 11i v1 and HP-UX 11i v2 operating systems
  2. http://klub.com.pl/dhcpv6/ Dibbler is a portable DHCPv6 implementation on Linux 2.4/2.6 and Windows XP and Windows 2003.   
This project was started as master thesis by Tomasz Mrugalski and Marek Senderski of Computer Science faculty on Gdansk University of Technology.
  1. http://dhcpv6.sourceforge.net/ Project UNIX name: dhcpv6 Operating System: All POSIX (Linux/BSD/UNIX-like OSes), Linux


DHCPv6 Server installation on Fedora

  1. Update with  dhcpv6-0.10-11_FC3.i386.rpm using # rpm -U  dhcpv6-0.10-11_FC3.i386.rpm
  2. Create a database directory # mkdir /var/db/dhcpv6
  3. Copy sample server configuration file # cp dhcp6s.conf  /etc/dhcp6s.conf
  4. Start the server daemon using # dhcp6s –dDf eth0 

Server configuration

File : /etc/sysconfig/dhcp6s
        Specify the interface for dhcp6s  
        DHCP6SIF=eth0
                  
File : /etc/dhcp6s.conf
        interface eth0 {
            server-preference 255;
            renew-time 60;
            rebind-time 90;
            prefer-life-time 130;
            valid-life-time 200;
            allow rapid-commit;
            link BBB {
                pool{
                    range 2001:0E30:1402:2::4 to 2001:0E30:1402:2::ffff/64;
                    prefix 2001:0E30:1402::/48;
                };
            };
        };


DHCPv6 Client installation on Fedora

  1. Update with dhcpv6_client-0.10-11_FC3.i386.rpm using # rpm -U dhcpv6_client-0.10-11_FC3.i386.rpm
  2. Copy sample client configuration file # cp dhcp6c.conf  /etc/dhcp6c.conf
  3. Start the client daemon using # dhcp6c –dDf eth0 

Client configuration

File : /etc/sysconfig/network-scripts/ifcfg-eth0
        IPV6INIT=yes
        DHCP6C=yes

File : /etc/dhcp6c.conf
        interface eth0 {
            #information-only;
            send rapid-commit;
            #request prefix-delegation;
            #request temp-address;
            address {
                2001:0E30:1402:1:9656:3:4:56/64;
            };
        };

DHCPv6 Testing

  1. Start the server daemon in debug mode in foreground # dhcp6s –dDf eth0
  2. Restart the network service of client # service network restart
  3. See the address assignment # ifconfig