You are on page 1of 9

COMPUTER NETWORKS – CSE302

UNIT I - PROBLEMS
PART I – COMPUTER NETWORKS AND THE INTERNET

Problem No 1:
This elementary problem begins to explore propagation delay and transmission delay, two
central concepts in data networking. Consider two hosts, A and B, connected by a single link of
rate R bps. Suppose that the two hosts are separated by m meters, and suppose the propagation
speed along the link is s meters/sec. Host A is to send a packet of size L bits to Host B.
a. Express the propagation delay, 𝑑𝑝𝑟𝑜𝑝 in terms of m and s.
b. Determine the transmission time of the packet, 𝑑𝑡𝑟𝑎𝑛𝑠 in terms of L and R.
c. Ignoring processing and queuing delays, obtain an expression for the end-to-end delay.
d. Suppose Host A begins to transmit the packet at time 𝑡 = 0 . At time 𝑡 = 𝑑𝑡𝑟𝑎𝑛𝑠 , where is the
last bit of the packet?
e. If 𝑠 = 2.5 ∗ 108 , 𝐿 = 120 𝑏𝑖𝑡𝑠, 𝑎𝑛𝑑 𝑅 = 56 ∗ 103 . Find the distance of m

Solution:
𝑚
a. 𝑑𝑝𝑟𝑜𝑝 = 𝑠𝑒𝑐𝑜𝑛𝑑𝑠
𝑠
𝐿
b. 𝑑𝑡𝑟𝑎𝑛𝑠 = 𝑅 𝑠𝑒𝑐𝑜𝑛𝑑𝑠
𝑚 𝐿
c. 𝑑𝑒𝑛𝑑−𝑡𝑜−𝑒𝑛𝑑 = ( 𝑠 + 𝑅) 𝑠𝑒𝑐𝑜𝑛𝑑𝑠
d. The bit is just leaving Host A
𝐿 120
e. 𝑚= 𝑠= (
3 2.5 ∗ 10
8)
= 536 𝑘𝑚
𝑅 56∗10

*****
Problem No 2:
Answer the following questions,
a. What is the transmission rate of Ethernet LANs?
b. Visit the Queuing and Loss applet at the companion Web site. What is the maximum emission
rate and the minimum transmission rate? With those rates, what is the traffic intensity? Run
the applet with these rates and determine how long it takes for packet loss to occur. Then
repeat the experiment a second time and determine again how long it takes for packet loss
to occur. Are the values different? Why or why not?
c. In case there is exactly one packet switch between a sending host and a receiving host. The
transmission rates between the sending host and the switch and between the switch and the
receiving host are R1 and R2 respectively. Assuming that the switch uses store-and-forward
packet switching, what is the total end-to-end delay to send a packet of length L?

Solution:
a. Ethernet LANs have transmission rates of 10 Mbps, 100 Mbps, 1 Gbps, and 10 Gbps.
b. The maximum emission rate is 500 packets/sec and the maximum transmission rate is 350
packets/sec. The corresponding traffic intensity is 500/350 =1.43 > 1. The loss will
eventually occur for each experiment, but the time when loss first occurs will be different
from one experiment to the next due to the randomness in the emission process.
c. Consider the data: R1= Transmission rates between the sending host and the switch, R2=
Transmission rates between the switch and the receiving host, L= Packet of length. Thus, the
end-to-end delay is L/R1 + L/R2.
Explanation for (b) :
The most complicated and interesting component of end-to-end delay is queuing delay. In this
interactive animation, you specify the packet arrival rate and the link transmission speed. You'll
then see packets arrive and queue for service. When the queue becomes full, you'll see the queue
overflow--that is, packet loss.

A particularly interesting case is when the emission and transmission rates are the same, for
example when both are 500 packets/sec. If you let the interactive animation run for a very long
time, you'll eventually see the queue fill up and overflow. Indeed, when the two rates are the
same (that is, ρ = 1), the queue grows without bound (with random inter-arrival times), as
described in the text.
*****
Problem No 3:
From Figure 1, consider the bottleneck link along the path from the server to the client as the
first link with rate Rs bits/sec. Suppose we send a pair of packets back to back from the server to
the client, and there is no other traffic on this path. Assume each packet of size L bits, and both
links have the same propagation delay dprop.

Figure 1. Throughput for a file transfer from server to client

a. What is the packet inter-arrival time at the destination? (i.e.) how much time elapses from
when the last bit of the first packet arrives until the last bit of the second packet arrives?
b. Then consider the second link is the bottleneck link (i.e. 𝑅𝑐 < 𝑅𝑠). Is it possible that the
second packet queues at the input queue of the second link? Explain. Now suppose that the
server sends the second packet T seconds after sending the first packet. Explain how large
must T be to ensure no queuing before the second link?

Solution:
The first packet is A and the second packet is B.
a. If the bottleneck link is the first link, then packet B is queued at the first link waiting for the
transmission of packet A. So the packet inter-arrival time at the destination is simply L/Rs.
b. If the second link is the bottleneck link and both packets are sent back to back, it must be true
that the second packet arrives at the input queue of the second link before the second link
finishes the transmission of the first packet.
L/Rs + L/Rs + dprop < L/Rs + dprop + L/Rc
Sending the second packet T seconds later, we will ensure that there is no queuing delay for the second
packet at the second link if we have:
L/Rs + L/Rs + dprop + T >= L/Rs + dprop + L/Rc .
Thus, the minimum value of T is L/Rc − L/Rs

Explanation:

*****
Problem No 4:
Consider a router buffer preceding an outbound link. In this problem, you will use Little’s
formula, a famous formula from queuing theory. Let N denote the average number of packets in
the buffer plus the packet being transmitted. Let ‘a’ denote the rate of packets arriving at the link.
Let ‘d’ denote the average total delay (i.e., the queuing delay plus the transmission delay)
experienced by a packet. Little’s formula is N = a · d. Suppose that on average, the buffer contains
10 packets, and the average packet queuing delay is 10 msec. The link’s transmission rate is 100
packets/sec. Using Little’s formula, what is the average packet arrival rate, assuming there is no
packet loss?
Solution:
The total number of packets in the system includes those in the buffer and the packet that
is being transmitted is N=10+1.
Using Little formula, 𝑁 = 𝑎. 𝑑, where d = (queuing delay + transmission delay).
So, (10+1) = a*(queuing delay + transmission delay).
(i.e.) 11=a*(0.01+1/100) =a*(0.01+0.01).
Thus, a=550 packets/sec.
Explanation:

*****
Problem No 5:
Suppose two hosts, A and B, are separated by 20,000 kilometers and are connected by a direct
link of 𝑅 = 1𝐺𝑏𝑝𝑠 and the propagation speed over the link is 2.5 ∗ 108 𝑚/𝑠𝑒𝑐. (i) Calculate the
bandwidth-delay product R.dprop (ii) Consider sending a file of 800,000 bits from Host A to Host
B. Suppose the file is sent continuously as one big message. What is the maximum number of bits
that will be in the link at any given time? (iii) What is the width (in meters) of a bit in the link?

Solution:
(i) R.dprop = 80,000,000 bits (Where dprop =d/s; d =20,000 kms,s=2.5*108 , R=1 Gbps)
(ii) 800,000 bits, this is because that the maximum number of bits that will be in the link at any
given time = min (bandwidth-delay product, packet size) = 800,000 bits.
(iii) .25 meters

Explanation:
*****
Problem No 6:
Consider sending real-time voice from Host A to Host B over a packet-switched network (VoIP).
Host A converts analog voice to a digital 64 kbps bitstream on the fly. Host A then groups the bits
into 56-byte packets. There is one link between Hosts A and B; its transmission rate is 2 Mbps
and its propagation delay is 10 msec. As soon as Host A gathers a packet, it sends it to Host B. As
soon as Host B receives an entire packet, it converts the packet’s bits to an analog signal. How
much time elapses from the time a bit is created (from the original analog signal at Host A) until
the bit is decoded (as part of the analog signal at Host B)?

Solution:
Consider the first bit in a packet. Before this bit can be transmitted, all of the bits in the
56.8
packet must be generated. This requires 64 ∗ 103 𝑠𝑒𝑐 = 7𝑚𝑠𝑒𝑐
56.8
The time required to transmit the packet, ∗ 106 𝑠𝑒𝑐 = 224𝜇𝑠𝑒𝑐
2

Propagation delay = 10 msec.


The delay until decoding is,7𝑚𝑠𝑒𝑐 + 224𝜇𝑠𝑒𝑐 + 10𝑚𝑠𝑒𝑐 = 17.224𝑚𝑠𝑒𝑐
A similar analysis shows that all bits experience a delay of 17.224 𝑚𝑠𝑒𝑐.

Explanation:

*****
Problem No 7:
Consider distributing a file of F = 15 Gbits to N peers. The server has an upload rate of us = 30
Mbps, and each peer has a download rate of di = 2 Mbps and an upload rate of u. For N = 10, 100
and 1,000 and u = 300 Kbps, 700 Kbps, and 2 Mbps, prepare a chart giving the minimum
distribution time for each of the combinations of N and u for both client-server distribution and
P2Pdistribution.

Solution:
𝑁𝐹 𝐹
i. To find the minimum distribution time for client-server , 𝐷𝑐𝑠 = ma x { 𝑢 , 𝑑 }
𝑠 𝑚𝑖𝑛
𝐹 𝐹
ii. To find the minimum distribution time for P2P, 𝐷𝑃2𝑃 = max{𝑢 , 𝑑 , 𝑁𝐹/(𝑢𝑠 +
𝑠 𝑚𝑖𝑛
∑𝑁
𝑖=1 𝑢𝑖 )}
iii. Where F = 15 Gbits = 15 * 1024 Mbits, us = 30 Mbps, dmin = di = 2 Mbps, 300Kbps = 300/1024
Mbps

Client Server
N
10 100 1000
300 Kbps 7680 51200 512000
u
700 Kbps 7680 51200 512000
2 Mbps 7680 51200 512000
Peer to Peer
N
10 100 1000
300 Kbps 7680 25904 47559
u
700 Kbps 7680 15616 21525
2 Mbps 7680 7680 7680

Explanation:

*****
Problem No 8:
Consider an HTTP client who wants to retrieve a web document at a given URL. The IP address
of the HTTP server is initially unknown. What transport and application-layer protocols besides
HTTP are needed in this scenario?

Solution:
Application layer protocols: DNS and HTTP
Transport layer protocols: UDP for DNS; TCP for HTTP

*****
Problem No 9:
State TRUE or FALSE for the following questions,
a. A user requests a Web page that consists of some text and three images. For this page, the
client will send one request message and receive four response messages.
b. Two distinct Web pages (for example, www.mit.edu/research.html and
www.mit.edu/students.html) can be sent over the same persistent connection
simultaneously.
c. With nonpersistent connections between browser and origin server, a single TCP segment
can carry two distinct HTTP request messages.
d. The Date: header in the HTTP response message indicates when the object in the response
was last modified.
e. HTTP response messages never have an empty message body.

Solution:
a. F
b. T
c. F
d. F
e. F

*****
Problem No 10:
Suppose you can access the caches in the local DNS servers of your department. Can you propose
a way to roughly determine the Web servers (outside your department) that are most popular
among the users in your department? Explain.

Solution:
We can periodically take a snapshot of the DNS caches in the local DNS servers. The Web
server that appears most frequently in the DNS caches is the most popular. This is because if
more users are interested in a Web server, then DNS requests for that server are more frequently
sent by users. Thus, that Web server will appear in the DNS caches more frequently.

*****
Problem No 11:
Prior to persistent connections, one separate TCP connection was used to fetch each URL.
Analyze the advantages of persistent connections over the old HTTP paradigm of one connection
per data transfer
Solution:
 By opening and closing fewer TCP connections, CPU time is saved in routers and hosts
(clients, servers, proxies, gateways, tunnels, or caches), and memory used for TCP
protocol control blocks can be saved in hosts.
 HTTP requests and responses can be pipelined on a connection. Pipelining allows a client
to make multiple requests without waiting for each response, allowing a single TCP
connection to be used much more efficiently, with much lower elapsed time.
 Network congestion is reduced by reducing the number of packets caused by TCP opens,
and by allowing TCP sufficient time to determine the congestion state of the network.
 Latency on subsequent requests is reduced since there is no time spent in TCP's
connection opening handshake.
 HTTP can evolve more gracefully, since errors can be reported without the penalty of
closing the TCP connection. Clients using future versions of HTTP might optimistically try
a new feature, but if communicating with an older server, retry with old semantics after
an error is reported.

*****
Problem No 12:
Suppose you need to send one message to three different users: user1@example.com,
user2@example.com, and user3@example.com. In terms of the SMTP commands, is there
any difference between sending one separate message per user and sending only one message
with multiple (three) recipients? Explain.

Solution:
If a separate message is sent for each of the users, one MAIL, one RCPT (RCPT is a
command used in an electronic mail transaction) and one DATA command will be issued for each
of the messages, resulting in the transmission of three copies of the message data. If only one
message with multiple recipients (three) is sent, one MAIL, multiple RCPT and one DATA
command will be issued, resulting in the transmission of only one copy of the message data.

*****
Problem No 13:
Although TCP is a full-duplex protocol, SMTP uses TCP in a half-duplex fashion. The client
sends a command and then stops and waits for the reply. How can this half-duplex operation
fool the TCP slow-start mechanism when the network is running near capacity?
Solution:
Consider the first four network round trips. Each is a small command (probably a single
segment) that places a little load on the network. If all five make it through to the server without
retransmission, the congestion window could be five segments when the body is sent. If the body
is large, the client could send the first five segments at once, which the network might not be able
to handle.

*****
Problem No 14:
Find the transmission delay if (𝑖 )𝐿 = 1000 𝑏𝑖𝑡𝑠 and 𝑅 = 1 𝑘𝑏𝑝𝑠, (𝑖𝑖 ) 𝐿 = 1 𝐾𝑏, 𝑅 = 1 𝑘𝑏𝑝𝑠

Solution:
𝑳 1000
(i) dtrans = 𝑹 𝒔𝒆𝒄𝒐𝒏𝒅𝒔 = 1000 = 1 sec
𝑳
(ii) dtrans = 𝑹 𝒔𝒆𝒄𝒐𝒏𝒅𝒔 =1.024 sec (Here, L is 1 Kb = 1024, while R is signal, Base 10, so 1000)

*****

Problem No 15:
Find the propagation delay: d=2.1 km , s=3 ∗ 108 ∗ 0.7 m/s

Solution:
𝒎 2.1 ∗ 103
𝒅𝒑𝒓𝒐𝒑 = 𝒔𝒆𝒄𝒐𝒏𝒅𝒔 = 2.1∗108 = 10−5 𝑠𝑒𝑐
𝒔

*****

Problem No 16:
Review the car –caravan analogy from the below Figure 2. Assume a propagation speed of
100 km/hour. Tollbooths are 75 km apart and the tollbooth services a car at a rate of one car
every 12 seconds.

a. Suppose the caravan travels 150km, beginning in front of one tollbooth, passing through a
second tollbooth, and finishing just after a third tollbooth. What is the end-to-end-delay?
b. Repeat (a), now assuming that there are eight cars in the caravan instead of ten.

Figure 2. Caravan Analogy

Solution:

a) There are ten cars. It takes 120 seconds, or 2 minutes, for the first tollbooth to service the 10
cars.Each of these cars has a propagation delay of 45 minutes (travel 75 km) before arriving
at the second tollbooth. Thus, all the cars are lined up before the second tollbooth after 47
minutes. The whole process repeats itself for traveling between the second and third
tollbooths. It also takes 2 minutes for the third tollbooth to service the 10 cars. Thus the total
delay is 96 minutes.

b) Delay between tollbooths is 8*12 seconds plus 45 minutes, i.e., 46 minutes and 36 seconds.
Thetotal delay is twice this amount plus 8*12 seconds, i.e., 94 minutes and 48 seconds.

*****

You might also like