Expanding the Embedded Universe: Migrating From IPv4 to IPv6

The Internet Protocol (IP) developedduring the mid-1970s, is the backbone of a family of protocols thatincludes TCP, UDP, RIP, and virtually every otherprotocol used for Internet communications.

The current version, IP version 4 (IPv4), has been in use for morethan 20 years. IPv4 has proven to be amazingly adaptable over theyears; however, the demands placed upon the protocol at its inceptionpale in comparison to the demands of the millions of hosts that are nowconnected to the Internet today.

IPv4 is finally beginning to show some chinks in its armor. IPversion 6 (IPv6) , designed asa successor to IPv4 deals with many of IPv4's shortcomings. Thisarticle touches upon three of the major problems found in IPv4 and howIPv6 corrects each of these problems.

A few of the major problems currently found in IPv4 include:

#1. DepletedAddress Space
The main motivation for replacing IPv4 with something better is thatthe IPv4 address space will ultimately be exhausted. Estimates for thetotal depletion of the IPv4 address space vary from 2005 until 2018.

Most estimates put the date around 2008 to 2010. Despite thedisagreements on when the address space will be depleted, most agreethat it will definitely happen unless something better is put in place.Compounding the problem is the uneven distribution of the IPv4 addressspace across the globe.

#2. FlawedAddressing Architecture
IPv4 addresses do not provide an efficient and scalable hierarchicaladdress space. That is, it is impossible for a single high-leveladdress to represent many lower-level addresses or networks.

To picture what a hierarchical address space looks like, think ofthe telephone numbering system. Just by looking at the area code, onecan immediately determine what city or region to route the call. WithIPv4 routing becomes increasingly complicated and expensive as the sizeof the Internet grows.

#3. High Cost
Another criticism of IPv4 is the high cost and maintenance requirementsof networks. A significant percentage of the cost of administering anIPv4 network is incurred in the initial configuration of network hosts.IPv4's limitations also aggravate the task of renumbering networkdevices, which is cumbersome to network administrators.

IPv6 To The Rescue
One of the common myths associated with IPv6 is that the only reason toadopt IPv6 is the impending depletion of the IPv4 address space. Theexpanded address space of IPv6 is not the only improvement made in theprotocol, however.

IPv6 also offers improvements in: addressing architecture, astateless address autoconfiguration mechanism, a less expensive addressresolution protocol, header format simplification, the ability todetect and recover from a failed forward route, and an improved methodto join and leave multicast groups.

To the end user, IPv6 offers obvious advantages. Because of IPv6'slarger address capacity, it allows greater flexibility in allocatingaddresses and routing traffic ” freeing device users to use theInternet as they always have, but now with even higher levels ofseamless integration between devices (Figure1 below ).

Figure1. IPv6 allows users to display/talk/show/interact with each other fromdevice to device

Dual Stack Approach Eases Transition
The Internet will consist of a combination of IPv4 and IPv6 nodes for aperiod of time during the transition. Therefore, compatibility betweenIPv4 and IPv6 nodes is critical for a successful transition.

Because IPv6 is not backwards compatible with IPv4, a dual stackapproach is needed to enable nodes to communicate over both IPv4 andIPv6 simultaneously. This approach paves the way for transitionmechanisms that will enable the Internet to move to IPv6.

Although the dual stack approach is the recommended transitionmechanism for networks, under certain circumstances, such dualstack configurations can also be used in IPv6-only mode forisolated IPv6 networks.

This removes the additional overhead of the IPv4 stack for thosedevices that do not require IPv4 tunneling. Additional capabilitiesinclude Neighbor Discovery, Multicast Listener Discovery, Tunneling,DNS for IPv6, IPv6 Extension Headers, and Ancillary Data.

Let's take a look at each of these in a bit more detail.

Neighbor Discovery
Neighbor Discovery solves a set of problems related to the interactionbetween nodes attached to the same link. It defines mechanisms forsolving each of the following problems:

StatelessAddress Autoconfiguration. This is a new feature of IPv6beneficial to network administrators, because it requires no manualconfiguration of hosts, minimal (if any) configuration of routers, andno additional servers. The stateless mechanism allows a host togenerate its own addresses using a combination of locally availableinformation and information advertised by routers and verifies thateach generated address is unique on the link.

Stateless Address Autoconfiguration should greatly decrease thecosts of administering an enterprise network. Also, the task ofrenumbering networks will be simplified since IPv6 can assign newaddresses and gracefully time out existing addresses without manualreconfiguration or DHCP.

RouterDiscovery. This feature is used to locate neighboring routers aswell as to learn prefixes and configuration parameters related toStateless Address Autoconfiguration.

RouterAdvertisements. These allow routers to inform hosts how toperform Address Autoconfiguration and contain Internet parameters suchas the hop limit which should use in outgoing packets and, optionally,link parameters such as the link Maximum Transmission Unit (MTU). Thisfacilitates centralized administration of critical parameters that canbe set on routers and automatically propagated to all attached hosts.

PrefixDiscovery. Flags associated with the prefixes specify theintended uses of a particular prefix. Hosts use the advertised on-linkprefixes to build and maintain a list that is used in deciding when apacket's destination is on-link or beyond a router.

AddressExpiration. IPv6 addresses are leased to an interface for afixed (possibly infinite) length of time. Each address has anassociated lifetime that indicates how long the address is bound to aninterface.

When a lifetime expires, the binding (and address) become invalidand the address may be reassigned to another interface elsewhere in theInternet. To handle the expiration of address bindings gracefully, anaddress goes through two distinct phases while assigned to aninterface.

Initially, an address is “preferred,” meaning that its use inarbitrary communication is unrestricted. Later, an address becomes”deprecated” in anticipation that its current interface binding willbecome invalid. While in a deprecated state, the use of an address isdiscouraged but not strictly forbidden.

AddressResolution. This capability is the process through which a nodedetermines the link-layer address (Ethernet MAC address, for example)of a neighbor given only its IP address. Address Resolution isredefined for IPv6 and does not use Address Resolution Protocol (ARP)packets, as is the case for IPv4.

Nodes accomplish Address Resolution of IPv6 neighbors bymulticasting a request for the target node to return its link-layeraddress. The target returns its link-layer address in a unicastresponse. By using multicast and unicast addresses instead of thebroadcast address, there are fewer needless interruptions of othernodes on the network.

NeighborUnreachability Detection. This detects the failure of a neighboror the failure of the forward path to the neighbor. Once failure hasbeen detected, an alternate route can be found without interrupting theflow of data from the application's point of view.

DuplicateAddress Detection. To insure that all configured addresses areunique on a given link, nodes perform Duplicate Address Detection onaddresses before assigning them to an interface.

Header FormatSimplification. In order to simplify and optimize processing ofIP packets, a few changes were made to the format of the IP header forIPv6. The length of the IPv6 header is fixed as opposed to the variablelength IPv4 header.

This helps to simplify processing of IPv6 packets as certainassumptions in the IP processing code can be made. Also, some IPv4header fields have been dropped or made optional.

Most notable is the lack of a checksum field for the IPv6 header.This greatly improves performance in routers. When an IPv4 packet isforwarded by a router the Time-to-Live (TTL) field must be decremented,which forces the IPv4 header checksum to be recomputed; a CPU intensiveoperation. Since this field is not present in the IPv6 header routerssimply decrement the Hop Limit, TTL in IPv6, and forward the packet.

Further, Neighbor Discovery defines five different ICMPv6 packettypes. The messages serve the following purpose:

* RouterSolicitation: Hosts send out Router Solicitations that requestrouters to generate Router Advertisements.

* RouterAdvertisement: Routers advertise their presence together withvarious link and Internet parameters either periodically, or inresponse to a Router Solicitation message.

* NeighborSolicitation: Sent by a node to determine the link-layeraddress of a neighbor, or to verify that a neighbor is still reachablevia a cached link-layer address.

* NeighborAdvertisement: A response to a Neighbor Solicitation message. Anode may also send unsolicited Neighbor Advertisements to announce alink-layer address change.

* Redirect: Used by routers to inform hosts of a better first hop for adestination.

Multicast Listener Discovery
The purpose of Multicast Listener Discovery is to enable each IPv6router to discover the presence of multicast listeners (that is, nodeswishing to receive multicast packets) on its directly attached links,and to discover specifically which multicast addresses are of interestto those neighboring nodes.

This information is then provided to whichever multicast routingprotocol is being used by the router, in order to ensure that multicastpackets are delivered to all links where there are interestedreceivers.

Tunneling
In most deployment scenarios, the IPv6 routing infrastructure will bebuilt up over time. While the IPv6 routing infrastructure is beingdeployed, the existing IPv4 routing infrastructure can remainfunctional and can be used to carry IPv6 traffic.

Tunneling provides a way to utilize the existing IPv4 routinginfrastructure to carry IPv6 traffic. IPv6/IPv4 hosts and routers cantunnel IPv6 datagrams over regions of IPv4 routing topology byencapsulating them within IPv4 packets.

IPv6 defines numerous techniques to accomplish tunneling. Based onusability, flexibility, and perceived popularity, many implementations(Nucleus IPv6) have been designed to support two such tunnelingtechniques: Configured Tunneling and 6to4 Tunneling.

ConfiguredTunneling. In configured tunneling, the tunnel endpoint addressis determined from configuration information in the encapsulating node.For each tunnel, the encapsulating node must store the tunnel endpointaddress.

When an IPv6 packet is transmitted over a tunnel, the tunnelendpoint configured for that tunnel is used as the destination addressfor the encapsulating IPv4 header. Configured tunneling uses IPv6native addresses as the source and destination addresses of the IPv6packet.

6to4 Tunneling. The IANA has permanently assignedthe prefix 2002::/16 for the 6to4 scheme. The subscriber site is thendeemed to have the address prefix 2002:V4ADDR::/48, where V4ADDR is theglobally unique 32-bit IPv4 address.

Within the subscriber site, this prefix is used exactly like anyother IPv6 prefix. The 6to4 address is used as the source address ofall communications via the 6to4 tunnel.

DNS For IPv6
To support the storage of IPv6 addresses, the following extensions havebeen defined:

* A new resource record type, AAAA, is defined to map a domain nameto an IPv6 address
* A new domain, ip6.int, is defined to support lookups based on address

IPv6 Extension Headers
Unlike in IPv4, the IPv6 header is a fixed length. Any additionalinformation that needs to be provided to the IP layer is contained inextension headers appended to the basic IPv6 header.

Ancillary Data
Ancillary data is used to transfer IPv6 Extension Headers andadditional control information between the application and the networkstack via socket options and the SendMessage/RecieveMessage routinesprovided by the IPv6 networking provider. This additional data is usedby the local IPv6 stack, intermediate IPv6 stacks responsible forpacket routing and the destination IPv6 stack to properly process theIPv6 packet as is required by the sending application.

In Conclusion
With the imminent exhaustion of the IPv4 address space, and a mountingnumber of embedded devices pushing the limits, the need for a newprotocol is upon us. Fortunately, IPv6 has the necessary prerequisitesto move the industry forward, enabling new and innovative functionalityon a variety of devices that just a few years ago were unimaginable.

Rex Smith is a Product Manager forthe Embedded Systems Division of Mentor Graphics where he is responsible for Nucleus OSand related products. Rex has spent more than 12 years working withembedded systems. Smith earned a Bachelors of Science in ElectricalEngineering from University of Alabama. You can email Rex at:rex_smith@mentor.com.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.