Sie sind auf Seite 1von 12

e-PG Pathshala

Subject : Computer Science Paper: Computer Networks

Module: IPv6 Overview Module No: CS/CN/29

Quadrant 1 – e-text

In this module, we will take a look at some of the new and interesting features of the
next-generation of the IPv4 protocol, namely IPv6 protocol. We will see how IPv6
addresses some of the problems that IPv4 has run into, especially in terms of
scalability, and addressing. The objectives for this module address the topics
mentioned below.
Learning Objectives:

 Motivation behind IPv6

 Features of IPv6

 IPv6 headers

 IPv6 addresses

 IPv4 to IPv6 transition


29.1 IPv6: motivation

The initial motivation for IPv6 was to find a solution to the IPv4 32-bit address-space
exhaustion problem. This was the first scalability issue that had to be addressed, as the
internet grew in leaps and bounds. As this change was necessary, additional
factors/goals were added for IPv6. Additional problems in IPv4 such as full support for
QoS were also considered. Further, the header format was revisited to help speed
processing/forwarding, and facilitate QoS.
29.2 IPv6 Features

Thus the major features of IPv6 are given below.

 Enlarged address space:- IPv6 addresses are 128-bits wide, giving us 2^128
different addresses, as against the 2^32 addresses of IPv4. That is a pretty large
number and is expected to cover the huge number of devices and things t hat are
likely to be connected in future.
The notation used to represent these addresses is a colon-hex notation as
shown below:
x:x:x:x:x:x:x:x , where x is 16-bits – written as 4 hex numbers.

That is, it is a list of 7 4-hex groups separated by colons. For example:


47AB:2345:4567:8765:AB45:CD98:879A:0001.

If there are contiguous 0s, they are compressed, and replaced with just two
colons, as illustrated below:
47CD::A456:0124 (between 47cd and a456, there are 16 zeros).

There is also a provision to specify IPv6 compatible IPv4 addresses as


::128.42.1.87 (the two :: in front indicate that the first 3 groups are all zero.

 Aggregation-based address hierarchy:- Further, this address is


organized/designed in a hierarchical manner such that aggregation of addresses
becomes easy (similar to CIDR addressing but with more levels). This helps in
efficient handling of addresses at the different routers, especially at the backbone
(ISP’s) routers which handle large numbers of addresses.

 Fixed header format:- The header format is simplified to have a fixed structure so
that processing and forwarding of packets is speeded up. The packet format is
designed such that any additional information is added as extensible headers, so
that only what is needed can be added. This improves efficiency of processing.

 Better support for Quality of Service:- QoS support is provided by means of


provision for specifying QoS requirements in each packet.

 Authentication and security:- Security is not an afterthought – it is integrated into


the IPv6 scheme with IPsec, the security part, being mandatory.

 Auto-configuration:- Address configuration is made easier without the need for a


separate protocol. Auto-configuration is part of the IPv6 protocol, and it is easier
for devices to get their IP addresses assigned.

 End-to-end fragmentation:- In order to reduce the processing at the routers, no


fragmentation is done at the routers; instead if any fragmentation is needed, it is
handled at the end systems. That is, the source machine IPv6 is responsible for
finding out the smallest MTU among the links in the path, and fragment the
packet accordingly and send the fragments. The destination IPv6 should put
them back together.

 Mobility:- The routing functionality is enhanced to include seamless support for


mobile hosts.
 Multicast:- Support for multicast routing is also enhanced. A feature called
“anycast” address, is supported, wherein it will route the packet to any of the
members in the group. This is useful when we have several replicated servers,
and need to reach any one of them.
29.3 IPv6 datagram format

The format of the IPv6 datagram is given in Fig. 29.1.

Figure 29.1 IPv6 datagram format


We can notice that it has a 40-byte base header followed by optional additional headers
and data. The version field which is the first field helps to identify this as a IPv6 packet,
so that it can be interpreted accordingly.
The next field, Traffic Class, identifies class of traffic or priority of datagram. It is an 8-
bit field available for use by originating nodes and/or forwarding routers to identify and
distinguish between different classes or priorities of IPv6 packets. For example, it can
be used as the codepoint in DiffServ networks. To use this field, the service interface
must provide means for upper-layer protocol to supply the value of the traffic class. The
value of the traffic class can be changed by the source, the forwarder, or the receiver.
An upper-layer protocol should not assume that the value of traffic class in a packet has
not been changed.
Next is the IPv6 Flow Label field, which is used to identify datagrams belonging to the
same flow. This is useful when we need to route related sequence of packets that need
special handling. The flow is normally identified by the combination of the three fields –
source address, destination address and flow label. The router can treat packets
belonging to a flow as having the same attributes – namely, path, resource allocation,
discard requirements, accounting, security, etc. Different flows may get different
treatments in terms of buffer sizes, forwarding precedence, quality of service, etc.
The next field is the Payload Length field, which specifies the length of the IPv6
payload as a 16-bit unsigned integer; i.e., the rest of the packet following this IPv6
header, in octets. Any extension headers present are considered part of the payload,
i.e., included in the length count.
This is followed by the NxtHeader field, which points to the next header if a header
exists, and identifies the upper layer protocol for data, if there are no further headers.
Next is the Hop Limit field, which is the equivalent of TTL. It counts the number of hops
travelled by the packet. It is decremented at each hop, and the packet is dropped if this
value goes to zero.
This is followed by the 128-bit source and destination addresses. Up to this is the 40-
byte fixed length base header. This may be followed by extension headers that handle
fragmentation, source routing, authentication, security and other options. These
extension headers are mostly of fixed length.
29.3.1 Changes from IPv4

The major changes from the IPv4 datagram format (given in Fig. 29.2) are as follows.

Figure 29.2 IPv4 datagram format for comparison


Six fields have been removed - ID, flags, flag offset, TOS, hlen, and header checksum.
Checksum is removed entirely to reduce the processing time at each hop.
Fragmentation related fields have been removed as fragmentation is not performed at
the routers. It is done only at the source end, and that information is specified in an
extension header.
Three fields have been changed - total length to payload length, protocol to next
header, and TTL to hop limit.
Two new fields have been added – traffic class and flow label.

Two fields have been expanded - source and destination IP addresses to 128 bits from
32 bits.
Other major changes are that options are allowed, but outside of header, indicated by
the “Next Header” field.

There is also a new version of the companion protocol ICMP, called ICMPv6, which
supports additional message types, such as “Packet Too Big”, and multicast group
management functions.
29.3.2 IPv6 Extension Headers

A few of the main extension headers and their purposes are listed below:
Routing – for extended routing, like IPv4 loose list of routers to visit
Fragmentation – for fragmentation and reassembly
Authentication – for integrity and authentication, and security
Encapsulation – for confidentiality
Hop-by-Hop Option – for special options that require hop-by-hop processing
Destination Options – for optional information to be examined by the destination node.

It is interesting to see how these headers are arranged in an IPv6 datagram. Some
examples are given in Fig. 29.3.

Figure 29.3 IPv6 Extension Header Examples


Fig. 29.3(a) shows the arrangement when there is no extension header. The Next
Header field in the base IPv6 header points to TCP, the upper layer protocol. Fig.
29.3(b) shows the case of an IPv6 packet with one extension header, namely, routing
header. The Next Header field in the base header points to the Routing header, and the
Next Header in the Routing header points to TCP. Fig. 29.3(c) shows a packet with two
headers. The base Next Header points to Routing header, and the Next Header field in
the Routing header points to the fragmentation header, which in turn points to TCP.

One important point to note is that, except the hop-by-hop extension header, none of
these headers is processed at the intermediate routers. This reduces processing time.
Also, except for the destination options header, none of the headers appears more than
once. Another important point to note is that, the headers if and when they are
specified, appear in a particular fixed order. The order is shown in Table 29.1.
Table 29.1 Extension Header Order

Order Header Type Next Hdr Code

1 Basic IPv6 Header

2 Hop-by-Hop Options 0

4 Routing header 43

5 Fragment header 44

6 Authentication header 51

7 Encapsulation Security Payload header 50

8 Destination Options 60

9 Mobility header 135

No Next header (Null) 59

Upper layer: TCP, UDP, ICMP 6, 17, 58


The hop-by-hop options must be examined by every router. It specifies discard and
forwarding behavior. Options include Pad1 – to pad one byte, PadN to pad n bytes,
Jumbo payload to indicate large payloads and so on.
The routing header lists of one or more intermediate nodes to visit on the way to the
destination (similar to the source routing option of IPv4). The header includes Next
Header, header extension length, Routing type (e.g. type 0 = Source Routing), and
segments left. An example of its use is shown in Fig. 29.4.

Figure 29.4 Source Routing Example

When the packet leaves the source A, it has R1 as the first router to be visited. Hence,
R1 is specified as the destination. At R1, the list is looked up to identify the next router
to visit – as R2, and so on. The Left field is updated to reflect the number of
hops/routers to be visited.
The fragment header is used to identify fragments and their sequence. In IPv6,
fragmentation is only performed by the source. The format of the fragmentation header
is given in Fig. 29.5.

Figure 29.5 Fragment header format


The fragment offset, more bit and identifier perform the same function as in IPv4
fragmentation, and the fragment header is present in each fragment. The offset, is given
in 8-octet units, of the data following this header, relative to the start of the fragmentable
part of the original packet. IPv6 header and any extension headers that must be
processed by nodes en route form the unfragmentable part.

The Path MTU Discovery mechanism is used to discover the maximum packet size that
can be sent along the path. If the MTU of any link is smaller than the packet length, it
needs to be fragmented. And this fragmentation is done at the source. As per IPv6
guidelines, the MTU of every link must be at least 1280 bytes.
The reassembly of the fragments is carried out only at the destination. The
unfragmentable part of the reassembled packet consists of all headers up to, but not
including, the fragment header of the first fragment packet. The Next Header field of the
last header of the unfragmentable part is obtained from the Next Header field of the first
fragment’s Fragment header. The Payload Length of the reassembled packet is
computed from the length of the unfragmentable part and the length and offset of the
last fragment.
29.4 IPv6 Addressing

As mentioned earlier, there are three categories of unicast addresses – Unicast,


Multicast and Anycast. In IPv6, addresses are assigned to interfaces, and not hosts. An
interface itself is expected to have multiple addresses.
The different addresses of an interface differ in their scope : Global unicast, Site-Local
unicast, Link-Local unicast, and multicast. The type of address is identified by the
address prefix as shown in the Fig. 29.6.

Figure 29.6 IPv6 address prefixes


The IPv4 compatible addresses have the first 96 bits as zeroes, followed by the 32-bit
IPv4 address. Global Unicast Address has a prefix of 001, and has global scope.
The global unicast address consists of a global routing prefix (48 bits), a subnet id (16
bits), and an interface id (64 bits). The global routing prefix, is a (typically hierarchically-
structured) value assigned to a site (a cluster of subnets/links). The Subnet ID identifies
a subnet within the site. The Interface ID is constructed in the modified EUI-64
(extended unique identifier – RFC 2464) format, from the MAC (48-bit) ID. Each of
these fields is divided into many sub-fields as shown below to facilitate aggregation at
various levels.

3 13 8 24 16 64

P TLA ID RES NLA ID SLA ID Interface ID

P : Format Prefix (001)


TLA : Top-Level Aggregation Identifier (8192)
RES : Reserved
NLA : Next-Level Aggregation Identifier
SLA : Site-Level Aggregation Identifier
Interface ID : Interface Identifier

To get the EUI-64 address for a 48-bit MAC address, 0xff-fe is inserted between the 3rd
and 4th bytes, and the universal/local bit (the second low-order bit of the first byte) is
complemented. For example, for a MAC address of 00-02-b3-1e-83-29, the EUI-64 ID
will be: 02-02-b3-ff-fe-1e-83-29.

Site local addresses, are meaningful only in a single site zone, and may be re-used in
other sites. This is equivalent to the IPv4 private address space. These addresses are
not automatically configured and must be assigned. The structure of these addresses is
given below:

Link local unicast address is meaningful only in a single link zone, and may be re -used
on other links. Link-local addresses are used with auto-configuration and when no
routers are present. These are required for Neighbor Discovery process. An IPv6 router
never forwards link-local traffic beyond the link. If the MAC address is known, it is
converted to EUI-64, and the Link local prefix is added to get the link local address. The
format of the link-local address is shown below. For the above example, the address will
be assigned as FE80::202:b3ff:fe1e:8329.
The only drawback of this technique is that the MAC address is known directly from the
IP address, and can cause security issues.
In addition to these there are a few other special IPv6 addresses as shown below.

 Loopback address (0:0:0:0:0:0:0:1 or ::1) to identify a loopback interface

 IPv4-compatible address (0:0:0:0:0:0:w.c.x.z or ::w.c.x.z)


This is used by dual-stack nodes – i.e., nodes running IPv4 and IPv6, and is
used to route IPv6 packets in an IPv4 infrastructure. IPv6 traffic is automatically
encapsulated with an IPv4 header and sent to the destination using the IPv4
infrastructure.

 IPv4 mapped address (0:0:0:0:0:FFFF:w.c.x.z or ::FFFF:w.c.x.z) used to


represent an IPv4-only node to an IPv6 node. This is never used as a source or
destination address of an IPv6 packet.
29.4.1 IPv6 Multicast Address

The format of a multicast address is shown in Fig 29.7.

Figure 29.7 Multicast addresses


29.5 Address Autoconfiguration

This feature allows plug and play. There are two methods for autoconfiguration:
Stateless and Stateful. In the stateless method, a system uses link-local address as
source and multicasts to "All routers on this link". The router replies and provides all the
needed prefix information. All prefixes have an associated lifetime. The system can use
the link-local address permanently if there is no router. The problem with stateless is
that anybody can connect to the network.
In the stateful method, the routers ask the new system to go to DHCP (DHCPv6) server
(by setting a managed configuration bit) by multicasting to "All DHCP servers". The
DHCP server assigns an address.
29.6 Transition From IPv4 To IPv6

A very important aspect of the IPv6 protocol, is the seamless mechanism provided to
upgrade or transition from IPv4 to IPv6 in an incremental fashion. Note that not all
routers can be upgraded simultaneously. It may take several years before the complete
transition to IPv6btakes place. So we will have a mix of IPv4 and IPv6 routers. So, how
will the network operate with mixed IPv4 and IPv6 routers, in a manner that is
transparent to end users?

There are two approaches for the transition: Dual stack approach, and the tunnel
approach. In dual stack approach, both IPv4 and IPv6 stacks will co-exist in the new
IPv6 devices; hence they will be able to work with IPv4 networks.
In the tunnel approach, IPv6 packets are tunneled through IPv4 networks, by
encapsulating IPv6 packets in IPv4 packets. These tunnels could be manually
configured or automatically configured using some special IPv6 addresses.
Figure 29.8 shows an example of tunneling where an IPv6 datagram is carried as a
payload in IPv4 datagram among IPv4 routers. Routers A, B, E and F are v6 routers
while C and D are v4 routers. Logically router B is connected to router E, but physically
it goes through C and D. Routers B and E are responsible for encapsulating the IPv6
packet in an IPv4 packet, and decapsulating it respectively.
Figure 29.8 IPv6 Tunneling through IPv4 network
29.7 Summary

Thus we have had an overview of the IPv6 protocol, and the many features that are built
into it. It is built on the experiences learned from IPv4 . It has a large address space,
new efficient header, and autoconfiguration as new features. Yet, it retains the
robustness of IP by essentially being IP !

Let us watch as to when we will have all IPv6 network!


Acknowledgements & References

1. Computer Networking: A Top Down Approach Featuring the Internet, 6th edition.
Jim Kurose, Keith Ross
Addison-Wesley, 2012.
2. Computer Networks: A systems Approach, 4 th edition, David Peterson, Davie,
Morgan Kauffman, 2012.

3. Computer Networks An Open Source Approach, Ying-Dar Lin, Ren-Hung Hwang,


Fred Baker, McGraw Hill, 2012.

Das könnte Ihnen auch gefallen