Вы находитесь на странице: 1из 3

Homework 1 Solutions

CSEE W4119 - Computer Networks Fall 2010 1. Statistical Multiplexing In class, we saw that packet switching can make more ecient 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 M C Answer: L MC = R Vishal Misra

(b) Now suppose we use packet switching to support a population of M P users. Derive a formula (in terms of p, M P, 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 (1 p)(M P N ) N

Then, the probability that more than N users are busy is: 1 or
N M P i=0

pi (1 p)(M P i)

i=N +1


MP i p (1 p)(M P i) i

(c) Plug in some numbers. Let L = 1M bps, r = 64Kbps andp = 0.1 . Give the value for M C. What is the probability that more than M C users are busy for M P = 2 M C? What about M P = 4 M C? [Note: Feel free to use a tool such as Mathematica or Excel, or even write a small program to compute these numerical values.] Answer: M C should be an integer, so we compute it to be
1M bps M C = 64Kbps = 15

For M P = 2 M C = 30, N = M C = 15 and p = 0.1 : 1 15 30

i=0 i

pi (1 p)(30i) = 0.0000000037 1

For M P = 4 M C = 60, N = M C = 15 and p = 0.1 : 1 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 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. No transmission error is occurred. (a) Express the propagation delay, dprop in terms of m and s. Answer: dprop = m s (b) Determine the transmission time of the packet, dtrans in terms of L and R . L Answer: dtrans = R (c) Ignoring processing and queuing delays, obtain an expression for the end-to-end delay. L Answer: dprop + dtrans = m + R s (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 rst bit of the packet? Answer: Since dtrans is greater, the rst 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 m 100 dtrans . From dprop = (2.5108 = dtrans = 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 le with 5 embedded jpeg images (J1, ..., J5). Assume all the images and the index.html le are individually (but not together!) small enough to t in one packet. Include the RTT for any TCP connection setup, but dont 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 15 60
i=0 i

pi (1 p)(60i) = 0.0002013878

(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 dierence 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.