Sunteți pe pagina 1din 4

CS 356 Homework #1 Solutions

Problem 1: Consider users who share a communication link with transmission rate R.
Each user is generating data at a rate of D when busy, but is busy only with probability
p. (See the discussion of statistical multiplexing in Section 1.3)

a. What is M, the maximum number of users that can be supported simultaneously


under circuit switching? Please give a formula for M in terms of p, R, D.

In circuit switching, the bandwidth required by a user must be reserved at all


times, whether or not the users transmit data. So the maximum number of users
that can be supported, M = R/D.

b. Now consider packet switching and a user population of N users. Give a formula (in
terms of p, M, N) for the probability that more than M users are sending data
simultaneously. (Hint: Use the binomial distribution).

For each user, the probability that a user is transmitting data is p. The
probability that a user does not transmitting data is 1-p. Probability that exactly
M users out of N are sending data is:
N
CM ( p ) (1- p)
M N-M

Probability that 0-M users are transmitting data is:

∑ i= 0-M Ci (p ) (1- p)
N i N-i

This is also known as binomial distribution.

The probability that more than M users are simultaneously transmitting data is

1 - ∑ i= 0-M Ci (p ) (1- p)
N
i
N-i

c. Suppose R = 1.6 Mbps, D = 100 kbps, p = 0.1, and N = 50. Calculate the numerical
value of the probability in part (b). (You might need to write a small
program to do this.)

Plugging in the values: M = R/D =1.6 Mbps / 100 kbps = 16. 384 ≈ 16
With M = 16, N = 50, p = 0.1, the probability that 16 users are transmitting data
simultaneously out of 50 users is 3.8028 × 10 -06 ≈ 0

Problem 2: Suppose two hosts, A and B, are separated by 16,000 kilometers and are
connected by a direct link with transmission rate R = 1.6 Mbps. Suppose the propagation
speed over the link is 2.5 · 108 meters/sec.

a. Calculate the bandwidth-delay product R · dprop.


The Bandwidth is 1.6 Mbps. The propagation delay here would be the
distance/speed = 16000 km / 2.5 ×108 = .064 seconds.

So the delay bandwidth product is: 1.6 Mbps × .064 = 102,400 bits.
b. Consider sending a file of 400,000 bits from Host A to Host B. Suppose the file is
sent continuously as one large message. What is the maximum number of bits that
will be in the link at any given time?

At any given time, the number of bits that are in the link is equal to the delay
bandwidth product. So the answer is 102,400 bits.

c. Provide an interpretation of the bandwidth-delay product

The delay bandwidth product is the capacity of the link. It represents the
maximum number of bits that are in the link at any given time.

d. What is the width (in meters) of a bit in the link? Is it longer than a football field?

The width of each bit in the link is distance/ ( delay bandwidth product) = 16,000
kms / 102,400 = .15625 km = 156.25 m. So a bit is longer than a football field.

e. Derive a general expression for the width of a bit in terms of the propagation speed s,
the transmission rate R, and the length of the link m.

The width of a bit is m / ( R * m / s) = s / R

Problem 3: In modern packet-switched networks, the source host segments long,


application-layer messages (for example, an image or a music file) into smaller packets
and sends the packets into the network. The receiver then reassembles the packets back
into the original message. We refer to this process as message segmentation.
Segmenting a message into packets has the advantage of pipelining, namely: as soon as a
packet is completely received by a node, the node can process and transmit the packet to
the next node without waiting for the rest of the message. This observation is to be
illustrated by the following analysis.

Consider sending a message of 8 · 106 bits from Host A to Host B. There are four links
(and three switches) between A and B. Each link has a transmission rate of R = 1.6
Mbps. Disregard queuing, propagation, and processing delays.

a. Consider sending the message from Host A to Host B without message


segmentation. How long does it take to move the message from Host A to the first
switch? Keeping in mind that each switch uses store-and-forward packet switching, what
is the total time to move the message from Host A to Host B?

Time for the message to move from host A to switch 1 is equal to the size of the
message divided by the bandwidth of the link. So time for the message to travel
from host A to switch 1 is 8·106 / 1.6 Mbps = 5 seconds

Total time for the message to go from host A to host B is four times the time it
takes to traverse single link. So Total time = 4 × 5 = 20 seconds.

b. Now suppose the message is segmented into 5,000 packets, with each packet being
1,600 bits long. How long does it take to move the first packet from Host A to the
first switch? When the first packet is being sent from the first switch to the second
switch, the second packet is being sent from Host A to the first switch. At what time
will the second packet be fully received at the first switch?

Time for the first packet to travel from A to switch 1 is equal to the size of the
packet divided by the link bandwidth. So first packet’s travel time: 1600/1.6
Mbps = 0.001 seconds = 1ms.

The second packet would also take one millisecond to get to the switch 1. So the
absolute time since beginning when the second packet would be fully received =
2 * 1 = 2 ms.

c. How long does it take to move the entire message from Host A to Host B when
message segmentation is used? Compare this result with your answer in part (a) and
comment. (10 points)

A segment takes 1ms to traverse a link, and there are 4 links that need to be
traversed from host A to host B. So the first segment arrives at B after a 4ms
delay. Later on, 1 segment arrives after every 1ms at B. So the final segment
arrives at B at 4 + 4999 × 1 = 5003 ms = 5.003 seconds.

Compared to the 20 seconds that it took the message when it was not segmented,
the segmentation reduces delay.

d. Discuss the drawbacks of message segmentation.

1. Segmentation complicated the logic at the receiving end. The segments need to
be ordered at the destination.

2. Message segmentation results in many smaller packets. Since the header


size is usually the same for all packets regardless of their size, with message
segmentation, the total amount of header bytes is more. So the total overhead for
sending the same message is more with segmentation.

Problem 4: In Problem 3, we did not consider the additional header overhead associated
with each packet. We will take such overhead into account in the following analysis.
Consider sending a large file of F bits from Host A to Host B. There are four links (and
three switches) between A and B. Host A segments the file into segments of S bits each
and adds 40 bits of header to each segment, forming packets of L = 40 + S bits. Each
link has a transmission rate of R bps. Disregard propagation, queuing, and processing
delays.

a. Find the value of S that minimizes the total delay of moving the file from Host A to
Host B, where the total delay is defined as from when the first bit of the first packet
leaves Host A until the last bit of the last packet arrives at Host B.

The total number of segments for the file F = F/S segments. The time taken to
transmit a single segment on a link with transmission rate R is L/R = (40 + S)/R.
There are 4 links and F/S segments that need to be sent. The first segment arrives at
the destination after a delay of 4 · (40+S)/R. After that, a segment arrives after every
(40+S)/R time. So the total delay is

D = 4 · (40 + S)/R + (F/S - 1) · (40 + S) /R

Rearranging,

D = ((40 + S) /R) · ( F/S + 3))


= (1/R) · ( 40 · F/S + F + 120 + 3S) = f(S)

Since S has to be minimized, taking differentiation of D with respect to S:


f’(S) = (1/R) · ( 3 – 40F/S2 )

Setting f’(S) = 0, and solving for S,

S = √ ( 40 · F /3)

b. Suppose F = 8 · 106 bits and R = 1.6 · 106 bps, calculate the numerical value of the
optimal S obtained in part (a).

Plugging in the value of F = 8· 106 , S = √ ( 40 · 8 · 106 / 3 ) = 10,327.95 ≈ 10,328 bits


S-ar putea să vă placă și