Homework Assignment #1 Solutions EE122: Introduction to Communication Networks (Fall 2008) Department of Electrical Engineering and Computer Sciences College of Engineering University of California, Berkeley 1. Kurose & Ross P7 [12 points] a) [4 points] 10 users (1Mbps / 100Kpbs) b) [1 point] p=0.1 (10% = 10/100) c) [5 points] If exactly n users are sending, it means the rest of 40‐n users are not sending and there are multiple combinations of the users that transmit out of those 40. 40 The required probability is: P[sending=n] = ∙ pn ∙ (1‐p)40‐n d) [2 points] P[sending ≥ 11] = P[sending=11] + P[sending=12] + … +P[sending=40]. To make the sum shorter, P[sending ≥ 11] = 1 – (P[sending=10] + …+P[sending=0]). Using the formula from point (b) we get P[sending ≥ 11] ≈0.15% P12 [7 points] The delay for the first packet is 0, for the second packet L/R, for the third 2∙L/R and so on. The average delay is: AvgDel = ∑ · P20 [13 points] a) [4 points] The link propagation delay is dprop=40ms, and thus the bandwidth‐ delay=4∙107bits=40Mbits. b) [4 points] Since the file is smaller than the bandwidth‐delay product, the entire file will be “in the link” at a given time, and thus, the answer is 400,000 bits. c) [5 points] The bit “width” is given by the signal propagation speed divided by the bit generation speed, resulting in a width of (2.5∙108m/s)/(109bits/s) = 0.25m P24 [15 points] a) [2 points] From the source to the first switch, the packet takes 5 seconds (size/bandwidth). From the source to the destination, the packet takes 15s (there are three hops). b) [2 points] For the first packet from source to the switch it takes 1ms. The second packet will be fully received at the first switch after 2ms. c) [6 points] Sending the entire file would take 5000∙1ms + 2ms=5.002s (to send all segments to the first hop it takes 5000ms and the last segment has to cross two more links after reaching the first switch). Sending the packet this way is much faster than sending the entire file at once, because all the links are active at the same time for most of the transmission, compared to the first case when links were used sequentially (this is why it is approximately 1/3 of that time). d) [5 points] First, segments may arrive out of order and need to be tracked at the destination. Second, in packet switched networks there is an associated overhead for each segment (header/trailer) such that the overall data sent over the network is significantly larger than the file (due to the header/trailer overhead). 2. Ping & Traceroute [15 points] a) [6 points] RTT/light time Chart 1 ‐ ratio RTT/light vs distance 8 7 6 5 4 3 2 1 0 0 2000 4000 6000 8000 10000 12000 14000 Distance (km) b) [3 points] The RTT is larger than the time it takes light to travel because routers take time to process packets, because network links are physically longer than the shortest geographical distances and because the signal travels with speeds smaller than the speed of light in vacuum. c) [6 points] Chart2 ‐ hops vs distance 24 22 20 18 16 14 12 10 0 2000 4000 6000 8000 10000 12000 14000 16000 3. a) b) c) 4. a) b) c) d) One can observe that typically, the number of hops tends to increase with the geographical distance. One reason for this is that it is expensive to create very long links. Another reason is that the network links usually connects large cities, and, the longer the distance the greater probability of encountering large cities and of combining multiple smaller link segments (this is of course if not going over an ocean as you can observe for Tokyo). Moon Colonization [12 points] [3 points] RTT ≈ 2.56s, Bw X Delay ≈ 128Mbits [5 points] The bandwidth x delay product represents the maximum number of bits that can be “on the link” at a given time, i.e. that were transmitted at one end and not yet received at the other end. [4 points] Minumum delay is given by the RTT and the transmission time, since there is a request from the earth being transmitted and a response needs to be received. Thus Minimum delay = RTT + transmission time = 2.56s + 25MB/100Mbit = 2.56s + 2s ≈ 4.56s File Transfer [20 points] [4 points] Transfer Time, Tt = M/B + D + A/B + D=(M+A)/B + 2D [5 points] In the case of consecutive uncorrupted transmission and acknowledgement. The probability that the file transmission is not corrupted = (1‐Pc)M The probability that the file and the associated acknowledgement are not corrupted = (1‐Pc)M+A, thus, the probability of having at least of them corrupted = 1‐(1‐Pc)M+A. Thus, the Expected Transmission Time is: E[Tt]= Tt/(1‐Pc)M+A , since this is a geometric distribution. If the formula for the expectation is not known, it can be derived as follows: =Tt ∙ (1‐Pc)M+A + 2 ∙ Tt (1‐(1‐Pc) M+A) (1‐Pc) M+A + 3 ∙ Tt (1‐(1‐Pc) M+A)2 (1‐Pc) M+A +… E[Tt] = ∑ namely, the sum of all possible times with their associated probability of occurrence (successful transmission in round 1, in round 2, etc). Thus, E[Tt] = Tt (1‐Pc)M+A ∙ ∑ 1 1 , where the latter sum is equal to M+A 2 1/((1‐Pc) ) . If not known, it can be computed by splitting it into an infinite set of geometric 1 1 ·∑ . series of the form: ∑ 1 1 [5 points] When there are no losses, the transmission time for K segments is: Tt(K) = M/B + K (D + A/B + D) When there are losses, the expected transmission time for K segments is: E[Tt](K) = K ∙ (M/(K∙B) +D+A/B+D)/(1‐Pc)M/K+A , think of it as the same as having K smaller files. [6 points] When there are losses: E[Tt](K=1) = 1.021/0.3675 ≈ 2.778s; E[Tt](K=2) = 1.042/0.6059 ≈ 1.719s When there are no losses, sending the entire file in a single chunk is obviously faster (1.021s for K=1 and 1.042s for K=2) as one does not have to wait for multiple acknowledgements. However, we can observe that when there are losses, it is faster to send the file if it is split in two parts rather than sending it all at once, even if we have to wait for multiple acknowledgements. The reason is that there is a higher probability for the entire file to be corrupted than it is for each of the individual segments (and this probability increases exponentially with the segment size) and the penalty associated with a corrupted transmission is to retransmit the data, which takes a long time in the case of the entire file. [There is a tradeoff between the number of segments that have to be acknowledged (time that increases with the number of segments) and the number of times each segment is expected be retransmitted (which decreases with the segment size).] e) [extra 5 points] To compute the value of K that achieves the minimum delay, we need to compute the derivative with respect to K of the expected transmission time from point (c) and compute the value of K for this expression to be zero. To check that this value is a minimum (and not a maximum) you can compute the second degree derivative and show it is positive (or show that the first degree one is increasing) or fill in numbers for the numerical case, although we will not penalize you for skipping this step. After computing the derivative and simplifying the exponential terms, we obtain a second degree equation in K of the form: 2 leading to ln 2 · · 1 · 1 0 , When using the numerical values from point (d), this equation has a root at ~7.4. Note that it’s easy to approximate the formula for Kmin when using the values from point (d) to be ~ such that you don’t have to compute the complicated formula. When using K=7, the expected transmission is approximately ~1.32s and it can be checked numerically that this value is smaller than when using K=8. This means that the shortest time to transmit a file in this context is to split it in 7 parts. 5. Moving Data Around [6 points] Sending a truck with the hard drives costs less 2000$ and should take less than 5 days. On the other hand, transferring the data with a 4Mbps connection (using full speed which is practically impossible) takes ~39 months (note that we have 50 Terabytes not bits) and at a price of 80$/month (combined sender and receiver) it results in over 3000$. Thus, for both time and price sending the physical truck would be preferable. However, given that the results may vary depending on your assumptions (particularly regarding price), we will accept any results that are correctly computed given your stated assumptions (and given that your assumptions are not completely wrong).