CS168 Fall 2014 Homework 1 Assigned: Wednesday, 10 September 2014 Due: Monday, 22 September 2014 Name: SID: Discussion Section (Day/Time): Instructions - Submit this homework using Pandagrader/GradeScope(https://www.gradescope.com/ courses/214). - To submit, print out this document, write your answers on it, then scan it and upload to Pandagrader. Scanning services are available from the Berkeley Library System (http://www.lib.berkeley.edu/using-the-libraries/print-scan). Be sure to double-check your submission to ensure that Pandagrader has scanned in your solution correctly. You may want to consider using a pdf markup program to insert your answers into this document in the provided spaces, especially in Problem 5 if your plot is computer-generated. - Use your @berkeley.edu email address to sign in to Pandagrader. If you don’t have a Pandagrader account, click ”Login” and then ”Forgot Password” on the Pandagrader website and follow the instructions. If you have any problems with the submission process, it is your responsibility to come to office hours prior to the homework’s due date. - If you need more space for work, or you write code to calculate a result, attach these materials at the end of the homework when you submit. - If you have questions, ask on Piazza (strongly preferred) or email Akshay (akshay [dot] narayan [at] berkeley). - Some potentially useful information: 1 Byte = 8 bits, 1 Mbps = 106 bits , 1 Gbps = 109 bits , 1 ms = 10−3 sec. sec sec CS168 Homework 1 - Page 2 of 9 Wednesday, 10 September 2014 1. (20 points) Miscellaneous Short Questions (a) (4 points) Consider a single link with bandwidth B and propagation delay (i.e., latency) L. It takes 1ms for an entire 500 byte packet to arrive at other end of the link (that is, it takes 1ms from the time the first bit starts being transmitted until the last bit arrives at the other end of the link). It takes 2ms for an entire 1500 byte packet to arrive at the other end of the link. (i) What is the bandwidth B of the link? (in Mbps) (ii) What is the propagation delay L of the link? (in ms) B = 8 Mbps, L = 0.5 ms 8 ∗ 500 bits L s+ = 0.001 s B bits s 8 ∗ 1500 bits L s+ = 0.002 s B bits s Solve 2 equations in 2 variables. (b) (4 points) Which of the following reflects the Internet’s ‘best effort’ design philosophy? (Select all that apply.) Packets can be dropped Switches have finite buffer capacity Reuse of existing telephone lines Organizing functionality in layers The term ‘best effort’ refers to the fact that the Internet provides no reliability guarantees, so packets cna be dropped. Packets can be dropped because switches have finite buffer capacity. However, no switch can have infinite buffer capacity, so we also accepted answers that did not mark this option. CS168 Homework 1 - Page 3 of 9 Wednesday, 10 September 2014 (c) (4 points) Which of the following design choices helped the Internet to scale? (Select all that apply.) Reuse of existing telephone lines Setting a minimum threshold of acceptable end-to-end packet delay Settling on IP as the common protocol for interconnection Statistical multiplexing at the granularity of individual packets There was no minimum threshold set (even today), and telephone lines helped deployability (we also accepted answers that did not mark this since it can be argued that deployability and scalability are separate ideas). IP as the common protocol allowed for a decentralized Internet, which helped scaling, and had statistical multiplexing been implemented at a higher granularity, switches would have had to maintain state, hurting scalability. (d) (4 points) Reverse engineering links characteristics: Consider a link with bandwidth B and latency (i.e. one way propagation delay) L, with hosts 1 and 2 attached to opposite ends of the link. Starting at time t=0, Host 1 sends two data packets (back-to-back) to Host 2, which ACKs them immediately (requiring no processing time). The ACKs arrive at times T1 and T2. The data packets are of size P and the ACKs are of size A. (You may assume A < P ). Solve for the link bandwidth B in terms of the arrival times T1 and T2, and the packet sizes P and A. The expression for B should not contain L on the right-handside. P B= T2 − T1 Since all else is identical for the two packets sent, the only difference is the transmission time of the second packet immediately after packet 1 was sent. So, a packet of size P had a transmission time of T2 − T1 , and we can calculate the bandwidth B. CS168 Homework 1 - Page 4 of 9 Wednesday, 10 September 2014 (e) (2 points) Suppose you would like to urgently deliver 300 TB of data from Boston to Los Angeles. You have available a 1 Gbps dedicated link for data transfer. Which of the following approaches would you prefer to transmit the data? A. The 1 Gbps link B. FedEx overnight delivery on a hard drive 8 ∗ 300 × 1012 bits ≈ 667 hrs 1 × 109 bits s Overnight delivery will take at most 24 hours since it’s “overnight”. (f) (2 points) Indicate which of the following are true: Packet switching is more efficient than circuit switching because it uses statistical multiplexing at a finer granularity The Internet uses layering to achieve high performance The Internet’s use of layering encourages innovation in link technologies Transmission time dominates propagation time when transferring a 1GB file over a 1Gbps satellite link that has a propagation delay of 10seconds Packet switching can allow two separate flows to use the same link as if they had it to themselves through packet-level statistical multiplexing, while circuit switching requires ‘reservations’ of entire paths. Layering is an abstraction, and allows for extensibility and innovation in individual layers (including the link layer), not performance. 8×1 GB = 8 s. So transmission delay does not dominate propagation delay in this 8 Gb s case. CS168 Homework 1 - Page 5 of 9 Wednesday, 10 September 2014 2. (12 points) Bottleneck Links Consider Figure 1 below. Assume that we know the bottleneck link along the path from A to B is the first link with RS bits/sec. Suppose we send a pair of packets back to back from A to B, and there is no other traffic on this path. Assume each packet of size L bits, and both links have the same propagation delay dprop . Figure 1: Throughput for a file transfer from server to client (a) (4 points) Consider Figure 1(a). What is the packet inter-arrival time at the destination? That is, how much time elapses from when the last bit of the first packet arrives until the last bit of the second packet arrives? L RS RS is the bottleneck link, so the transmission time on that link will determine the inter-arrival time. CS168 Homework 1 - Page 6 of 9 Wednesday, 10 September 2014 (b) (2 points) Again consider Figure 1(a). Now assume that the second link is the bottleneck link (i.e., RC < RS ). Is it possible that the second packet queues at the input queue of the second link? Explain. Yes. (c) (2 points) Once more consider Figure 1(a). Now, suppose that A sends the second packet T seconds after sending the first packet. How large must T be to ensure no queuing before the second link? Explain. If you assumed that Rc was the bottleneck: RLC − RLS Look at the timing diagram above for the explanation. If you assumed that Rs was the bottleneck: 0. If you did not state your assumption, we defaulted to assuming Rc was the bottleneck. (d) (4 points) Consider Figure 1(b). Suppose that there are M paths between A and B. No two paths share any link. Path k (k = 1, . . . , M ) consists of N links with k . transmission rates R1k , R2k , . . . , RN (i) If A can only use one path to send data to B, what is the maximum throughput that it can achieve? maxM (min(Rnk )). Throughput is limited by the ‘thinnest’ link, and we want to use the path with the biggest limiting link. (ii) If A can use all M paths to send data, what is the maximum throughput that it achieve? Pcan M k min(R n ). Instead of maxing over the paths as in (i), we sum. k=1 CS168 Homework 1 - Page 7 of 9 Wednesday, 10 September 2014 3. (10 points) Circuit Switching Consider the circuit-switched network in Figure 2. (a) (3 points) What is the maximum number of simultaneous connections that can be in progress at any one time in this network? Explain. 16. One for each link. (b) (3 points) Suppose that all connections are between switches A and C. What is the maximum number of simultaneous connections that can be in progress? Explain. 8. 4 through B, 4 though D. (c) (4 points) Suppose we want to make four connections between switches A and C, and another four connections between switches B and D. Can we simultaneously route all eight connections through the network? Explain. Yes. A → C has 2 through B, 2 through D. Same pattern for B → D. Figure 2: A circuit-switched network consisting of four switches and 16 links. CS168 Homework 1 - Page 8 of 9 Wednesday, 10 September 2014 4. (10 points) Link Properties Suppose two hosts, A and B, are separated by 20,000 kilometers and are connected by a direct link of R = 2 Mbps. Suppose the propagation speed over the link is 2.5 × 108 meters/sec. (a) (2 points) Calculate the bandwidth-delay product, R · dprop . 2 × 106 bits 20000 × 103 m × s 2.5 × 108 ms = 1.6 × 105 bits (b) (2 points) Consider sending a file of 800,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? min(BDP, 800000) = BDP. 1.6 × 105 bits. (c) (3 points) Visualize the link as a pipe filled with a sequence of bits. What is the width (in meters) of a bit in the link, i.e., what fraction of the link corresponds to one bit? 20000×103 m = 125 m. 1.6×105 bits (d) (3 points) 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. s = R CS168 Homework 1 - Page 9 of 9 Wednesday, 10 September 2014 5. (10 points) Fun! The ping program determines the round-trip-time (RTT) to any host in the Internet. Using a computer on campus (either your device connected to AirBears or an instructional machine) ping the following hosts five times each to calculate an ‘average RTT’: - stanford.edu (Palo Alto, CA) - monash.edu.au (Melbourne, AUS) - cmu.edu (Pittsburgh, PA) - iitd.ac.in (Delhi, India) - washington.edu (Seattle, WA) - nus.edu.sg (Singapore) - cam.ac.uk (Cambridge, UK) - uwaterloo.ca (Waterloo, Canada) For each of these cities find the physical distance from Berkeley (You can look these up here: http://www.geobytes.com/citydistancetool.htm), and then compute the estimated time T for a packet to reach that location. (a) (7 points) Plot a graph where the x axis represents the distance to each city, and the y axis represents the ratio between the RTT as measured by the ping program and the shortest possible time 2T to reach that city and return. You may disregard transmission delays as ping packets are quite small. These are the results we got. Yours may be slightly different. (b) (3 points) What is the ideal ratio? Did you achieve it? Does the ratio increase, decrease, or stay the same as geographical distance increases? Why might this be the case? The ideal ratio would have been 1. You almost certainly did not achieve it. (Note that even though Monash is almost touching the x-axis, it has a value of 2) As you can see the ratio roughly gets smaller as distance increases - this is because delays like queueing delays are more relevant when overall travel time is smaller. Also, note that if the overall RTT is greater, you have more leeway in taking small suboptimal detours to still gain a relatively small ratio.
© Copyright 2026 Paperzz