You are on page 1of 39

CLASSFUL ADDRESSING

IP address, when started, used the concept of classes, this architecture


Is called classful addressing. Later, new architecture called classless
addressing was introduced. However, most of the Internet is still using
classful addrssing and the migration is slow.

In classful adressing, the IP address space is devided into five classes:


A, B, C, D, and E

Each class occupy occupies some part of the whole address space

1 08/08/2020
In classful addressing the address space is
divided into 5 classes:

A, B, C, D, and E.

2 08/08/2020
Figure 4-3

Finding the class in binary notation

We can find the classes, when IP address is given in binary or decimal

3 08/08/2020
Figure 4-4

Finding the address class

4 08/08/2020
Figure 4-2

Occupation of the address space

5
Example 5

Show that Class A has


231 = 2,147,483,648 addresses

6 08/08/2020
Example 5

How can we prove that we have 2,147,483,648 addresses in


class A?

Solution
In class A, only 1 bit defines the class. The remaining 31 bits are
available for the address. With 31 bits, we can have 231
or 2,147,483,648 addresses.

7
Example 6

Find the class of the following IP addresses


00000001 00001011 00001011 11101111
11000001 00001011 00001011 11101111

Solution
• 00000001 00001011 00001011 11101111
1st is 0, hence it is Class A
• 11000001 00001011 00001011 11101111
1st and 2nd bits are 1, and 3rd bit is 0 hence, Class C

8 08/08/2020
Figure 4-5

Finding the class in decimal notation

9 08/08/2020
Example 7

Find the class of the following addresses


158.223.1.108
227.13.14.88
193.14.56.22
14.23.120.8
252.5.15.11

Solution
• 158.223.1.108
1st byte = 158 (128<158<191) class B
• 227.13.14.88
1st byte = 227 (224<227<239) class D
10 08/08/2020
Figure 4-6

Netid and hostid

In classful addressing, IP addreses are divided into Netid and Hostid

11 08/08/2020
Class and Blocks

 Each class A is divided into a fixed number of blocks, with fixed size.
 Class A is divided into 128 blocks, with each block having a different
NetID.
– The first covers address from 0.0.0.0 – 0.255.255.255 (netid 0)
– The second covers 1.0.0.0 – 1.255.255.255 (netid 1)
– The last block covers 127.0.0.0 – 127.255.255.255 (netid 127)
 Note, for each block the first byte (NetID) is the same, but the other 3
bytes (HostID) can take any value in the given range.
 The first and the last blocks are reserved for special purposes.One
block (netid 10) is used for private addresses.The remaining 125
blocks can be assigned to organisation (total number of organisation)
 Each block contains 16, 777, 216 addresses, organization should be
really large (larger than the needs of most organisation)
12
All-Zeros Address
0.0.0.0
 The block 0.0.0.0, which contains only one single address, is
reserved for communication when a host needs to send an
IPv4 packet but it does not know its own address.
 This is normally used by a host at bootstrap time when it does
not know its IPv4 address.
 The host sends an IPv4 packet to a bootstrap server (called
DHCP server as discussed in using this address as the source
address and a limited broadcast address as the destination
address to find its own address

13
All-Ones Address: Limited
Broadcast Address
255.255.255.255
 The block 255.255.255.255, which contains one
single address, is reserved for limited broadcast
address in the current network.
 A host that wants to send a message to every other
host can use this address as a destination address in
an IPv4 packet
 However, a router will block a packet having this type
of address to confine the broadcasting to the local
network.

14
Figure 4-7
Blocks in class A

15
Direct Broadcast Address

The last address in a block or subblock (with the suffix set all to 1s) can be
used as a
direct broadcast address. This address is usually used by a router to send
a packet to
all hosts in a specific network. All hosts will accept a packet having this type
of destination
address. Note that this address can be used only as a destination address in
an IPv4
packet. In Figure 5.38, the router sends a datagram using a destination IPv4
address
with a suffix of all 1s. All devices on this network receive and process the
datagram.

16 08/08/2020
Network Address

We have already discussed network addresses. The first address (with


the suffix set all to 0s) in a block defines the network address. It actually
defines the network itself (cabling) and not any host in the network.

17
Millions of class A addresses
are wasted.

18 08/08/2020
Class B

 Class B is divided into 16,384 blocks, with each block having a


different NetID.
– The first covers address from 128.0.0.0 – 128.0.255.255 (netid
128.0)
– The last block covers 191.255.0.0 – 191.255.255.255 (netid
191.255)
 Note, for each block the first two bytes (NetID) are the same, but the
other 2 bytes (HostID) can take any value in the given range.
 There are 16,384 blocks that can be assigned to organisation.
 Each block contains 65, 536 addresses, organization should be large
enough to use all these addresses.
 Class B address were designed for mid-size organizations

19
Figure 4-8

Blocks in class B

20
Many class B addresses
are wasted.

21 08/08/2020
Class C

 Class C is divided into 2,097,157 blocks, with each block having a


different NetID. 256 blocks are used for private addresses, leaving
2,096,896 blocks for assignment to organizations.
– The first covers address from 192.0.0.0 – 192.0.255.255 (netid
192.0.0)
– The last block covers 223.255.255.0 – 223.255.255.255 (netid
223.225.225)
 Note, for each block the first three bytes (NetID) are the same, but the
other 2 bytes (HostID) can take any value in the given range.
 There are 2,096,902 blocks that can be assigned.
 Each block contains 256 addresses (total number of organization that
can have class C address is 2,096,902)
 Class C address were designed for small organizations (needing less
than 256 address)
22
Figure 4-9
Blocks in class C

23
The number of addresses in
a class C block
is smaller than
the needs of most organizations.

24 08/08/2020
Class D addresses
are used for multicasting;
there is only
one block in this class.

25 08/08/2020
Class E addresses are reserved
for special purposes;
most of the block is wasted.

26 08/08/2020
Network Addresses

The network address is the first address.

The network address defines the network to the


rest of the Internet.
Given the network address, we can find the
class of the address, the block, and the range of
the addresses in the block
27
In classful addressing,
the network address
(the first address in the block)
is the one that is assigned
to the organization.

28
Example 8

Given the network address 132.21.0.0, 220.34.76.0 and


73.22.17. 25
find the class, the block, the range of the addresses
Also, Find the number of addresses in the block?
Solution

The 1st byte is between 128 and 191.


Hence, Class B
The block has a netid of 132.21.
The addresses range from
132.21.0.0 to 132.21.255.255.

29 08/08/2020
Figure 4-5

Finding the class in decimal notation

30
Example

An address in a block is given as 200.11.8.45. Find the number of addresses


in the block, the first address, and the last address. Show a possible
configuration of the network that uses this block.

Since 200 is between 192 and 223, the class of the address is C
The number of addresses in this block is 256
The first address is 200.11.8.0
The last address is 200.11.8.255

31 08/08/2020
Mask

The routers in the Internet normally use an algorithm to


extract the network address from the destination address of
a packet.
To do this, we need a network mask or default mask
To extract the network address from the destination address
of a packet, a router uses the AND operation.
When the destination address (or any address in the block)
is ANDed with the default mask, the result is the network
address

32
Network Mask

33
Mask

A mask is a 32-bit binary number.


The mask is ANDeD with IP address to get
• The block address (Network address)
• Mask And IP address = Block Address

34
Figure 4-10

Masking concept

35
Figure 4-11

AND operation

The bits in the address corresponds to 1s in the mask are preserved.

The bits corresponding to the 0s in the mask change to 0.

36
The network address is the
beginning address of each block.
It can be found by applying
the default mask to
any of the addresses in the block
(including itself).
It retains the netid of the block
and sets the hostid to zero.
37
Default Mak

 Class A default mask is 255.0.0.0


 Class B default mask is 255.255.0.0
 Class C Default mask 255.255.255.0

38
Example
 A router receives a packet with the destination
address 201.24.67.32. Show how the router finds the
network address of the packet.

39

You might also like