We have then assumed that the expected value of the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: RTT + ￿(RTO + T ), (20.4) because once the sender times out, the expected time to send a packet and get an ACK is exactly T , the number we want to calculate. Solving Equation (20.4), we find that T = ￿ RTT + 1−￿ · RTO. The expected throughput of the protocol is then equal to 1/ T packets per second.5 5 The careful reader or purist may note that we have only calculated T , the expected time between the transmission of a data packet and the receipt of an ACK for it. We have then assumed that the expected value of the reciprocal of X, which is a random variable whose expected value is T , is equal to 1/ T . In general, however, 1/ E[ X] is not equal to E[1/ X]. But the formula for the expected throughput we have written does in fact hold. Intuitively, to see why, define Yn = X1 + X2 + . . . Xn . As n → ∞, one can show using the Chebyshev inequality that the probability that |Yn − nT | > δ n goes to 0 or any positive δ . That is, when viewed over a long period of time, the random variable X looks like a constant—which is the only distribution for which the expected value of the reciprocal is equal to the reciprocal of the expectation. SECTION 20.5. SLIDING WINDOW PROTOCOL 11 The good thing about the stop-and-wait protocol is that it is very simple, and should be used under two circumstances: first, when throughput isn’t a concern and one wants good reliability, and second, when the network path has a small RTT such that sending one packet every RTT is enough to saturate the bandwidth of the link or path between sender and receiver. On the other hand, a typical Internet path between Boston and San Francisco might have an RTT of about 100 milliseconds. If the network path has a bit rate of 1 megabit/s, and we use a packet size of 10,000 bits, then the maximum throughput of stop-and-wait would be only 10% of the possible rate. And in the face of packet loss, it would be much lower than that. The next section describes a protocol that provides considerably higher throughput. ￿ 20.5 Sliding Window Protocol The key idea is to use a window of packets that are outstanding along the path between sender and receiver. By “outstanding”, we mean “unacknowledged”. The idea then is to overlap packet transmissions with ACK receptions. For our purposes, a window size of W packets means that the sender has at most W outstanding packets at any time. Our protocol will allow the sender to pick W , and the sender will try to have W outstanding packets in the network at all times. The receiver is almost exactly the same as in the stopand-wait case, except that it must also buffer packets that might arrive out-of-order so that it can deliver them in order to the receiving application. This addition makes the receiver a bit more complex than before, but this complexity is worth the extra throughput in most situations. The key idea in the protocol is that the window slides every time the sender gets an ACK. The reason is that the receipt of an ACK is a positive signal that one packet left the network, and so the sender can add another to replenish the window. This plan is shown in Figure 20-7 that shows a sender (top line) with W = 5 and the receiver (bottom line) sending ACKs (dotted arrows) whenever it gets a data packet (solid arrow). Time moves from left to right here. There are at least two different ways of defining a window in a reliable transport protocol. Here, we will stick to the following: A window size of W means that the maximum number of outstanding (unacknowledged) packets between sender and receiver is W . When there are no packet losses, the operation of the sliding window protocol is fairly straightforward. The sender transmits the next in-sequence packet every time an ACK arrives; if the ACK is for packet k and the window is W , the packet sent out has sequence number k + W . The receiver ACKs each packet echoing the sender’s timestamp and delivers packets in sequence number order to the receiving application. The sender uses the ACKs to estimate the smoothed RTT and linear deviations and sets a timeout. Of course, the timeout will only be used if an ACK doesn’t arrive for a packet within that duration. We now consider what happens when a packet is lost. Suppose the receiver has received packets 0 through k − 1 and the sender doesn’t get an ACK for packet k. If the subsequent packets in the window reach the receiver, then each of those packets triggers an ACK. 12 CHAPTER 20. RELIABLE DATA TRANSPORT PROTOCOLS !"#$"%& +& ,& !"#$"%HB&&I)#$GI&B)J"&K&/& ?@AB& -& .& /& +& ,& -& .& /& 6789:;6& 0& 1& '<=)>&2& 2& 3& +4& '"(")*"%& CD(E">&FGB>& 5& ++& +,& +-& 2& +.& 0& 1& 3& +4& ++& +,& +-& 2& Figure 20-7: The sliding window protocol in action (W = 5 here). So the sender will have the following ACKs assuming no further packets are lost: k + 1, k + 2, . . . , k + W − 1. Moreover, upon the receipt of each of these ACKs, an...
View Full Document

Ask a homework question - tutors are online