Ipv6 Tutorial
Ipv6 Tutorial
Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol
(IP) and the first version of the protocol to be widely deployed. IPv6 was
developed by the Internet Engineering Task Force (IETF) to deal with the longanticipated problem of IPv4 address exhaustion.
This tutorial will help you in understanding IPv6 and its associated terminologies
along with appropriate references and examples.
Audience
This tutorial has been designed to help beginners understand the basic concepts
of IPv6 required to work with any TCP/IP based protocols. After completing this
tutorial, you will find yourself at a moderate level of expertise of IPv6 from
where you can take yourself to next levels.
Prerequisites
Before you start proceeding with this tutorial, we are assuming that you are
already aware of basic computer and network concepts such as what is a
protocol, why do we need protocol, network layers, etc.
Table of Contents
About the Tutorial i
Audience i
Prerequisites i
Copyright & Disclaimer i
Table of Contents ii
1. OVERVIEW 1
Why New IP Version? 1
Why Not IPv5? 1
Brief History 2
2. FEATURES 3
3. ADDRESSING MODES 5
Unicast 5
Multicast 5
Anycast 6
5. SPECIAL ADDRESSES 12
Reserved Multicast Address for Routing Protocols 12
Reserved Multicast Address for Routers/Node 13
ii
6. HEADERS 14
Fixed Header 14
Extension Headers 15
7. COMMUNICATION 17
Neighbor Discovery Protocol 17
8. SUBNETTING 19
9. TRANSITION FROM IPV4 TO IPV6 20
Dual Stack Routers 20
Tunneling 20
NAT Protocol Translation 21
10. MOBILITY 22
Mobility Operation 22
Route Optimization 24
11. ROUTING 25
Routing protocols 25
Protocols Changed to Support IPv6 26
12. SUMMARY 27
Future of IPv6 27
iii
1. OVERVIEW
IPv6
Internet has grown exponentially and the address space allowed by IPv4
is saturating. There is a requirement to have a protocol that can satisfy
the needs of future Internet addresses that is expected to grow in an
unexpected manner.
IPv4 on its own does not provide any security features. Data has to be
encrypted with some other security application before being sent on the
Internet.
Data prioritization in IPv4 is not up-to-date. Though IPv4 has a few bits
reserved for Type of Service or Quality of Service, but they do not provide
much functionality.
IPv6
Brief History
After IPv4s development in the early 80s, the available IPv4 address pool begun
to shrink rapidly as the demand of addresses exponentially increased with
Internet. Taking pre-cognizance of the situation that might arise, IETF, in 1994,
initiated the development of an addressing protocol to replace IPv4. The
progress of IPv6 can be tracked by means of the RFC published:
On June 06, 2012, some of the Internet giants chose to put their Servers on
IPv6. Presently they are using Dual Stack mechanism to implement IPv6 in
parallel with IPv4.
2. FEATURES
IPv6
Simplified Header
IPv6s header has been simplified by moving all unnecessary information and
options (which are present in IPv4 header) to the end of the IPv6 header. IPv6
header is only twice as bigger than IPv4 provided the fact that IPv6 address is
four times longer.
End-to-end Connectivity
Every system now has unique IP address and can traverse through the Internet
without using NAT or other translating components. After IPv6 is fully
implemented, every host can directly reach other hosts on the Internet, with
some limitations involved like Firewall, organization policies, etc.
Auto-configuration
IPv6 supports both stateful and stateless auto-configuration mode of its host
devices. This way, absence of a DHCP server does not put a halt on intersegment communication.
Faster Forwarding/Routing
Simplified header puts all unnecessary information at the end of the header. The
information contained in the first part of the header is adequate for a Router to
take routing decisions, thus making routing decision as quickly as looking at the
mandatory header.
IPSec
Initially it was decided that IPv6 must have IPSec security, making it more
secure than IPv4. This feature has now been made optional.
IPv6
No Broadcast
Though Ethernet/Token Ring are considered as broadcast network because they
support Broadcasting, IPv6 does not have any broadcast support anymore. It
uses multicast to communicate with multiple hosts.
Anycast Support
This is another characteristic of IPv6. IPv6 has introduced Anycast mode of
packet routing. In this mode, multiple interfaces over the Internet are assigned
same Anycast IP address. Routers, while routing, send the packet to the nearest
destination.
Mobility
IPv6 was designed keeping mobility in mind. This feature enables hosts (such as
mobile phone) to roam around in different geographical area and remain
connected with the same IP address. The mobility feature of IPv6 takes
advantage of auto IP configuration and Extension headers.
Smooth Transition
Large IP address scheme in IPv6 enables to allocate devices with globally unique
IP addresses. This mechanism saves IP addresses and NAT is not required. So
devices can send/receive data among each other, for example, VoIP and/or any
streaming media can be used much efficiently.
Other fact is, the header is less loaded, so routers can take forwarding decisions
and forward them as quickly as they arrive.
Extensibility
One of the major advantages of IPv6 header is that it is extensible to add more
information in the option part. IPv4 provides only 40-bytes for options, whereas
options in IPv6 can be as much as the size of IPv6 packet itself.
3. ADDRESSING MODES
IPv6
Unicast
In unicast mode of addressing, an IPv6 interface (host) is uniquely identified in a
network segment. The IPv6 packet contains both source and destination IP
addresses. A host interface is equipped with an IP address which is unique in
that network segment. When a network switch or a router receives a unicast IP
packet, destined to a single host, it sends out one of its outgoing interface which
connects to that particular host.
Multicast
The IPv6 multicast mode is same as that of IPv4. The packet destined to
multiple hosts is sent on a special multicast address. All the hosts interested in
that multicast information need to join that multicast group first. All the
interfaces that joined the group receive the multicast packet and process it,
while other hosts not interested in multicast packets ignore the multicast
information.
IPv6
Anycast
IPv6 has introduced a new type of addressing, which is called Anycast
addressing. In this addressing mode, multiple interfaces (hosts) are assigned
same Anycast IP address. When a host wishes to communicate with a host
equipped with an Anycast IP address, it sends a Unicast message. With the help
of complex routing mechanism, that Unicast message is delivered to the host
closest to the Sender in terms of Routing cost.
IPv6
IPv6
Address Structure
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block
is then converted into 4-digit Hexadecimal numbers separated by colon symbols.
For example, given below is a 128-bit IPv6 address represented in binary format
and divided into eight 16-bits blocks:
0010000000000001 0000000000000000 0011001000111000 1101111111100001
0000000001100011 0000000000000000 0000000000000000 1111111011111011
Each block is then converted into Hexadecimal and separated by : symbol:
8
IPv6
2001:0000:3238:DFE1:0063:0000:0000:FEFB
Even after converting into Hexadecimal format, IPv6 address remains long. IPv6
provides some rules to shorten the address. The rules are as follows:
Rule 1: Discard leading Zero(es):
In Block 5, 0063, the leading two 0s can be omitted, such as (5th block):
2001:0000:3238:DFE1:63:0000:0000:FEFB
Rule 2: If two of more blocks contain consecutive zeroes, omit them all and
replace with double colon sign ::, such as (6th and 7th block):
2001:0000:3238:DFE1:63::FEFB
Consecutive blocks of zeroes can be replaced only once by :: so if there are still
blocks of zeroes in the address, they can be shrunk down to a single zero, such
as (2nd block):
2001:0:3238:DFE1:63::FEFB
Interface ID
IPv6 has three different types of Unicast Address scheme. The second half of the
address (last 64 bits) is always used for Interface ID. The MAC address of a
system is composed of 48-bits and represented in Hexadecimal. MAC addresses
are considered to be uniquely assigned worldwide.
Interface ID takes advantage of this uniqueness of MAC addresses. A host can
auto-configure its Interface ID by using IEEEs Extended Unique Identifier (EUI64) format. First, a host divides its own MAC address into two 24-bits halves.
Then 16-bit Hex value 0xFFFE is sandwiched into those two halves of MAC
address, resulting in EUI-64 Interface ID.
IPv6
Link-Local Address
Auto-configured IPv6 address is known as Link-Local Address. This address
always starts with FE80. The first 16 bits of link-local address is always set to
1111 1110 1000 0000 (FE80). The next 48-bits are set to 0, thus:
10
IPv6
Link-local addresses are used for communication among IPv6 hosts on a link
(broadcast segment) only. These addresses are not routable, so a Router never
forwards these addresses outside the link.
Unique-Local Address
This type of IPv6 address is globally unique, but it should be used in local
communication. The second half of this address contains Interface ID and the
first half is divided among Prefix, Local Bit, Global ID, and Subnet ID.
11
5. SPECIAL ADDRESSES
IPv6
Version 6 has slightly complex structure of IP address than that of IPv4. IPv6
has reserved a few addresses and address notations for special purposes. See
the table below:
In IPv4, the address 0.0.0.0 with netmask 0.0.0.0 represents the default
route. The same concept is also applied to IPv6, the address
0:0:0:0:0:0:0:0 with netmask all 0s represents the default route. After
applying IPv6 rule, this address is compressed to ::/0.
The above table shows the reserved multicast addresses used by interior
routing protocol.
12
IPv6
These addresses help routers and hosts to speak to available routers and
hosts on a segment without being configured with an IPv6 address.
13
6. HEADERS
IPv6
The wonder of IPv6 lies in its header. An IPv6 address is 4 times larger than
IPv4, but surprisingly, the header of an IPv6 address is only 2 times larger than
that of IPv4. IPv6 headers have one Fixed Header and zero or more Optional
(Extension) Headers. All the necessary information that is essential for a router
is kept in the Fixed Header. The Extension Header contains optional information
that helps routers to understand how to handle a packet/flow.
Fixed Header
Version (4-bits):
0110.
Traffic Class (8-bits): These 8 bits are divided into two parts. The most
significant 6 bits are used for Type of Service to let the Router know
what services should be provided to this packet. The least significant 2
bits are used for Explicit Congestion Notification (ECN).
Flow Label (20-bits): This label is used to maintain the sequential flow
of the packets belonging to a communication. The source labels the
sequence to help the router identify that a particular packet belongs to a
specific flow of information. This field helps avoid re-ordering of data
packets. It is designed for streaming/real-time media.
14
IPv6
Payload Length (16-bits): This field is used to tell the routers how
much information a particular packet contains in its payload. Payload is
composed of Extension Headers and Upper Layer data. With 16 bits, up
to 65535 bytes can be indicated; but if the Extension Headers contain
Hop-by-Hop Extension Header, then the payload may exceed 65535
bytes and this field is set to 0.
Next Header (8-bits): This field is used to indicate either the type of
Extension Header, or if the Extension Header is not present, then it
indicates the Upper Layer PDU. The values for the type of Upper Layer
PDU are same as IPv4s.
Hop Limit (8-bits): This field is used to stop packet to loop in the
network infinitely. This is same as TTL in IPv4. The value of Hop Limit
field is decremented by 1 as it passes a link (router/hop). When the
field reaches 0, the packet is discarded.
This
field
indicates
the
address
of
Extension Headers
In IPv6, the Fixed Header contains only that much information which is
necessary, avoiding those information which is either not required or is rarely
used. All such information is put between the Fixed Header and the Upper layer
header in the form of Extension Headers. Each Extension Header is identified by
a distinct value.
When Extension Headers are used, IPv6 Fixed Headers Next Header field points
to the first Extension Header. If there is one more Extension Header, then the
first Extension Headers Next-Header field points to the second one, and so on.
The last Extension Headers Next-Header field points to the Upper Layer
Header. Thus, all the headers point to the next one in a linked list manner.
If the Next Header field contains the value 59, it indicates that there are no
headers after this header, not even Upper Layer Header.
The following Extension Headers must be supported as per RFC 2460:
15
IPv6
These headers:
Extension Headers are arranged one after another in a linked list manner, as
depicted in the following diagram:
16
7. COMMUNICATION
IPv6
In IPv4, a host that wants to communicate with another host on the network
needs to have an IP address acquired either by means of DHCP or by manual
configuration. As soon as a host is equipped with some valid IP address, it can
speak to any host on the subnet.
To communicate on layer-3, a host must also know the IP address of the other
host. Communication on a link is established by means of hardware-embedded
MAC Addresses. To know the MAC address of a host whose IP address is known,
a host sends ARP broadcast and in return, the intended host sends back its MAC
address.
In IPv6, there are no broadcast mechanisms. It is not a must for an IPv6
enabled host to obtain an IP address from DHCP or manually configure one, but
it can auto-configure its own IP.
ARP has been replaced by ICMPv6 Neighbor Discovery Protocol.
DAD (Duplicate Address Detection): When the host does not listen
from anything from the segment regarding its Neighbor Solicitation
message, it assumes that no duplicate address exists on the segment.
Once a host is done with the configuration of its IPv6 addresses, it does the
following things:
IPv6
18
8. SUBNETTING
IPv6
19
IPv6
Tunneling
In a scenario where different IP versions exist on intermediate path or transit
networks, tunneling provides a better solution where users data can pass
through a non-supported IP version.
20
IPv6
[Image: Tunneling]
The above diagram depicts how two remote IPv4 networks can communicate via
a Tunnel, where the transit network was on IPv6. Its reverse is also possible
where the transit network is on IPv6 and the remote sites that intend to
communicate are on IPv4.
21
10. MOBILITY
IPv6
Home Link: This link is configured with the home subnet prefix and this
is where the Mobile IPv6 device gets its Home Address.
Home Address: This is the address which the Mobile Node acquires from
the Home Link. This is the permanent address of the Mobile Node. If the
Mobile Node remains in the same Home Link, the communication among
various entities takes place as usual.
Home Agent: This is a router that acts as a registrar for Mobile Nodes.
Home Agent is connected to Home Link and maintains information about
all Mobile Nodes, their Home Addresses, and their present IP addresses.
Foreign Link: Any other Link that is not Mobile Nodes Home Link.
Mobility Operation
When a Mobile Node stays in its Home Link, all communications take place on its
Home Address as shown below:
22
IPv6
23
IPv6
Route Optimization
When a Correspondent Node initiates a communication by sending packets to
the Mobile Node on the Home Address, these packets are tunneled to the Mobile
Node by the Home Agent. In Route Optimization mode, when the Mobile Node
receives a packet from the Correspondent Node, it does not forward replies to
the Home Agent. Rather, it sends its packet directly to the Correspondent Node
using Home Address as Source Address. This mode is optional and not used by
default.
24
11. ROUTING
IPv6
Routing concepts remain same in case of IPv6 but almost all routing protocols
have been redefined accordingly. We discussed earlier how a host speaks to its
gateway. Routing is a process to forward routable data choosing the best route
among several available routes or path to the destination. A router is a device
that forwards data that is not explicitly destined to it.
There exists two forms of routing protocols:
Routing protocols
RIPng
RIPng stands for Routing Information Protocol Next Generation. This is an
Interior Routing Protocol and is a Distance Vector Protocol. RIPng has been
upgraded to support IPv6.
OSPFv3
Open Shortest Path First version 3 is an Interior Routing Protocol which is
modified to support IPv6. This is a Link-State Protocol and uses Djikrastas
Shortest Path First algorithm to calculate best path to all destinations.
25
IPv6
BGPv4
BGP stands for Border Gateway Protocol. It is the only open standard Exterior
Gateway Protocol available. BGP is a Distance Vector protocol which takes
Autonomous System as calculation metric, instead of the number of routers as
Hop. BGPv4 is an upgrade of BGP to support IPv6 routing.
DNS: There has been no new version of DNS but it is now equipped with
extensions to provide support for querying IPv6 addresses. A new AAAA
(quad-A) record has been added to reply IPv6 query messages. Now the
DNS can reply with both IP versions (4 & 6) without any change in the
query format.
26
12. SUMMARY
IPv6
IPv4 since 1982, has been an undisputed leader of Internet. With IPv4s address
space exhaustion, IPv6 is now taking over the control of Internet, which is called
Internet2.
IPv4 is widely deployed and migration to IPv6 would not be easy. So far IPv6
could penetrate IPv4s address space by less than 1%.
The world has celebrated World IPv6 Day on June 08, 2011 with a purpose to
test IPv6 address over Internet in full. On June 06, 2012 the Internet community
officially launched IPv6. This day all ISPs who were offering IPv6 were to enable
it on public domain and were to keep it enable. All the device manufacturer also
participated to offer IPv6 by-default enabled on devices.
This was a step towards encouraging Internet community to migrate to IPv6.
Organizations are provided plenty of ways to migrate from IPv4 to IPv6. Also
organizations, willing to test IPv6 before migrating completely can run both IPv4
and IPv6 simultaneously. Networks of different IP versions can communicate and
user data can be tunneled to walk to the other side.
Future of IPv6
IPv6 enabled Internet version 2 will replace todays IPv4 enabled Internet. When
Internet was launched with IPv4, developed countries like U.S. and Europe took
the larger space of IPv4 for deployment of Internet in their respective countries
keeping future need in mind. But Internet exploded everywhere reaching and
connecting every country of the world increasing the requirement of IPv4
address space. As a result, till this day U.S. and Europe have many IPv4 address
space left with them and countries like India and China are bound to address
their IP space requirement by means of deployment of IPv6.
Most of the IPv6 deployment is being done outside U.S., and Europe. India and
China are moving forward to change their entire space to IPv6. China has
announced a five year deployment plan named China Next Generation Internet.
After June 06, 2012 all major ISPs were shifted to IPv6 and rest of them are still
moving.
IPv6 provides ample of address space and is designed to expand todays
Internet services. Feature-rich IPv6 enabled Internet version 2 may deliver more
than expected.
27