Module 4 Lec 31-36 - IP Addressing
Module 4 Lec 31-36 - IP Addressing
Disclaimer: The contents in this slide have been referred from many sources which I do not claim as my own. Some of the content has been modified for easier
understanding of the students without any malafide intention. This slide is only for educational purpose strictly, and not for the commercial purpose. Images
portrayed (if any) are not to hurt the sentiments of any person.
Objectives
• The objective of this module is to discus following concepts…
1. IP Addressing
2. Subnetting
3. Supernetting
10.0.73.23
Amit Jha, SOEE, KIIT-DU
IPv4 Addressing: Classful Addressing
• Total address space is divided into five classes, A, B, C, D, E.
• In binary notation, the first few bits can immediately tell us the class
of the address.
• In dotted-decimal notation, the first byte defines the class.
0-127
128-191
192-223
224-239
240-255
Amit Jha, SOEE, KIIT-DU
IPv4 Addressing: Class Ranges
Total # Networks Total # Hosts Application
Possible Possible
Let us say, when KIIT has established, it was given a class C address. So, in the starting,
KIIT could have used this class C address to accommodate 256 hosts, approximately all it
could have. Due to the exponential growth of KIIT, it now need to have more than 10000 hosts.
But, as per the class C, it can handle at max 256 hosts only if it could have used classful
addressing.
Note: In Classful addressing, either a large part of the available addresses are wasted or we are unable to
accommodate all hosts.
Amit Jha, SOEE, KIIT-DU
Classless Addressing & Block Allocation
• In this scheme, there are no classes, but the addresses are still granted in blocks.
This is done by the ICANN.
• However, ICANN does not normally allocate addresses to individual Internet
users. It assigns a large block of addresses to an IP.
• In classless addressing, when an entity, small or large, needs to be connected to the
Internet, it is granted a block (range) of addresses by ISP.
• The size of the block depends upon the size of entity.
• For proper operation of the CIDR, three restrictions need to be applied to the
allocated block. They are as follows:-
• Restriction:
1. The addresses in a block must be contiguous, one after another.
2. The number of addresses in a block N must be a power of 2.
3. The first address must be evenly divisible by the number of addresses.
HYU 4.6: Why all three restrictions need to be followed to allocate the block of IP addresses?
Amit Jha, SOEE, KIIT-DU
Example 4.7: An Example of classless address with Block Allocation
The network address can also be found out as (Given address AND Mask)
e.g., 11001101 00010000 00100101 00100111 AND Operation
11111111 11111111 11111111 11110000
11001101 00010000 00100101 00100000 = 205.16.37.32/28
Amit Jha, SOEE, KIIT-DU
Example 4.9: If in an organization, one of the address is 167.199.170.82/27 then find out,
its mask, network address, the first address, and the last address.
The network address can also be found out as (Given address AND Mask)
e.g., 10100111 11000111 10101010 01010010 AND Operation
11111111 11111111 11111111 11100000
10100111 11000111 10101010 01000000 = 167.199.170.64/27
Amit Jha, SOEE, KIIT-DU
Example 4.10: An ISP has requested a block of 1000 addresses. Determine the prefix length and verify
whether the firs address is divisible by total no of addresses or not. Also, note whether it follows all
three restrictions of block allocation or not.
Answer:- Since 1000 is not a power of 2, 1024 addresses are granted. The prefix length is calculated as n = 32 − log21024 =
22. Assume that an available block, 18.14.12.0/22, is granted to the ISP. It can be seen that the first address in decimal is
302,910,464, which is divisible by 1024.
Note: 18.14.12.0 = 00010010. 00001110. 00001100. 00000000 302910464 ( combining all bytes together)
What is the concept of subnet?
The process of dividing a larger network into smaller
number of sub networks is known as subnet.
Blind Rule: Borrow from the Host ID, thus subnetting increases the number of 1s in the mask (prefix).
Amit Jha, SOEE, KIIT-DU
Subnetting
• More level of hierarchy can be created using subnetting.
• An organization (or an ISP) that is granted a range of addresses may
divide the range into several subranges and assign each subrange to a
subnetwork (or subnet).
• Note that nothing stops an organization from creating more levels,
i.e.,
• A subnetwork can be divided into several sub-subnetworks.
• A sub-subnetwork can be divided into several sub-sub-subnetworks. And so
on..
•
Designing of Subnets
Subnet should be designed properly to felicitate routing of packets.
• Let total number of addresses granted to the organization is N, the prefix
length is n, the assigned number of addresses to each subnetwork is 𝑵𝒔𝒖𝒃
and the prefix length for each subnetwork is 𝒏𝒔𝒖𝒃 . Then following rules is
applied.
• The number of addresses in each subnetwork should be power of 2.
• The prefix length of each subnetwork is found using 𝒏𝒔𝒖𝒃 = 𝟑𝟐 − 𝒍𝒐𝒈𝟐 (𝑵𝒔𝒖𝒃 ).
• The starting address in each subnetwork should be divisible by the number of
addresses in the subnetwork. This can be achieved if we first assign addresses to the
larger subnetwork.
Few Key points to Remember for Subnet
• For a subnet,
A subnet with subnet id (prefix id) bits as all zeros is not used because this is not
allowed by most of the router, however, some of the routers like Cisco Systems
devices allow the use of these subnets when the id subnet zero command is
configured.
Similarly, a subnet with subnet id bits as all ones is not allowed however, some of
the devices may allow to use these subnetworks.
• In a subnet,
Host id with all host id (suffix id) bits set to zero is not allowed as host IP address
this is because, this results in first IP address in that subnet which is generally a
network (subnetwork here) address.
Host id (suffix id) with all host id bits set to one is not allowed as host IP address
this is because, this results in the broadcast address in that network (subnetwork
here).
Amit Jha, SOEE, KIIT-DU
Example 4.11:- Given the Class C network of 204.15.5.0/24, subnet the
network in order to create the network as shown in figure 3 with the host
requirements depicted therein.
Figure 3
Note:- Two bits would only allow you four subnets (22).
14 hosts
17 unused 14 hosts, 1 Network Address and 17 unused out of 32
Ans:-
By using Variable Length Subnet Masks (VLSM), we can avoid the unnecessary wastage of IP
addresses. VLSM allows us to use different masks for each subnet, thereby using address space
efficiently.
Figure 3
Observations:-
From these determinations, DeviceA and DeviceB have addresses that are part of the same subnet.
Brain Exercise: Repeat the this Homework if you don’t wish to choose 162.12.0.0 as an IP address for any of the subnetworks
Amit Jha, SOEE, KIIT-DU
and observe the number of unused addresses .
Give me a Solution !!!!!!!!!!
• Assume, your friend is sending a message from Alaska to you in
Bhubaneswar using Internet. Can you guess how many entries will be
there in routing table to which your friend is connected?
SOEE SOME
Other part of the
c world
a
a
KIIT Bhubaneswar
SOCS b d SO Ele.
Thus we need supernetting to reduce the burden of routers by combining several small networks into a super network.
Solution:
Supernet Mask: As four networks are to be combined with n= 24 each. Thus for supernet, the value of n becomes = 22
Thus supernet Mask = 11111111.11111111.11111100.00000000 = 255.255.252.0
First Network address: take any one of the given network address and make 32-22=10 right most bits 0.
Thus we get 192.16.0.0/22 as first network address.
Alternate Solution: Take any one of the given network address and do ‘AND’ operation with mask.
192. 16. 2. 0
AND 255. 255. 252. 0
192. 16. 0. 0 First Network address
Amit Jha, SOEE, KIIT-DU
Routing Table at Bhubaneswar Router