Skip to main content

UNDERSTANDING IP ADDRESSING




                     Understanding IP Addressing: 
               Everything You Ever Wanted To Know


Background
The Internet continues to grow at a phenomenal rate. This is reflected in the 
tremendous popularity of the World Wide Web (WWW), the opportu-nities that 
businesses see in reaching customers from virtual storefronts, and the emergence 
of new ways of doing business. It is clear that expanding business and public 
awareness will continue to increase demand for access to resources on the Internet.
Internet Scaling Problems
Over the past few years, the Internet has experienced two major scaling issues as it 
has struggled to provide continuous and uninterrupted growth:
 The eventual exhaustion of IP version 4 (IPv4) address space
 The need to route traffic between the ever increasing number of net-works 
that comprise the Internet
The first problem is concerned with the eventual depletion of the IP address space. 
IPv4 defines a 32-bit address which means that there are only 232 (4,294,967,296) 
IPv4 addresses available. As the Internet con-tinues to grow, this finite number of 
IP addresses will eventually be exhausted.
The address shortage problem is aggravated by the fact that portions of the IP 
address space have not been efficiently allocated. Also, the tradi-tional model of 
classful addressing does not allow the address space to be used to its maximum 
potential. The Address Lifetime Expectancy (ALE) Working Group of the Internet 
Engineering Task Force (IETF) has expressed concerns that if the current address 
allocation policies are not modified, the Internet will experience a near to medium 
term exhaus-tion of its unallocated address pool. If the Internet’s address supply 
problem is not solved, new users may be unable to connect to the global Internet. 
More than half of all possible IPv4 addresses have been assigned to ISPs, 
corporations, and government agencies, but only an estimated 69 million addresses 
are actually in use.

About IP Addressing
 IP Address is short for Internet Protocol Address.
 It is a unique address assigned to each computing device in an IP network.
 ISP assigns IP Address to all the devices present on its network.
 Computing devices use IP Address to identify and communicate with other.

Types Of IP Address-
IP Addresses may be of the following two types

1.Static IP Address-
 Static IP Address is an IP Address that once assigned to a network element
always remains the same.
 They are configured manually.
 Some ISPs do not provide static IP addresses.
 Static IP Addresses are more costly than dynamic IP Addresses
2. Dynamic IP Address-
Dynamic IP Address is a temporarily assigned IP Address to a network element.
 It can be assigned to a different device if it is not in use.
 DHCP or PPPoE assigns dynamic IP addresses.
IP Address Format-
IP Address is a 32 bit binary address written as 4 numbers separated by dots.
 The 4 numbers are called as octets where each octet has 8 bits.
 The octets are divided into 2 components- Net ID and Host ID
1.Network ID represents the IP Address of the network and is used to identify the
network.
2. Host ID represents the IP Address of the host and is used to identify the host
within the network.
IP Address Example-
                         Example of an IP Address is-
           00000001.10100000.00001010.11110000
                          (Binary Representation)
                                            OR
                                    1.160.10.240
                          (Decimal Representation)
 There are two systems in which IP Addresses are classified-
                          Classful Addressing
In Classful Addressing System, IP Addresses are organized into following 5 classes
1. Class A- If the 32 bit binary address starts with a bit 0, then IP Address belongs
to class A.
In class A IP Address,
 The first 8 bits are used for the Network ID.
 The remaining 24 bits are used for the Host ID.

Total Number Of IP Addresses-
Total number of IP Addresses available in class A
= Numbers possible due to remaining available 31 bits = 231
Total Number Of Networks-
Total number of networks available in class A
= Numbers possible due to remaining available 7 bits in the Net ID – 2
= 27
– 2 = 126
Total Number Of Hosts-
Total number of hosts that can be configured in class A
= Numbers possible due to available 24 bits in the Host ID – 2 = 224
– 2
(The reason of subtracting 2 is explained later.)
Range Of 1st Octet- We have-
 Minimum value of 1st octet = 00000000 = 0
 Maximum value of 1st octet = 01111111 = 127
From here,
 Range of 1st octet = [0, 127]
 But 2 networks are reserved and unused.
 So, Range of 1st octet = [1, 126]
Use- Class A is used by organizations requiring very large size networks like NASA, Pentagon etc.

2. Class B- If the 32 bit binary address starts with bits 10, then IP Address belongs
to class B.
In class B IP Address,
 The first 16 bits are used for the Network ID.
 The remaining 16 bits are used for the Host ID.



Total Number Of IP Addresses-
Total number of IP Addresses available in class B
= Numbers possible due to remaining available 30 bits = 230
Total Number Of Networks-
Total number of networks available in class B
= Numbers possible due to remaining available 14 bits in the Net ID = 214
Total Number Of Hosts-
Total number of hosts that can be configured in class B
= Numbers possible due to available 16 bits in the Host ID – 2 = 216
– 2
Range Of 1st Octet- We have-
 Minimum value of 1st octet = 10000000 = 128
 Maximum value of 1st octet = 10111111 = 191
So, Range of 1st octet = [128, 191]
Use- Class B is used by organizations requiring medium size networks like
IRCTC, banks etc.
3. Class C- If the 32 bit binary address starts with bits 110, then IP Address
belongs to class C. In class C IP Address,
 The first 24 bits are used for the Network ID.
 The remaining 8 bits are used for the Host ID.


Total Number Of IP Addresses-
Total number of IP Addresses available in class C
= Numbers possible due to remaining available 29 bits= 229
Total Number Of Networks-
Total number of networks available in class C
= Numbers possible due to remaining available 21 bits in the Net ID = 221
Total Number Of Hosts-
Total number of hosts that can be configured in class C
= Numbers possible due to available 8 bits in the Host ID – 2 = 28
– 2
Range Of 1st Octet-We have-
 Minimum value of 1st octet = 11000000 = 192
 Maximum value of 1st octet = 110111111 = 223
So, Range of 1st octet = [192, 223]
Use-Class C is used by organizations requiring small to medium size networks.
 For example- engineering colleges, small universities, small offices etc.
4. Class D- If the 32 bit binary address starts with bits 1110, then IP Address
belongs to class D.
 Class D is not divided into Network ID and Host ID.


Total Number Of IP Addresses-
Total number of IP Addresses available in class D


= Numbers possible due to remaining available 28 bits = 228
Range Of 1st Octet We have-
 Minimum value of 1st octet = 11100000 = 224
 Maximum value of 1st octet = 11101111 = 239
So, Range of 1st octet = [224, 239]
Use
 Class D is reserved for multicasting.
 In multicasting, there is no need to extract host address from the IP Address.
 This is because data is not destined for a particular host.
5. Class E- If the 32 bit binary address starts with bits 1111, then IP Address belongs to class E
Class E is not divided into Network ID and Host ID.
Total Number Of IP Addresses-
Total number of IP Addresses available in class E
= Numbers possible due to remaining available 28 bits = 228

Range Of 1st Octet-We have-
 Minimum value of 1st octet = 11110000 = 240
 Maximum value of 1st octet = 11111111 = 255
So, Range of 1st octet = [240, 255]
Use- Class E is reserved for future or experimental purposes.

Rules for assigning Host ID:
The Host ID is used to determine the host within any network. The Host ID is
assigned based on the following rules:
o The Host ID must be unique within any network.

o The Host ID in which all the bits are set to 0 cannot be assigned as it is used
to represent the network ID of the IP address.
o The Host ID in which all the bits are set to 1 cannot be assigned as it is
reserved for the multicast address.
Rules for assigning Network ID:
If the hosts are located within the same local network, then they are assigned with
the same network ID. The following are the rules for assigning Network ID:
o The network ID cannot start with 127 as 127 is used by Class A.
o The Network ID in which all the bits are set to 0 cannot be assigned as it is
used to specify a particular host on the local network.
o The Network ID in which all the bits are set to 1 cannot be assigned as it is
reserved for the multicast address.
Classes of IP Address- All the classes of IP Address are summarized in the
Classless Addressing
Classless Addressing is an improved IP Addressing system.
 It makes the allocation of IP Addresses more efficient.
 It replaces the older classful addressing system based on classes.
 It is also known as Classless Inter Domain Routing (CIDR).
CIDR Block-
When a user asks for specific number of IP Addresses,
 CIDR dynamically assigns a block of IP Addresses based on certain rules.
 This block contains the required number of IP Addresses as demanded by the
user.
 This block of IP Addresses is called as a CIDR block.
Rules For Creating CIDR Block- A CIDR block is created based on the
following 3 rules-
Rule-01: All the IP Addresses in the CIDR block must be contiguous.
Rule-02:
 The size of the block must be presentable as power of 2.
 Size of the block is the total number of IP Addresses contained in the block.
 Size of any CIDR block will always be in the form 2'¹
, 2'²
, 2'³
, 2'⁴
, 2'5 and so on.
Rule-03: First IP Address of the block must be divisible by the size of the block.
REMEMBER
If any binary pattern consisting of (m + n) bits is divided by 2n
, then-
 Remainder is least significant n bits
 Quotient is most significant m bits
So, any binary pattern is divisible by 2n
, if and only if its least significant n bits are 0.
Examples-
Consider a binary pattern-
01100100.00000001.00000010.01000000
(represented as 100.1.2.64)
 It is divisible by 25
since its least significant 5 bits are zero.
 It is divisible by 26
since its least significant 6 bits are zero.
 It is not divisible by 27
since its least significant 7 bits are not zero.

CIDR Notation-
CIDR IP Addresses look like- a.b.c.d / n
They end with a slash followed by a number called as IP network prefix.
 IP network prefix tells the number of bits used for the identification of network.
 Remaining bits are used for the identification of hosts in the network.
Subnetting in Networking-
In networking,
 The process of dividing a single network into multiple sub networks is called
as subnetting.
 The sub networks so created are called as subnets.
Example-Following diagram shows the subnetting of a big single network into 4
 smaller subnets
Advantages- The two main advantages of subnetting a network are-
 It improves the security.
 The maintenance and administration of subnets is easy.
Subnet ID-Each subnet has its unique network address known as its Subnet ID.
 The subnet ID is created by borrowing some bits from the Host ID part of the IP
Address.
 The number of bits borrowed depends on the number of subnets created.

Types of Subnetting-
Subnetting of a network may be carried out in the following two ways.
1. Fixed Length Subnetting- Fixed length subnetting also called as classful
subnetting divides the network into subnets where-
 All the subnets are of same size.
 All the subnets have equal number of hosts.
 All the subnets have same subnet mask.
2. Variable Length Subnetting- Variable length subnetting also called
as classless subnetting divides the network into subnets where-
 All the subnets are not of same size.
 All the subnets do not have equal number of hosts.
 All the subnets do not have same subnet mask.
Disadvantages of Subnetting-
1. Subnetting leads to loss of IP Addresses.
During subnetting,
 We have to face a loss of IP Addresses.
 This is because two IP Addresses are wasted for each subnet.
 One IP address is wasted for its network address.
 Other IP Address is wasted for its direct broadcasting address.
2. Subnetting leads to complicated communication process
After subnetting, the communication process becomes complex involving thefollowing 4 steps-
1. Identifying the network.
2. Identifying the sub network
3. Identifying the host
4. Identifying the process

Subnet Mask Use- Subnet mask is used to determine to which network the given
IP Address belongs to. Host use its subnet mask to determine whether the other
host it wants to communicate with is present within the same network or not.
 If the destination host is present within the same network, then source host sends
the packet directly to the destination host.
 If the destination host is present in some other network, then source host routes
the packet to the default gateway (router).
 Router then sends the packet to the destination host.