0% found this document useful (0 votes)
1 views

Classful addressing

The document explains IPv4 addressing, which uses a 32-bit structure divided into a prefix (network) and suffix (node). It discusses classful and classless addressing, highlighting the limitations of classful addressing and the introduction of classless inter-domain routing (CIDR) for more efficient address allocation. Additionally, it covers subnetting principles and provides examples for designing subnets based on specific address requirements.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Classful addressing

The document explains IPv4 addressing, which uses a 32-bit structure divided into a prefix (network) and suffix (node). It discusses classful and classless addressing, highlighting the limitations of classful addressing and the introduction of classless inter-domain routing (CIDR) for more efficient address allocation. Additionally, it covers subnetting principles and provides examples for designing subnets based on specific address requirements.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

IP 4.

0 Network layer Addressing


The IP4.0 version uses 32 bits width used in computer networks. The addresses are called
Internet Protocol addresses shortly termed as IP addresses. The 32-bit IPv4 address
is also hierarchical, but divided only into two 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). The Figure (1) below shows the prefix and suffix of a 32-bit IPv4
address. The prefix length is n bits and the suffix length is (32 -n) bits.

The scheme where prefix is fixed length, which is now obsolete, is


referred to as classful addressing. The new scheme, which is referred to
as classless addressing, uses a variable-length network prefix.

Dotted Decimal Notation

 The value of any segment (byte) is between 0 and 255 (both included).

128 is first byte;


11 is second byte
3 is third byte
31 is the last byte
Classful Addressing : Here the entire address apace divided
into various classes

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.

Address Depletion problem in classful addressing:


Since the addresses were not distributed properly, the Internet was faced with the problem
of the addresses being rapidly used up, resulting in no more addresses available for
organizations that needed to be connected to the Internet.
For example if we consider class A, it has got only 128 networks with each network that can
support(224) 16,777,216 nodes or computers . Since there may be only a few organizations
that are this much large, and so most of the addresses in this class were wasted. Similarly in
Class B also much of the addresses unused or wasted. On the otherhand Class-C has a
different problem, where we have 2 24, very large number of networks but each network
hardly can be provided with maximum of 256 number of nodes which is very less. Class E
and Class E are hardly used and so all the addresses dedicated to them are also wasted.
CLASSLESS INTER-DOMAIN ADDRESSING (CIDR)
• In 1996, the Internet authorities announced a new architecture
called classless addressing.
• In classless addressing, variable-length blocks are used that belong
to no classes.
• We can have a block of 1 address, 2 addresses, 4 addresses, 128
addresses, and so on.
and thus number of addresses in a block needs to be a power of 2.

Prefix Length: Slash Notation


Since the prefix length is not inherent in the address, we need to
separately give the length of the prefix. In this case, the prefix length, n,
is added to the address, separated by a slash. The notation is informally
referred to as slash notation and formally as classless interdomain
routing or CIDR (pronounced cider). It is shown in figure(2) below:

Here the value of n is referred to as prefix length; and a value of 32 −


n is referred to as suffix length. The prefix in an address defines the
block (network); the suffix defines the node (device).
Note :
• We can have a prefix length that ranges from 0 to 32.
• The size of the network is inversely proportional to the length of the
prefix.
• A small prefix means a larger network
• A large prefix means a smaller network.

Rules of classless Addressing


• The IP addresses in a block are continuous.
• The first address of a block should be exactly divisible by the
number of addresses of a block.
• The size of the Block should be power of 2.
Extracting Information from an Address

Given any address in the block, we normally like to know three


pieces of information
• One is about the block to which the address belongs.
• Second is the number of addresses.
• Third is the first address in the block, and the last address in the
block.

If the value of prefix length, n is given, we can easily find


these three pieces of information.

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.

• The number of addresses in the network is


232-n = 232-27 = 25 = 32 addresses
• The first address can be found by keeping the first 27 bits and
changing the rest of the 5 bits to 0’s.
• The last address can be found by keeping the first 27 bits and
changing the rest of the 5 bits to 1’s.
First and last addresses in the block using address
mask.
• The address mask is a 32-bit number in which the n leftmost bits are
set to 1s and the rest of the bits (32 − n) are set to 0s.
• The number of addresses in the block :
N = NOT (mask) + 1
• The first address in the block =
(Any address in the block) AND (mask)
• The last address in the block =
(Any address in the block) OR [(NOT (mask)].

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

Bits for 224 = 11100000


NOT operation on 224 = 00011111
Bit Pattern of 82 = 01010010

• Number of addresses in the block:


N = NOT (mask) + 1= NOT(255.255.255.224 ) =
=0.0.0.31 + 1 = 32 addresses

• First address: = (address) AND (mask)


=(167.199.170.82)AND(255.255.255.224)
= 167.199.170.64
• Last address = (address) OR (NOT mask)
=(167.199.170.82)OR(0.0.0.31)
= 167.199.170.95

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,

You might also like