EC312Homework26
Name: SOLUTIONS
- 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 = 12The 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/24address: 00001110 00001100 01001000 00001000
mask:AND 11111111 11111111 11111111 00000000
first address: 00001110 00001100 01001000 0000000014.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/18address: 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
- What is the size of the header? 5x4bytes = 20 bytes
- What is the size of the data? Length of data = Total length – HLEN = 84 – 20 = 64 bytes
- 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.Circlethebestword, or fillintheblanks,to completethestatementsbelowthatpertaintoIPv4addreses.
•AnIPaddressisasoftware/hardwareaddresswhichismadeup of16 /512 /32 bits.
•AnIPaddressconsistsoftwoparts,a NetworkID anda HostID.
•Ifallofthe broadcastaddress.
•Ifallofthe broadcastaddress.
IDbitsofanIPaddressarezero,thentheaddressisthe network/
IDbitsofanIPaddressareone,thentheaddressisthenetwork/
11.Show allwork:
(a)Whatisthenetworkaddressof156.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 manyhostscan beassignedauniqueIPaddresson thisnetwork?
232-21-2 = 211-2 = 2046 hosts
(c)Whatisthefirst availableIPaddressthatcanbeassignedtoahost?
first address assigned to a host: 10011100 10001111 00001000 00000001 156.143.8.1
(d)Whatisthelast availableIPaddressthatcanbeassignedtoahost?
last address assigned to a host: 10011100 10001111 00001111 11111110 156.143.15.254
12.CanprivateIPv4addressesberoutedacrosstheInternet?Ifnot,whatisthepurposeofprivateIP
addresses? Ifso,explainhow theycanberoutedacrosstheInternet.
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.