EC312 Homework 26
Name: SOLUTIONS
1.
In IP addressing, we know the first and last address in the block. Can we find our CIDR?
If the answer is yes, show the process.
Compare network address and broadcast address (i.e. 230.8.16.0 and 230.8.31.255). View them in bits.
230.8.16.0 - 11100110.00001000.0001
0000.00000000
6.
230.8.31.255 - 11100110.00001000.0001
1111.11111111
Count the number of bits that are the same, and this is your CIDR In this example, the CIDR is 20.
2. (c). Rewrite the following IP addresses using dotted-decimal notation:
01010111 10000100 00110111 00001111
87.132.55.15
3. (b). In classless addressing, what is the size of the block (N) if the value of the prefix
(n) is the following: n = 14
N = 2
32-n
= 2
32-14
= 2
18
= 262144 addresses
4. (b). Change the following prefix length to a mask in dotted-decimal notation: n=14
11111111 11111100 00000000 00000000
255.252.0.0
5. (b). Change the following mask to a prefix length: 255.240.0.0
Change the dotted-decimal to binary.
11111111 11110000 00000000 00000000
Count the number of 1s = 12 The prefix is 12.
(a) and (b). Each of the following addresses belong to a block. Find the first and last address in each block: a. 14.12.72.8/24 address: 00001110 00001100 01001000 00001000
mask: AND 11111111 11111111 11111111 00000000
first address: 00001110 00001100 01001000 00000000 14.12.72.0 address: 00001110 00001100 01001000 00001000
NOT mask: OR 00000000 00000000 00000000 11111111
last address: 00001110 00001100 01001000 11111111 14.12.72.255 b. 200.107.16.17/18 address: 11001000 01101011 00010000 00010001
mask: AND 11111111 11111111 11000000 00000000
first address: 11001000 01101011 00000000 00000000 200.107.0.0 address: 11001000 01101011 00010000 00010001
NOT mask: OR 00000000 00000000 00111111 11111111
last address: 11001000 01101011 00111111 11111111 200.107.63.255
7. Can each of the following be the value of the TTL in a datagram? Explain you answer. a. 23
– Yes. The TTL field is 8 bits which means the maximum value of TTL is 255.
b. 0
– No. When TTL is decremented to 0, the datagram is discarded.
c. 1 – Yes. This would be the last hop of the datagram.
d. 301
– No. The TTL field is 8 bits which means the maximum value of TTL is 255.
8. (a), (c) and (e). An IP datagram has arrived with the following partial information in the header (in hexadecimal): 45000054 00030000 2006...
4 5 00 0054 0003 0000 20 06...
VER HLEN Service Total ID Flag & TTL Protocol
Type Length Frag Offset a.
What is the size of the header? 5x4bytes = 20 bytes b.
What is the size of the data? Length of data = Total length – HLEN = 84 – 20 = 64 bytes c.
How many more routers can the packet travel to? 32 hops, so 32 routers. The last router will discard the datagram.
9. Which fields of the IPv4 header may change from router to router?
TTL, Header checksum
10. Circle the best word, or fill in the blanks, to complete the statements below that pertain to IPv4 addreses.
• An IP address is a software / hardware address which is made up of 16 / 512 / 32 bits.
• An IP address consists of two parts, a
Network ID and a Host ID.
• If all of the broadcast address.
• If all of the broadcast address.
Host
Host
ID bits of an IP address are zero, then the address is the network /
ID bits of an IP address are one, then the address is the network /
11. Show all work:
(a) What is the network address of 156.143.10.55 / 21 ? address: 10011100 10001111 00001010 00110111
mask: AND 11111111 11111111 11111000 00000000
first address: 10011100 10001111 00001000 00000000 156.143.8.0
(b) How many hosts can be assigned a unique IP address on this network?
2
32-21
-2 = 2
11
-2 = 2046 hosts
(c) What is the first available IP address that can be assigned to a host? first address assigned to a host: 10011100 10001111 00001000 00000001 156.143.8.1
(d) What is the last available IP address that can be assigned to a host? last address assigned to a host: 10011100 10001111 00001111 11111110 156.143.15.254
12. Can private IPv4 addresses be routed across the Internet? If not, what is the purpose of private IP addresses? If so, explain how they can be routed across the Internet.
No. These private IPv4 addresses are provided to users to be used internally to private networks. This allows users the ability to have an allotment of IP addresses to use within a private network whose addresses can be distributed by the network administrator rather than the Internet Service Provider. These addresses must be unique within a private network, but do not need to be unique globally. All IP routers know that these addresses are for private networks only.