CH 04
CH 04
Figure 4-1
Dotted-decimal notation
Hexadecimal Notation
75 95 1D EA
0x75951DEA
1
Example 1
129.11.11.239
Example 2 Example 3
Change the following IP address from Find the error, if any, in the following IP
dotted-decimal notation to binary notation. address:
111.56.45.78 111.56.045.78
Solution Solution
Find the error, if any, in the following IP Change the following IP addresses from
address: binary notation to hexadecimal notation.
75.45.301.14 10000001 00001011 00001011 11101111
Solution Solution
In dotted-decimal notation,
0X810B0BEF or 810B0BEF16
each number is less than or
equal to 255; 301 is outside this range.
2
4.2 In classful addressing,
the address space is
CLASSFUL divided into five classes:
ADDRESSING A, B, C, D, and E.
A 231 50%
B 230 25%
C 229 12.5%
D 228 6.25%
E 228 6.25%
3
Example 5 Example 6
Figure 4-5
Example 6 (Continued)
Finding the class in decimal notation
Find the class of the address:
11000001 10000011 00011011 11111111
Solution
Find the class of the address: Find the class of the address:
227.12.14.87 193.14.56.22
Solution Solution
The first byte is 227 (between 224 and 239); The first byte is 193 (between 192 and 223);
the class is D. the class is C.
4
Example 8 Solution (Continued)
In Example 4 we showed that class A has 231 Each byte in the notation has a weight.
(2,147,483,648) addresses. How can we The weights are as follows:
prove this same fact using dotted-decimal 2563 , 2562, 2561, 2560
notation? Last address: 127 × 2563 + 255 × 2562 +
Solution 255 × 2561 + 255 × 2560 = 2,147,483,647
First address: = 0
The addresses in class A range from 0.0.0.0 to If we subtract the first from the
127.255.255.255. We notice that we are
dealing with base 256 numbers here. last and add 1, we get 2,147,483,648.
5
Blocks in class B
Figure 4-9
Blocks in class C
Class D addresses
are used for multicasting; Class E addresses are reserved
there is only for special purposes;
one block in this class. most of the block is wasted.
6
Network Addresses
The network address is the first address. In classful addressing,
The network address defines the network to the the network address
rest of the Internet. (the first address in the block)
is the one that is assigned
Given the network address, we can find the to the organization.
class of the address, the block, and the range of
the addresses in the block
Example 9 Example 10
Given the network address 17.0.0.0, find the Given the network address 132.21.0.0, find
class, the block, and the range of the the class, the block, and the range of the
addresses. addresses.
Solution Solution
The class is A because the first byte is between The class is B because the first byte is between
0 and 127. The block has a netid of 17. 128 and 191. The block has a netid of
The addresses range from 17.0.0.0 to 132.21. The addresses range from
17.255.255.255. 132.21.0.0 to 132.21.255.255.
7
Figure 4-10
Masking concept
Mask
A mask 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.
Figure 4-11
AND operation
Example 12 Example 13
Given the address 23.56.7.91 and the default Given the address 132.6.17.85 and the
class A mask, find the beginning address default class B mask, find the beginning
(network address). address (network address).
Solution Solution
The default mask is 255.0.0.0, which means The default mask is 255.255.0.0, which means
that only the first byte is preserved that the first 2 bytes are preserved
and the other 3 bytes are set to 0s. and the other 2 bytes are set to 0s.
The network address is 23.0.0.0. The network address is 132.6.0.0.
8
Example 14 Multihomed Device
Given the address 201.180.56.5 and the class • Internet address defines the node’s connection
C default mask, find the beginning to its network
address (network address). • A device with multiple network connections
must have multiple IP addresses – one for each
Solution network
• A computer attached to different networks is
The default mask is 255.255.255.0, termed multihomed
which means that the first 3 bytes are • The different addresses may belong to different
preserved and the last byte is set to 0. classes
The network address is 201.180.56.0.
Multihomed devices
Multihomed Device
• A router must be connected to different
networks to route packets
• Hence a router must have > 1 IP address – one
for each interface; so is multihomed
• IP address defines the network location of a
device, not its identity (Network,HostID)
• A device’s IP address must be changed if it is
moved to another network
Network addresses
Special Addresses
Special Address Netid Hostid Source/Dest
Network Address Specific All 0’s None
Direct Broadcast Specific All 1’s Destination
Limited Broadcast All 1’s All 1’s Destination
This host on network All 0’s All 0’s Source
Specific host on this All 0’s Specific Destination
network
Loopback address 127 Any Destination
9
Direct Broadcast Address Limited Broadcast Address
⇐ Class E Address
Example of this host on this address Example of specific host on this network
⇐ Class A Address
⇐ Class A Address
Loopback
Address
Private Addresses
A number of blocks in each class are assigned for
private use. They are not recognized globally.
10
Multicast Addresses
Unicast Addresses • Multicast communication is one-to-many.
• Sent from individual source to multiple
• Unicast communication is one-to-one. destinations
• All hosts on the internet have at least one • Class D address
unicast address
• Entire address defines Group ID
• Unicast addresses belong to classes A, B & C
• A system on the Internet may have > 1 Class D
multicast addresses in addition to unicast address
• Class D address can only be destination
11