Internet Protocols and
Algorithms
IPv4 and IPv6
IPv4
• IPv4 stands for Internet Protocol version v4 stands
for Version Four (IPv4), is the most widely used
system for identifying devices on a network.
• The IPv4 protocol allows interconnected networks
and transmission of data from one place (source) to
the destination.
IPv4
• IPv4 addresses are 32-bit numbers that are typically
displayed in dotted decimal notation.
• A 32-bit address contains two primary parts: the
network prefix and the host number.
• All hosts within a single network share the same
network address.
• Each host also has an address that uniquely identifies
it.
IPv4 - Subnet Mask
• The 32-bit IP address contains information about the
host and its network.
• For this, routers use Subnet Mask, which is as long as
the size of the network address in the IP address.
• Subnet Mask is also 32 bits long. If the IP address in
binary is ANDed with its Subnet Mask, the result
yields the Network address. For example, say the IP
Address is 192.168.1.152 and the Subnet Mask is
255.255.255.0.
IPv4 - Subnet Mask
• This way the Subnet Mask helps extract the Network
ID and the Host from an IP Address. It can be
identified now that 192.168.1.0 is the Network
number and 192.168.1.152 is the host on that
network.
IPv4
• Depending on the scope of the network and the type
of device, the address is either globally or locally
unique.
• Devices that are visible to users outside the network
(webservers, for example) must have a globally
unique IP address.
• Devices that are visible only within the network must
have locally unique IP addresses.
IPv4
• IP addresses are assigned by a central numbering
authority that is called the Internet Assigned
Numbers Authority (IANA).
• IANA ensures that addresses are globally unique
where needed and has a large address space
reserved for use by devices not visible outside their
own networks.
IPv4 Classful Addressing
• To provide flexibility in the number of addresses
distributed to networks of different sizes, 4-octet
(32-bit) IP addresses were originally divided into
three different categories or classes: class A, class B,
and class C.
• Each address class specifies a different number of
bits for its network prefix and host number.
IPv4
• Class A addresses: use only the first byte (octet) to
specify the network prefix, leaving 3 bytes to define
individual host numbers.
• Class B addresses: use the first 2 bytes to specify the
network prefix, leaving 2 bytes to define host
addresses.
• Class C addresses: use the first 3 bytes to specify the
network prefix, leaving only the last byte to identify
hosts.
IPv4
• In binary format, with an x representing each bit in
the host number, the three address classes can be
represented as follows:
IPv4
• In each IP address class, the number of host-number
bits raised to the power of 2 indicates how many
host numbers can be created for a particular network
prefix.
• Class A addresses have 224 (or 16,777,216) possible
host numbers, class B addresses have 216 (or 65,536)
host numbers, and class C addresses have 28 (or 256)
possible host numbers.
IPv4
• Following are IP addresses in binary format and their
dotted decimal equivalents:
IPv4 Subnetting
• Because of the physical and architectural limitations
on the size of networks, you often must break large
networks into smaller subnetworks.
IPv4 Subnetting
• The figure shows a network comprised of three
subnets.
IPv4 Subnetting
• The figure show three devices connected to the
Alpha subnet on the left, three devices connected to
the Beta subnet on the right, and a third subnet
named Gamma that interconnects the left and right
subnets over a WAN link. Collectively, the six devices
and three subnets are contained within the larger
class B network prefix. In this example, the
organization is assigned the network
prefix 172.16/16, which is a class B address. Each
subnet is assigned an IP address that falls within this
class B network prefix.
IPv4
• In addition to sharing the class B network prefix (the
first two octets), each subnet shares the third octet.
Because we are using a /24 network mask in
conjunction with a class B address, the third octet
identifies the subnet.
• All devices on a subnet must have the same subnet
address. In this case, the alpha subnet has the IP
address 172.16.1.0/24, the beta subnet has the IP
address 172.16.2.0/24, and the Gamma subnet is
assigned 172.16.10.10/24.
IPv4
• Because the first 24 bits in the 32-bit address identify
the subnet, the last 8 bits are available to assign to
hosts attachments on each subnet. To reference a
subnet, the address is written as 172.16.10.0/24 (or
just 172.16.10/24).
• The /24 indicates the length of the subnet mask
(sometimes written as 255.255.255.0). This network
mask indicates that the first 24 bits identify the
network and subnetwork while the last 8 bits identify
hosts on the respective subnetwork.
Assignment
• IPv4 supports three different types of addressing
modes.
• Prepare a PowerPoint presentation on these three
modes.
Unicast Addressing Mode
• In this mode, data is sent only to one destined host.
The Destination Address field contains 32- bit IP
address of the destination host. Here the client sends
data to the targeted server.
Broadcast Addressing Mode
• In this mode, the packet is addressed to all the hosts
in a network segment. The Destination Address field
contains a special broadcast address,
i.e. 255.255.255.255. When a host sees this packet
on the network, it is bound to process it. Here the
client sends a packet, which is entertained by all the
Servers.
Multicast Addressing Mode
• This mode is a mix of the previous two modes, i.e.
the packet sent is neither destined to a single host
nor all the hosts on the segment.
• In this packet, the Destination Address contains a
special address which starts with 224.x.x.x and can
be entertained by more than one host.
Multicast Addressing Mode
• Here a server sends packets which are entertained by
more than one servers. Every network has one IP
address reserved for the Network Number which
represents the network and one IP address reserved
for the Broadcast Address, which represents all the
hosts in that network.
Problems with IPv4
• A Less number of available IPv4. The total number of
available IPs is 4 294 967 296 (232).
• Does not support IPsec natively. Yes, it could be
configured, but it is harder.
• Limited IPv4 header (60 bytes).
• The price of IPv4 is rising. Each year the price is
rising.
IPv6
IPv6
• IPv6 is the latest version of IP and introduced to
replace the IPv4 back in 1998.
• IPv6 is mostly faster than IPv4.
IPv6 Address Format
• All IPv6 addresses are 128 bits long, written as 8
sections of 16 bits each.
• They are expressed in hexadecimal representation,
so the sections range from 0 to FFFF.
• Sections are delimited by colons, and leading zeroes
in each section may be omitted.
• If two or more consecutive sections have all zeroes,
they can be collapsed to a double colon.
IPv6
• IPv6 addresses consist of 8 groups of 16-bit
hexadecimal values separated by colons (:).
• IPv6 addresses have the following format:
• Each aaaa is a 16-bit hexadecimal value, and each a is
a 4-bit hexadecimal value. Following is a sample IPv6
address: