Lab/Tutorial :
SEHH2238 : Data Communications and Networking
Session 7 : IP Addressing and Subnets
(Solution)
Copyright By PowCoder代写 加微信 powcoder
Classful Addressing
1. For the each of the following
a) 0111 1111 1111 0000 0110 0111 0111 1101 (Binary) b) 210.34.2.8
c) 129.14.6.8
(i) the class
(ii) the mask
(iii) the net-id
(iv) the host-id
(v) the network address
(vi) the broadcast address
(i) the class: From the first byte, the first bit is 0. Class A
(ii) the mask: 11111111 00000000 00000000 00000000
(iii) the net-id: 0111 1111
(iv) the host-id: 1111 0000 0110 0111 0111 1101
(v) the network address: 0111 1111 00000000 0000000 00000000
(vi) the broadcast address: 0111 1111 11111111 11111111 11111111
b) 210 = 128 + 64+ 16 +21101 0010
(i) the class: From the first byte, leading bits are 110. Class C
(ii) the mask: 255.255.255.0
(iii) the net-id: 210.34.2
(iv) the host-id: 8
(v) the network address: 210.34.2.0
(vi) the broadcast address: 210.34.2.255
c) 129 = 128 + 11000 0001
(i) the class: From the first byte, leading bits are 10. Class B
(ii) the mask: 255.255.0.0
(iii) the net-id: 129.14
(iv) the host-id: 6.8
(v) the network address: 129.14.0.0
(vi) the broadcast address: 129.14.255.255
SEHH2238 Computer Networking Tutorial 7 Page 1
Classless Addressing
2. In a block of addresses, we know the IP address of one host is 25.34.12.56/16.
a) What is the network address?
b) What is the broadcast address?
a) Network address = first address
Mask: 1111 1111 1111 1111 0000 0000 0000 0000 Network address = Host address (Bitwise AND) Mask OR The last 16 bits are host-id
That is bits in the host-id are all “0” for network address Network address :25.34.0.0
b) Broadcast address = Last address
Mask: 1111 1111 1111 1111 0000 0000 0000 0000 That is bits in the host-id are all “1” for broadcast. Broadcast address :25.34.255.255
3. Repeat Question 2 for IP address of 205.16.37.37/29.
a) Network address = first address
Host address: 11001101 00010000 00100101 00100101 Mask: 11111111 11111111 11111111 11111000 Network address = Host address (Bitwise AND) Mask
OR The last 3 bits are host-id
That is bits in the host-id are all “0” for network address Network address : 205.16.37. (00100000) = 205.16.37.32
b) Broadcast address = Last address
Mask: 11111111 11111111 11111111 11111000 That is bits in the host-id are all “1” for broadcast Broadcast address : 205.16.37. (00100111) = 205.16.37.39
SEHH2238 Computer Networking Tutorial 7 Page 2
4. Which of the followings are valid subnet masks? (Is there any subnet?) a) 255.255.0.0
b) 255.0.255.0
c) 255.255.255.15 d) 255.255.255.192 e) 255.255.255.132
a) Depending on which class of network.
Class A: Valid with subnets
Class B: Valid but without subnets
Class C: Invalid because 24 bits are needed for the net-id
b) Invalid: cannot have bit “0” between the “1”s c) Invalid: the last bit should not be “1”
d) Valid: because 19211000000
e) Invalid: because 13210000100
5. If a company is granted a class B network address 135.58.0.0 and this company needs 13 subnets, what should be the subnet mask? How many host addresses are available in each subnet? Show the derivation steps.
A class B network with address 135.58.0.0
– The company needs 13 subnets. 24 = 16 > 13
– Therefore 4 bits are needed for the subnet ID.
– The number of “1”s in the default mask of class B network is 16. – Therefore the number of “1”s in the subnet mask is 16+4 = 20
– The subnet mask is
11111111 11111111 11110000 which is 255.255.240.0
– There are 32-20 = 12 bits for the host ID.
– Therefore the number of host addresses in each subnet
= 212 – 2 = 4094
SEHH2238 Computer Networking Tutorial 7
6. Example 18.5 in the textbook: An organization is granted a block of addresses with the beginning address 14.24.74.0/24. The organization needs to have 3 subblocks of addresses to use in its three subnets: one subblock of 10 addresses, one subblock of 60 addresses, and one subblock of 120 addresses. Design the subblocks.
There are 232– 24 = 256 addresses in this block. The first address is 14.24.74.0/24; the last address is 14.24.74.255/24. To satisfy the third requirement, we assign addresses to subblocks, starting with the largest and ending with the smallest one.
a) The number of addresses in the largest subblock, which requires 120 addresses, is not a power of 2. log2120 = 7. We allocate 27 =128 addresses. The subnet mask for this subnet can be found as n1 = 32 − log2 128 = 25. The first address in this block is 14.24.74.0/25; the last address is 14.24.74.127/25.
b) The number of addresses in the second largest subblock, which requires 60 addresses, is not a power of 2 either. We allocate 64 addresses. The subnet mask for this subnet can be found as n2 = 32 − log2 64 = 26. The first address in this block is 14.24.74.128/26; the last address is 14.24.74.191/26.
c) The number of addresses in the smallest subblock, which requires 10 addresses, is not a power of 2. We allocate 16 addresses. The subnet mask for this subnet can be found as n3 = 32 − log2 16 = 28. The first address in this block is 14.24.74.192/28; the last address is 14.24.74.207/28.
If we add all addresses in the previous subblocks, the result is 208 addresses, which means 48 addresses are left in reserve. The first address in this range is 14.24.74.208. The last address is 14.24.74.255. We don’t know about the prefix length yet. Figure 18.23 shows the configuration of blocks. We have shown the first address in each block.
SEHH2238 Computer Networking Tutorial 7 Page 4
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com