3
Homework 1 Solutions CSEE W4119 - Computer Networks Fall 2010 Vishal Misra 1. Statistical Multiplexing In class, we saw that packet switching can make more efficient use of resources by taking advantage of the fact that only a fraction of potential senders are active at any time. In this problem, you will be asked to demonstrate this fact mathematically. Suppose we have a single link with capacity L bits per second and a population of users that generate data at r bits per second when busy. The probability that a user is busy generating data is p (a) What is the maximum number of users that can be supported using circuit switching? Call this value MC Answer: MC = L R (b) Now suppose we use packet switching to support a population of MP users. Derive a formula (in terms of p,MP,N,L,andr ) for the probability that more than N users are busy? (Hint: Start by deriving a formula for the probability that exactly N users are busy.) Answer: The probability that exactly N users are busy is: MP N p N (1 p) (MP N) Then, the probability that more than N users are busy is: 1 N i=0 MP i p i (1 p) (MP i) or MP i=N+1 MP i p i (1 p) (MP i) (c) Plug in some numbers. Let L =1M bps, r = 64Kbps andp =0.1. Give the value for MC . What is the probability that more than MC users are busy for MP =2 × MC ? What about MP =4 × MC ? [Note: Feel free to use a tool such as Mathematica or Excel, or even write a small program to compute these numerical values.] Answer: MC should be an integer, so we compute it to be MC = 1Mbps 64Kbps = 15 For MP =2 MC = 30,N = MC = 15 and p =0.1: 1 15 i=0 30 i p i (1 p) (30i) =0.0000000037 1

Hw1 10 Solutions

Embed Size (px)

Citation preview

Page 1: Hw1 10 Solutions

Homework 1 Solutions

CSEE W4119 - Computer Networks

Fall 2010 Vishal Misra

1. Statistical Multiplexing

In class, we saw that packet switching can make more efficient use of resources by taking advantage of

the fact that only a fraction of potential senders are active at any time. In this problem, you will be

asked to demonstrate this fact mathematically.

Suppose we have a single link

with capacity L bits per second and a population of users that generate data at r bits per second when

busy. The probability that a user is busy generating data is p

(a) What is the maximum number of users that can be supported using circuit switching? Call this

value MCAnswer:

MC =L

R

(b) Now suppose we use packet switching to support a population of MP users. Derive a formula (in

terms of p,MP,N,L,andr ) for the probability that more than N users are busy? (Hint: Start

by deriving a formula for the probability that exactly N users are busy.)

Answer: The probability that exactly N users are busy is:

�MP

N

�pN (1− p)(MP−N)

Then, the probability that more than N users are busy is:

1−N�

i=0

�MP

i

�pi(1− p)(MP−i)

orMP�

i=N+1

�MP

i

�pi(1− p)(MP−i)

(c) Plug in some numbers. Let L = 1Mbps, r = 64Kbps andp = 0.1 . Give the value for MC.

What is the probability that more than MC users are busy for MP = 2 × MC? What about

MP = 4 × MC? [Note: Feel free to use a tool such as Mathematica or Excel, or even write a

small program to compute these numerical values.]

Answer: MC should be an integer, so we compute it to be

MC = � 1Mbps64Kbps� = 15

For MP = 2 ∗MC = 30, N = MC = 15 and p = 0.1 :

1−�15

i=0

�30i

�pi(1− p)(30−i)

= 0.0000000037

1

Page 2: Hw1 10 Solutions

For MP = 4 ∗MC = 60, N = MC = 15 and p = 0.1 :

1−�15

i=0

�60i

�pi(1− p)(60−i)

= 0.0002013878

2. Delays

This elementary problem begins to explore propagation delay and transmission delay, two central

concepts in data networking. Consider two hosts, Hosts A and B , connected by a single link of rate Rbps. 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. No transmission error is

occurred.

(a) Express the propagation delay, dprop in terms of m and s.Answer: dprop =

ms

(b) Determine the transmission time of the packet, dtrans in terms of L and R .

Answer: dtrans =LR

(c) Ignoring processing and queuing delays, obtain an expression for the end-to-end delay.

Answer: dprop + dtrans =ms +

LR

(d) Suppose Host A begins to transmit the packet at time t = 0 . At time t = dtrans, where is the

last bit of the packet?

Answer: At the time t = dtrans, Host A has just put the last bit on the link

(e) Suppose dprop is less than dtrans . At time t = dtrans, where is the first bit of the packet?

Answer: Since dtrans is greater, the first bit has arrived at Host B before Host A has transmitted the

last bit.

(f) Suppose s = 2.5 × 104, L = 100bits and R = 28Kbps. Find the distance m so that dprop equals

dtrans. From dprop =m

(2.5×108 = dtrans =100

28000 ,m = 2.5× 108 × 100/28000 = 892857.14m

3. HTTP (read the section in the book on http, persistent/non-persistent):

For each of the following http scenarios: calculate the # of round trip times (RTT) required to fetch

and receive an index.html file with 5 embedded jpeg images (J1, ..., J5). Assume all the images and

the index.html file are individually (but not together!) small enough to fit in one packet. Include the

RTT for any TCP connection setup, but don’t worry about the TCP connection closing time.

(a) http 1.0 with no parallel tcp connections

Answer: 12 RTTs 2 RTTs for each image and 2 RTTs to get index.html

(b) http 1.0 using up to 4 parallel tcp connections (your solution should minimize the number of total

RTTs)

Answer: 6 RTTs 2 RTTs to get index.html 1 RTT to get 4 images in parallel and anotehr RTT to

get the 5th image

(c) http 1.1 with persistent connections and no pipelining

Answer: 7 RTTs 2 RTTs to get index.html, 1 RTT for each of the 5 images

2

Page 3: Hw1 10 Solutions

(d) http 1.1 with persistent connections and pipelining

Answer: 3RTTs+ 2RTTs to get index.html, then assuming propogation delay ¿¿ transmission delay,

all images are fetched in another RTT (+ minor transmission delay)

4. The department has a machine that acts as both a webserver (HTTP) and an email (SMTP) server.

The webserver runs on port 80 and the email server runs on port 25. You have a logging mechanism

that tracks the number of bytes sent and received on those two ports. Do you expect to see a difference

in the magnitudes of the sent/received bytes on port 25? How about port 80? State any assumptions

that you make. Repeat the answer (for the same ports) for machines that act as clients for the servers.

Answer: At the server, the incoming port number is going to be 80 (or 25). The outgoing port number

(the external port number) will be the random port number that was assigned at the client side by the

client operating system at the time of connection. Hence the number of bytes sent on the external port 80

(and 25) will be zero, and the situation on the client would be exactly reversed. Note that some students

were confused by what the question meant by “sent on port” and analyzed the situation by looking at the

behavior of web browing and emailing, and I will accept a correct and reasonable analysis of that.

3