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

Lecture W4 CN IP Addressing P1

The document discusses IP addressing and classful addressing. It introduces the concept of an address space and how IPv4 uses 32-bit addresses. It explains how the IPv4 address space is divided into five classes - A, B, C, D and E. Each class is divided into a fixed number of blocks with a fixed size allocation of addresses. Classful addressing uses a two-level addressing scheme with a network ID and host ID to extract addressing information from a given IP address. Examples are provided to demonstrate how to determine the class, block, and address range for a given IP address.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Lecture W4 CN IP Addressing P1

The document discusses IP addressing and classful addressing. It introduces the concept of an address space and how IPv4 uses 32-bit addresses. It explains how the IPv4 address space is divided into five classes - A, B, C, D and E. Each class is divided into a fixed number of blocks with a fixed size allocation of addresses. Classful addressing uses a two-level addressing scheme with a network ID and host ID to extract addressing information from a given IP address. Examples are provided to demonstrate how to determine the class, block, and address range for a given IP address.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 65

Computer Networks

Week 4

Dr. Hamayun khan (PhD)


Superior University, Lahore
[email protected]
IP
Addressing
OBJECTIVES:
 To introduce the concept of an address space in general and the
address space of IPv4 in particular.
 To discuss the classful architecture and the blocks of addresses
available in each class.
 To discuss the idea of hierarchical addressing and how it has
been implemented in classful addressing.
 To explain subnetting and super-netting.
 To discuss classless addressing, that has been devised to solve the
problems in classful addressing.
 To discuss some special blocks and some special addresses in
each block.
 To discuss NAT technology and show how it can be used to
alleviate of address depletion.
Chapter Introduction
Outline
Classful Addressing

Classless Addressing

Special Addresses

NAT
INTRODUCTION

The identifier used in the IP layer of the TCP/IP


protocol suite to identify each device connected to the
Internet is called the Internet address or IP address.
An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a host or a router
to the Internet; an IP address is the address of the
interface.
An IPv4 address is 32 bits long.

The IPv4 addresses are unique


and universal.
Address Space
A protocol like IPv4 that defines addresses has an address
space.
An address space is the total number of addresses used by
the protocol. If a protocol uses b bits to define an address, the
address space is 2b because each bit can have two different
values (0 or 1).
IPv4 uses 32-bits to make address space.
The address space of IPv4 is
232 or 4,294,967,296.
Notation
There are three common notations to show an IPv4 address:
binary notation
dotted-decimal notation
hexadecimal notation
Binary Notation: Base 2
an IPv4 address is displayed as 32 bits

01110101 10010101 00011101 11101010


Dotted-Decimal Notation: Base 256
To make the IPv4 address more compact and easier to read,
an IPv4 address is usually written in decimal form with a
decimal point (dot) separating the bytes
Figure Dotted-decimal notation
Example 1

Change the following IP addresses from binary notation to


dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 11100111 11011011 10001011 01101111
d. 11111001 10011011 11111011 00001111
Example 1

Change the following IP addresses from binary notation to


dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 11100111 11011011 10001011 01101111
d. 11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation:
a. 129.11.11.239 b. 193.131.27.255
c. 231.219.139.111 d. 249.155.251.15
Example 2

Change the following IP addresses from dotted-decimal notation


to binary notation.
a. 111.56.45.78 b. 221.34.7.82
c. 241.8.56.12 d. 75.45.34.78
Example 2

Change the following IP addresses from dotted-decimal notation


to binary notation.
a. 111.56.45.78 b. 221.34.7.82
c. 241.8.56.12 d. 75.45.34.78

Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
Example 3

Change the following IP addresses from binary notation to


hexadecimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Example 3

Change the following IP addresses from binary notation to


hexadecimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111

Solution
We replace each group of 4 bits with its hexadecimal equivalent.
Note that hexadecimal notation normally has no added spaces or
dots; however, 0X (or 0x) is added at the beginning or the
subscript 16 at the end to show that the number is in
hexadecimal.
a. 0X810B0BEF or 810B0BEF16
b. 0XC1831BFF or C1831BFF16
CLASSFUL ADDRESSING

IP addresses, when started a few decades ago, used the


concept of classes. This architecture is called classful
addressing. In the mid-1990s, a new architecture,
called classless addressing, was introduced that
supersedes the original architecture. In this section, we
introduce classful addressing because it paves the way
for understanding classless addressing and justifies the
rationale for moving to the new architecture.
Topics Discussed in the Section
Classes
Classes and Blocks
Two-Level Addressing
Classes
the IP address space is divided into
five classes: A, B, C, D, and E.
Each class occupies some part of the
whole address space.
Recognizing Classes
To find the class of an address -
in the binary notation, the first few bits ...
in the dotted-decimal notation, the value of
the first byte ...
Figure Finding the class of address
Figure Netid and hostid
Classes and Blocks
One problem with classful addressing
- each class is divided into a fixed number of
blocks with each block having a fixed size.
Class A

Number of blocks in class A is 27 = 128 blocks.


Each block can be assigned to one organization.
Each block contains 16,777,216 addresses.
Figure Blocks in Class A
Note

Millions of class A addresses


are wasted.
Class B

Number of blocks in class B is 214 = 16,384.


Each block can be assigned to one organizations.
Each block contains 65,536 addresses.
Figure Blocks in Class B
Note

Many class B addresses are wasted.


Class C
Number of blocks in class C is 221 = 2,097,152.
Each block contains 256 addresses, that can be
assigned to 2,097,152 organizations
Each block contains 256 addresses.
Figure Blocks in Class C
Note

Not so many organizations are so small


to have a class C block.
Class D
Only one block of class D addresses, designed
for multicasting
Each address in this class is used to define one
group of hosts on the Internet.
Note

Class D addresses are made of one


block, used for multicasting.
Note

The only block of class E addresses was


reserved for future purposes.
Two-Level Addressing
When classful addressing was designed, it was
assumed that the whole Internet is divided into
many networks and each network connects
many hosts.
That is, the Internet was seen as a network of
networks.
A network was normally created by an
organization that wanted to be connected to the
Internet.
The range of addresses allocated to an
organization in classful addressing
was a block of addresses in
Class A, B, or C.
Since all addresses in a network belonged to a
single block, each address in classful addressing
contains two parts: netid and hostid.
Figure Two-level addressing in classful addressing
Extracting Information in a Block
Given any address in the block, we normally
like to know:
- the number of addresses
- the first address
- the last address.
For this, we need to know the class of the
address.
1. The number of addresses in the block,
N = 232−n.
2. To find the first address: keep the n leftmost
bits and set the (32 − n) rightmost bits to 0.
3. To find the last address: keep the n leftmost
bits and set the (32 − n) rightmost bits to 1s.
Figure Information extraction in classful addressing

netid 000 ... 0


First address
Example 7
An address in a block is given as 73.22.17.25. Find the number of
addresses in the block, the first address, and the last address.

Solution
1. The number of addresses in this block is N = 232−n =
16,777,216.
2. To find the first address, we keep the leftmost 8 bits and set the
rightmost 24 bits all to 0s. The first address is 73.0.0.0/8, in
which 8 is the value of n.
3. To find the last address, we keep the leftmost 8 bits and set the
rightmost 24 bits all to 1s. The last address is 73.255.255.255.
Figure Solution to Example 7
Example 8
An address in a block is given as 180.8.17.9. Find the number of
addresses in the block, the first address, and the last address.

Solution
1. The number of addresses in this block is N = 232−n = 65,536.
2. To find the first address, we keep the leftmost 16 bits and set
the rightmost 16 bits all to 0s. The first address is
18.8.0.0/16, in which 16 is the value of n.
3. To find the last address, we keep the leftmost 16 bits and set the
rightmost 16 bits all to 1s. The last address is
18.8.255.255.
Figure Solution to Example 8
Example 9
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.

Solution
1. The number of addresses in this block is N = 232−n = 256.
2. To find the first address, we keep the leftmost 24 bits and set
the rightmost 8 bits all to 0s. The first address is
200.11.8.0/24, in which 24 is the value of n.
3. To find the last address, we keep the leftmost 24 bits and set the
rightmost 8 bits all to 1s. The last address is
200.11.8.255/24.
Figure Solution to Example 9
Example 10

Given the network address 17.0.0.0, find the class, the block, and
the range of the addresses.
Example 10

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 11

 Given the network address 132.21.0.0, find the class, the block, and the range
of addresses.
Example 11

 Given the network address 132.21.0.0, find the class, the block, and the range
of addresses.

Solution

 The class is B, the block is 132.21, and the range is 132.21.0.0 to


132.21.255.255
Example 12

 Given the network address 220.34.76.0, find the class, the block, and the range
of addresses
Example 12

 Given the network address 220.34.76.0, find the class, the block, and the range
of addresses

Solution
 The class is C, the block is 220.34.76, and the range of addresses is
220.34.76.0 to 220.34.76.255
Network Address
- the first address of a block
- used in routing a packet to its destination network.
Note

The network address is the identifier of


a network.
Example 13

Given the address 23.56.7.91, find the beginning address


(network address).
Example 13

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 14

Given the address 132.6.17.85, find the beginning address


(network address).
Example 14

Given the address 132.6.17.85, 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 15

Given the address 201.180.56.5, find the beginning address


(network address).
Example 15

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.

You might also like