Uploaded by harpreetanandsingh

Compre-2023-Solved

advertisement
BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI
Department of Computer Science & Information Systems
Second Semester 2022-2023
COMPUTER NETWORKS (CS F303)
Comprehensive Examination (REGULAR)
Date of Exam: 08-05-2022 (FN)
PART-A (CLOSED BOOK)
MM: 41
Duration: 1.5 Hrs.
---------------------------------------------------------------------------------------------------------------------------NAME: KEY
BITS ID: SOLUTION
-------------------------------------------------------------------------------------------------------------------------------------Note: Read and follow the instructions given below to attempt the question paper.
a) Write answers in the space provided after each question.
b) Avoid overwriting; overwritten answers will not be evaluated.
c) Use the last few pages of your main answer sheet for the rough work.
Q.1 Answer the following questions in brief.
[1+1+2+3=7M]
a) What is the purpose of the connection-oriented welcoming socket, which the server uses to perform an
accept()? Once the accept() is done, does the server use the welcoming socket to communicate back to the
client? Explain.
Sol: The welcoming socket is used in a server to wait for incoming client connection requests in connectionoriented (TCP-based) communication. A new socket is created on return from the accept(), and the server then
uses this new socket to communicate back to the client.
b) What does demultiplexing a Protocol Data Unit (PDU) up to an upper-level protocol mean?
Sol: Demultiplexing refers to passing an incoming protocol data unit (PDU) up to the appropriate higher-level
protocol. The PDU will typically have a field indicating the upper layer protocol to which the PDU payload should
be passed.
c) Give one difference between what a switch does in a packet-switched network and a circuit-switched
network.
Sol: Switches in a circuit-switched network participate in a connection set-up/teardown protocol but not in a
packet-switched network.
Look up the packet’s destination address during forwarding in a packet-switched network, but not in a circuitswitched network.
d) Consider distributing a file of F bits to N peers using a P2P architecture. Assume a fluid model. Suppose dmin
is very large, so peer download bandwidth is never a bottleneck. Suppose that us ≤ (us+u1+…+uN)/N. Specify a
distribution scheme that has a distribution time of F/us.
Sol: u = u1+u2+ …+uN
us ≤ (us+u1+…+uN)/N
…. (1)
Divide the file into N parts, with the ith part having size (ui/u)*F. The server transmits the ith part to peer i at rate
ri = (ui*us/u)
Note that (r1 + r2 + …. +rN = us), so that the aggregate server rate does not exceed the link rate of the server.
Also, have each peer i forward the bits it receives to each of the N-1 peers at rate ri.
The aggregate forwarding rate by peer i is (N-1)*ri.
We have (N-1)*ri = (us*ui)/u <= ui (From eq.1)
Thus the aggregate forwarding rate of peer i is less than its link rate ui
In this distribution scheme, peer I receive bits at an aggregate rate of ri + ∑ rj = us
Thus each peer receives the file in F/us
Q.2 Assume A and B are the only two stations on Ethernet. Each has a steady queue of frames to send. Both A
and B attempt to transmit a frame, collide, and A wins the first back-off race. At the end of this successful
transmission by A, both A and B attempt to transmit and collide. What is the probability that A wins the second
back-off race? Show the key steps of your calculation.
[2M]
Sol: 5/8 = 0.625
Page | 1
Q.3 Consider the following packet routing strategies.
MinCost: Every node picks the path that has the smallest sum of link costs along the path.
MinHop: Every node picks the path with the smallest number of hops (irrespective of the link cost).
SecondMinCost: Every node picks the path with the second lowest sum of link costs. That is, every node picks
the second-best path with respect to path costs.
MinCostSquared: Every node picks the path that has the smallest sum of squares of link costs along the path.
Assume that sufficient information (e.g., costs, delays, bandwidths, and loss probabilities of the various links) is
exchanged in the link state advertisements so that every node has complete information about the entire
network and can correctly implement the strategies above. You can also assume that a link's properties don't
change, e.g., it doesn't fail.
Which of these strategies will work correctly, and which will result in routing with loops. In case of strategies
that result in routing loops, devise an example network topology with a routing loop.
[3M]
Sol: All except SecondMinCost will work fine. To see why SecondMinCost will not work: consider the triangle
topology with 3 nodes, A, B, C, and equal cost on all the links. The second route from A to C is via B, and the
second best route from B to C is via A, resulting in a routing loop.
Q.4 Consider the network shown in the picture below. Each node implements Dijkstra's shortest path algorithm
using the link costs shown in the picture.
[3+3=6M]
a) Initially, node B's routing table contains only one entry for itself. When B runs Dijkstra's algorithm, in what
order are nodes added to the routing table? List all possible answers.
Sol: B, C, E, A, F, D and B, C, E, F, A, D
b) Now suppose the link cost for one of the links changes but all costs remain non-negative. For each change in
link cost listed below, state whether it is possible for the route at node B (i.e., the link used by B) for any
destination to change, and if so, name the destination(s) whose routes may change.
i) The cost of link(A, C) decreases.
Sol: Can affect route to A. If cost_AC ≤ 3, then we can start using this edge to go to A instead of edge BA.
ii) The cost of link(B, C) increases.
Sol: Can affect route to C,F,E. If cost_BC ≥ 7, then we can use BE-EC to go to C instead of BC. If cost BC ≥ 5, then
we can use BE-EF to go to F. If cost_BC ≥ 3, can use BE to go to B. (Note: Three routes from B to C, F, and E
should be mentioned to get the credit of 1 Marks. No partial marks.)
iii) The cost of link(B, C) decreases.
Sol: Can affect route to D. If cost_BC ≤ 1, then we can use BC-CE-ED to go to D instead of BD.
Q.5 Four users are sharing a common link of 4 Mbps. User A is connected to the common link via a 5 Mbps link
and uses an application requiring x Mbps. Users B, C, and D download large files (i.e., using as much bandwidth
as possible). B is connected via an x Mbps link, while C and D are each connected via their own 10Mbps link.
What is the max-min fair allocation if:
[2M]
(a) x = 2 Mbps
Sol: 1 Mbps for each user
(b) x = 0.5 Mbps
Sol: A=0.5, B=0.5, C=1.5, D=1.5 Mbps
Page | 2
Q.6 Mobile IP involves what is called “triangular routing,” with packets from the source node to the mobile node
transiting through the mobile node’s home agent but return packets sent from the mobile node to the source
node proceeding directly. Do you see any problem in sending the return packet directly to the source node?
Explain.
[2M]
Sol: One major problem that mobile IP can encounter is that it is susceptible to address filtering by Internet
Service Providers, i.e., the enforcement of packet filtering rules that drop packets with source addresses that
do not belong to the local subnet (to combat address spoofing). This will result in return packets sent from the
mobile host (with its original home IP address) being dropped since they do not carry a source address that
belongs to the local subnet.
Q.7 The topology shown below comprises six Autonomous Systems (AS): A, B, C, W, X, Y. Assume that W, X, and
Y are access ISPs and that A, B, and C are backbone provider networks. The provider networks A, B, and C must
send traffic to each other directly and provide full BGP information to their customer networks. All traffic
entering an ISP access network must be destined for that network, and all traffic leaving an ISP access network
must have originated in that network.
[1.5+1.5=3M]
a) How is the desired behavior of the access network implemented in BGP?
Sol: The desired behavior can be achieved by policy routing in BGP. The access network x must not advertise
path xCy to B, and it must not advertise the path xBAw to C to enforce the desired behavior. The w and y are
clearly access networks.
b) How is the desired behavior of the provider network implemented in the BGP?
Sol: The B learns from A that A has path Aw to w. B should install this path into its tables and advertise Baw to
the customer x but not C. Similarly, C learns from A that it has a path Aw to w. C should install it into its tables
and advertise Caw to the customer y but not B.
Q.8 Consider a go-back-N protocol with cumulative acknowledgments that uses sequence numbers 0-3 and has
a window size of 2. Assume that the sender transmits four packets, P0, P1, P2, and P3, and that P1 is discarded
before it reaches the receiver. No other packets or acks are lost. The beginning of this scenario is shown at right,
with the timeout interval shown.
Complete the diagram to show all the acknowledgements and all packet transmissions and retransmissions.
Label all packets and acknowledgements with their sequence numbers. Also, mention when each packet is
available to the application at the receiver. Continue the scenario until all four packets have been delivered and
acknowledged.
[3M]
Page | 3
Q.9 Consider the MPLS network with MPLS tables for R1, R2, R3, and R4, shown below. All routers shown in the
network are MPLS enabled. Suppose that we want to perform traffic engineering so that packets from R6
destined for A are switched to A via R6-R4-R3-R1, and packets from R5 destined for A are switched via R5-R4R2-R1. Show the MPLS tables in R5 and R6 and the modified table in R4 that would make this possible. [3M]
In
Out Dest. Out
label label
Interface
9
A
0
In
Out Dest. Out
label label
Interface
7
A
0
Q.10 Consider a router that is managing three flows on which packets of constant size arrive at the following
wall clock times:
[10M]
Flow A: 1, 3, 5, 6, 8, 9, 11
Flow B: 1, 4, 7, 8, 9, 13, 15
Flow C: 1, 2, 4, 6, 7, 12
All three flows share the same outbound link, on which the router can transmit one packet per time unit. Assume
that there is an infinite amount of buffer space. Suppose the router implements fair queuing. Give the wall clock
time for each packet when the router transmits it. Arrival time ties will be resolved in the order of A, B, and C.
Show the packet transmission process in the following table till wall clock time 11. The first entry in the table is
provided for your reference. Use the packet numbering with respect to the wall clock time. For example, the
second packet arrives into Flow B at wall clock time 4 hence it should be numbered as B4, not B2.
Marking Scheme: 1M for each row details filled correctly (2 to 11).
Wall
Clock
Arrival
Time (Ai)
Packet Arrives
Finish
Time (Fi)
Packet
Sent
A’s Queue
B’s Queue
C’s Queue
1
2
3
4
1.0
1.333
1.833
2.333
A1
B1
B1
A3
A3
B4
C1
C1, C2
C1, C2
C2, C4
2.666
3.0
C2
B4
A5
A5, A6
B4
B4
C2, C4
C4, C6
7
3.333
A5
A5, A6
B7
C4, C6
8
3.666
C4
A6, A8
B7, B8
C4, C6, C7
9
4.0
2.0
3.0
3.0
3.333
4.0
4.0
5.0
5.0
4.333
6.0
6.0
5.333
7.0
6.333
A1
B1
C1
A3
5
6
A1,B1,C1
C2
A3
B4
C4
A5
A6
C6
B7
C7
A8
B8
A9
B9
B7
A6, A8, A9
B7, B8, B9
C6, C7
10
11
4.333
4.666
A11
8.0
A6
C6
A6, A8, A9
A8, A9, A11
B8, B9
B8, B9
C6, C7
C6, C7
xx—00—xx
Page | 4
Q.1 Consider the topology where two hosts, A and B, send packets to D through router R. The bottleneck link in the
path from R to D runs at 10MB/s (i.e., 10 Megabytes per second). The RTTs from A to D and B to D are 100 ms. Assume
that both A and B can communicate with R instantaneously and at an arbitrarily large rate. Assume that each packet
has a length of 1250 bytes and the buffer on router R can hold 200 packets.
[1+1+1+3+2+1+2+2=13M]
a) What is the bandwidth-delay product in Megabytes (MB)?
Sol: 100ms and 10MB/s means BPD is 1 MB.
b) How many packets can the network hold (on the wire plus in R)?
Sol: The wire contains 1MB or 106/(1250) = 800 packets. i.e. 800 packets on the wire, and 200 in the router.
Suppose that at time t = 0, host A has a congestion window of 999 packets, B has a congestion window of 0, and R’s
buffer is empty. You should assume that packet drops are always experienced by the flow with more packets in flight.
You should assume that each flow updates its congestion window after each RTT, decreasing it if any packet was
dropped and increasing it otherwise.
Assume that each flow is governed by AIMD, in which the congestion window grows by being incremented by one and
shrinks by being halved (rounding down).
c) At which value of t will the number of outstanding packets exceed the network’s capacity? Give your answer in RTTs,
not seconds.
Sol: 1 RTT (1000+1 = 1001 packets) (Note: No marks if part (b) is not correct.)
d) At which value of t will the number of outstanding packets next exceed the network’s capacity? Give your answer
in RTTs, not seconds. What are the congestion windows in the RTT after this? Give your answer in packets.
Sol: Let us consider the time before the second drop. At t RTTs, A has 498 + t packets in flight, and B has t packets in
flight. Thus, after t = 252 RTTs, there will be 1002 packets in flight, and a drop will occur.
Suppose that instead of AIMD, we are using an AIAD protocol. In this case, every drop decreases the congestion
window by 5 packets (to a minimum of 1 packet) instead of halving the congestion window. Whereas the increment
value remains the same as in AIMD.
e) What are the congestion windows of both hosts at t = 300 RTTs for AIAD? Give your answer in packets.
Sol: B’s window increases by 1 each RTT, so it will be 300. A’s congestion window is given by 999 – t, which is 699.
f) How do the number of dropped packets in AIMD and AIAD compare?
Sol: In AIAD, more packets are dropped.
g) Does AIAD eventually converge to a fair allocation between flows? Explain.
Sol: Yes – the smaller flow always grows, and the larger shrinks if necessary, so it does. (Note: 0 marks without any
explanation.)
h) On the real internet, the smaller flow can have its packets dropped too. Suppose that the flow to experience the
drop was chosen randomly with a 50% probability. Explain the effect of AIAD on fairness in this new model.
Sol: The system would never converge to a fair allocation between flows, since each flow would now evolve in the
same way: growth until the network is overloaded, followed by a 50% chance of a flow reduction.
1|Page
Q.2 The details of an IPv4 address block assigned by an ISP to your research lab are as follows:
Original network address: 142.150.0.0/16 (represents the superblock of the IP address from which the given block is
extracted)
Base address: 142.150.235.0
Network mask: 255.255.255.224
Broadcast address: 142.150.235.31
Reserved Router address: 142.150.235.1
Answer the following questions for the above-mentioned IPv4 address block.
[1+1+1+1+1+1+4=10M]
a) What is the address of the assigned subnetwork, and what is the extended network prefix?
Sol: 142.150.235.0/27
b) Which IP addresses can you use to configure the computers in your lab?
Sol: 142.150.235.2 – 142.150.235.30
c) How do you configure your computer’s IP address, default gateway, and subnet mask?
Sol: IP address: from (b) Default gateway: 142.150.235.1 Subnet mask: 255.255.255.224. No marks for writing DHCP
does the configuration.
d) How many bits of the host number are used to designate the subnet of your lab?
Sol: 11 bits are used.
g) What is the role of the “reserved router address”? Why is this information important?
Sol: This is the address of an IP router on the 142.150.235.0/27 subnet. All systems on this subnet should use the
address 142.150.235.1 as a default gateway.
h) Do you need to set up a router in your lab?
Sol: No, I assume that the router is provided (at address 142.150.235.1). OR Yes, but it is configured with the reserved
router address IP (142.150.235.1)
i) Suppose you wanted to subdivide the assigned address block into 3 smaller subnetworks. Out of these subnetworks,
one subnetwork must be of 16 IP addresses, and the remaining two must be of equal size. What are the network
addresses and range of IP addresses of these 3 subnetworks? How many hosts can you configure for each subnetwork?
Sol: Three subnets with 16, 8, and 8 interfaces must be given. For number of hosts must exclude broadcast address,
subnetwork address, and reserved router address.
142.150.235.0/28 to 142.150.235.15/28 (16 - 2 or 3)
142.150.235.16/29 to 142.150.235.23/29 (8 - 2 or 3)
142.150.235.24/29 to 142.150.235.31/29 (8 – 2 or 3)
2|Page
Q.3 Consider the following network. It contains six hosts (A through E) and two Routers. Corresponding IP and MAC
addresses are shown for each interface.
[6+6+2+2=16M]
a) Host E wants to send a packet to host B. Write all the steps required for the packet to be sent to B in sequence and
specify all necessary information at each step. Assume that the forwarding tables of all switches already have entries
for all MAC addresses and that all hosts and routers already know each other’s MAC addresses.
Sol:
1. Host E creates an Ethernet frame with Ethernet destination address 88-88-88-88-88-88.
2. Router 2 receives the frame and extracts the datagram. The forwarding table in this router indicates that the
datagram has to be routed to 192.168.2.002.
3. Router 2 then sends an Ethernet frame with the destination address 33-33-33-33-33-33 and source address 55-5555-55-55-55 via its interface with IP address of 192.168.22.003.
4. Router 1 receives the frame and extracts the datagram. The forwarding table in this router indicates that the
datagram has to be send to 192.168.8.003.
5. Router 1 then sends an Ethernet frame with the destination address 11-11-11-11-11-11 and source address 22-2222-22-22-22 via its interface with IP address of 192.168.8.002.
b) Write the forwarding table entries maintained at Router 1. Assume the forwarding table consists of three pieces of
information, i.e., Subnet Address, Subnet Mask, and Interface number. Assume the left interface of both routers is 1
and the right interface of both routers is 2, as shown in the network figure.
Sol: Routing table at R1
Subnet Address
Subnet Mask
192.168.8.0
255.255.255.252 or 255.255.255.0
192.168.76.0
255.255.255.252 or 255.255.255.0
192.168.22.0
255.255.255.248 or 255.255.255.0
192.168.2.0
255.255.255.252 or 255.255.255.0
Interface
1
2
2
2
c) Can hosts A and E have the same IP address? Can they have the same MAC address? Provide justification.
Sol: The A and E can have the same IP addresses belonging to two different LANs. (OR If the answer is written in the
context of the given topology then both IP addresses can’t be same as they belong to two different subnets.) However,
they cannot have the same MAC addresses, as MAC addresses must be unique across the LANs.
d) Can hosts A and B have the same IP address? Can they have the same MAC address? Provide justification.
Sol: A and B cannot have the same IP addresses, as both belong to the same LAN subnet. The MAC addresses for both
cannot be identical for the reason specified in (c).
3|Page
Download