Addressing
Addressing
Addresses
Note
Note
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
TCP/IP Protocol Suite 7
Example 2
Change the following IPv4 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
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.
Solution
We replace each group of 4 bits with its
hexadecimal equivalent. Note that 0X (or 0x) is
added at the beginning or the subscript 16 at the
end.
a. 0X 8 1 0 B 0 B E F or 810B0BEF16
b. 0X C 1 8 3 1 B F F or C1831BFF16
TCP/IP Protocol Suite 10
Example 5
Find the number of addresses in a range if the
first address is 146.102.29.0 and the last address
is 146.102.32.255.
Solution
We can subtract the first address from the last
address in base 256 (see Appendix B). The result
is 0.0.3.255 in this base. To find the number of
addresses in the range (in decimal), we convert
this number to base 10 and add 1 to the result..
Solution
We convert the number of addresses minus 1 to
base 256, which is 0.0.0.31. We then add it to the
first address to get the last address. Addition is
in base 256.
1 1 1 1
Start
0 0 0 0
Solution
.
b. The first byte is 193 (between 192 and 223); the class is C.
c. The first byte is 14 (between 0 and 127); the class is A.
d. The first byte is 252 (between 240 and 255); the class is E.
Solution
Figure 5.16 shows a possible configuration of the
network that uses this block.
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.
TCP/IP Protocol Suite 41
Figure 16 Solution to Example 5.13
Solution
Figure 5.17 shows a possible configuration of the
network that uses this block.
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
TCP/IP Protocol Suite
last address is
45
Figure 18 Solution to Example 5.15
Solution
Since the class of the address is B, we assume
that the router applies the default mask for class
C, 255.255.255.0 to find the network address.
n1 = n2 = n3 = n4 = 16 + log24 = 18.
Solution
The value of n is 27. The network mask has
twenty-seven 1s and five 0s. It is
255.255.255.224.
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.
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.
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.