Acn 4
Acn 4
Acn 4
Lecture 4
IPv4 Addresses
4.1 Introduction
Hexadecimal 80 0B 03 1F
Example
Solution
a. There should be no leading zeroes (045).
b. We may not have more than 4 bytes in an IPv4 address.
c. Each byte should be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal notation.
4-2 CLASSFUL ADDRESSING
6
Occupation of address space
The only block of class E addresses was reserved for future purposes.
Two-level addressing in classful addressing
Information extraction in classful addressing
✓ To get the first IP address in the block range → replace hostid with all zero’s
✓ To get the Last IP address in the block range → replace hostid with all one’s
Example
An address in a block is given as 73.22.17.25. Find the class
of the IP, number of addresses in the block, the first address,
and the last address.
Solution
1. Since the most significant octet is 73, it is Class A
2. The number of addresses in this block is N = 232−n =
16,777,216.
3. 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.
4. 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.
Solution to previous Example
Example
Solution
1. Since the most significant octet is 180, it is Class B
2. The number of addresses in this block is N = 232−n = 65,536.
3. 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.
4. 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.
Solution to Previous Example
Example
Solution
1. Since the most significant octet is 200, it is Class C
2. The number of addresses in this block is N = 232−n = 256.
3. 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/16, in which 24 is the value of n.
4. 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/16.
Solution to Previous Example
Sample Internet
Network addresses
Network Mask
Finding a network address using the default mask
Example
Solution
Since the class of the address is B, we assume that the router
applies the default mask for class B, 255.255.0.0 to find the
network address.
Example
Network Subnetting
4-3 CLASSLESS ADDRESSING
Solution
The value of n is 27. The network mask has twenty-seven 1s
and five 0s. It is 255.255.255.240.
a. The number of addresses in the network is 232 − n = 32.
b. We use the AND operation to find the first address
(network address). The first address is 167.199.170.64/27.
Example Continued
Solution
The network mask is 255.255.255.0.
a. The number of addresses in the network is 232 − 24 = 256.
b. To find the first address, we use the short cut methods
discussed early in the chapter. The first address is
17.63.110.0/24.
Example Continued
Solution
The network mask is 255.255.240.0.
a. The number of addresses in the network is 232 − 20 = 4096.
b. To find the first address, we apply the first short cut to
bytes 1, 2, and 4 and the second short cut to byte 3. The
first address is 110.23.112.0/20.
Example Continued
c. To find the last address, we apply the first short cut to bytes
1, 2, and 4 and the second short cut to byte 3. The OR operation
is applied to the complement of the mask. The last address is
110.23.127.255/20.
Example
Source: 0.0.0.0
Destination: 255.255.255.255
Packet
Network
221.45.71.64/24 221.45.71.126/24
221.45.71.20/24 221.45.71.178/24
Loopback address
Transport layer
Destination address:127.x.y.z
Private Addresses