0 0
Read Time:8 Minute, 26 Second

In today’s technological era, we are witnessing a massive leap in the usage of the internet and networking devices. Every home has a laptop, smartphone, digital watch, IoT device, home automation component, and other devices that are connected to the home network or the Internet. Devices communicate with each other through various network protocols, with TCP and IP being the most frequently used protocols. Each device connected to the network must have an IP address that identifies the device on the network.

This article explains the Internet Protocol and how IPv6 differs from IPv4.

What is IP (Internet Protocol)?

Being humans, we identify and communicate with each other using our names. Likewise, in the computing world, devices use IP addresses to identify and interact with each other. A common language used by all computing devices to communicate with each other is known as a protocol. Akin to human languages, the protocol also has a set of rules that formats and processes the data.

The Internet Protocol (IP) is a set of rules that specifies addressing and routing the data between computers. It is mostly used with network transport protocols, such as TCP and UDP.

The Internet exists today because of this unique addressing pattern. The IANA manages the IP address ranges for networks/sites that connect to the Internet. However, if we run an isolated local network infrastructure, we can assign numbers according to our preference. Now, let’s get into the nitty-gritty of both architecture and its comparative analysis.


The first major version of Internet Protocol (IP) is version 4 (IPv4). It uses a 32-bit network addressing schema that further splits into four 8-bit numbers known as octets. For instance, google.com has an IP address of The format is known as dotted quad notation. These IP addresses can either be configured manually or automatically obtained through a DHCP server.

To check the live status of the remote device, we can do an ICMP probing to that IP using the ping command:

ping -c 1 google.com
PING google.com ( 56(84) bytes of data.
64 bytes from ams17s12-in-f14.1e100.net ( icmp_seq=1 ttl=116 time=247 ms


IP addresses are broken into two parts, network, and host addresses for creating sub-networks. The subnet numbers help to decide the network and host parts of the IP. Also, the available IP space is divided into five different classes as tabulated below.

Address ClassIP RangesSubnet MaskNo of NetworksNo of hosts per Network
Class A1.0.0.0 to,777,214
Class B128.0.0.0 to,28265,534
Class C192.0.0.0 to,097,150254
Class D224.0.0.0 to
Class E240.0.0.0 to

The calculation of subnet involves a few mathematical rubrics behind the screen. To ease our computation, we can use tools like ipcalc or subnetcalc for IPv4 subnetting. The below snippets shows how to use the tools:

Address: 01101110.00000000.00010100. 00010010
Netmask: = 24 11111111.11111111.11111111. 00000000
Wildcard: 00000000.00000000.00000000. 11111111
Network: 01101110.00000000.00010100. 00000000
HostMin: 01101110.00000000.00010100. 00000001
HostMax: 01101110.00000000.00010100. 11111110
Broadcast: 01101110.00000000.00010100. 11111111
Hosts/Net: 254 Class A
Address =
11000000 . 10101000 . 00001010 . 00001111
Network = / 24
Netmask =
Broadcast =
Wildcard Mask =
Hosts Bits = 8
Max. Hosts = 254 (2^8 - 2)
Host Range = { - }
Properties =
- is a HOST address in
- Class C
- Private
GeoIP Country = Unknown (??)
DNS Hostname = (Name or service not known)

Usually, IP addresses are given to the end host machine and router gateway interface, as illustrated below.

Here, the traffic from Machine A ( hits the router gateway interface ( at the left side of the internet cloud. It reaches Google Server gateway through Internet routing and finally to the destination server.

To identify the network interface IP you can use commands such ifconfig , hostname or ip .

ifconfig ens160
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet netmask broadcast
inet6 fe80::fc7f:d8da:a969:1c1d prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:23:6f:30 txqueuelen 1000 (Ethernet)
RX packets 35607241 bytes 34540488400 (34.5 GB)
RX errors 0 dropped 12 overruns 0 frame 0
TX packets 24701952 bytes 15008379564 (15.0 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
hostname -I

There are special purposes network IP addresses like or The former is the default route or quad-zero route, whilst the latter is called the loopback address.

In the below snippet, we’ll see the Kernel IP routing table with the default route for that network. The flag ‘U’ represents that the network route is UP, whilst G signifies that the network route is the network gateway.

netstat -rn | grep ens160
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface UG 0 0 0 ens160 U 0 0 0 ens160

Usually, the IPv4 datagram consists of a header field with 20 bytes, options field, and data fields with a variable length. The sample packet format is shown below.

Below, Wireshark capture helps to decipher the packet header information from the live traffic.


Internet Protocol version 6 is the updated version of Internet Protocol (IP). Version 6 of the Internet Protocol is intended to replace the older version (IPv4), which carries 75% of total internet traffic as of 2018 (Source: Google IPv6 Stats).

The IPv6 address is 128 bits (16 bytes) using 32 hexadecimal digits, whilst these digits are further divided into eight groups of four digits each for ease of management. A brief illustration is shown below.

There are few basic steps involved in the IPv6 naming convention.

Rule 1: All letters are case insensitive. For example, ‘ab41’ equals ‘AB41’ Rule 2: Successive fields with ‘0’ can be visualized as “::”, but only once in an addressing Rule 3: Representing leading zeros in a field are optional. For instance, ‘001a’ equals ‘1a’

For Instance, let’s take the IPv6 address, 45ab:0000:a179:0000:0000:c1c0:abcd:0876

Apply Rule 1 => 45ab:0000:a179:0000:0000:c1c0:abcd:0876 Apply Rule 2 => 45ab:0:a179:0:0:c1c0:abcd:876 Apply Rule 3 => 45ab:0:a179::c1c0:abcd:876

There are three types of IPv6 addresses: Unicast, Multicast, and Anycast. The unicast address is the single network interface and packets delivered to that specific interface. Additionally, unicast addresses have local(link-local) and global scope levels. Multicast address is the group interfaces to which the packets get delivered. Anycast address is the group interface and packet delivered to the nearest interface.

Few well-known addresses are tabulated below.

]::1/128Loopback address
ff00::/8Multicast addresses
fe80::/10Link-local addresses
2001::/16Regular IPv6 unicast addresses
2002::/166to4 Unicast addresses
subnetcalc 2001:4860:4860::8888/64
Address = 2001:4860:4860::8888
2001 = 00100000 00000001
4860 = 01001000 01100000
4860 = 01001000 01100000
0000 = 00000000 00000000
0000 = 00000000 00000000
0000 = 00000000 00000000
0000 = 00000000 00000000
8888 = 10001000 10001000
Network = 2001:4860:4860:: / 64
Netmask = ffff:ffff:ffff:ffff::
Wildcard Mask = ::ffff:ffff:ffff:ffff
Hosts Bits = 64
Max. Hosts = 18446744073709551616 (2^64 - 1)
Host Range = { 2001:4860:4860::1 - 2001:4860:4860:0:ffff:ffff:ffff:ffff }
Properties =
- 2001:4860:4860::8888 is a HOST address in 2001:4860:4860::/64
- Global Unicast Properties:
+ Interface ID = 0000:0000:0000:8888
+ Sol. Node MC = ff02::1:ff00:8888
GeoIP Country = United States (US)
DNS Hostname = dns.google

Again, the IPv6 packet has both header and payload. The header size is fixed to 40bytes, with source and destination address taking 32bytes. The sample packet format is shown below.

Though IPv6 has umpteen advantages, it cannot supplant IPv4. Both protocol versions have to co-exist for some time for seamless migration. Hence, the service providers are offering a dual-stack support system that possesses a network interface that can understand both IPv4 and IPv6 packets.

There are few smart transition mechanisms, namely IPv6 Tunneling, IPv4 mapped IPv6 addresses, etc. The former encapsulates the IPv6 packet in IPv4, whilst the latter maps the IPv6 to IPv4 addresses in the dual-stack implementations.

IPv4 vs IPv6 – Quick Comparative Analysis

FeaturesInternet Protocol – Version 4 [IPv4]Internet Protocol – Version 6 [IPv6]
Deployment & allocation19811999
Address Space4.29 x 10^93.4 x 10^38
FormatDotted Decimal / []Hexadecimal / [2400::4]
Number of Octets416
Header SizeVaries from 20 – 60 bytes40 bytes
ClassesFive classes: Class A, Class B, Class C, Class D, Class ENone
Security Features / Authentication and encryptionNot availableAvailable
Check sumAvailableNot available
IPSecExternal and optionalInbuilt feature
Hop CountIndicated by TTL fieldIndicated by Hoplimit field
FragmentationPerformed by sender and forwarding routersDone by sender only
Option FieldsProvided in the IPv4 headerThere are no optional fields, but IPv6 Extension headers are available
MulticastIGMP manages the multicast group membershipMLD replaces the IGMP
Broadcast messageAvailableNot available. Multicast is used
IP to MAC MappingAddress Resolution ProtocolNeighbour Discovery Protocol


We explored the basics of Internet Protocol and its versions. Along the way, the article elucidates the addressing schema, packet format, functioning of the IPv4 and IPv6 with comparative analysis. Though IPv4 is carrying the majority of Internet traffic today, IPv6 is the future of the networking world.