You are on page 1of 30

Ip addressing

IPv4 ADDRESSING
CLASSFUL ADDRESSING
CLASSLESS ADDRESSING

What is an IP Address ?
In IPv4, an IP address is a 32 bit address (logical) which
universally defines the connection of a host or router to
the Internet.
NOTE : IP address is the address of a connection, not of
a host or the router. Thus it can change when the device
is moved to another network.(Think DHCP !!)
E.g : When connected to NITT Wifi, this Computers IP
address is 10.1.76.23. When I access Wifi using a
hotspot, the IP address will be different from the
previous one. Infact IP address changes when you
switch routers
Gist : Dont get too attached to your IP address.

Also very important to note that IP address defines a


unique connection to the Internet. If a device has two
connections to the Internet simultaneously, it will have
two IP addresses.
Food for thought : What would happen if I were to
attach two IP addresses onto the same NIC ?

ADDRESS SPACE
Total number of addresses used by the protocol.
IPv4 uses 32 bits to define the address. So theoretically
there will be 2^32 addresses possible (4,294,967,296).
Thus if there werent any restrictions, more than 4
Billion devices could be connected to the Internet AT A
TIME.

ADDRESS NOTATION
32 bit address can be represented in three ways :
Binary Notation (Base 2)
10000000 00001011
00000011 00011111
Dotted Decimal Notation (Base 10) 128 . 11 . 3 . 31
Hexadecimal Notation (Base 16)
80 0B 03 1F

HIERARCHY IN ADDRESSING
32 bit IPv4 address is hierarchical, divided into 2 parts.
The first part of the address, called the prefix, defines
the NETWORK.
The second part of the address, called the suffix,
defines the NODE (connection of a device to the
Internet).
Prefix length is n bits, then the suffix length is 32-n bits.
Prefix can be of fixed length or variable length also.
Initially it was fixed length. This scheme was called
Classful Addressing. Then it as made variable length to
deal with few issues, and that scheme was called
Classless Addressing.

CLASSFUL ADDRESSING
When the Internet started, IPv4 was designed with a
fixed length prefix. There were 3 fixed length prefixes
(n=8,16,24) to accommodate large and small networks.
Thus the whole address space was divided into 5
classes : A,B,C,D,E

CLASS A ADDRESSING
Network Length is of 8 bits. But the first bit, which defines the class,
is set to 0. Thus only 7 bits act as the network identifier.
Default format 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
N Network Identifier. H Node identifier.
Thus only 128 networks in the world can have a Class A address.
Addresses per network : 2^24 : 16,777,216
But even in Class A there is no 0.0.0.0, because this is the default
gateway to the Internet.
Also there is no 127.x.x.x included since this is the Loopback IP
address.
Assigned to Large Organizations.

CLASS B ADDRESSING
The network length is 16 bits. The first two bits are set
to 10, to define the class.
Default Format
10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Address range : 128.x.x.x to 191.255.x.x
Number of Class B Networks possible : 2^14 : 16,384
Addresses per network : 2^16 : 65,536
Assigned to Medium Scale Organizations.

CLASS C ADDRESSING
Network Length is 24 bits. But first 3 bits set to 110.
Default format
110NNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Address Range : 192.0.x.x 223.255.x.x
Number of Networks possible : 2^21 : 2,097,152
Addresses per Network : 256
Assigned to Small Scale Organizations.

CLASS D & CLASS E ADDRESSES


CLASS D ADDRESSES : First 4 bits set to 1110. Address range is
224.x.x.x to 239.x.x.x
This Class is used in Multicasting. The data is not intended for any
particular host. Therefore there is no host or network address to be
extracted for the IP address.
Multicasting differs from Broadcasting in that in Multicasting the
Data is not intended for any particular receiver (like a video server
sending out Networked TV Channels). In broadcasting, the data is
sent to the connected receivers from a single sender.
CLASS E ADDRESSES : Range of addresses 240.x.x.x
255.255.255.255
Used for R&D purposes.

SUBNET MASKING
A subnet mask is a 32 bit number which tells the router
which all bits of the IP address are for the Network
portion and which are for the Host portion.
By default the Subnet mask for the Class A address is 8
(8 bits for network & 24 bits for host). For Class B
address it is 16 and for class C address, it is 24.

CONCEPT OF PRIVATE IP
ADDRESSES
Private IP Addresses are those addresses which are not
routable directly on the internet. These are used for
devices to identify themselves within a private network.
In Class A, private IP address ranges from 10.0.0.0 to
10.255.255.255
In Class B, private IP ranges from 172.16.0.0 to
172.31.255.255
In Class C, private IP ranges from 192.168.0.0 to
192.168.255.255

ADDRESS DEPLETION IN
CLASSFUL ADDRESSING
Classful addressing has become obsolete.
Consider the fact the IP addresses have been unevenly
distributed i.e Class A addresses can accommodate
almost 2^16 devices per network, which is a lot and
definitely no large organization will even have that
much size, while in Class C addresses, only 256 devices
can be accommodated per network and not many small
companies are that SMALL.
Thus the internet was faced with the problem of IP
addresses getting used up, leaving no space for new
entrants desiring to be connected to the Internet.

SUBNETTING
Large networks like the Class A & Class B address blocks are divided
into small blocks/subnetworks.
Each subnet has a larger prefix length than the original network.
By subnetting, we can create networks that are easier to manage.
Subnetting help to reduce network traffic by removing collision and
broadcast traffic. Consider that only 30 connections are needed in a
Class C address. If we didnt do any subnetting, all the 256 possible
connections would do route advertisement, which will slow down the
network. But by subnetting, we can create subnets of different sizes
desired which help to cut down on advertisements, thereby reducing
traffic intensity.
Money can be saved by reducing on equipment for IP range.

SUPERNETTING
Used to combine several Class C Blocks into a larger
block to be attractive to smaller companies which need
more than 256 addresses available in the Class C block ,
but not as much as the Class B block with 65,536
addresses in a network.

ADVANTAGE OF CLASSFUL
ADDRESSING
Obviously, the fact that by looking at the address itself,
we could decide which class it was and easily find the
prefix length

CLASSLESS ADDRESSING
In this method, the same address space is used, but gives a fair share
to organizations.
Here the Address spaces are divided into variable length blocks of
powers of 2 and are given to Internet Service Providers ISPs who
provide Internet access to the customers which may include large
scale, medium scale or small scale organizations or even individuals.
Theoretically we can have a block of 2^0,2^1,2^2,,2^32
addresses.
Prefix length is variable and can range from 0 to 32.
Network size is inversely proportional to the prefix length.
We can also think of the Address Classes as Classless addresses
whose prefix length is 8,16,24 for Class A,B,C addresses.

CLASSLESS INTER-DOMAIN
ROUTING (CIDR)
This is a representation of an IP Address and its
associated routing prefix. This is also called as the Slash
Notation.
It is constructed by an IP Address, a slash and a decimal
number. The number is the count of leading 1 bits in the
routing mask, traditionally called the network mask.
Consider the notation 220.8.24.255/25
This means that the prefix length is 25 bits, i.e the
network is defined by the first 25 bits in the address,
while the last 7 bits determine the address of the device
within the network.

EXTRACTING INFORMATION
FROM AN ADDRESS
Given the value of prefix length as n,
We can find the number of addresses in the block as
N=2^(32-n).
To find the first address within the network, keep the n
leftmost bits and set the (32-n) rightmost bits as 0s.
To find the last address within the network, keep the n
leftmost bits and set the (32-n) rightmost bits as 1s.

ADDRESS ALLOCATION BY ISPs


Ultimate responsibility of Block allocation falls with the Internet
Corporation for Assigned Names & Notations (ICANN).
ICANN allocates blocks of IP Addresses to ISPs.
When allocating blocks of addresses, two restrictions are placed on the
ISP :
Number of requested addresses, N, needs to be a power of 2 (N=2^(32n) i.e n=32-logN to the base 2. Thus is N not a power of 2, we cant have
an integer value for N)
Requested block must be allocated where there is an adequate number
of contiguous addresses available in the Address Space. The first address
in the space must be divisible by the number of addresses in the block so
that the first address can be the prefix followed by (32-n) number of 0s.

SUBNETTING
An organization which has been assigned a range of addresses
may divide the range into several subranges and assign each
subrange to a subnetwork.
If total number of addresses granted to organization is N, prefix
length is n, assigned number of addresses to each subnetwork
is Nsub and prefix length for each subnetwork is nsub :
Number of addresses in each subnetwork to be a power of 2.
Prefix length for each subnetwork nsub = 32-log2(Nsub)
Starting address in each subnetwork to be divisible by the
number of addresses in that subnetwork

ADDRESS AGGREGATION
One of the advantages of CIDR method.
Also called as Address Summarization or Route
Summarization
When blocks of addresses combined to create a larger
block, routing done based on prefix of the larger block.
Basically it minimises the number of routing tables in
the network and consolidates routes into a single route
advertisement.
It can reduce latency in a complex network
Network stability can be improved by reducing or
eliminating unnecessary routing updates.

INTRODUCTION TO IPv6
ADDRESSING
In the age of ever increasing devices desiring to be
connected to the Internet at all times, IoT and so on,
having only 4 Billion connections at a time wont suffice.
Address Depletion of the IPv4 is a major problem.
Also the lack of accommodation for Real time audio and
video transmission in IPv4 and encryption and
authentication of data for some applications, have been
the motivation for IPv6.
IPv6 address is of 128 bits long.

To make IPv6 address readable easily, they are


represented in hexadecimal colon notation.

Since the hexadecimal format is very long and mostly


filled with zeros, we can abbreviate the address.
The leading zeros in a section (4 digits between 2
colons) can be omitted.
ONLY leading zeros can be dropped, not trailing zeros.

ADDRESS SPACE OF IPv6


2^128 addresses are possible in IPv6
Just as IPv4 Classful addressing had Type prefixes for
Classes, IPv6 also has Type prefixes for different types of
addresses

You might also like