PS4-Solution

pdf

School

Purdue University *

*We aren’t endorsed by this school

Course

46300

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

3

Uploaded by CoachOryxPerson15

Report
ECE 46300: Introduction to Computer Communication Networks 1 Problem Set 4 Solutions (20 Points) 1 IP Addressing 1. What is the 32‑bit binary equivalent of the IP address 223.1.3.27? (1 point) 11011111 00000001 00000011 00011011 2. Consider a host machine with IP address 10.23.124.6 and subnet mask 255.255.248.0. (a) What is the address (in CIDR format) of the subnet the machine is part of? (1 point) IP = 10.23.124.6 = 00001010 00010111 01111100 00000110 Subnet mask = 255.255.248.0 = 11111111 11111111 11111000 00000000 Subnet address is bitwise AND of IP and subnet mask = 00001010 00010111 01111000 00000000 = 10.23.120.0/21 (b) What is the maximum number of IP addresses the subnet can support? (1 point) Looking at the subnet mask or the CIDR format, the first 21 bits are used for the subnet address. Hence, the subnet can support 2 11 = 2048 IP addresses. (c) What is the range of IP addresses in the subnet? (2 points) 00001010 00010111 01111 000 00000000 (10.23.120.0) to 00001010 00010111 01111 111 11111111 (10.23.127.255) 3. Consider a network using 8‑bit IP addresses. Suppose a router uses Longest Prefix Matching and has the below routing table. The addresses are in the CIDR format. For each of the five output ports, give the associated range of IP addresses and the number of addresses in the range. (5 points) Destination Address Output Port 0/2 0 64/3 1 96/3 2 128/2 3 192/2 4 00 000000 (0) to 00 111111 (63), 64 addresses 010 00000 (64) to 010 11111 (95), 32 addresses 011 00000 (96) to 011 11111 (127), 32 addresses 10 000000 (128) to 10 111111 (191), 64 addresses 11 000000 (192) to 11 111111 (255), 64 addresses Subject to Purdue University copyright policies Do not share, distribute, or post online
ECE 46300: Introduction to Computer Communication Networks 2 4. Consider the routing table below and a series of packets going through the router. For each packet, determine the output port the packet will be forwarded on. Assume router uses Longest Prefix Matching. All addresses are in CIDR format. (6 points) Destination Address Output Port 192.168.0.0/16 1 192.168.20.0/22 2 0.0.0.0/0 3 192.168.23.10 4 Destination IP Header Output Port Packet 1 192.168.23.4 2 Packet 2 192.168.23.10 4 Packet 3 192.168.32.1 1 Packet 4 192.165.23.10 3 Packet 5 192.168.22.234 2 Packet 6 192.168.21.10 2 First, we extract the subnet address bits from each of the routing table entries Destination Address Subnet Address Bits Output Port 192.168.0.0/16 11000000 10101000 1 192.168.20.0/22 11000000 10101000 000101 2 0.0.0.0/0 zero subnet bits – matches every packet 3 192.168.23.10 11000000 10101000 00010111 00001010 4 (a) Packet 1 ( 11000000 10101000 000101 11 00000100) – Routing table entries 1, 2, 3 are all pre‑ fixes of the queried destination IP header, but entry 2 is the longest prefix. (b) Packet 2 ( 11000000 10101000 00010111 00001010 ) – All four routing table entries are prefixes of the queried destination IP header, but entry 4 is the longest prefix. (c) Packet 3 ( 11000000 10101000 00100000 00000001) – Routing table entries 1 and 3 both are prefixes of the queried destination IP header, but entry 1 is the longest prefix. (d) Packet 4 (11000000 10100101 00010111 00001010) – Only routing table entry 3 is a prefix of the queried destination IP header. (e) Packet 5 ( 11000000 10101000 000101 10 11101010) – Routing table entries 1, 2, 3 are all pre‑ fixes of the queried destination IP header, but entry 2 is the longest prefix. (f) Packet 6 ( 11000000 10101000 000101 01 00001010) – Routing table entries 1, 2, 3 are all pre‑ fixes of the queried destination IP header, but entry 2 is the longest prefix. Subject to Purdue University copyright policies Do not share, distribute, or post online
ECE 46300: Introduction to Computer Communication Networks 3 2 Routing Table Suppose we have a network with 6 routers A–F and all links have cost 1. Suppose the routing tables below are given for routers A and F. Give a diagram of the smallest network, i.e., network with least number of links, that is consistent with these tables. (4 points) Destination Cost Next hop B 1 B C 1 C D 2 B E 3 C F 2 C Table 1: Router A’s routing table Destination Cost Next hop A 2 C B 3 C C 1 C D 2 C E 1 E Table 2: Router F’s routing table Below is the solution network with least number of links. Subject to Purdue University copyright policies Do not share, distribute, or post online
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help