CS-605 Slide 1 - Lecture 3 - IP Classful Addressing PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Chapter 4

IP Addresses:
Classful Addressing

©The McGraw-Hill Companies, Inc., 2000 1 © Adapted for use at JMU by Mohamed Aboutabl, 2003
CONTENTS
• INTRODUCTION
• CLASSFUL ADDRESSING
• OTHER ISSUES
• A SAMPLE INTERNET

©The McGraw-Hill Companies, Inc., 2000 2 © Adapted for use at JMU by Mohamed Aboutabl, 2003
4.1 Introduction
• An IP address is a 32-bit address that identifies a connection to
the Internet.
• The IP addresses are universally unique.
• The address space of IPv4 is 232 or 4,294,967,296.
• IP address is written as a Binary (hexadecimal) or a Dotted-
Decimal (w/out leading zeros) notation. See examples in the
textbook.

©The McGraw-Hill Companies, Inc., 2000 3 © Adapted for use at JMU by Mohamed Aboutabl, 2003
CLASSFUL
4.2 ADDRESSING

• The IP address space (all possible IP values) is


divided into five classes: A, B, C, D, and E.

1
2

1 1 1 1
4 8 16 16

©The McGraw-Hill Companies, Inc., 2000 4 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Finding the class of an IP address
1st Byte
decimal
values

0 - 127

128-191

192-223

224-239

240-255

©The McGraw-Hill Companies, Inc., 2000 5 © Adapted for use at JMU by Mohamed Aboutabl, 2003
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.
©The McGraw-Hill Companies, Inc., 2000 6 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 6 (Continued)

Find the class of the address:


11000001 10000011 00011011 11111111

Solution

The first 2 bits are 1; the third bit is 0.


This is a class C address.

©The McGraw-Hill Companies, Inc., 2000 7 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 7

Find the class of the address:


227.12.14.87

Solution

The first byte is 227 (between 224 and 239);


the class is D.

©The McGraw-Hill Companies, Inc., 2000 8 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 7 (Continued)

Find the class of the address:


193.14.56.22

Solution

The first byte is 193 (between 192 and 223);


the class is C.

©The McGraw-Hill Companies, Inc., 2000 9 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Netid and hostid

• Only classes A, B, and C addresses are subdivided.


• Exercise: How many different “Netid”s and “Host”s in each of
the classes A, B, C?
Netid’s Hostid’s
• 2^(8-1) = 128 • 2^24 = 16,777,216
• 2^(16-2) = 16,384 • 2^16 = 65,536
• 2^(24-3) = 2,097,152 • 2^8 = 256
©The McGraw-Hill Companies, Inc., 2000 10 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Blocks in class A

Millions of class A addresses One Block (Netid 10) is for Private


are wasted. Addresses.
©The McGraw-Hill Companies, Inc., 2000 11 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Blocks in class B

Many class B addresses


are wasted. 16 Blocks are reserved for Private
Addresses.
©The McGraw-Hill Companies, Inc., 2000 12 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Blocks in class C

The number of addresses in


a class C block is smaller than 256 Blocks are reserved for
the needs of most organizations. Private Addresses.
©The McGraw-Hill Companies, Inc., 2000 13 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Class D addresses (ONE block)
are used for multicasting;
Each address define one group. Each group member
has a multicast and a unicast IP address

Class E addresses (ONE block) are reserved for special


purposes (limited broadcast) ; most of the block is
wasted.

©The McGraw-Hill Companies, Inc., 2000 14 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Network Addresses

1. The network address is the first address in


the block.
2. The network address defines the network to
the rest of the Internet.
3. Given the network address, we can find the
class of the address, the block, and the range
of the addresses in the block

©The McGraw-Hill Companies, Inc., 2000 15 © Adapted for use at JMU by Mohamed Aboutabl, 2003
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.
©The McGraw-Hill Companies, Inc., 2000 16 © Adapted for use at JMU by Mohamed Aboutabl, 2003
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.
©The McGraw-Hill Companies, Inc., 2000 17 © Adapted for use at JMU by Mohamed Aboutabl, 2003
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.

©The McGraw-Hill Companies, Inc., 2000 18 © Adapted for use at JMU by Mohamed Aboutabl, 2003
IP address → Network Address

1. Find the class, then the Netid, then set Hostid = 0


Example: IP=134.45.78.2 is a class B (128-191) with
Netid=134.45, so its network address is 134.45.0.0

2. Use a Mask which is a 32-bit binary number that gives the


first address in the block (the network address) when bitwise
ANDed with an address in the block.

©The McGraw-Hill Companies, Inc., 2000 19 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Default Masks

Class Mask in dotted-decimal

A 255.0.0.0

B 255.255.0.0

C 255.255.255.0

©The McGraw-Hill Companies, Inc., 2000 20 © Adapted for use at JMU by Mohamed Aboutabl, 2003
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.

©The McGraw-Hill Companies, Inc., 2000 21 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 12

Given the address 23.56.7.91 and the default


class A mask, 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.
©The McGraw-Hill Companies, Inc., 2000 22 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 13

Given the address 132.6.17.85 and the


default class B mask, 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.
©The McGraw-Hill Companies, Inc., 2000 23 © Adapted for use at JMU by Mohamed Aboutabl, 2003
We must not
apply the default mask
of one class to
an address belonging
to another class.

©The McGraw-Hill Companies, Inc., 2000 24 © Adapted for use at JMU by Mohamed Aboutabl, 2003
• IP addresses are almost depleted even though
the number of devices on the Internet is much
less than 2^32.
• Remedies to this problem are discussed in
Chapter 5

©The McGraw-Hill Companies, Inc., 2000 25 © Adapted for use at JMU by Mohamed Aboutabl, 2003
4.13
OTHER
ISSUES

©The McGraw-Hill Companies, Inc., 2000 26 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Multihomed devices

©The McGraw-Hill Companies, Inc., 2000 27 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Special Addresses

1. Network Address
2. Direct Broadcast Address
3. Limited Broadcast Address
4. This Host on This Network
5. Specific Host on This Network
6. Loopback Address

©The McGraw-Hill Companies, Inc., 2000 28 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Network addresses

©The McGraw-Hill Companies, Inc., 2000 29 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example of direct broadcast address

©The McGraw-Hill Companies, Inc., 2000 30 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example of limited broadcast address

©The McGraw-Hill Companies, Inc., 2000 31 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example of this host on this address

©The McGraw-Hill Companies, Inc., 2000 32 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example of specific host on this network

©The McGraw-Hill Companies, Inc., 2000 33 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example of loopback address

©The McGraw-Hill Companies, Inc., 2000 34 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Private Addresses

A number of blocks in each class are assigned


for private use. They are not recognized
globally.

©The McGraw-Hill Companies, Inc., 2000 35 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Unicast, Multicast, and
Broadcast Addresses
Unicast communication is one-to-one.

Multicast communication is one-to-many.


(Class D address defining the Groupid)

Broadcast communication is one-to-all.

©The McGraw-Hill Companies, Inc., 2000 36 © Adapted for use at JMU by Mohamed Aboutabl, 2003
4.4 A SAMPLE
INTERNET
WITH
CLASSFUL
ADDRESSES

©The McGraw-Hill Companies, Inc., 2000 37 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Sample internet

©The McGraw-Hill Companies, Inc., 2000 38 © Adapted for use at JMU by Mohamed Aboutabl, 2003

You might also like