Quiz 1 Solutions
Quiz 1 Solutions
10 6 6 6 12 40
Do not use this paper as a scratchpad. NEATLY show the main working with the answer.
A. Answer the following objective type questions (just write the answer in BLOCK LETTERS) [10 marks]
1. Switches in a circuit-switched network process connection establishment and tear-down messages, whereas
switches in a packet-switched network do not. True or False? TRUE
2. A circuit-switched network may prevent some senders from starting new conversations. True or False? TRUE
3. Once a connection is correctly established, a switch in a circuit-switched network can forward data correctly
without requiring data frames to include a destination address. True or False? TRUE
4. Unlike in packet switching, switches in circuit-switched networks do not need any information about the
network topology to function correctly. True or False? FALSE
6. The aggregate (i.e., sum) of peaks is usually much larger than peak of aggregates in terms of bandwidth
usage. True or False? TRUE
7. Bursty traffic (i.e., when packet arrivals are not evenly spaced in time) always leads to queuing delays. True or
False? FALSE
8. Which socket API is used to specify the length of the queue for pending connections? LISTEN ( )
10. GET and POST requests are a part of the HTTP protocol.
B. A sender, S, sends out data packets of length 2000 bits destined to a specific receiver, R via a dedicated link with a
transmission rate of 100 Megabytes/sec. After receiving each packet, R sends out an acknowledgement packet (also
2000 bits) to S. S transmits the next packet only after receiving the acknowledgement from R. Both R and S have an
additional processing delay of 5ms from the time it completely receives a packet and starts transmitting the next
packet. Assuming the length of the physical link to be 150 meters. [3 + 2 + 1 = 6 marks]
(i) What is the maximum number of data packets per second that S can send to R?
(ii) If we want to increase the delivery rate to 100K packets/sec, assuming other factors constant, how much should
the processing delay lowered to?
For 100K packets/second, each packet delivery should be completed in 1/10^5 = 10 microseconds
The propagation and transmission delay is 1 + 5 = 6 microseconds.
Hence processing must be completed in 10 – 6 = 4 microseconds on both sides.
Since side processing delay = 4/2 = 2 microseconds.
(iii) Which strategy will result in a greater improvement on the delivery rate: (a) reducing the link length by 50%, (b)
cutting down the processing delays by 50%?
(b) will have more effect as it is directly added to the total delay, where as for (a) the factor is divided by 3x10^8 and is
relatively smaller than case (b).
C. 8 end-hosts share a common network that has a maximum transmission rate of 15 Megabits/sec. If a packet faces
collision, that packet is retransmitted by the corresponding end-host. Including retransmissions, each end-host sends
traffic at an average rate of 1.5 Megabits/sec. Each packet is 10 Kilobits long. Assume that no packet gets dropped
except due to collisions and each end-host’s average queue length is 5. [1 + 3 + 2 = 6 marks]
(i) What can be the maximum network utilization for this network?
(ii) Suppose we measure the network utilization to be 0.72. What fraction of packets sent by the nodes (including
retransmissions) experience a collision? Note that retransmissions are not counted for estimating network utilization.
Actual network utilization (without retransmissions) = 0.72, i.e., useful bitrate = 15 x 0.72 = 10.8 Mbps.
Total bitrate transmitted = 12 Mbps.
Fraction of retransmitted packets = (12 – 10.8)/12 = 0.1 or 10%
(iii) What is the average queueing delay, in milliseconds, experienced by a packet before it is sent over the network?
Note the question. Delay – “, experienced by a packet before it is sent over the network”, i.e, we are asking a question
related to the L3 queue at the end-hosts. Average queue length is given to be 5.
Packets per second by each end-host = 1.5 x 10^6 bps / 10^4 bits/packet = 150 packets/second
For each end-host, waiting time = 5 packets / 150 packet/second = 0.033 seconds = 33 milliseconds.
D. A router has an input interface and two output interfaces P1 and P2, where P1 is considerably slower than P2.
Packets pushed through P1 experience an average delay of 5 milliseconds, compared to 1 millisecond in case of P2.
[3 + 3 = 6 marks]
(i) The router assigns 25% of the incoming packets to the slower interface and the rest to the faster one. The average
number of packets in the router’s waiting queue is 40. What is the average rate, in packets per second, at which the
router processes packets?
Expected waiting time of packets at the router = (0.25 x 5) + (0.75 x 1) = 2 milliseconds (W)
Average length of router’s queue = 40 packets (L)
Packet processing rate at the router (A) = L/W (Little’s Law) = 40packets / 2milliseconds = 20K packets/second.
(ii) Suppose the router assigns a packet to one of the interfaces uniformly randomly. Assume that the maximum
packet processing capability of the router is 30K packets/sec. What should be the maximum queue length allocated to
avoid packet loss at the router.
Expected waiting time of packets at the router = (0.5 x 5) + (0.5 x 1) = 3 milliseconds (W)
Packet processing rate at the router (A) = 30K packets/second.
Queue length at router = 30K x 3x10^-3 packets = 90 packets.
E. Answer the following questions with a one-line explanation. [4x2 + 4x1 = 12 marks]
(i) What will the following code snippet print (typically, on a Linux/Unix based system)? [2 marks]
1. /*assume includes */
2. int main() {
3. int fd;
4. fd = socket(AF_INET,SOCK_STREAM,0);
5. printf("%d\n",fd);
6. return 0;
7. }
Three. Any positive integer greater than equal to three can be awarded 1.5 marks.
(ii) What will be the little-endian hexadecimal representation of the port number 8080 (stored in two registers X and Y
of size 1 byte each, X has a lower memory address than Y) [2 marks]
(iii) A modified TDMA scheme allocates time slots to users proportional to their data rate requirements. Suppose three
users A, B and C with average demands 2 Mbps, 3 Mbps and 5 Mbps share a TDMA link with capacity of 10 Mbps.
What fraction of the total time the link will be utilized by user C? [2 marks]
Switch supports protocols upto L2, whereas Router supports protocols upto L3 (e.g, routing algorithms, understands
IP addresses)
(v) Can two processes share the same TCP port on the same end-host? (Yes/No) [1 mark] NO
(vi) Can a single process bind to multiple TCP ports on the same end-host? (Yes/No) [1 mark] YES
(vii) Can different processes bind to the same TCP port on different end-hosts in a common networked environment?
(Yes/No) [1 mark] YES
(viii) Your friend claims that her browser’s source port is always set to 8080 while making an HTTP connection.
True/False? [1 mark] FALSE