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

Assignment Chapter 5 Solution

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Assignment Chapter 5 Solution

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1. What is the address space in each of the following systems?

a. a system with 8-bit addresses


b. a system with 16-bit addresses
c. a system with 64-bit addresses
Ans: Since each bit can represent 2 numbers 0 and 1, n bits can represent 2 n
numbers.
a. A system with 8-bit addresses can have an address space of
28 addresses = 256 addresses.
b. A system with 8-bit addresses can have an address space of
216 addresses = 65,536 addresses.
c. A system with 8-bit addresses can have an address space of
264 addresses = 18.446x1018 addresses.
2. An address space has a total of 1,024 addresses. How many bits are needed to
represent an address?
Ans: Since 2n addresses need n bits, n addresses need log2n bits.
1,024 addresses need log21024 = log2210 = 10 bits.
3. An address space uses three symbols: 0, 1, and 2 to represent addresses. If each
the address is made of 10 symbols; how many addresses are available in this system?
Ans: Since each symbol can represent 3 numbers 0, 1 and 2, n symbol can represent
3n numbers.
Addresses available with 10 symbols = 310 = 59,049.
4. Change the following IP addresses from dotted-decimal notation to binary
notation:
a. 114.34.2.8
b. 129.14.6.8
c. 208.34.54.12
d. 238.34.2.1
Ans: 128, 64, 32, 16, 8, 4, 2, 1
a. 01110010.00100010.00000010.00001000
b. 10000001.00001110.00000110.00001000
c. 11010000.00100010.00110110.00001100
d. 11101110.00100010.00000010.00000001
5. Change the following IP addresses from dotted-decimal notation to hexadecimal
notation:
a. 114.34.2.8
b. 129.14.6.8
c. 208.34.54.12
d. 238.34.2.1
Ans: 8, 4, 2, 1
a. 01110010.00100010.00000010.00001000 = 0x72220208
b. 10000001.00001110.00000110.00001000 = 0x810E0608
c. 11010000.00100010.00110110.00001100 = 0xD022360C
d. 11101110.00100010.00000010.00000001 = 0xEE220201
6. Change the following IP addresses from hexadecimal notation to binary notation:
a. 0x1347FEAB
b. 0xAB234102
c. 0x0123A2BE
d. 0x00001111
Ans: 8, 4, 2, 1
a. 00010011.01000111.11111110.10101011
b. 10101011.00100011.01000001.00000020
c. 00000001.00100011. 10100010. 10111110
d. 00000000. 00000000.00010001.00010001
7. How many hexadecimal digits are needed to define the netid in each of the
following classes?
a. Class A
b. Class B
c. Class C
Ans:
a. n = 8 bits = 2 hexadecimal digits
b. n = 16 bits = 4 hexadecimal digits
c. n = 24 bits = 6 hexadecimal digits
8. Change the following IP addresses from binary notation to dotted-decimal
notation:
a. 01111111 11110000 01100111 01111101
b. 10101111 11000000 11111000 00011101
c. 11011111 10110000 00011111 01011101
d. 11101111 11110111 11000111 00011101
Ans: 128, 64, 32, 16, 8, 4, 2, 1
a. 127.240.103.125
b. 175.192.248.29
c. 223.176.31.93
d. 239.247.199.29
9. Find the class of the following IP addresses:
a. 208.34.54.12
b. 238.34.2.1
c. 242.34.2.8
d. 129.14.6.8
Ans: Class A 0-127, B 128-191, C 192-223, D 224-239, E 240-255
a. Class C
b. Class D
c. Class E
d. Class B
10. Find the class of the following IP addresses:
a. 11110111 11110011 10000111 11011101
b. 10101111 11000000 11110000 00011101
c. 11011111 10110000 00011111 01011101
d. 11101111 11110111 11000111 00011101
Ans: Class A 0000-0111, B 1000-1011, C 1100-1101, D 1110, E 1111
a. Class E
b. Class B
c. Class C
d. Class D
11. Find the netid and the hostid of the following IP addresses:
a. 114.34.2.8
b. 132.56.8.6
c. 208.34.54.12
d. 251.34.98.5
Ans: Class A 0-127, B 128-191, C 192-223, D 224-239, E 240-255
a. Class A. Netid 114, Hostid 34.2.8
b. Class B. Netid 132.56, Hostid 8.6
c. Class C. Netid 208.34.54, Hostid 12
d. Class E. Class D and E are not divided into netid and hostid.
12. Find the number of addresses in the range if the first address is 14.7.24.0 and the
last address is 14.14.34.255.
Ans: We can subtract the first address from the last address in base 256. The result is
0.7.10.255 in this base. To find the number of addresses in the range, we convert this
number to base 10 and add 1 to the result.
Number of addresses = (0 x 2563 + 7 x 2562 + 10 x 2561 +255 x 2560) + 1 = 461,568.
13. If the first address in a range is 122.12.7.0 and there are 2048 addresses in the
range, what is the last address?
Ans: We convert the number of addresses minus 1 to base 256, which is
2048 – 1 = 7 x 256 + 255 = 0.0.7.255.
We then add it to the first address to get the last address.
Last address = (122.12.7.0 + 0.0.7.255)256 = 122.12.14.255.
14. Find the result of each operation:
a. NOT (22.14.70.34)
b. NOT (145.36.12.20)
c. NOT (200.7.2.0)
d. NOT (11.20.255.255)
Ans:
a. 233.241.185.221
b. 110.219.243.235
c. 55.248.253.255
d. 244.235.0.0
15. Find the result of each operation:
a. (22.14.70.34) AND (255.255.0.0)
b. (12.11.60.12) AND (255.0.0.0)
c. (14.110.160.12) AND (255.200.140.0)
d. (28.14.40.100) AND (255.128.100.0)
Ans: 110=64+32+8+4+2, 160=128+32, 14=8+4+2, 40=32+8
200=128+64+8, 140=128+8+4, 128=128, 100=64+32+4
a. 22.14.0.0
b. 12.0.0.0
c. 14.72.128.0
d. 28.0.32.0
16. Find the result of each operation:
a. (22.14.70.34) OR (255.255.0.0)
b. (12.11.60.12) OR (255.0.0.0)
c. (14.110.160.12) OR (255.200.140.0)
d. (28.14.40.100) OR (255.128.100.0)
Ans: 110=64+32+8+4+2, 160=128+32, 14=8+4+2, 40=32+8
200=128+64+8, 140=128+8+4, 128=128, 100=64+32+4
a. 255.255.70.34
b. 255.11.60.12
c. 255.238.172.12
d. 255.142.108.100
17. In a class A subnet, we know the IP address of one of the hosts and the subnet
mask as given below: IP Address: 25.34.12.56, Subnet mask: 255.255.0.0.
What is the first address (subnet address)? What is the last address?
Ans: Subnet id, nsub = 16. To find the first address, we keep the leftmost 16 bits and
set the rightmost 16 bits all to 0s.
The first address (subnet address) is 25.34.0.0.
To find the last address, we keep the leftmost 16 bits and set the rightmost 16 bits all
to 1s.
The last address is 25.34.255.255.
18. In a class B subnet, we know the IP address of one of the hosts and the subnet
mask as given below: P Address: 131.134.112.66, Subnet mask: 255.255.224.0.
What is the first address (subnet address)? What is the last address?
Ans: Subnet id, nsub = 19. To find the first address, we keep the leftmost 19 bits and
set the rightmost 13 bits all to 0s.
The first address (subnet address) is 131.134.96.0.
To find the last address, we keep the leftmost 19 bits and set the rightmost 13 bits all
to 1s.
The last address is 131.134.127.255.
19. In a class C subnet, we know the IP address of one of the hosts and the subnet
mask as given below: IP Address: 202.44.82.16, Subnet mask: 255.255.255.192.
What is the first address (subnet address)? What is the last address?
Ans: Subnet id, nsub = 26. To find the first address, we keep the leftmost 26 bits and
set the rightmost 6 bits all to 0s.
The first address (subnet address) is 202.44.82.0.
To find the last address, we keep the leftmost 26 bits and set the rightmost 6 bits all
to 1s.
The last address is 202.44.82.63.
20. Find the subnet mask in each case:
a. 1024 subnets in class A
b. 256 subnets in class B
c. 32 subnets in class C
d. 4 subnets in class C
Ans: Subnet id, nsub = n + log2s. Subnet mask has nsub numbers of 1s and (32- nsub) 0s.
a. nsub = 8 + log21024 = 8 + log2210 = 18. Subnet mask = 255.255.192.0
b. nsub = 16 + log2256 = 16 + log228 = 24. Subnet mask = 255.255.255.0
c. nsub = 24 + log232 = 24 + log225 = 29. Subnet mask = 255.255.255.248
d. nsub = 24 + log24 = 24 + log222 = 26. Subnet mask = 255.255.255.192
21. In a block of addresses, we know the IP address of one host is 25.34.12.56/16.
What is the first address (network address) and the last address (limited broadcast
address) in this block?
Ans: We use the AND operation to find the first address (network address).
Known host = 23. 34. 12. 56
Network mask = 255. 255. 0. 0
First address = 23. 34. 0. 0
We use the OR operation to find the last address (limited broadcast address).
Known host = 23. 34. 12. 56
Complement of network mask = 0. 0. 255. 255
Last address = 23. 34. 255. 255
22. In a block of addresses, we know the IP address of one host is 182.44.82.16/26.
What is the first address (network address) and the last address (limited broadcast
address) in this block?
Ans: We use the AND operation to find the first address (network address).
Known host = 182. 44. 82. 16
Network mask = 255. 255. 255. 192
First address = 182. 44. 82. 0
We use the OR operation to find the last address (limited broadcast address).
Known host = 182. 44. 82. 16
Complement of network mask = 0. 0. 0. 63
Last address = 182. 44. 82. 63
23. In fixed-length subnetting, find the number of 1s that must be added to the mask
if the number of desired subnets is _______.
a. 2
b. 62
c. 122
d. 250
Ans: Number of 1s that must be added to the mask is, log2s.
a. log22 = 1
b. log264 = log226 = 6
c. log2128 = log227 = 7
d. log2256 = log228 = 8
24. An organization is granted the block 16.0.0.0/8. The administrator wants to
create 500 fixed-length subnets.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
c. Find the first and the last address in the first subnet.
d. Find the first and the last address in the last subnet (subnet 500).
Ans:
a. Subnet mask, nsub = n + log2s = 8 + log2512 = 8 + log229 = 17
b. Addresses in each subnet, N = 2^(32-nsub) = 2(32-17) = 215 = 32,768
c. First Address = 16.0.0.0. 32,767 = 127x256+255, Last Address = 16.0.127.255
2nd block 16.0.128.0 - 16.0.255.255
3rd block 16.1.0.0 - 16.1.127.255
4th block 16.1.128.0 - 16.1.255.255
d. First Address = 16.249.128.0, Last Address = 16.249.255.255
25. An organization is granted block 130.56.0.0/16. The administrator wants to
create 1024 subnets.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
c. Find the first and the last address in the first subnet.
d. Find the first and the last address in the last subnet (subnet 1024).
Ans:
a. Subnet mask, nsub = n + log2s = 16 + log21024 = 8 + log2210 = 26
b. Addresses in each subnet, N = 2^(32-nsub) = 2(32-26) = 26 = 64
c. First Address = 130.56.0.0, Last Address = 130.56.0.63
d. First Address = 130.56.255.192, Last Address = 130.56.255.255
26. An organization is granted block 211.17.180.0/24. The administrator wants to
create 32 subnets.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
c. Find the first and the last address in the first subnet.
d. Find the first and the last address in the last subnet (subnet 32).
Ans:
a. Subnet mask, nsub = n + log2s = 24 + log232 = 24 + log225 = 29
b. Addresses in each subnet, N = 2^(32-nsub) = 2(32-29) = 23 = 8
c. First Address = 211.17.180.0, Last Address = 211.17.180.7
d. First Address = 211.17.180.248, Last Address = 211.17.180.255
27. Write the following mask in slash notation (/n):
a. 255.255.255.0
b. 255.0.0.0
c. 255.255.224.0
d. 255.255.240.0
Ans:
a. 11111111.11111111.11111111.00000000 -> /24
b. 11111111.00000000.00000000.00000000 -> /8
c. 11111111.11111111.11100000.00000000 -> /19
d. 11111111.11111111.11110000.00000000 -> /20
27. Find the range of addresses in the following blocks:
a. 123.56.77.32/29
b. 200.17.21.128/27
c. 17.34.16.0/23
d. 180.34.64.64/30
Ans:
a. We use the AND operation to find the first address.
Known host = 123. 56. 77. 32
Network mask = 255. 255. 255. 248
First address = 123. 56. 77. 32
We use the OR operation to find the last address.
Known host = 123. 56. 77. 32
Complement of network mask = 0. 0. 0. 7
Last address = 123. 56. 77. 39
Range of addresses 123.56.77.32 - 123.56.77.39
b. We use the AND operation to find the first address.
Known host = 200. 17. 21. 128
Network mask = 255. 255. 255. 224
First address = 200. 17. 21. 128
We use the OR operation to find the last address.
Known host = 200. 17. 21. 128
Complement of network mask = 0. 0. 0. 31
Last address = 200. 17. 21. 159
Range of addresses 200.17.21.128 - 200.17.21.159
c. We use the AND operation to find the first address.
Known host = 17. 34. 16. 0
Network mask = 255. 255. 254. 0
First address = 17. 34. 16. 0
We use the OR operation to find the last address.
Known host = 17. 34. 16. 0
Complement of network mask = 0. 0. 1. 255
Last address = 17. 34. 17. 255
Range of addresses 17.34.16.0 - 17.34.17.255
d. We use the AND operation to find the first address.
Known host = 180. 34. 64. 64
Network mask = 255. 255. 255. 252
First address = 180. 34. 64. 64
We use the OR operation to find the last address.
Known host = 180. 34. 64. 64
Complement of network mask = 0. 0. 0. 3
Last address = 180. 34. 64. 67
Range of addresses 180.34.64.64 - 180.34.64.67
29. In classless addressing, we know the first and the last address in the block. Can
we find the prefix length? If the answer is yes, show the process and give an
example.
Ans: We can find prefix length from the first and last addresses in the block.
We know, N = 232-n, where n is the prefix length.
So, prefix length can be found by, n = 32 – log2N
where N is the number of addresses in the block which can be obtained by
subtracting the first address from the last address.
Let us consider the block having the first address 180.34.64.64 and the last address
180.34.64.67.
The number of addresses in the block,
N = (180.34.64.67 - 180.34.64.64)256 + 1 = 3 + 1 = 4
Prefix length, n = 32 – log24 = 32 – log222 = 30.
30. In classless addressing, we know the first address and the number of addresses in
the block. Can we find the prefix length? If the answer is yes, show the process and
give an example.
Ans: We can find prefix length from only the number of addresses in the block.
We know, N = 232-n, where n is the prefix length.
So, prefix length can be found by, n = 32 – log2N
where N is the number of addresses in the block.
Let us consider the block having the first address 17.34.16.0 and the number of
addresses 512.
The number of addresses in the block, N = 512
Prefix length, n = 32 – log2512 = 32 – log229 = 23.
31. In classless addressing, can two blocks have the same prefix length? Explain.
Ans: Two blocks can have the same prefix length because prefix length only
determines the size of the block. But blocks of the same size can reside in different
points in the address space.
Let us consider the blocks 17.34.16.0/24 and 17.34.17.0/24.
Both blocks have the same prefix 24 but contain different ranges of addresses.
32. In classless addressing, we know the first address and one of the addresses in the
block (not necessarily the last address). Can we find the prefix length? Explain.
Ans: In classless addressing, the prefix length cannot be found if we are given only an
address in the block even with the first address of the block. The given address can
belong to a block with any prefix length. In classless addressing, if we need to find
the block we need either
1. prefix length or
2. both first and last addresses or
3. one of the first or last addresses and the number of total addresses.
Let us consider the first address 230.8.24.0 and another address 230.8.24.56.
This may represent any of the blocks from 230.8.24.0/24 to 230.8.24.0/26.
33. An ISP is granted a block of addresses starting with 150.80.0.0/16. The ISP wants
to distribute these blocks to 2600 customers as follows:
a. The first group has 200 medium-size businesses; each needs approximately 128
addresses.
b. The second group has 400 small businesses; each needs approximately 16
addresses.
c. The third group has 2000 households; each needs 4 addresses.
Design the subblocks and give the slash notation for each subblock. Find out how
many addresses are still available after these allocations.
Ans:
Group 1: 200 × 128 = 25,600 n1 = 16 + log2 (65536/25600) = 17
Group 2: 400 × 16 = 6,400 n2 = 16 + log2 (65536/6400) = 19
Group 3: 2000 × 4 = 8,000 n3 = 16 + log2 (65536/8000) = 19
a. First group starts at 150.80.0.0/17
25,599 = 99 x 256 + 255
First group ends at 150.80.99.255/17
For each customer, nsub = 16 + log2(65536/128) = 16 + log2512 = 16 + log229 = 25
First subblock 150.80.0.0/25 - 150.8.0.127
Last subblock 150.80.99.128/25 -150.80.99.255
b. Second group starts at 150.80.100.0/19
6,399 = 24 x 256 + 255
Second group ends at 150.80.124.255/19
For each customer, nsub = 16 + log2(65536/16) = 16 + log24096 = 16 + log2212 = 28
First subblock 150.80.100.0/28
Last subblock 150.80.124.240/28
c. Last group starts at 150.80.125.0/19
7,999 = 31 x 256 + 63
Last group ends at 150.80.156.63/19
For each customer, nsub = 16 + log2(65536/4) = 16 + log216384 = 16 + log2214 = 30
First subblock 150.80.125.0/30
Last subblock 150.80.156.60/30
Total granted addresses, N = 232-16 = 65,536
Total addresses used = 25,600 + 6,400 + 8,000 = 40,000
Addresses still available = 65,536 – 40,000 = 25,536
The first address in this range is 150.80.156.64 and last address is 150.80.255.255.
34. An ISP is granted a block of addresses starting with 120.60.4.0/20. The ISP wants
to distribute these blocks to 100 organizations with each organization receiving 8
addresses only. Design the subblocks and give the slash notation for each subblock.
Find out how many addresses are still available after these allocations.
Ans: Total addresses granted, N = 232-20 = 4096
Addresses needed: 100 × 8 = 800 nsub = 20 + log2 (4096/800) = 22
Address allocation starts at 120.60.4.0/22
799 = 3 x 256 + 31
Address allocation ends at 120.60.7.31/22
For each customer, nsub = 20 + log2(4096/8) = 20 + log2512 = 20 + log229 = 29
First subblock 120.60.4.0/29 - 120.60.4.7/29
Last subblock 120.60.7.24/29 - 120.60.7.31/29
Addresses still available = 4096 – 800 = 3,296
35. An ISP has a block of 1024 addresses. It needs to divide the addresses to 1024
customers. Does it need subnetting? Explain your answer.
Ans: An ISP does not need subnetting to distribute 1024 addresses to 1024
customers because each customer only needs one address not a block of addresses.
Although an ISP can do subnetting using the /32 prefix as it defines 1 address as a
block. But it will require extra hardware which makes subnetting in this case
inefficient.

You might also like