Classful addressing
Classful addressing
The value of any segment (byte) is between 0 and 255 (both included).
Three fixed-length prefixes were designed with n 8, n 16, and n 24
and respectively they are called as Class-A, B and C . The special classes
are D and E.
In class A, the network length is 8 bits, but since the first bit, which is 0,
defines the class, we can have only seven bits as the network identifier.
This means there are only 2 7 128 networks in the world that can have a
class A address.
In class B, the network length is 16 bits, but since the first two bits, which
are (10) 2, define the class, we can have only 14 bits as the network identifier. This means
there are only 214 = 16,384 networks in the world that can have a class B address.
. In class C, the network length is 24 bits, but since three bits 110 define the class, we can
have only 21 bits as the network identifier. This means there are 2 21 = 2,097,152 networks in
the world that can have a class C address.
Class D is not divided into prefix and suffix. It is used for multicast addresses. Next is class E
that start with 1111 in binary. Class E is not used and kept as reserve.
Example (1)
A classless address is given : 167.199.170.82/27. Find (a)
number of addresses (b)First address of the block and (c)
the last address of the block.
Example 18.2
A classless address is given as 167.199.170.82/27. The mask in
dotted-decimal notation is 255.255.255.224. Find:
(a)Number of addresses in the block
(b) First Address of the block
(c)The Last address of the block
Answer :
The AND, OR, and NOT operations need to be done when subnet
mask is given.
Note :
Bits for 255= 11111111
NOT operation on 255 = 00000000
Block Allocation
Two restrictions need to be applied to the allocated block.
1. The number of requested addresses N, needs to be a power of 2.
N = 2 32-n or n = 32 - log2N
2. One restriction is that the first address in the block needs to be
divisible by the number of addresses in the block.
Subnetting
• More levels of hierarchy can be created using subnetting.
• An organization that is granted a range of addresses may divide the
range into several subranges and assign each subrange to a subnet.
Designing Subnets
• Rule 01: The number of addresses in each subnetwork should be a
power of 2.
• Rule 02: The prefix length for each sub-network should be found
using the following formula:
nsub = 32 - log2Nsub
• Rule 03: The starting address in each subnetwork should be divisible
by the number of addresses in that sub-network.
When you are subnetting always Start from a bigger
subnet to smaller subnet
Example 18.5
An organization is granted a block of addresses with the
beginning address 14.24.74.0/24. The organization needs to
have 3 subblocks of addresses to use in its three subnets:
one subblock of 10 addresses,
one subblock of 60 addresses,
and one subblock of 120 addresses.
Design the subblocks
Solution:
• There are 232 – 24 = 256 addresses in this block. The first address is
14.24.74.0/24; the last address is 14.24.74.255/24.
• To satisfy the third requirement, we assign addresses to subblocks,
starting with the largest and ending with the smallest one.
Part (a)
• The number of addresses in the largest subblock, which requires
120 addresses, is not a power of 2. So we allocate 128 addresses.
• The subnet mask for this subnet can be found as
n1 = 32 − log2128 = 32 – 7 = 25.
• The first address in this block is 14.24.74.0/25 and the last
address is 14.24.74.127/25.
The first address of the block is divisible by number of addresses,
( It is evident by 7 lower bits of last byte (0) being 0’s )
Part (b)
• The number of addresses in the second largest subblock, which
requires 60 addresses.
• The number of addresses given is 60 again It is not a power of 2. So
we allocate 64 addresses.
• The subnet mask for this subnet can be found
as n2 = 32 − log264 = 32 – 6 = 26.
The first address in this block is 14.24.74.128/26; and the last
address is 14.24.74.191/26.
[ Again first address is divisible by number of addresses in this
block. It is evident by the lower 6 bits of the last byte (128)
contains 0’s]
Part-(c)
• The number of addresses in the smallest subblock, which requires
10 addresses, is not a power of 2 either. So we allocate 16
addresses.
• The subnet mask for this subnet can be found as : n3 = 32 − log216
= 32 - 4 = 28.
The first address in this block is 14.24.74.192/28 and the last
address is 14.24.74.207/28.
• The first address is divisible by number of addresses.
[It is evident by lower 4 bits of the last byte (192) being 0’s ]
If we add all addresses in the previous subblocks, the result
is 208 addresses,