0% found this document useful (0 votes)
50 views2 pages

EC312 PS26 - Solutions

This document contains the solutions to homework problems about IP addressing concepts. Some of the key points covered include: - Finding the CIDR of an address block from the network and broadcast addresses - Converting between binary and dotted-decimal notation for IP addresses - Calculating the number of addresses and available ranges for a given prefix length - Identifying fields in the IPv4 header - Stating that private IP addresses cannot be routed on the public internet and explaining their purpose for internal networks.

Uploaded by

Trần Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

EC312 PS26 - Solutions

This document contains the solutions to homework problems about IP addressing concepts. Some of the key points covered include: - Finding the CIDR of an address block from the network and broadcast addresses - Converting between binary and dotted-decimal notation for IP addresses - Calculating the number of addresses and available ranges for a given prefix length - Identifying fields in the IPv4 header - Stating that private IP addresses cannot be routed on the public internet and explaining their purpose for internal networks.

Uploaded by

Trần Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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.00010000.00000000
230.8.31.255 - 11100110.00001000.00011111.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 = 232-n = 232-14 = 218 = 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.
6. (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 Host


ID bits of an IP address are zero, then the address is the network /
broadcast address.

• If all of the Host


ID bits of an IP address are one, then the address is the network /
broadcast address.

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?

232-21-2 = 211-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.

You might also like