CN Assignment 3 2022-23
CN Assignment 3 2022-23
Information Technology
B.Tech (6th Semester)
Assignment 3 (For All Students)
Subject Name: Computer Network Subject Code: KCS 603
Problem 1: LAN
Consider the LAN scenario above. Answer each question below briefly, e.g., in a few words or a sentence or two at
most. (Really, please be brief)
a) Assign an IP address to the leftmost interface of the router, given that the subnet part of IP addresses are 24
bits.
b) Suppose A wants to send an IP datagram to B and knows B’s IP address. Must A also know B’s MAC address
to send the datagram to B? If so, how does A getthis info? If not, explain why not.
c) Suppose A wants to send an IP datagram to C and knows C’s IP address. Must A also know C’s MAC address
to send the datagram to C? If so, how does A getthis info? If not, explain why not.
d) Suppose that R has a datagram (that was originally sent by A) to send to C. What are the MAC addresses on
the frame that is sent from R to C? What are the IP addresses in the IP datagram encapsulated within this
frame?
e) Suppose the switches above are learning switches and suppose that theswitch has just been turned on. Suppose
now A send an Ethernet frame to B.
a. On how many outgoing switch interfaces will this first frame be carried?
b. Now suppose that B replies to A and A sends a second frame to B. On how many outgoing switch
interfaces will this second frame be carried?
Suppose now (for the two questions below) that the router is removed from the scenario above
f) Can the nodes keep their IP addresses the same as shown in the pictureabove? Explain in one or two sentences.
g) Suppose that the network manager wants to assign A and C to the same VLAN and B and D to a different
VLAN. When a frame is forwarded between switches, how does the receiving switch know which VLAN the
frame is destined to?
Problem 2: Fragmentation
Suppose a router receives an IP packet of 552 bytes, and has to fragment the packet and forward the fragments across a
network with an MTU of 300 bytes. Then, a subsequent router has to further forward the packet (and/or any resulting
fragments) onto another network that has an MTU of 100 bytes. Here, the MTU refers to the size of the largest packet
that can be carried in a link-layer frame. If the size of the TCP header is 20 bytes and that of the IP header is also 20
bytes (i.e., there are no options), compute the values for the following fields in the IP headers for all of the fragments
that traverse each network:-
a) Length
b) MF
c) Offset
Problem 3: IP Routing
Suppose a router has the following forwarding table, and that the contents of the router ARP cache are shown below.
Describe what the router does (i.e., out of which interface does it forward the packet, and what is the destination
MAC address of the outgoing frame) with a packet addressed to each of the following destinations:-
a) 128.96.39.10
b) 128.96.40.12
c) 128.96.40.151
d) 192.4.153.17
Problem 4: A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four
organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses, respectively, and in that order. For each
of these, give the first IP address assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation.
Problem 5: A router with IP address 125.45.23.12 and Ethernet physical address 23:45:AB:4F:67:CD has received a
packet for a host destination with IP address 125.11.78.10 and Ethernet physical address AA:BB:A2:4F:67:CD.
a. Show the entries in the ARP request packet sent by the router. Assume no subnetting.
b. Show the entries in the ARP packet sent in response to part a.
c. Encapsulate the packet made in part a in a data link frame. Fill in all the fields.
d. Encapsulate the packet part b in a data link frame. Fill in all the fields
Problem 6: IP forwarding.
Consider the network diagram below. Each router (a square in the figure) is labeled with the names of its interfaces (e.g.,
eth0) and the IP addresses assigned to each. Each network (a circle) is labeled with its network name and prefix length.
a) The machine I’m typing this on has an IP address 192.168.9.12. To which of the networks above am I
connected? What is the subnet mask my machine should use?
b) What is the most concise CIDR block R2 can use to describe the networks reachable through R3?
What path would a packet from my machine follow to a host on network F? Explain how the packet is forwarded
by showing the rows in each forwarding table that would be invoked. If the packet is forwarded by R2, please list
the forwarding table entries in R2’s table that would be used.
Problem 7: Why does the Offset field in the IP header measure the offset in 8-byte units? (Hint: Recall that the Offset
field is 13 bits long.)
Problem 8: Suppose a TCP message that contains 1024 bytes of data and 20 bytes of TCP header is passed to IP for
delivery across two networks interconnected by a router (i.e., it travels from the source host to a router to the destination
host). The first network has an MTU of 1024 bytes; the second has an MTU of 576 bytes. Each network’s MTU gives the
size of the largest IP datagram that can be carried in a link-layer frame. Give the sizes and offsets of the sequence of
fragments delivered to the network layer at the destination host. Assume all IP headers are 20 bytes.
Problem 9: In a datagram, the M bit is zero, the value of HLEN is 5, the value of total length is 200, and the offset value
is 200. What is the number of the first byte and number of the last byte in this datagram? Is this the last fragment, the first
fragment, or a middle fragment?
We use CIDR. Without using longest prefix matching, a forwarding table looks like this. If we use longest prefix
matching, we can combine a few entries together. What is a table with a minimum number of entries that still be able to
forward packet correctly?