1CSIE,NTUT,TAIWAN
IP Addresses,
Classful Addressing
Chuan-Ming Liu
CSIE,NTUT
Spring ’04,TAIWAN
CSIE,NTUT,TAIWAN 2
CONTENTS
INTRODUCTION
CLASSFUL ADDRESSING
OTHER ISSUES
A SAMPLE INTERNET
CSIE,NTUT,TAIWAN 3
INTRODUCTION
4.1
CSIE,NTUT,TAIWAN 4
An IP address is a
32-bit
address.
CSIE,NTUT,TAIWAN 5
The IP addresses
are
unique.
CSIE,NTUT,TAIWAN 6
addr15
addr1
addr2
addr41addr31 addr226
…………..
…………..
………….,…………..
…………..
…………..…………..
Address Space
Total number of addresses used by the protocol
If a protocol uses N bit to define an address,the
address space is 2N.
IPv4 uses 32 bit addresses.
CSIE,NTUT,TAIWAN 7
The address space of IPv4 is
232
or
4,294,967,296.
CSIE,NTUT,TAIWAN 8
Address Notations
Three common notations to show an IP
– Binary Notation
– Dotted-Decimal Notation
– Hexadecimal Notation
CSIE,NTUT,TAIWAN 9
01110101 10010101 00011101 11101010
Binary Notation
CSIE,NTUT,TAIWAN 10Figure 4-1
Dotted-decimal notation
CSIE,NTUT,TAIWAN 11
0111 0101 1001 0101 0001 1101 1110 1010
Hexadecimal Notation
75 95 1D EA
0x75951DEA
CSIE,NTUT,TAIWAN 12
The binary,decimal,and
hexadecimal number
systems are reviewed in
Appendix B.
CSIE,NTUT,TAIWAN 13
Example 1
Change the following IP address from binary
notation to dotted-decimal notation.
10000001 00001011 00001011 11101111
Solution
129.11.11.239
CSIE,NTUT,TAIWAN 14
Example 2
Change the following IP address from
dotted-decimal notation to binary notation.
111.56.45.78
Solution
01101111 00111000 00101101 01001110
CSIE,NTUT,TAIWAN 15
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).
CSIE,NTUT,TAIWAN 16
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.
CSIE,NTUT,TAIWAN 17
Example 4
Change the following IP addresses from
binary notation to hexadecimal notation.
10000001 00001011 00001011 11101111
Solution
0X810B0BEF or 810B0BEF16
CSIE,NTUT,TAIWAN 18
CLASSFUL
ADDRESSING
4.2
CSIE,NTUT,TAIWAN 19
Classful Addressing
IP address space is divided into five classes,A,
B,C,D,and E when IP addresses started
CSIE,NTUT,TAIWAN 20Figure 4-2
Occupation of the address space
CSIE,NTUT,TAIWAN 21
In classful addressing,
the address space is
divided into five classes,
A,B,C,D,and E.
CSIE,NTUT,TAIWAN 22Figure 4-3
Finding the class in binary notation
CSIE,NTUT,TAIWAN 23Figure 4-4
Finding the address class
CSIE,NTUT,TAIWAN 24
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.
CSIE,NTUT,TAIWAN 25
Example 6
Find the class of the address:
00000001 00001011 00001011 11101111
Solution
The first bit is 0,This is a class A address.
CSIE,NTUT,TAIWAN 26
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.
CSIE,NTUT,TAIWAN 27Figure 4-5
Finding the class in decimal notation
CSIE,NTUT,TAIWAN 28
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.
CSIE,NTUT,TAIWAN 29
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.
CSIE,NTUT,TAIWAN 30
Example 8
In Example 4 we showed that class A has 231
(2,147,483,648) addresses,How can we
prove this same fact using dotted-decimal
notation?
Solution
The addresses in class A range from 0.0.0.0 to
127.255.255.255,We notice that we are
dealing with base 256 numbers here,
CSIE,NTUT,TAIWAN 31
Solution (Continued)
Each byte in the notation has a weight,
The weights are as follows:
2563,2562,2561,2560
Last address,127? 2563 + 255? 2562 +
255? 2561 + 255? 2560 = 2,147,483,647
First address,= 0
If we subtract the first from the
last and add 1,we get 2,147,483,648,
CSIE,NTUT,TAIWAN 32
Netid and Hostid
An IP address in class A,B,and C is divided
into netid and hostid
Netid is to address the network
Hostid is to address the host on the specific
network
Classes D and E are not divided
CSIE,NTUT,TAIWAN 33Figure 4-6
Netid and hostid
CSIE,NTUT,TAIWAN 34
Class A and Its Blocks
Class A is divided into 128 blocks with each
block having a different netid.
Blocks
– First block – 0.0.0.0 to 0.255.255.255 (netid 0)
– Second block – 1.0.0.0 to 1.255.255.255 (netid 1)
– Last block – 127.0.0.0 to 127.255.255.255 (netid 127)
The first and last blocks are reserved
Each block contains 16,777,216 addresses
CSIE,NTUT,TAIWAN 35Figure 4-7
Blocks in class A
CSIE,NTUT,TAIWAN 36
Millions of class A addresses
are wasted,
CSIE,NTUT,TAIWAN 37
Class B and Its Blocks
Divided into 16,384 blocks
16 blocks are reserved for private addresses
Each block contains 65,536 addresses
CSIE,NTUT,TAIWAN 38Figure 4-8
Blocks in class B
CSIE,NTUT,TAIWAN 39
Many class B addresses
are wasted.
CSIE,NTUT,TAIWAN 40
Class C and Its Blocks
Divided into 2,097,152 blocks
256 blocks are reserved for private addresses
Each block contains 256 addresses
CSIE,NTUT,TAIWAN 41Figure 4-9
Blocks in class C
CSIE,NTUT,TAIWAN 42
The number of addresses in
a class C block
is smaller than
the needs of most organizations,
CSIE,NTUT,TAIWAN 43
Class D addresses
are used for multicasting;
there is only
one block in this class.
CSIE,NTUT,TAIWAN 44
Class E addresses are reserved
for special purposes;
most of the block is wasted,
CSIE,NTUT,TAIWAN 45
Network Addresses
The network address is the first address in the
block.
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
CSIE,NTUT,TAIWAN 46
In classful addressing,
the network address
(the first address in the block)
is the one that is assigned
to the organization,
CSIE,NTUT,TAIWAN 47
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.
CSIE,NTUT,TAIWAN 48
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.
CSIE,NTUT,TAIWAN 49
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.
CSIE,NTUT,TAIWAN 50
Mask
Given an IP address,can one find the network
address?
Not consider subnet yet
A mask is a 32 bit binary number that gives
the first addresses in the block when bitwise
ANDed with an address in the block
AND operation
Default masks
CSIE,NTUT,TAIWAN 51Figure 4-10
Masking concept
CSIE,NTUT,TAIWAN 52Figure 4-11
AND operation
CSIE,NTUT,TAIWAN 53
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,
CSIE,NTUT,TAIWAN 54
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.
CSIE,NTUT,TAIWAN 55
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.
CSIE,NTUT,TAIWAN 56
Example 14
Given the address 201.180.56.5 and the class
C default mask,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.
CSIE,NTUT,TAIWAN 57
We must not
apply the default mask
of one class to
an address belonging
to another class,
CSIE,NTUT,TAIWAN 58
OTHER
ISSUES
4.3
CSIE,NTUT,TAIWAN 59
Multihomed Devices
Devices connected to more than one network
More than one IP address
One IP address for one interface
CSIE,NTUT,TAIWAN 60Figure 4-12
Multihomed devices
CSIE,NTUT,TAIWAN 61
Location,Not Names
Internet Address defines the network location
of a device,not its identity.
The movement of a computer from one
network to another means that its IP address
must be changed … Mobile IP
CSIE,NTUT,TAIWAN 62
Special Addresses
Network address
Direct broadcast address
Limited broadcast address
This host on this network
Specific host on this network
Lookback address
0 – this ; 1 – all
CSIE,NTUT,TAIWAN 63Figure 4-13
Network addresses
CSIE,NTUT,TAIWAN 64
Direct Broadcast Address
Used by a router to send a packet to all hosts in
the specific network
All hosts will accept a packet having this type
of destination address
CSIE,NTUT,TAIWAN 65Figure 4-14
Example of direct broadcast address
CSIE,NTUT,TAIWAN 66
Limited Broadcast Address
All 1s for the netid and hostid
A host can use it to send a message to all other
hosts on the same network
The packet is blocked by routers
CSIE,NTUT,TAIWAN 67Figure 4-15
Example of limited broadcast address
CSIE,NTUT,TAIWAN 68
This Host on This Network
All 0s
Used by a host a bootstrap time
Source address only
CSIE,NTUT,TAIWAN 69Figure 4-16
Example of this host on this address
CSIE,NTUT,TAIWAN 70
Specific Host on This Network
Netid of all 0s
Used by a host to send a message to another
host on the same network
Packet is blocked by routers
Destination address only
CSIE,NTUT,TAIWAN 71Figure 4-17
Example of specific host on this network
CSIE,NTUT,TAIWAN 72
Loopback Address
IP address with 127.xxx.xxx.xxx
Used to test the software on a machine
Packet using this address never leaves the
machine
Testing the IP software
CSIE,NTUT,TAIWAN 73Figure 4-18
Example of loopback address
CSIE,NTUT,TAIWAN 74
Private Addresses
A number of blocks in each class are private
not recognized globally
Private networks
– Class A,10.0.0
– Class B,172.16 to 172.31
– Class C,192.168.0 to 192.168.255
CSIE,NTUT,TAIWAN 75
Unicast,Multicast,and
Broadcast Addresses
Unicast communication is one-to-one.
Multicast communication is one-to-many.
Broadcast communication is one-to-all.
CSIE,NTUT,TAIWAN 76
Multicast delivery will be
discussed in depth in
Chapter 14.
CSIE,NTUT,TAIWAN 77
A SAMPLE
INTERNET
WITH
CLASSFUL
ADDRESSES
4.4
CSIE,NTUT,TAIWAN 78Figure 4-19
Sample internet