Você está na página 1de 13

1

Tutorial on IPv6
By
Bhuvaneswaran Vengainathan

In the mid of 1970s an effort has been made to develop an “integrated services” network
which can provide both voice services as well as data communication services. As a
result ATM network and IP network had been established. Both networks are based on
packet-switching. ATM is a connection oriented service and IP is a connectionless
service. Connection oriented service introduces complexity in the routers, whereas
connectionless service keeps the operation within the network simple and puts the
complexity to the edge of the network. Because of IP's simplicity, all networks (LAN,
WAN etc.) were built based on IP. IP refers to IPv4 (Internet Protocol Version 4). IPv4
provides a best-effort service which makes every effort to deliver the packet successfully
to the destination. When packets are lost due to congestion it does not take any action.
IPv4 uses a limited address space to address the nodes in very large networks. To
overcome some of the drawbacks in the existing IP, a new version of IP has been
introduced. The new version of IP is called IPv6 (Internet Protocol version 6), the Next
Generation Protocol.

This document addresses the features of IPv6 as compared to IPv4, the IPv6 header
format, the formation of IPv6 addresses, the types of IPv6 addresses and the Extension
headers of IPv6.

1. Transition from IPv4 to IPv6


Most of the useful features of IPv4 were carried over to IPv6.The below figure shows
the highlighted fields in IPv4 were carried over to IPv6 with some change in the field’s
name. Others (less useful features) in the IPv4 were dropped.

Figure 1.1: IPv4 to IPv6


2

The changes from IPv4 to IPv6 primarily into the following categories:
• Expanded Addressing Capabilities
IPv6 has 128 bits (16 – bytes) Source and Destination IP Addresses. This is a
change from 32 bits (4 - bytes) IP address to 128 bits IP address. The change is to
address a much greater number of nodes. New type of address is included in IPv6
called an “anycast address”, in which packets addressed to anycast address is
delivered to a single interface (the nearest that is identified by the address).

• New Header Format


The change is to simplify the header and to keep header overhead to a
minimum because the simpler the header, the faster the header can be processed by a
router. This is accomplished by moving less useful fields and optional fields to
extension headers that are placed after the basic IPv6 header.

• Flow Labeling Capability


Enable the labeling of packets from a particular source to a particular
destination for which the source requests special handling (Qos /real-time).

• Authentication and Privacy Capabilities


IPv6 includes support for security options, such as authentication (via
Authentication header), data integrity and data confidentiality.

2. IPv6 Header Format


Figure shows the format of an IPv6 header.

Ver. Traffic Class Flow Label

Payload Length Next Header Hop Limit

Source Address

Destination Address

Figure 2.1: IPv6 Header Format

• Version: IP version number (4-bits). The value of 4-bit version is 6.


• Traffic Class: 8-bit Traffic Class field. This field is set by the sender. This
field provides similar functionality as that of IPv4 Type of Service field. The
default value of Traffic Class field is set to 0.
3

• Flow Label: 20-bit flow label field. This field may be used by the sender to
label a sequence of packets for which the sender desires special handling by
intervening routers, such as real-time service (voice). There may be multiple
active flows from a source to a destination. The flow is uniquely identified by
the combination of a source address and a non-zero flow label. For default
router handling, the field is set to 0.
• Payload Length: 16-bit Payload Length field. This specifies the length of the
IPv6 payload (including extension headers if any) following the basic IPv6
header. The maximum value in this field is 65,535.
• Next Header: 8-bit Next Header field. Indicates the type of the extension
header (if present) or the protocol (such as TCP, UDP or ICMPv6) following
the IPv6 header.
• Hop Limit: 8-bit Hop Limit field. Indicates the maximum number of hops that
a packet can take before being discarded. The maximum value in this field is
255. The value gets decremented by 1 by each node that forwards the packet.
The packet is discarded if the Hop Limit is decremented to zero. This field is
same as that of the Time to Live (TTL) field in IPv4 header.
• Source Address: 128-bit Source Address field. IPv6 address of the originating
host.
• Destination Address: 128-bit Destination Address field. IPv6 address of the
intended recipient of the packet. In most cases the Destination Address is set
to the ultimate Destination Address. If the Routing header is present, the
Destination Address is set to the next router interface in the source route
address list.

Possible values in the Next Header field.


Value Description
0 Hop-by-Hop Options Header
1 Internet Control Message Protocol (ICMPv4)
(IPv4 support)
4 IP in IP (encapsulation)
6 Transmission Control Protocol (TCP)
17 User Datagram Protocol (UDP)
43 Routing Header
44 Fragmentation Header
50 Encrypted Security Payload Header
51 Authentication Header
58 Internet Control Message Protocol (ICMPv6)
59 No Next Header
60 Destination Options Header
134-254 Unassigned
255 Reserved

3. IPv6 Addresses
IPv6 addresses are 128 bits long, which is four times larger than an IPv4 address.
There are no address classes in IPv6, as we have with IPv4 but the high-order bits of
the128-bit address specifies the type of address.
4

IPv4 addresses are written in dotted decimal notation, where the decimal values are
separated by dots (e.g. 192.168.9.18). The same way IPv6 addresses are written as
eight 16-bits hexadecimal numbers, separated by colons (:)
(e.g. 3ffe:3f2b:f101:f201:4fbc:f201:f3b1:9c5a).

Some of IPv6 addresses contain long sequences of zeros. To simplify the


representation of IPv6 addresses, a compressed address form uses a double colon (::)
to specify contiguous sequence of 16-bit blocks of zero. Note that the double colon
(::) can appear only once in an IPv6 address. For example:

3ffe:3f2b:0:0:0:f201:f3b1:9c5a can be compressed as


3ffe:3f2b::f201:f3b1:9c5a

Network prefixes can also be represented by specifying a slash and the number of bits
specify the network (e.g. 3ffe:3f2b:: /8).

4. IPv6 Address Prefix Allocation


The high-order bits of the 128-bit address specify the type of address. The table
shows the different values of the high-order bits and the type of address these bits
imply.

IPv6 Address Prefix Allocation from RFC 1884.

Allocation Format Prefix Fraction of


(Binary) Address Space
Reserved 0000 0000 1/256
Unassigned 0000 0001 1/256
Reserved for NSAP Allocation 0000 001 1/128
Reserved for IPX Allocation 0000 010 1/128
Unassigned 0000 011 1/128
Unassigned 0000 1 1/32
Unassigned 0001 1/16
Unassigned 001 1/8
Provider-Based Unicast Address 010 1/8
Unassigned 011 1/8
Reserved for Geographic- 100 1/8
Based Unicast Addresses
Unassigned 101 1/8
Unassigned 110 1/8
Unassigned 1110 1/16
Unassigned 1111 0 1/32
Unassigned 1111 10 1/64
Unassigned 1111 110 1/128
Unassigned 1111 1110 0 1/512
Link Local Use Addresses 1111 1110 10 1/1024
Site Local Use Addresses 1111 1110 11 1/1024
Multicast Addresses 1111 1111 1/256
5

These high-order bits are called the format prefix. For example, if high-order 10 bits
are 1111111010, it is a Link Local Use Address.

5. Types of IPv6 Addresses


There are three types of IPv6 Addresses.
• Unicast
A unicast address identifies a single interface based on the scope
of the address. A packet sent to a unicast address is delivered to the interface
identified by that address.

S1 R1

S2 S3
Figure 5.1: Unicast
• Anycast
An Anycast address identifies multiple interfaces. A packet sent to
an anycast address is delivered to any one of the interfaces identified by that
address (typically the nearest one in terms of routing distance).

S1 R1 R2

Anycast Group

S4
Figure 5.2: Anycast
• Multicast
A Multicast address identifies multiple interfaces. A packet sent
to a multicast address is delivered to all interfaces identified by that address.

S1 R1

S2 S3 S4
Multicast Group
Figure 5.3: Multicast

Note: There are no Broadcast Addresses in IPv6.


6

6. Unicast IPv6 Addresses


The following addresses are categorized under Unicast IPv6 Addresses
o Aggregatable Global Unicast Addresses
o Link Local Addresses
o Site Local Addresses
o Unspecified Address
o Loopback Address
o IPv4 Mapped IPv6 Addresses
o IPv4 Compatible IPv6 Addresses

6.1 Aggregatable Global Unicast Addresses


Aggregatable Global Unicast Addresses are also known as Global Addresses,
which is identified by the high order 3 bits of 001. The address format is as
follows:

001 TLA ID RES NLA ID SLA ID Interface ID


3 13 8 24 16 64

• TLA-ID: Top Level Aggregation Identifier identifies the highest level in


the Routing hierarchy.
• NLA-ID: Next Level Aggregation Identifier identifies a specific customer
site.
• SLA-ID: Site Level Aggregation Identifier is used by an individual
organization to create its own local addressing hierarchy and to identify
subnets.
• Interface-ID: Interface Identifier is used to an interface on a link. Interface
ID is 64-bit in length. It is derived from the interface’s built-in 48-bit
IEEE 802 address. The first three octets of the Ethernet address become
company_id of EUI-64. The fourth and fifth octets of EUI-64 are set to
FFFE hexadecimal. The last three octets of the Ethernet address become
last three octets of the EUI-64.

The Interface Identifier is then formed from the EUI-64 by complementing the
“Universal/Local” (U/L) bit. For example:
Ethernet built-in address is 24-0B-2B-5D-6A-77 would be
26-0B-2B-FF-FE-5D-6A-77

6.2 Link Local Addresses


Link Local Addresses are identified by the high-order 10 bits of 1111111010.It is
used on a single link. These addresses are always beginning with fe80. The
address format is as follows:

1111111010 0 Interface ID
10-bits n-bits (118-n) bits
7

6.3 Site Local Addresses


Site Local Addresses are identified by the high-order 10 bits of 1111111011. It
can be used for addressing within a site. The scope of a site local address is the
site. A site is an organizational network or a portion of an organization network
(e.g. 192.168.9.0/24, 192.168.0.0/16). These addresses are always beginning with
fec0. The address format is as follows:

1111111011 0 subnet ID Interface ID


10-bits n-bits m-bits (118-n-m) bits

6.4 Unspecified Address


An Unspecified Address consists of all zeros in 128 bit IPv6 Address. It is written
as 0:0:0:0:0:0:0:0 (::). It indicates the absence of an IPv6 address. It is used as a
source address of IPv6 packets sent by a node that is bootstrapping, before the
node learns its IPv6 address. It is similar to the IPv4 address 0.0.0.0.

6.5 IPv4 Mapped IPv6 Addresses


These types of addresses are used to represent the addresses of IPv4 only node,
those that do not support IPv6. The address format is as follows:

0000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0000 FFFF IPv4 address


80-bits 16-bits 32-bits

6.6 IPv4 Compatible IPv6 Address


These types of addresses are used by Hosts and Routers to dynamically tunnel
IPv6 packets over IPv4 routing infrastructure. The address format is as follows:

0000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0000 0000 IPv4 address


80-bits 16-bits 32-bits

An example of this type of address is ::192.168.9.18.

7. Multicast IPv6 Addresses


A Multicast IPv6 Address is an identifier for a group of nodes. A node can listen
to any number of multicast addresses at the same time. Multicast address is used
as a destination address and cannot be used as a source address. The address
format is as follows:

11111111 flags scope group ID

8-bits 4-bits 4-bits 112-bits

• Flags: Flags are 4 bits long. The high-order 3 bits are reserved and set to
0. The fourth bit is called as T flag. When T flag set to 0, indicates a
permanently assigned multicast address (well-known). When T flag set to
1, indicates a non- permanently assigned multicast address (transient).
• Scope: Scope is a 4 bit value used to limit the scope of the multicast
group.
8

• Group ID: Group ID is 112 bits long. Group ID identifies the multicast
group.
Scope field values from RFC 1884
Value Scope
0 Reserved
1 Node-Local Scope
2 Link-Local Scope
3 Unassigned
4 Unassigned
5 Site-Local Scope
6 Unassigned
7 Unassigned
8 Organizational-Local Scope
9 Unassigned
A Unassigned
B Unassigned
C Unassigned
D Unassigned
E Global Scope
F Reserved

7.1 Predefined Multicast Addresses


The Multicast Address FF0X:0:0:0:0:0:0:0 is reserved, where the X value ranges
from 0 to F. These addresses shall never be assigned to any multicast group. The
following multicast addresses identify the group of all IPv6 nodes, within scope 1
or 2.

All Nodes Addresses FF01:0:0:0:0:0:0:1


FF02:0:0:0:0:0:0:1
The following multicast addresses identify the group of all IPv6 routers, within
scope 1 or 2.

All Router Addresses FF01:0:0:0:0:0:0:2


FF02:0:0:0:0:0:0:2
The following multicast address identifies all IPv6 routers, within scope 5.

All Router Addresses FF05:0:0:0:0:0:0:2

To query the network nodes efficiently during address resolution, Solicited Node
Address is used. The Address format is FF02:0:0:0:1:FFXX:XXXX, where X’s
are the low-order 24 bits of address (unicast or anycast).
9

8.IPv6 Extension Headers


An IPv6 packet may carry zero, one or more extension headers, each identified by
a Next Header value. Extension Headers (if present) can be placed between the
IPv6 header and the upper layer header in a packet. Currently defined Extension
headers are:
o Hop-by-Hop Options header
o Routing
o Fragment
o Authentication
o Encapsulating Security Payload
o Destination Options header (Identified by a Next Header
value of 60)

IPv6 Header Hop-by-hop Header UDP Header +


Next Hdr = Hop-by-Hop Next Hdr = UDP Data

Extension headers are processed or examined only by the node identified by the
destination address field of the IPv6 header. One exception is the Hop-by-Hop
Options header that must be examined by every node along packet’s delivery
path.

8.1 Hop-by-Hop Options


Carries optional information that must be examined by every node along a
packet’s delivery path. It is identified by a Next Header value of 0 in the IPv6
header. Hop-by-Hop Options header (if present) must be appear immediately after
an IPv6 header. The header format is as follows:

Next Header Hdr Extn Len


.
Options
.

• Next Header: Next Header is 8-bit long. Identifies the type of the header
immediately following the Hop-by-Hop Options header.
• Hdr Ext Len: Hdr Ext Len is 8-bit long. Specifies the length of Hop-by-
Hop Options header in 8-octet units.
• Options: Three Options for Hop-by-Hop Options header are defined here.
o Pad1 Option
o PadN Option
o Router Alert
Pad1 Option is used to insert one octet of padding into Options area of a header.

0 (8-bits)
10

PadN Option is used to insert two or more octets of padding into Options area of a
header.

1 (8-bits) Opt Data Len (8) Option Data…

For N octets padding, the Option Data Length field contains the value N-2, which
is of zero valued octets.
Router Alert Options are used in situations where an IPv6 packet addressed to
particular destination contains information for special processing by routers along
the path.

8.2 Routing Header


The Routing Header extension is similar to IPv4’s Loose Source and Record
Route option. It is used by the IPv6 source system to list one or more intermediate
nodes to be visited on its paths to the final destination. RFC 2460 defines a
Routing Type of zero. It is identified by a Next Header value of 43 in the
immediately preceding header. The header format for Routing header of Type 0 is
as follows:

Next Header Hdr Ext Len Routing Type = 0 Segments Left

Reserved

Address [1]

Address [n]

• Next Header: 8-bit Next Header field. Identifies the type of the header
immediately following the Routing header.
• Hdr Ext Len: 8-bit Hdr Ext Len. Specifies the length of Routing header in
8-octet units. The value of Hdr Ext Len is equal to two times the number
of addresses in source address list of the header. For example, if the
number of addresses is 2 then the value in the Hdr Ext Len will be 4.
• Routing Type: 8-bit Routing Type. The value is 0.
• Segments Left: 8-bit Segments Left. Specifies the number of nodes still to
be visited before reaching the final destination.
• Reserved: 32-bit Reserved field. Initialized to zero on transmission and
ignored on reception.
• Address[1 ..n]: Each Address is 128 bit long. It is the intermediate nodes
addresses that are to be visited on the way to packet’s final destination.
11

Src Address = S
Dest Address = R1 Src Address = S
Segments left = 2 Dest Address = D
Route Addr [1] = R2 Segments Left = 0
Route Addr [2] = D Route Addr [1] = R1
Route Addr [2] = R2

S R1 R2

Src Address = S D
Dest Address = R2 Src Address = S
Segments Left = 1 Dest Address = D
Route Addr [1] = R1 Segments Left = 0
Route Addr [2] = D Route Addr [1] = R1
Route Addr [2] = R2

Figure 8.2.1: Source Routing Example

8.3 Fragment Header


The Fragment header is used to send a packet larger than the path MTU to its
destination. If the packet is too large to fit into the path MTU, a source node may
divide the packet into fragments and send each fragment as a separate packet,
which is reassembled at the receiver. It is identified by a next header value of 44
in the immediately preceding header. The format is as follows:

Next Header Reserved Fragment Offset Res M

Identification

• Next Header: 8-bit Next Header field. Identifies the type of the header
immediately following the Fragmentable part of the original header.
• Reserved: 8-bit Reserved field. Initialized to zero on transmission and
ignored on reception.
• Fragment Offset: 13-bit Fragment Offset field. It is relative to the start of
the Fragmentable part of the original packet. The fragment offset value of
the first fragment is 0. The fragment offset value is represented in 8 octet
units
• Res: 2-bit Reserved field. Initialized to zero on transmission and ignored
on reception.
• M flag: 1=more fragments; 0 = last fragment.
• Identification: 32 bit Identification field. A node, on fragmenting an IPv6
packet, generates same identification value for all its fragments.
12

8.3.1 Fragmentation and Reassembly


When an Ipv6 packet is fragmented, fragments into two parts, namely
Unfragmentable and Fragmentable parts Each fragment, except possibly the last
one, being an integer multiple of 8 octets long.
Unfragmentable Part Fragmentable Part
• The Unfragmentable part consists of the IPv6 header plus any extension
headers must be processed by intermediate nodes. This part includes the
IPv6 header, Routing header (if present) and Hop-by-Hop Options header
(if present).
• The Fragmentable part of the original packet need be examined only by
the final destination node. This part includes Destination Options header
for final destination plus the upper layer header and data.
The original packet is reassembled only from fragment packets that have same
Source Address, Destination Address and Fragment Identification.
Original pkt (1500)
Reassembled pkt without Fragment Hdr

Unfragmentable Data
Path MTU = 1280 Part

Unfragmentable Fragment 1st fragment


Part header size<1280 Unfragmentable Fragment 1st fragment
Part header size < 1280
Unfragmentable Fragment 2nd (last)
Part header fragment Unfragmentable Fragment 2nd (last)
Part header fragment
Figure 8.3.1.1: Fragmentation and Reassembly

8.4 Destination Options Header


Carries optional information that needs to be examined only by a packet’s
destination node. The header is identified by the value 60 in the previous header’s
Next Header field. The header format is as follows:
Next Header Hdr Extn Len
.
Options
.
• Next Header: 8-bit Next Header field. Identifies the type of header
immediately following the Destination Options header.
• Hdr Ext Len: Hdr Ext Len is 8-bit long. Specifies the length of Destination
Options header in 8-octet units.
• Options: Only two options defined in Destination Options header.
o Pad1 Option
o PadN Option
13

References

RFC 2460: S. Deering and R. Hinden, Internet Protocol Version 6 Specification,


December 1998.

RFC 2464: M. Crawford, Transmission of IPv6 Packets over Ethernet Networks,


December 1998.

RFC 1884: R. Hinden and S. Deeering, IP Version 6 Addressing Architecture,


December 1995.

RFC 2374: R. Hinden, M. O’ Dell and S. Deeering, An IPv6 Aggregatable Global


Unicast Address Format, July 1998.

RFC 2375: R. Hinden and S. Deering, IPv6 Multicast Address Assignments,


July 1998.

ABOUT THE AUTHOR:


Bhuvaneswaran Vengainathan,
Software Engineer,
Net-O2 Technologies,
E-mail: vbhuvanes at yahoo.com.

Você também pode gostar