IPv4 and IPv6

1. IPv4
○ Address type
○ Notations
○ IPv4 Packet Format
○ Network Address Translation (NAT)

2. IPv6
○ why we need IPv6 IP address?
○ Structure
○ Packet Format
○ Extension Headers
○ Advantages.

3. Transition from IPv4 to IPv6
○ Dual Stack
○ Tunneling
○ Header translation


Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol.
It is one of the core protocols which is based on standards of internetworking
methods in the Internet.
It was first used in the ARPANET in 1983
It is a connectionless protocol which is used on packet-switched networks.
It provides the logical connection between network devices by providing
unique identity to each device.
It is based on the best-effort model, which guarantees neither delivery nor
avoidance of duplicate delivery.
Address Type
Address Space is the total number of addresses used by the protocol.
IPv4 is a 32 bit address which means it consist of 2^32 (i.e. 4,294,967,296)
address space
Example: is an IPv4 address
Theoretically, more than 4 billion device can be connected to internet.
But due to imposed restriction on IP addresses, actual number is much


IPv4 address can be represented in two way:
● Binary Notation: IPv4 is a 32 bit address in which there are 4 octet each
having the bytes.
● Dotted Decimal Notation: IPv4 address are written in decimal notation
to make it more compact and easier to read.Each number in dotted
decimal notation value ranges from 0 to 255. Decimal Notation
10101101 .00010000. 10010110. 00001100 Binary Notation

IPv4 Packet Format
The IPv4 packet header consists of 14 fields,out of which 13 are used. It
consists of 20 bytes of data.
● Version:- The first header field in an IP packet is the four-bit which
indicates the version of the internet header.This four-bit field is set to
binary 0100 for IPv4 or binary 0110 for IPv6.
● Header length:- It is also known as Internet Header Length (IHL). The
second field (4 bits) tells the number of 32-bit words in the header. The
minimum value for this field is 5.

Type of Service(ToS):– It also known as Differentiated Services Code Point
(DSCP). This field is used to carry information to provide quality of service
features. With the development of new technologies that require real-time
data streaming. Example Voice over IP (VoIP). Here we use DSCP field.
● Total Length:- This field is of 16 bit which defines the size entire datagram,
including header and data (in bytes). The minimum-length datagram is 20
bytes and the maximum is 65,535 bytes.
● Identifiers:– The identification field is used for uniquely identifying
fragments of an original IP datagram.

● Flags:–A 3 bits field is used to control and identify fragments. They are
○ bit 0: Reserved; must be zero.
○ bit 1: Don’t Fragment (DF)
○ bit 2: More Fragments (MF)
● Fragment Offset:-The fragment offset field is 13 bits long and specifies
the offset of a particular fragment.
● Protocol:-This field indicate the protocol used in the data portion of the IP
● Header Checksum:- It is of 16-bit which is used for error-checking of the

● Time To Live (TTL):-It is of 8 bit field which indicates the maximum time
for which a datagram is allowed to remain in the internet system. The
intention is to cause undeliverable datagrams to be discarded. The
maximum datagram lifetime (hops) in the range of 0-255.
● Source address :- This field indicate the IP address of source of packet.
● Destination address :- This field indicates the IP address of receiver of the
● Options:- This is an optional field reserved for future use.

Network Address Translation
NAT stands for Network Address Translation or Network Address
It is the virtualization of Internet Protocol (IP) addresses.
Network Address Translation is the process where a network device (like
firewall) assigns a public address to a computer inside a private network.
This helps in improving security and decrease the need of large number of
IP addresses in an organization.

In NAT, the private address range is used. I.e. to, to, and 192.168.0 0 to
NAT technique works well for computers that only have to access
resources inside the network, for example host want to access file servers
and printers.
Thus using private address routers inside the private network can route
traffic between private addresses with no trouble.

If a host want to access resources outside the network from Internet, then
the host must contain public IP address.
In this way (NAT) Network Address Translation works

IPv6 (Internet Protocol Version 6) is also known as IPng (Internet Protocol next
generation) and it is the most recent version of the Internet Protocol (IP).
It is a network layer protocol that that provides an identification and location of
computers on networks and routes the traffic across the Internet.
In Packet switching network, the data packets are send and receive between
two device.
IPv6 is introduced by the Internet Engineering Task Force (IETF) in 1998.

IPv6 was introduced to replace the widely used Internet Protocol Version 4
(IPv4) that is considered as the backbone of the modern Internet.
In 2004, Japan and Korea were first in public deployments of IPv6.

Features of IPv6
● It can support 128 bit long source and destination addresses.
● The header of IPv6 is simplified by moving all unnecessary information.
● It provide end to end connectivity by providing IP address to each
device in network and can communicate through the Internet without
using NAT.
● It does not require manual configuration or DHCP.
● It make faster forwarding/routing by simply removing the unnecessary
detail from header.
● IPv6 have IPSec security,which make it more secure than IPv4.

● IPv6 does not have any broadcast support. It uses multicast to
communicate with multiple hosts.
● IPv6 introduced a Anycast mode of packet routing in which packet is
route to the nearest destination.
● It enables hosts to roam in different geographical area and remain
connected with the same IP address.
● IPv4 used 6 bits DSCP (Differential Service Code Point) and 2 bits ECN
(Explicit Congestion Notification) to provide better Quality of Service
● It support smooth transition as the header is less loaded, so routers
can take forwarding decisions quickly as they arrive.

Why we need IPv6 IP address?
To make communication possible every device which is connected to internet
gets a unique number known as an IP address that connects it to the network.
Internet addressing system IPv4, has capacity for about 4.2 billion addresses.
The problem arise with the increase in number of new devices like computers,
smart phones, TVs, smart watches, cars etc these addresses are not enough to
meet the demand of new devices..
Thus, there a shortage of IPv4 addresses occur. So many methods were
adopted to prevent the depletion of IPv4, like Subnetting, VLSM and NAT etc
these methods were no longer able to provide IP address to networks for
future demands.
IPv4 is of 32 bits address, it can provide 2^32 IP addresses.
2^32 = 4294967296
= 4.2 billion
To overcome this limitation IPv6 Addresses are introduced:
IPv6 is of 128 bits which is 4 times of the IPv4 in bits size.
2^128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 total IP addresse
= 340 trillion trillion trillion
Thus, this is the reason with the deployment of IPv6 address.

An IPv6 address is of 128 bits long
It is divided into eight 16-bits blocks.
Each block is then converted into 4-digit.
it is represented by Hexadecimal numbers separated by colon symbols.

For example
IPv6 address represented in binary format and divided into eight 16-bits
0010000000000001 0000000000000000 0011001000111000
1101111111100001 0000000001100011 0000000000000000
0000000000000000 1111111011111011
Each block is then converted into Hexadecimal and separated by ‘:’

Some rules to shorten the IPv6 address
Rule.1: Discard leading Zero(es)
Leading zeros of a section can be omitted ,only leading 0s can be
dropped not trailing 0s, such as in block 5
Rule 2: Replace consecutive zero’s
If two or more blocks contain consecutive zeroes, omit them all and
replace it with double colon sign “::” such as in 6th and 7th block
Consecutive blocks of zeroes can be replaced only once,if there are
still blocks of zeroes in the address, they can be replaced by single
zero, such as in 2nd block

IPv6 Packet format
● Version: It is of 4 bits and remain constant i.e 6 or bit sequence 0110.
● Traffic Class: It is of 8 bits. This field hold two values. The 6
most-significant bits are used for differentiated services and remaining
two bits are used for ECN where the source provides data traffic
● Flow Label: It is of 20 bits and used for giving real-time applications
special service and also help to detect spoofed packets.
● Payload Length: It is of 16 bits. When a Hop-by-Hop extension header
holds a Jumbo Payload option then the length is set to zero.

● Next Header: It is 8 bits long which specifies the type of the next header
i.e. it specifies the transport layer protocol used by a packet’s payload.
● Hop Limit: It is 8 bits long and the value of this field decreases by one at
each intermediate node visited by the packet. When the counter reaches
0 the packet is discarded. This field replace the time to live field of IPv4.
● Source Address: It is 128 bits long and indicate the IP address of source
● Destination Address: It is 128 bits long and it indicate the IP address of
destination node.

Extension Header
Extension Header are added to give greater functionality to the IP datagram in
IPv6 address. It is added with a base header. These are the extension header:
● Hop-by-Hop option
● Source Routing
● Fragmentation
● Authentication
● Encrypted security payload
● Destination option

● Hop-by-Hop option: It is used when the source needs to pass information
to all routers visited by the datagram.The jumbo payload option is used to
define a payload longer than 65,535 bytes.
● Source Routing: The source routing Extension header is a method to
specify the route for an IPv6 datagram
● Fragmentation: Fragmentation header is used when a packet to be send
is larger than the Maximum Transmission Unit (MTU) a path can hold, then
the sending node splits the packet into fragments. The Fragment
extension header carries the information necessary to reassemble the
original packet at destination node.

● Authentication: Authentication extension header contains information
used to verify the authenticity of the packet.
● Encrypted Security Payload: It is used to contain information used to
verify the Confidentiality of most parts of the packet.
● Destination Option: Destination Option is used to examine the optional
information of data packet by the destination node.

1. Larger address space
2. Better header format
3. New additional options
4. Allowance for extension
5. More security

Transition from IPv4 to IPv6
Due to huge number of devices on internet,transition from IPv4 to IPv6
cannot happen suddenly.It will take some time to convert every device to
So,to make communication possible between every device in network we
need transition from IPv4 to IPv6.
Types of transition are:
1. Dual stack
2. Tunneling
3. Header Translation

1. Dual Stack
In Dual Stack, a router or a host is equipped with both IPv4 and IPv6
In the diagram shown,a hosts from IPv4 as well as IPv6 can access the
server with the help of a Dual Stack Router
The Dual Stack Router, can communicate with both the networks. Using
Dual Stack router we can also send and receive data belonging to both
protocols simultaneously.

Tunneling is a technique in which two computers using IPv6
addressing want to communicate with each other and the packets
have to pass through a region of IPv4 addressing.
So, to pass the packet through this region,it must contain IPv4 address.
In this when a packet enter the IPv4 region, IPv6 packet encapsulates
in a IPv4 packet and when it leaves that region IPv6 packet exit from
the IPv4 packet,
In such way, the IPv4 region create a tunnel to pass the IPv6 packets.

Header Translation
In a network, when a transmitter device transmit a packet in IPv6
format and the receiver still work at IPv4 format.
Then the tunneling technique will not work.
So, header translation technique is used in which header of IPv6
packet is converted to an IPv4 packet.
Header Translation use the mapped address to translate IPv6 to IPv4


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s