Vous êtes sur la page 1sur 7

Homework 1

Due date: 7th Nov., 2018


Total points: 100

1. Suppose users share a 2 Mbps link. Also suppose each user transmits continuously at 1 Mbps
when transmitting, but each user transmits only 20 percent of the time.
(a) When circuit switching is used, how many users can be supported?
(b) For the reminder of this problem, suppose packet switching is used. Why will there be
essentially no queueing delay before the link if two or fewer users transmit at the same
time? Why will there be a queueing delay if three users transmit at the same time?
(c) Find the probability that a given user is transmitting.
(d) Suppose now there are three users. Find the probability that at any given time, all three
users are transmitting simultaneously. Find the fraction of time during which the queue
grows.

a. 2 users can be supported because each user requires half of the link bandwidth.
b. Since each user requires 1Mbps when transmitting, if two or fewer users transmit
simultaneously, a maximum of 2Mbps will be required. Since the available bandwidth of
the shared link is 2Mbps, there will be no queuing delay before the link. Whereas, if three
users transmit simultaneously, the bandwidth required will be 3Mbps which is more than the
available bandwidth of the shared link. In this case, there will be queuing delay before the link.
c. Probability that a given user is transmitting = 0.2.
⎛ 3⎞
d. Probability that all three users are transmitting simultaneously = ⎜⎜ ⎟⎟ p 3 (1 − p )3−3 = (0.2)3 =
⎝ 3⎠
0.008. Since the queue grows when all the users are transmitting, the fraction of time during
which the queue grows (which is equal to the probability that all three users are transmitting
simultaneously) is 0.008.

2. We consider sending real-time voice from Host A to Host B over a packet-switching network.
Host A to Host B. Host A converts analog voice to a digital 128 kbps bit stream on the fly. Host
A then groups the bits into 64-byte packets. There is one link between Host A and B; its
transmission rate is 4 Mbps and its propagation delay 8ms. 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.
(a) How much time elapses from the time a bit is created (at Host A) until the bit is decoded
(at Host B)?
(b) What about the second bit?

1
(c) What about the other bits?

a. Consider the first bit in a packet. Before this bit can be transmitted, all of the bits in the packet
must be generated. This requires
64 × 8
sec = 4 msec.
128 × 10 3
The time required to transmit the packet is
64 × 8
sec = 128µ sec.
4 × 10 6
Propagation delay = 8 msec. The delay until decoding is
4 msec + 128µ sec + 8 msec = 12.128 msec
b. A similar analysis shows that all bits experience the same delay of 12.128 msec.
c. A similar analysis shows that all bits experience the same delay of 12.128 msec.

3. A 2 Gbps link supports a maximum of 5,000 users under circuit switching.


(a) At what rate are the users generating data?
(b) Now consider packet switching and a user population of N users. If the probability that a
specific user is active is p, what is the probability that exactly half of the users are sending
data?

a. (2 x 106 kbps) / (5 x 103) = 400 kbps

⎛ N ⎞ N2 N
b. ⎜⎜ N ⎟⎟ p (1 − p ) 2
⎝2⎠

4. (a) Suppose N packets arrive simultaneously to a link at which no packets are currently being
transmitted or queued. Each packet is of length L and the link has transmission rate R. What is
the average queueing delay for N packets?
(b) Now suppose that N such packets arrive to the link every LN/R seconds. What is the average
queueing delay of the packet?

a. The queuing delay is 0 for the first transmitted packet, L/R for the second transmitted packet,
and generally, (n-1)L/R for the nth transmitted packet. Thus, the average delay for the N packets
is:
(L/R + 2L/R + ....... + (N-1)L/R)/N
= L/(RN) * (1 + 2 + ..... + (N-1))
= L/(RN) * N(N-1)/2
= LN(N-1)/(2RN)

2
= (N-1)L/(2R)
Note that here we used the well-known fact:
1 + 2 + ....... + N = N(N+1)/2
b. It takes LN / R seconds to transmit the N packets. Thus, the buffer is empty when a each
batch of N packets arrive. Thus, the average delay of a packet across all batches is the average
delay within one batch, i.e., (N-1)L/2R.

5. Consider the queueing delay in a router buffer. Let I=La/R denote traffic density. Suppose that
the queueing delay takes the form IL/R (1-I) for I<1.
(a) Provide the formula for the total delay, that is, the queueing delay plus the transmission
delay.
(b) Plot the total delay as a function of L/R.

a. The transmission delay is L / R . The total delay is


IL L L/ R
+ =
R(1 − I ) R 1 − I
x
b. Let x = L / R . Total delay = .
1 − ax
For x=0, the total delay =0; as we increase x, total delay increases, approaching infinity as x
approaches 1/a.

6. Consider a short, 15-meter link, over which a sender can transmit at a rate of 160 bps in both
directions. Suppose that packets containing data are 200,000 bits long, and packets containing
control (e.g., ACK or handshaking) are 100 bits long. Assume that N parallel connections each
gets 1/N of the link bandwidth. Now consider the HTTP protocol, and suppose that each
downloaded object is 200 kbits long, and that the initial downloaded object contains 10
referenced objects from the same sender.
(a) Would parallel downloads via parallel instances of non-persistent HTTP make sense in this
case? Justify and explain your answer.
(b) Now consider persistent HTTP. Do you expect significant gains over the non-persistent
case? Justify and explain your answer.

a. Note that each downloaded object can be completely put into one data packet. Let Tp denote
the one-way propagation delay between the client and the server. First consider parallel
downloads via non-persistent connections. Parallel download would allow 10 connections
share the 160 bits/sec bandwidth, thus each gets just 16 bits/sec. Thus, the total time needed to
receive all objects is given by:
(100/160+Tp + 100/160 +Tp + 100/160+Tp + 200,000/160+ Tp )

3
+ (100/(160/10)+Tp + 100/(160/10) +Tp + 100/(160/10)+Tp + 200,000/(160/10)+ Tp )
= 13771 + 8*Tp (seconds)
Then consider persistent HTTP connection. The total time needed is give by:
(100/60+Tp + 100/160 +Tp + 100/160+Tp + 200,000/160+ Tp )
+ 10*(100/160+Tp + 200,000/160+ Tp )
=13758 + 24*Tp (seconds)
b. Assume the speed of light is 300*106 m/sec, then Tp=15/(300*106)=0.05 microsec. Tp is
negligible compared with transmission delay. Thus, we see that the persistent HTTP does not
have significant gain over the non-persistent case with parallel download.

7. Consider accessing your e-mail POP3.
(a) Suppose you have configured your POP mail client to operate in the download-and-delete
mode. Complete the following transaction.
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: blah blah …
S: .
?
?
(b) Suppose you have configured your POP mail client to operate in the download-and-keep
mode. Complete the following transaction.
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: blah blah …
S: .
?
?

a. C: dele 1
C: retr 2
S: (blah blah …
S: ………..blah)

4
S: .
C: dele 2
C: quit
S: +OK POP3 server signing off

b. C: retr 2
S: blah blah …
S: ………..blah
S: .
C: quit
S: +OK POP3 server signing off

8. Consider what happens when a browser (an HTTP client), running on some user’s host,
requests the URL www.somesite.com/index.html. In order for the user’s host to be able to send
an HTTP request message to the Web server www.somesite.com, the user’s host must first
obtain the IP address of www.somesite.com. Explain the steps through which the IP address
for such a hostname is obtained by the client.

1) The user machine runs the client side of the DNS application.
2) The browser extracts the hostname, www.someschool.edu, from the URL and passes the
hostname to the client side of the DNS application.
3) The DNS client sends a query containing the hostname to a DNS server.
4) The DNS client eventually receives a reply, which includes the IP address for the hostname.
5) Once the browser receives the IP address from DNS, it can initiate a TCP connection to the
HTTP server process located at port 80 at that IP address.

9. Consider distributing a file of F bits to N peers using a client-server architecture. Assume a


fluid model where the server can simultaneously transmit to multiple peers, transmitting to
each peer at different rates, as long as the combined rate does not exceed us.
(a) Suppose that us/N≤dmin. Specify a distribution scheme that has a distribution time of NF/us.
(b) Suppose that us/N≥dmin. Specify a distribution scheme that has a distribution time of F/dmin.
(c) Conclude that the minimum distribution time is in general given by max{NF/us, F/dmin}.

a) Consider a distribution scheme in which the server sends the file to each client, in parallel, at a
rate of a rate of us/N. Note that this rate is less than each of the client’s download rate, since by
assumption us/N ≤ dmin. Thus each client can also receive at rate us/N. Since each client receives
at rate us/N, the time for each client to receive the entire file is F/( us/N) = NF/ us. Since all the
clients receive the file in NF/ us, the overall distribution time is also NF/ us.

5
b) Consider a distribution scheme in which the server sends the file to each client, in parallel, at a
rate of dmin. Note that the aggregate rate, N dmin, is less than the server’s link rate us, since by
assumption us/N ≥ dmin. Since each client receives at rate dmin, the time for each client to receive
the entire file is F/ dmin. Since all the clients receive the file in this time, the overall distribution
time is also F/ dmin.

c) From Section 2.6 we know that


DCS ≥ max {NF/us, F/dmin} (Equation 1)
Suppose that us/N ≤ dmin. Then from Equation 1 we have DCS ≥ NF/us . But from (a) we have
DCS ≤ NF/us . Combining these two gives:
DCS = NF/us when us/N ≤ dmin. (Equation 2)
We can similarly show that:
DCS =F/dmin when us/N ≥ dmin (Equation 3).
Combining Equation 2 and Equation 3 gives the desired result.

10. Consider distributing a file of F bits to N peers using a P2P architecture. Assume a fluid model.
For simplicity assume that dmin is very large, so that peer download bandwidth is never a
bottleneck.
(a) Suppose that us≤(us+u1+…+uN)/N. Speficy a distribution scheme that has a distribution
time of F/us.
(b) Suppose that us≥(us+u1+…+uN)/N. Speficy a distribution scheme that has a distribution
time of NF/(us+u1+…+uN).
(c) Conclude that the minimum distribution time is in general given by max{F/us,
NF/(us+u1+…+uN)}.

a) Define u = u1 +u2+… + uN. By assumption


us ≤ (us + u)/N Equation 1
Divide the file into N parts, with the i part having size (ui/u)F. The server transmits the ith part
th

to peer i at rate ri = (ui/u)us. 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 = (N-1)(usui)/u≤ui,

where the last inequality follows from Equation 1. Thus the aggregate forwarding rate of peer i
is less than its link rate ui.

6
In this distribution scheme, peer i receives bits at an aggregate rate of

ri + ∑ r j = us
j <> i

Thus each peer receives the file in F/us.

b) Again define u = u1 + u2 + …+ uN. By assumption


us ≥ (us + u)/N Equation 2

Let ri = ui/(N-1) and rN+1 = (us – u/(N-1))/N.

In this distribution scheme, the file is broken into N+1 parts. The server sends bits from the ith
part to the ith peer (i = 1, …., N) at rate ri. Each peer i forwards the bits arriving at rate ri to each
of the other N-1 peers. Additionally, the server sends bits from the (N+1) st part at rate rN+1 to
each of the N peers. The peers do not forward the bits from the (N+1)st part.

The aggregate send rate of the server is


r1+ … + rN + N rN+1 = u/(N-1) + us – u/(N-1) = us
Thus, the server’s send rate does not exceed its link rate. The aggregate send rate of peer i is
(N-1)ri = ui
Thus, each peer’s send rate does not exceed its link rate. In this distribution scheme, peer i
receives bits at an aggregate rate of

ri + rN + 1 + ∑ r j = u /( N − 1) + (us − u /( N − 1)) / N = (us + u ) / N


j <> i

Thus each peer receives the file in NF/(us+u).


(For simplicity, we neglected to specify the size of the file part for i = 1,…, N+1. We now
provide that here. Let Δ = (us+u)/N be the distribution time. For i = 1, …, N, the ith file part is Fi
= ri Δ bits. The (N+1)st file part is FN+1 = rN+1 Δ bits. It is straightforward to show that F1+ …
+ FN+1 = F.)

c) The solution to this part is similar to that of 17 (c). We know from section 2.6 that

DP2 P >= max{F/us, NF/(us + u)}

Combining this with a) and b) gives the desired result.

Vous aimerez peut-être aussi