Unit 5 IPv6
Unit 5 IPv6
Unit 5 IPv6
In IP, each end node is uniquely identified by its IP address, whether the end node is part of a public or a
private network. An IPV4 address consists of 4 bytes in the form a.b.c.d (E.g. 173.14.2.225, 11.12.13.3). It can
be logically divided into a network and a host portion. While the network portion identifies the network to
which the end node belongs to, the host portion uniquely identifies the end node, from the other end nodes,
inside the network. IPV4 addressing supports two forms, namely class based and classless based, though class-
based approach is outdated.
Class A
The first octet denotes the network address, and the last three octets are the host portion. Any IP
address whose first octet is between 1 and 126 is a Class A address. Note that 0 is reserved as a part of
the default address and 127 is reserved for internal loopback testing.
Format: network.host.host.host
The first two octets denote the network address, and the last two octets are the host portion. Any
address whose first octet is in the range 128 to 191 is a Class B address.
Format: network.network.host.host
Class C
The first three octets denote the network address, and the last octet is the host portion. The first octet
range of 192 to 223 is a Class C address.
Format: network.network.network.host
Class D
Used for multicast. Multicast IP addresses have their first octets in the range 224 to 239.
Class E
Reserved for future use or research purpose and includes the range of addresses with a first octet from
240 to 255.
Classless IP addresses
Classful IP addresses is no longer popular and instead has been replaced with the
concept of classless IP address, where there is no concept of IP address classes and
no strict network and host boundaries. In classless IP addressing, there is no concept of Classful
addressing like Classes A, B, C, D and E. IPV4 address range 0.0.0.0 to 223.255.255.255 treated as a
single class. No strict 8-byte boundaries for the network and host portions. A Subnet masks defines
network & host boundaries. This approach is very useful for optimizing address usage.
In the above address, 16 and 21 denote the subnet masks respectively. This means
that in the first address 22.10.0.0, the first 16 bits are reserved for the network
portion and the rest of the 16 bits are reserved for the host portion. Similarly, in the
second address 173.2.224.0/21, the first 21 bits are reserved for the network
portion and the remaining 13 bits are reserved for the host portion. Thus, it can be seen that classless
addressing gives a flexible boundary between the
network and host portions, thereby allowing lot of flexibility in partitioning the
networks.
Header Format:
• Version number. These 4 bits specify the IP protocol version of the datagram. By looking at the
version number, the router can determine how to interpret the remainder of the IP datagram.
Different versions of IP use different datagram formats. The datagram format for the current
version of IP, IPv4, is shown in Figure.
• Header length. Because an IPv4 datagram can contain a variable number of options (which are
included in the IPv4 datagram header), these 4 bits are needed to determine where in the IP
datagram the data actually begins. Most IP datagrams do not contain options, so the typical IP
datagram has a 20-byte header.
• Type of service. The type of service (TOS) bits were included in the IPv4 header to allow different
types of IP datagrams (for example, datagrams particularly requiring low delay, high throughput,
or reliability) to be distinguished from each other. For example, it might be useful to distinguish
real-time datagrams (such as those used by an IP telephony application) from non-real-time
traffic (for example, FTP). The specific level of service to be provided is a policy issue determined
by the router’s administrator.
• Datagram length. This is the total length of the IP datagram (header plus data), measured in
bytes. Since this field is 16 bits long, the theoretical maximum size of the IP datagram is 65,535
bytes. However, datagrams are rarely larger than 1,500 bytes.
• Identifier, flags, fragmentation offset. These three fields have to do with so-called IP
fragmentation. Interestingly, the new version of IP, IPv6, does not allow for fragmentation at
routers.
• Time-to-live. The time-to-live (TTL) field is included to ensure that datagrams do not circulate
forever (due to, for example, a long-lived routing loop) in the network. This field is decremented
by one each time the datagram is processed by a router. If the TTL field reaches 0, the datagram
must be dropped.
• Protocol. This field is used only when an IP datagram reaches its final destination. The value of
this field indicates the specific transport-layer protocol to which the data portion of this IP
datagram should be passed. For example, a value of 6 indicates that the data portion is passed
to TCP, while a value of 17 indicates that the data is passed to UDP. Note that the protocol
number in the IP datagram has a role that is analogous to the role of the port number field in
the transport layer segment. The protocol number is the glue that binds the network and
transport layers together, whereas the port number is the glue that binds the transport and
application layers together. The link-layer frame also has a special field that binds the link layer
to the network layer.
• Header checksum. The header checksum aids a router in detecting bit errors in a received IP
datagram. The header checksum is computed by treating each 2 bytes in the header as a
number and summing these numbers using 1s complement arithmetic. The 1s complement of
this sum, known as the Internet checksum, is stored in the checksum field. A router computes
the header checksum for each received IP datagram and detects an error condition if the
checksum carried in the datagram header does not equal the computed checksum. Routers
typically discard datagrams for which an error has been detected. Note that the checksum must
be recomputed and stored again at each router, as the TTL field, and possibly the options field as
well, may change.
• Source and destination IP addresses. When a source creates a datagram, it inserts its IP address
into the source IP address field and inserts the address of the ultimate destination into the
destination IP address field. Often the source host determines the destination address via a DNS
lookup.
• Options. The options fields allow an IP header to be extended. Header options were meant to be
used rarely—hence the decision to save overhead by not including the information in options
fields in every datagram header. However, the mere existence of options does complicate
matters—since datagram headers can be of variable length, one cannot determine a priori
where the data field will start. Also, since some datagrams may require options processing and
others may not, the amount of time needed to process an IP datagram at a router can vary
greatly. These considerations become particularly important for IP processing in high-
performance routers and hosts. For these reasons and others, IP options were dropped in the
IPv6 header.
• Data (payload). Finally, we come to the last and most important field—the raison d’être for the
datagram in the first place! In most circumstances, the data field of the IP datagram contains the
transport-layer segment (TCP or UDP) to be delivered to the destination. However, the data field
can carry other types of data, such as ICMP messages.
Issues with IPv4:
Deficiency of address space - The devices connected to the Internet grows exponentially. The
size of address space 2^32 is quickly exhausted;
Too large routing tables
• Weak expansibility of the protocol - the insufficient size of heading IPv4 doesn't allow to place
demanded quantity of additional parameters in it;
• Problem of safety of communications - it is not stipulated any means for differentiation of
access to the information placed in a network;
• Absence of support of quality of service (QoS) - accommodation of the information about
throughput, the delays and demanded for normal work of some network appendices is not
supported;
• The problems connected with the mechanism of a fragmentation - the size of the maximal block
of data transmission on each concrete way is not defined;
• Absence of the auto-configuration IP addresses mechanism.
Overview of IPv6:
To respond to the need for a large IP address space, a new IP protocol, IPv6, was developed. Also, major
issues of IPv4 are addressed in this version.
The most important changes introduced in IPv6 are evident in the datagram format:
Expanded addressing capabilities. IPv6 increases the size of the IP address from 32 to 128 bits.
This ensures that the world won’t run out of IP addresses. Now, every grain of sand on the
planet can be IP-addressable. In addition to unicast and multicast addresses, IPv6 has introduced
a new type of address, called an any-cast address, which allows a datagram to be delivered to
any one of a group of hosts.
A streamlined 40-byte header. As discussed below, a number of IPv4 fields have been dropped
or made optional. The resulting 40-byte fixed-length header allows for faster processing of the IP
datagram. A new encoding of options allows for more flexible options processing.
Flow labeling and priority. IPv6 has an elusive definition of a flow. This allows “labeling of
packets belonging to particular flows for which the sender requests special handling, such as a
non-default quality of service or real-time service.” For example, audio and video transmission
might likely be treated as a flow.
IPv6 Simplifications:
• Remove header checksum: Because the transport-layer (for example, TCP and UDP) and link-
layer (for example, Ethernet) protocols in the Internet layers perform check summing, the
designers of IP probably felt that this functionality was sufficiently redundant in the network
layer that it could be removed.
• Remove hop-by-hop segmentation: IPv6 does not allow for fragmentation and reassembly at
intermediate routers; these operations can be performed only by the source and destination. If
an IPv6 datagram received by a router is too large to be forwarded over the outgoing link, the
router simply drops the datagram and sends a “Packet Too Big” ICMP error message back to the
sender.
• Options. An options field is no longer a part of the standard IP header. However, it has not gone
away. Instead, the options field is one of the possible next headers pointed to from within the
IPv6 header. The removal of the options field results in a fixed-length, 40-byte IP header.
IPv6 Header:
2 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).
3 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.
4 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.
5 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.
6 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.
IPv6 address is 128 bits long and is arranged in eight groups, each of which is 16 bits. Each group is
expressed as four hexadecimal digits and the groups are separated by colons.
Even after converting into Hexadecimal format, IPv6 address remains long. An IPv6 address may be
abbreviated to shorter notations by application of the following rules:
That address can be shortened because the addressing scheme allows the omission of any leading zero,
as well as any sequences consisting only of zeroes.
E.g.: FE80:CD00:0000:0CDE:1257:0000:211E:729C
Here's the short version:
FE80:CD00:0:CDE:1257:0:211E:729C
Rule 2: If two of more blocks contain consecutive zeroes, omit them all and replace with double colon sign
::
2001:0000:3238:DFE1:63:0000:0000:FEFB
can be written as
2001:0000:3238:DFE1:63::FEFB
The IPv6 addressing architecture allows you use the two-colon (::) notation to represent contiguous 16-
bit fields of zeros.
CIDR Notation is similar to IPv4 addresses, IPv6 addresses consist of NetworkID + HostID, and use
classless notation to identify (distinguish between) the two. Network ID is also referred to as prefix, and
the number of bits allocated to Network ID as prefix length. Information on the prefix is provided
together with each IPv6 address as a slash (/) at the end of the address followed by the prefix length.
IPv6 vs IPv4:
IPv4 IPv6
IPv4 addresses are 32 bit length. IPv6 addresses are 128 bit length.
IPv4 addresses are binary numbers IPv6 addresses are binary numbers
represented in decimals. represented in hexadecimals.
Because of the huge number of systems on the internet, the transition from IPv4 to IPv6 cannot happen
suddenly. The transition must be smooth to prevent any problems between IPv4 and IPv6 systems.
Dual stack
Tunneling
Header translation
Dual Stack:
Dual-stack transition mechanism enables to run both IP stacks (IPv4 and IPv6) in a single node. Maintains
both IP protocol stacks that operates parallel and thus allow the end node to use either protocols. Node
is capable of handling both kinds of IP (IPv4&IPv6) routing. Flow or routing decisions in the node are
based on IP header version’s field. Both IPv4 and IPv6 shares common transport layer protocols such as
TCP/IP. Many of client and server operating systems provide dual IP protocol stacks. For example:
Windows 7, 8, Linux
The Dual Stack Router, can communicate with both the networks. It provides a medium for the hosts to
access a server without changing their respective IP versions.
Fig: A dual-stack approach
In the dual-stack approach, if either the sender or the receiver is only IPv4-capable, an IPv4 datagram
must be used. As a result, it is possible that two IPv6-capable nodes can end up, in essence, sending IPv4
datagrams to each other. Suppose Node A is IPv6-capable and wants to send an IP datagram to Node F,
which is also IPv6-capable. Nodes A and B can exchange an IPv6 datagram. However, Node B must
create an IPv4 datagram to send to C. Certainly, the data field of the IPv6 datagram can be copied into
the data field of the IPv4 datagram and appropriate address mapping can be done. However, in
performing the conversion from IPv6 to IPv4, there will be IPv6-specific fields in the IPv6 datagram (for
example, the flow identifier field) that have no counterpart in IPv4. The information in these fields will
be lost. Thus, even though E and F can exchange IPv6 datagrams, the arriving IPv4 datagrams at E from D
do not contain all of the fields that were in the original IPv6 datagram sent from A.
Tunneling:
Tunneling is a strategy used when two computers using IPv4 want to communicate with each other and
the packet must pass through a region that uses IPv6. To pass through this region, the packet must have
an IPv6 address. So the IPv4 packet is encapsulated in an IPv6 packet when it enters the region, and it
leaves its capsule when it exits the region. Seems as if the IPv4 packet goes through a tunnel at one end
and emerges at the other end.
An alternative to the dual-stack approach is known as tunneling. Tunneling can solve the problem noted
above, allowing, for example, E to receive the IPv6 datagram originated by A. The basic idea behind
tunneling is the following. Suppose two IPv6 nodes (for example, B and E in Figure) want to interoperate
using IPv6 datagrams but are connected to each other by intervening IPv4 routers. We refer to the
intervening set of IPv4 routers between two IPv6 routers as a tunnel, as illustrated in Figure. With
tunneling, the IPv6 node on the sending side of the tunnel (for example, B) takes the entire IPv6
datagram and puts it in the data (payload) field of an IPv4 datagram. This IPv4 datagram is then
addressed to the IPv6 node on the receiving side of the tunnel (for example, E) and sent to the first node
in the tunnel (for example, C). The intervening IPv4 routers in the tunnel route this IPv4 datagram
among themselves, just as they would any other datagram, blissfully unaware that the IPv4 datagram
itself contains a complete IPv6 datagram. The IPv6 node on the receiving side of the tunnel eventually
receives the IPv4 datagram (it is the destination of the IPv4 datagram!), determines that the IPv4
datagram contains an IPv6 datagram, extracts the IPv6 datagram, and then routes the IPv6 datagram
exactly as it would if it had received the IPv6 datagram from a directly connected IPv6 neighbor.
Header Translation:
Translation mechanism refers the direct conversion of IP protocols. May include transformation of both
IPv4 and IPv6 protocol’s header and payload according to their IP specifications. Translation mechanisms
always need translators that can translate particular IPv4 address to particular IPv6 address and vice
versa. A host with IPv4 address sends a request to an IPv6 enabled server on Internet that does not
understand IPv4 address. In this scenario, the NAT-PT device can help them communicate. When the
IPv4 host sends a request packet to the IPv6 server, the NAT-PT device/router strips down the IPv4
packet, removes IPv4 header, and adds IPv6 header and passes it through the Internet. When a response
from the IPv6 server comes for the IPv4 host, the router does vice versa.