0% found this document useful (0 votes)
399 views81 pages

Classful Addressing

IP addresses use a system of classful addressing to divide the address space into networks and hosts. Addresses are made up of a network ID and host ID and are divided into five classes - A, B, C, D, and E. Classful addressing wastes much of the address space. Subnetting allows an organization to further divide their address space into subnets to better organize hosts. CIDR notation provides a more flexible way to define networks and subnets using masks of varying bit lengths.

Uploaded by

Yash Allampalli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
399 views81 pages

Classful Addressing

IP addresses use a system of classful addressing to divide the address space into networks and hosts. Addresses are made up of a network ID and host ID and are divided into five classes - A, B, C, D, and E. Classful addressing wastes much of the address space. Subnetting allows an organization to further divide their address space into subnets to better organize hosts. CIDR notation provides a more flexible way to define networks and subnets using masks of varying bit lengths.

Uploaded by

Yash Allampalli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 81

IP Addresses:

Classful Addressing
INTRODUCTION
An IP address is a 32-bit address.

The IP addresses are unique.


Address Space
…………..
addr1 …………..
addr15
addr2 ………….. …………..
…………..
addr41 addr226
addr31
………….. …………..
RULE:
If a protocol uses N bits to define
…………..an address,
addr1 space is 2N
the address
addr15
because each
addr2bit …………..
can have two different
…………..
values (0 …………..
and 1) and N bits can have 2N
values. addr41 addr226
addr31
………….. …………..
The address space of IPv4 is 232 or
4,294,967,296
Binary Notation

01110101 10010101 00011101 11101010


Dotted-decimal notation
Hexadecimal Notation

0111 0101 1001 0101 0001 1101 1110 1010

75 95 1D EA

0x75951DEA
Example 1

Change the following IP address from binary


notation to dotted-decimal notation.
10000001 00001011 00001011 11101111
Solution

11101111-
1*2^7+1*2^6+1*2^5+0*2^4+1*2^3+
1*2^2+1*2^1+1*2^0
Example 2

Change the following IP address from


dotted-decimal notation to binary notation.
111.56.45.78

Solution
01101111 00111000 00101101 01001110
Example 3

Find the error, if any, in the following IP


address:
111.56.045.78

Solution

There are no leading zeroes in


dotted-decimal notation (045).
Example 3 (continued)

Find the error, if any, in the following IP


address:
75.45.301.14

Solution

In dotted-decimal notation, each number is


less than or equal to 255; 301 is outside
this range.
Example 4

Change the following IP addresses from


binary notation to hexadecimal notation.
1000 0001 0000 1011 0000 1011 1110
1111
Solution

0X810B0BEF or 810B0BEF16
CLASSFUL
ADDRESSING
IP Addressess
• IP is a network layer - it must be capable of providing
communication between hosts on different kinds of networks
(different data-link implementations).

• The address must include information about what network the


receiving host is on. This is what makes routing feasible.

• IP addresses are logical addresses (not physical)32 bits.[ IPv4]


• Includes a network ID and a host ID.
• Every host must have a unique IP address.
• IP addresses are assigned by a central authority (American Registry for
Internet Numbers for North America).
Occupation of the address space

231(50%)

229(12.5%) 228(6.25%)
In classful addressing,
the address space is
divided into five classes:
A, B, C, D, and E.
Classful IP Address
Finding the address class
The four formats of IP Addresses
Class
A 0 NetID HostID

B 10 NetID HostID

C 110 NetID HostID

D 1110 Multicast Address


8 bits 8 bits 8 bits 8 bits
Example 1
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution

a. The first bit is 0. This is a class A address.


b. The first 2 bits are 1; the third bit is 0. This is a
class C address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Network and Host IDs
• A Network ID is assigned to an organization by a
global authority.

• Host IDs are assigned locally by a system


administrator.

• Both the Network ID and the Host ID are used for


routing.
IP Addresses
• IP Addresses are usually shown in dotted
decimal notation:
1.2.3.4 00000001 00000010 00000011 00000100

• cs.rpi.edu is 128.213.1.1
10000000 11010101 00000001 00000001
CS has a class B network
Blocks in class A
Millions of class A addresses
are wasted.
Blocks in class B
Many class B addresses
are wasted.
Blocks in class C
The number of addresses in
a class C block
is smaller than
the needs of most organizations.
Class D addresses
are used for multicasting;
there is only
one block in this class.
Class E addresses are reserved
for special purposes;
most of the block is wasted.
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
In classful addressing,
the network address
(the first address in the block)
is the one that is assigned
to the organization.
Example 9

Given the network address 17.0.0.0, find the


class, the block, and the range of the
addresses.

Solution

The class is A because the first byte is between


0 and 127. The block has a netid of 17.
The addresses range from 17.0.0.0 to
17.255.255.255.
Example 10

Given the network address 132.21.0.0, find


the class, the block, and the range of the
addresses.

Solution

The class is B because the first byte is between


128 and 191. The block has a netid of
132.21. The addresses range from
132.21.0.0 to 132.21.255.255.
Example 11

Given the network address 220.34.76.0, find


the class, the block, and the range of the
addresses.
Solution
The class is C because the first byte is
between 192 and 223. The block has a netid of
220.34.76.The addresses range from
220.34.76.0 to 220.34.76.255.
Mask
•A mask is a 32-bit number in which the n
leftmost bits are 1s and the 32 - n rightmost bits
are 0s.
•However, in classless addressing the mask for
a block can take any value from 0 to 32. It is
very convenient to give just the value of n
preceded by a slash (CIDR notation).
•In 1Pv4 addressing, a block of addresses can
be defined as x.y.z.t/n in which x.y.z.t defines
one of the addresses and the /n defines the
mask.
Masking concept
AND operation
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.
Number of blocks and block size in classful IPv4 addressing

Default masks for classful addressing


Example 12

Given the address 23.56.7.91, find the


beginning address (network address).

Solution

The default mask is 255.0.0.0, which means


that only the first byte is preserved and the
other 3 bytes are set to 0s. The network
address is 23.0.0.0.
Example 13

Given the address 132.6.17.85 and, find the


beginning address (network address).

Solution

The default mask is 255.255.0.0, which


Means that the first 2 bytes are preserved
and the other 2 bytes are set to 0s. The
network address is 132.6.0.0.
Example 14

Given the address 201.180.56.5, find the


beginning address (network address).

Solution

The default mask is 255.255.255.0,


which means that the first 3 bytes are
preserved and the last byte is set to 0.
The network address is 201.180.56.0.
We must not
apply the default mask
of one class to
an address belonging
to another class.
CIDR (Classless Inter-Domain Routing) Notation

18.46.74.10/8 – Class A
141.24.74.69/16 - Class B
200.14.70.22/24 – Class C

Number of 1’s in the mask


Location, Not Names

• An internet address defines the network


location of a device, not its identity.

• Movement of Computer/ Node from one


network to another means that its IP address
must be changed.
Multihomed devices
•A Device has different address for each network connected to it. Such computers
are called as Multihomed Computers.

•Each of these addresses can belong to a different class.

•The router has more than one IP address, one for each interface.
Network addresses
Example of direct broadcast address
- Host IDs are all 1’s.
Example of limited broadcast address
Example of this host on this address
Example of specific host on this network
Loop back address
• IP address with first byte as 127[127.X.Y.Z]
• Used to test the s/w on a machine [ Here the
packet simply returns to the protocol s/w on
the same machine]
• Eg. Ping appln to test if the process is able to
receive and process a packet.
• Eg. Client process sending msg to server
process on the same machine.
Special Addresses
Special Address Netid Hostid Source or
Destination
Network address Specific All 0s None
Direct broadcast address Specific All 1s Destination

Limited broadcast All 1s All 1s Destination


address
The host on this network All 0s All 0s Source

Specific host on this All 0s Specific Destination


network
Loopback address 127 Any Destination
Example of loopback address
Unicast, Multicast, and
Broadcast Addresses
Unicast communication is one-to-one.

Multicast communication is one-to-many.

Broadcast communication is one-to-all.


SUBNETTING
IP addresses are designed with
two levels of hierarchy.
Subnet Addresses
• An organization can subdivide it’s host address space
into groups called subnets.

• The subnet ID is generally used to group hosts based


on the physical network topology.

10 NetID SubnetID HostID


Hierarchy concept in a telephone number

Two levels: Netid & Hostid

Three levels: Netid : subnetid : Hostid


Default mask and subnet mask
Comparison of a default mask and
a subnet mask
Finding the Subnet Address
Given an IP address, we can find the
subnet address the same way we found the
network address. We apply the mask to the
address. We can do this in two ways:
straight or short-cut.
Straight Method
In the straight method, we use binary
notation for both the address and the
mask and then apply the AND operation
to find the subnet address.
Example 15

What is the subnetwork address if the


destination address is 200.45.34.56 and the
subnet mask is 255.255.240.0?
Solution

11001000 00101101 00100010 00111000


11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.


Short-Cut Method
** If the byte in the mask is 255, copy
the byte in the address.
** If the byte in the mask is 0, replace
the byte in the address with 0.
** If the byte in the mask is neither 255
nor 0, we write the mask and the address
in binary and apply the AND operation.
What is the subnetwork address if the
destination address is 19.30.84.5 and the
mask is 255.255.192.0?
The number of subnets must be
a power of 2.
A company is granted the site address
201.70.64.0 (class C). The company needs
six subnets. Design the subnets.
Solution

The number of 1s in the default


mask is 24 (class C).
Solution (Continued)

The company needs six subnets. This number


6 is not a power of 2. The next number that is
a power of 2 is 8 (23). We need 3 more 1s in
the subnet mask.
The total number of 1s in the subnet mask is
27 (24  3).
The total number of 0s is 5 (32  27).
Solution (Continued)
The mask is

11111111 11111111 11111111 11100000


or
255.255.255.224

The number of subnets is 8.


The number of addresses in each subnet
is 25 (5 is the number of 0s) or 32.
A company is granted the site address
181.56.0.0 (class B). The company needs
1000 subnets. Design the subnets.
Solution

The number of 1s in the default mask is 16


(class B).
Solution (Continued)

The company needs 1000 subnets. This


number is not a power of 2. The next number
that is a power of 2 is 1024 (210). We need 10
more 1s in the subnet mask.
The total number of 1s in the subnet mask is
26 (16  10).
The total number of 0s is 6 (32  26).
Solution (Continued)

The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26
(6 is the number of 0s) or 64.
Note:

The idea of subnetting and


supernetting of classful addresses is
almost obsolete.

TCP/IP Protocol Suite 81

You might also like