Homework 3 Solutions Sheet Network delay is an important design and performance characteristic of a computer network; it specifies how long it takes for a bit of data to travel across the network from one node to another. It is typically measured in multiples or fractions of seconds. Network engineers divide the delay into several parts: Propagation delay - time for a signal to reach its destination Processing delay - time routers take to process the packet header Queuing delay - time the packet spends in routing queues Transmission delay - time it takes to push the packet's bits onto the link Thus, we can calculate the total delay of a network using the following formula: Delay (or latency) = propagation delay + transmission delay + processing delay + queuing delay. ============================================================= Important Formulas: Term Bandwidth Delay (a.k.a. Latency) Propagation delay Unit Bandwidth is always expressed in terms of the number of bits per a unit of time: bits per second (bps) bytes per second (Bps) Delay is always expressed in terms of time: Second (s) Millisecond (ms) Microsecond (μs) Nanosecond (ns) Delay is always expressed in terms of time. Delay is always expressed Transmission in terms of time. delay RTT (round-triptime) Formula Always given in the problem Propagation delay + transmission delay + queuing delay Distance / speed of light (both will be given in the problem) OR: RTT / 2 File size / bandwidth Always given in the problem, but can be estimated as delay * 2. Important Conversions Millisecond (ms) = one thousandth (10-3=1/1000) of a second Microsecond (μs) = one millionth (10-6=1/1,000,000) of a second nanosecond (ms) = one billionth (10-9) of a second ================================================== Binary Prefix In computing, a binary prefix is a specifier or mnemonic that is prepended to the units of digital information, the bit and the byte, to indicate multiplication by a power of 2. In practice the powers used are multiples of 10, so the prefixes denote powers of 1024 = 210. The computer industry uses terms such as kilobyte, megabyte, and gigabyte, and corresponding symbols KB, MB, and GB, in two different ways. For example, in citations of main memory or RAM capacity, gigabyte customarily means 1073741824 bytes. This is a power of 2, specifically 230, therefore this usage is referred to as a binary unit or binary prefix. In most other contexts, the industry uses kilo, mega, giga, etc., in a manner consistent with their meaning in the International System of Units (SI): as powers of 1000. For example, a 500 gigabyte hard drive holds 500000000000 bytes, and a 100 megabit per second Ethernet connection transfers data at 100000000 bit/s. Prefixes for bit and byte multiples Decimal Binary value Unit symbol value Unit 3 10 10 =1,000 Kilo k 2 =1,024 Kilo 106=1,000,000 Mega M 220=1,048,576 Mega 9 30 10 =1,000,000,000 Giga G 2 =1,073,741,824 Giga 1012 Tera T 240 Tera symbol k M G T Q1) How long does it take to transmit a x KB over a y-Mbps link? Give your answer as a ratio of x and y. x KB / y Mbps = x(1024) B / y Mbps = x(1024)(8) b / y Mbps = 8192 x b / y Mbps = .00819 x Mb / y Mbps = .00819 x / (y/sec) = .00819 ((x/1) / (y/sec)) = .00819 ((x/1) * (sec/y)) = .00819 (x/y) sec = 8.29 (x/y) ms Q2) Calculate the total time required to transfer a 1.5-MB file in the following cases, assuming a RTT of 80 ms, a packet size of 1 KB and an initial 2×RTT of “handshaking” before data is sent. (a) The bandwidth is 10 Mbps, and data packets can be sent continuously. total time = initial handshaking + network delay initial handshaking = 2*RTT = 2*80 ms = 160 ms. Delay = propagation delay + transmission delay (assuming processing & queuing delays are not significant). = 40 ms + (1.5-MB / 10 Mbps) = 40 ms + (1.5*1,048,576 B / 10*1,000,000 bps) = 40 ms + (1.5*1,048,576*8 b / 10*1,000,000 bps) = 40 ms + (12,582,912 bits / 10,000,000 bps) = 40 ms + 1.26 s = 40 ms + 1260 ms = 1300 ms » total time = initial handshaking + network delay = 160 ms + 1300 ms = 1460 ms = 1.46 s (b) The bandwidth is 100 Mbps, but after we finish sending each data packet we must wait one RTT before sending the next. First, count number of packets needed to send the file: 1.5-MB / 1 KB = 12,582,912 bits / 1024(8) bits = 12,582,912 bits / 8192 bits = 1536 Thus, we need (1536-1) RTTs to be added to the total delay time. Second, we need to calculate the network delay in this case: Delay = propagation delay + transmission delay = 40 ms + (1.5-MB / 100 Mbps) = 40 ms + (1.5*1,048,576 B / 100*1,000,000 bps) = 40 ms + (1.5*1,048,576*8 b / 100*1,000,000 bps) = 40 ms + (12,582,912 bits / 100,000,000 bps) = 40 ms + 0.126 s = 40 ms + 126 ms = 166 ms » total time = initial handshaking + network delay + 1535 (80 ms) = 160 ms + 166 ms + 122800 ms = 123,126 ms = 123.26 s Q3) Calculate the total time required to transfer a 1000-KB file in the following cases, assuming an RTT of 100 ms, a packet size of 1 KB and an initial 2 × RTT of “handshaking” before data is sent. (a) The bandwidth is 1.5 Mbps, and data packets can be sent continuously. » total time = initial handshaking + network delay = 200 ms + 5500 ms = 5700 ms = 5.7 s (b) The bandwidth is 1.5 Mbps, but after we finish sending each data packet we must wait one RTT before sending the next. » total time = handshake + network delay + (number of packets-1) * RTT = 200 ms + 5700 ms + (1000 - 1)*100 ms = 105,800 ms = 105.8 s Q4) For each of the following operations on a remote file server, discuss whether they are more likely to be delay sensitive or bandwidth sensitive. (a) Open a file. Most likely delay sensitive, since the amount of data exchanged during the operation is small. (b) Read the contents of a file. Most likely bandwidth, though that depends on the size of the file and the actual characteristics of the data channel. It turns out in practice that most files are relatively small (a few K or less), so on an Ethernet (for example), it may well be that delay is the significant factor. (c) List the contents of a directory. Probably delay sensitive, though again it is hard to generalize. If the directory is large, bandwidth may be the issue. (d) Display the attributes of a file. Delay.