Performance Improvement of TCP with Delayed ACKs in IEEE 802.11 ...

3 downloads 166 Views 117KB Size Report
a multi-hop wireless network that uses the IEEE 802.11 MAC protocol. The significance .... We assume that the backoff values (in number of MAC layer slots) are ...
Performance Improvement of TCP with Delayed ACKs in IEEE 802.11 Wireless LANs Arzad A. Kherani



INRIA, 2004 Route Des Lucioles-BP 93, Sophia Antipolis, France 06902. Email: [email protected]

Abstract— We use a Markov renewal reward approach to analyse the throughput achieved by a TCP connection spanning a multi-hop wireless network that uses the IEEE 802.11 MAC protocol. The significance of the paper is twofold: (a) the method used in the paper is simple and can be used for performance evaluation of wireless LANs in general, and, (b) the analytical results suggest that there can be a significant gain in TCP performance due to ACK thinning if the TCP receiver uses the delayed acknowledgement option of TCP. This is in accordance with other simulation based studies on similar lines.

I. I NTRODUCTION The IEEE 802.11b [1] has emerged as the most widely used Wireless LAN standard in commercial environments. Owing to the broadcast nature of the medium (radio channel) the data link layer in wireless networks is different from that of other networks. The IEEE 802.11 protocol implements a distributed coordination function (DCF) [1]. This, along with the hidden terminal problem [2], makes the mathematical modeling of such networks hard. An important problem in such scenario is that of predicting the interaction between TCP and the 802.11 protocol. There is significant amount of literature available on performance of TCP over ad hoc networks employing the 802.11 protocol (see [7], [5], [8], [9], and the references therein). However, most of these studies are based on simulations and are meant to study the performance of TCP over 802.11 network. The performance measure of interest in these studies is the goodput obtained by a TCP controlled FTP application transferring a file of infinite length. Our objective in this paper is to come up with simple analytical models that can be used to predict the behaviour (goodput performance) of TCP over 802.11 based multi-hop wireless networks. In this paper, we also describe and analyse techniques to improve the performance of TCP over an 802.11 based network. We consider a general methodology for modeling of ∗ Work was supported by grant 2900 IT-1 from Centre Franco-Indien pour la Promotion de la Recherche Avancee (CEFIPRA). † Rajeev Shorey is a Research Staff Member in IBM India Research Laboratory, New Delhi, India. He is currently on leave from IBM IRL.

Rajeev Shorey



Computer Science Department, National University of Singapore, 3 Science Drive 2, Singapore 117543. Email: [email protected]

TCP over 802.11 networks and apply it to study the effect of ACK thinning due to delayed acknowledgement option of TCP. In a related paper [6], we model the TCP throughput in a multi-hop wireless network based on IEEE 802.11 nodes and assume a TCP window size (W ) of two packets. The results in this paper are an extension to the results in [6]. The analysis in this paper assumes a general TCP window size of W packets and incorporates the delayed acknowledgement option of TCP. The modeling aproach is to look at the time instants where a TCP packet (data or acknowledgement) has just been successfully transmitted. It is argued that these (random) time instants are renewal instants for the aggregate packet transmission attempt process. This observation allows us to use the standard renewal theory based arguments to compute time average performance measures. This paper is organised as follows. In Section II, we discuss the TCP modeling over an end-to-end chain of IEEE 802.11 nodes. Assuming that the TCP window size is at most 2, in this section we describe the embedded Markov Chain and derive the expression for the TCP throughput. Section III extends the analysis of Section II to the case of general window sizes. In Section IV, we present simulation results and describe methods to extend the analysis to consider various aspects of the IEEE 802.11 protocol not considered in this paper. Finally, Section V concludes the paper. II. TCP M ODELING OVER AN E ND - TO -E ND C HAIN In this section we formulate the problem and present the general solution methodology by giving an exact solution for a simple example. The more general case is addressed in Section III where the analysis assumes some minor approximations; the simulation results of Section IV support the approximations made in analysis of Section III. A. Description of the Setup Figure 1 depicts an 802.11 wireless LAN. There are 3 nodes numbered 1, 2 and 3. Node 2 is in the transmission range of both node 1 and 3. Nodes 1 and 3 are not in each other’s transmission range. Node number 1 is the source of a TCP session controlling a long file transfer between node 1 and node 3. The nodes are assumed to be static and the

channels are assumed to be always in good condition so that the routing is also static. The MAC layer implements the four way handshake (RTS/CTS/DATA/ACK) for data transmission. Further, we assume that TCP’s window size is fixed at W packets. The TCP receiver (i.e., node 3) employs the delayed acknowledgement option of TCP, i.e., the receiver generates a TCP ACK only after it has received d (≤ W ) TCP DATA packets; d equal to 1 corresponds to the case of standard TCP. Though, in the analysis to be presented we assume that d is equal to W . Note that we are not modeling the delayed acknowledgement timer associated with the TCP receiver. We expect that incorporating the delayed acknowledgement timer will not result in a significant change in throughput performance of TCP over the network under consideration.

TCP Source (Only Data)

Intermediate Node (Data and Ack)

FCFS Queue

The system state at embedded instants: The following quantities are used to represent the system state at the embedding instants ζn . The number of packets in the transmit buffer (n) of node i at instant ζn , n ≥ 0, is denoted Pi . Further, (n) denotes the W -dimensional vector corresponding to the S transmit queue of node 2 at instant ζn . The value of S (n) (j) is either p or a depending on whether the packet in the j th position of the transmit queue of node 2 is a TCP DATA packet (n) or a TCP ACK packet; we let S (n) (j) = 0 if P2 = 0. (n) (n) It follows that the process {P1 , S (n) , P3 } embedded at instants ζn forms a Markov chain. Observe that exactly one TCP DATA or TCP ACK packet is transmitted in the interval (ζn , ζn+1 ]. Let, for each n ≥ 1, Rn denote a random variable which is d if a TCP ACK packet has been transmitted from node 2 to node 1 in interval (ζn−1 , ζn ] and Rn = 0 otherwise. Now, the throughput achived by the TCP session is n TCP Sink (Only Acks) i=1 Ri T = lim n→∞ ζn n Ri . = lim n i=1 n→∞ i=1 (ζi − ζi−1 ) (n)

1

2 TCP Data packets

3 TCP Acknowledgement

Fig. 1. Figure showing a line network with 3 nodes. The MAC layer uses the 802.11 protocol whose transmit buffers are also shown.

We assume that the backoff values (in number of MAC layer slots) are sampled from geometric distribution with mean p1 instead of uniform distribution (see [10] and [14, chapter 8]). Assume also that there is no exponential backoff, i.e., the mean of the successive (geometrically distributed) backoff timer values are the same irrespective of the number of collisions. Our simulation results of Section IV suggest that these two assumptions do not affect the TCP throughput. Note that in the scenario under consideration we can have atmost one successful data transmission going on in the network at any instant. This observation is important and forms the basis of the analysis to follow. 1) The Embedded Markov Chain: We use the observation made above that there can be atmost one successful data transmission going on in the network at any instant. The assumptions on backoff timer made earlier implies that the system behaviour after the end of any such successful transmission is independent of the past system evolution. The idea then is to look at the system at the ends of the successful transmissions. Below we formalize this idea. The instants of embedding: We use ζn , n ≥ 0, to denote the random variable corresponding to the time instant at which nth successful transmission gets over in the network. We set ζ0 = 0. The above definition implies that at instant ζn the nth MAC layer acknowledgement is received by one of the three nodes.

(n)

Viewing the process {P1 , S (n) , P3 } defined above as a Markov renewal reward process with Ri the reward in the ith renewal period and Li := ζi − ζi−1 the length of the ith renewal period, a standard renewal reward argument [13] implies that the throughput is T =

E[R] , E[L]

where E[R] and E[L] are the expected values of, respectively, the reward in a renewal period and the length of a renewal period. Substituting for the values of E[R] and E[L], we see that  E[R] (p ,s,p ) π(p1 , s, p3 )E(p1 ,s,p3 ) [R] =  1 3 , T = E[L] (p1 ,s,p3 ) π(p1 , s, p3 )E(p1 ,s,p3 ) [L] where π(x) is the probability that a renewal period starts in state x and Ex [·] is the expectation operator conditioned on a renewal period starting with state x. Thus we can use the standard Markov renewal reward approach to find the TCP throughput. 2) TCP Throughput for W = d = 2: We apply the method proposed above to the case where the receiver (node 3) employs delayed acknowledgement option of TCP with the delayed acknowledgement parameter d = W . From now onwards, we drop the time index n from the notation and assume that W is equal to d and both these parameters are equal to 2. The case of general W requires some minor approximations and is studied in Section III. Figure 2 depicts the evolution of the Markov chain {P1 , S, P3 }. Here S is viewed as a column vector. The alphabets indicated in circles close to the states are used as lable for the corresponding state. In the figure the transitions indicated with dashed lines (B → C and B → D) are with probability 0.5; this is because of our assumption of no exponential backoff and exponentially

2 , 0, 0 A 0

1, p, 0 0 B

0, a, 0 G 0

0, 0, 1 F 0

It follows, after some simple algebra, that TCP throughput is given by T =

0, p, 0 D p 1, 0, 0 0 C

11δ 2p

(3)

where TO = DIF S + 3TS + TR + TC + TM is the expected MAC layer overhead owing to the distributed coordination function (RTS/CTS/ACK). Based on similar analysis, one can show that the throughput of TCP with W = 2 and d = 1 will be,

0, p, 0 0 E

T =

Fig. 2. Figure showing the evolution of the embedded Markov chain {P1 , S, P3 } for W = 2 case.

distributed backoff timer values. The transitions shown with solid lines are with probability 1. It is clear from Figure 2 that symmetry allows us to group states C and D into a single state. The reduced Markov chain thus obtained by grouping states C and D has a doubly stochastic transition probability matrix. Thus we get a trivial solution of equal steady state probability (= 16 ) for all the states of the reduced Markov chain. The stationary distribution of the embedded Markov chain of Figure 2 is then:  1 x = C, D, 12 , π(x) = (1) 1 , otherwise. 6 Recall the notation Rn and ζn . Note that Rn = 2 only for the transitions G → A and Rn = 0 otherwise. Also, the mean time between two successive successful transmissions is (assuming no collisions): E[ζn+1 − ζn ] = DIF S + TB + TR + 3TS +TC + TD + TM

2 E[R] = E[L] 6TO + 4TT D + 2TT A +

(2)

where TB is the expected backoff timer for the transition and TR , TC , TM , TD , TS , DIF S are time required for, respectively, RTS, CTS, MAC layer acknowledgement, Data (which could be TCP ACK or DATA packet depending on the transition), SIFS and DIFS. Note that, under assumption of geometrically distributed backoff timers and no exponential backoff, and with δ used to denote the MAC slot time: TB = pδ for transitions from a state where a single node has both the packets, and δ for transitions from a state where two distinct TB = 2p nodes have packets to be transmitted (this is because the minimum of 2 geometrically distributed random variable with mean p1 is again a geometric random variable with 1 ). mean 2p Let TT D (resp. TT A ) denote the TCP DATA (resp. TCP ACK) transmission time including the required MAC layer header overheads. Thus, TD being the time taken to transmit the data, TD = TT D or TT A depending on whether the transition is due to transmission of a TCP DATA packet or a TCP ACK packet.

4 16TO + 7TT D + 9TT A +

11δ p

.

(4)

A comparision of Equation 3 and 4 shows that there is a significant improvement when the receiver employs the delayed acknowledgement option. III. A NALYSIS FOR A G ENERAL W INDOW It has been observed [12] that in a chain network, a standard TCP connection (i.e., no delayed acknowledgements) with fixed window size of W packets attains a maximum throughput if W is one fifth of the number of hops in the chain. While [7] suggests that using delayed acknowledgements one can improve the performance seen by a TCP connection over an ad hoc network using the IEEE 802.11 MAC layer protocol. We have seen in the previous section that increasing d to 2 for W = 2 gave a significant improvement in performance. The analytical results of this section support the findings of [7] for general W and quantify the performance gain achieved by TCP session. In this section we assume that the window size of TCP session of Figure 1 is fixed at W packets. The delayed acknowledgement parameter is d = W . Figure 3 depicts the evolution of the embedded Markov chain {P1 , S, P3 }. The state represented by (i, j) is where W − i (resp. i − j) is the number of TCP packets in node 1’s (resp. node 2’s) transmission queue. For this particular case of d = W , node 2 can not have TCP DATA and TCP ACK packets simultaneously. Also, node 2 can have atmost one TCP ACK, in which case i = W and we let j = 1 . The state (W, W ) is the one where node 3 has just received the W th TCP DATA packet and has generated one TCP ACK, thus in this state node 3 is waiting to transmit one TCP ACK packet while the other nodes do not have any packets. Figure 3 depicts the evolution of the embedded Markov chain. All the transitions out of any state are equiprobable, i.e., if there are two possible transitions from a state (e.g., (2, 0)), then both these transitions are with probability half. In the above Markov chain, since one TCP ACK is generated after every 2W + 2 transitions (2W for transition from state (0, 0) to (W, W ) and the other 2 transitions for (W, W ) to (0, 0)), it follows that π(W, 1 ) = 2W1+2 . Thus the expected reward is W , E[R] = 2W + 2

(W,1’)

(W,W)

(3,3)

(1,1)

(2,2)

(3,2)

(2,1)

(3,1)

(W,1)

Parameter δ CW TS DIF S TR TC TT D TT A TM A

Value 20 µs 640 µs (32 δ) 10 µs 50 µs 352 µs 304 µs 12704 µs 1024 µs 304 µs TABLE I

(0,0)

(1,0)

(2,0)

(3,0)

(W,0)

Fig. 3. Figure showing the evolution of the embedded Markov chain {P1 , S, P3 } for case of general W .

since a (W, 1 ) → (0, 0) transition acknowledges W TCP DATA packets. Rate balance criteria for Markov chains imply that π(W, W ) = π(W, 1 ). The expected interacknowledgement time is then E[L] = 2π(W, 1 )E[TA ] +

W min(i,W   −1) i=0

π(i, j)Ei,j [TD ],

j=0

where Ei,j [TD ] denotes the mean transfer time required to transfer a TCP DATA packet in state (i, j) and E[TA ] is the expected time for transmission of a TCP ACK packet. An approximation: Now onward we assume that Ei,j [TD ] is independent of (i, j) and is denoted E[TD ]; this can be done because the backoff period is negligible as compared to the rest of the total TCP DATA transmission time. It is thus seen that E[L] ≈ 2π(W, 1 )E[TA ] + (1 − 2π(W, 1 ))E[TD ]. In the above expression, we can also include the effect of collision by changing E[TD ] appropriately. We do that after a while, for now though we consider only the case where no collision occurs; this is expected to hold good for smaller window sizes and also to serve as an upperbound for larger window sizes where the probability of MAC layer packet collision can be significant. The simulation results presented in the paper confirm this behaviour. For the case where no collision occurs, E[TD ] = DIF S + E[TB ] + TR + TS + TC + TS + TT D + TS + TM A . Similarly, E[TA ] = DIF S + E[TB ] + TR + TS + TC + TS + TT A + TS + TM A . Thus the expected throughput for a window size of W is, noting that π(W, W ) = π(W, 1 ), T (W ) =

W . 2(E[TA ] + W E[TD ])

On comparing this with Equation 3 which is exact, we see that our assumption of Ei,j [TD ] being independent of state does not cause significant error. A similar analysis can be done for the single hop case and we get that TCP throughput for the single hop case is given by, W . T (W ) = (E[TA ] + W E[TD ])

PARAMETERS OF 802.11b AS OBTAINED FROM TRACE FILE GENERATED BY ns-2. T HE VALUES INCLUDE THE MAC LAYER OVERHEADS FOR TRANSMISSION OF A PACKET.

For considering collisions at the MAC layer, we only have to change the computation of E[TD ] in the above expressions, rest of the expressions remain same. We assume that there is no exponential backoff; though this is not a restriction and exponential backoff can easily be taken into account. Note that there can be no collision of a TCP ACK thus E[TA ] p be the probability that two remains unchanged. Let p∗ := 2−p geometric p random variables are equal. We get the following renewal type equation for E[TD ], 1 + TR + TS + TC p +TS + TT D + TS + TM A ) 1 +p∗ (DIF S + + TR + E[TD ]) p

E[TD ] ≈ (1 − p∗ )(DIF S +

where the approximation sign is used because not in all the states a collision is possible. Thus we get a simple expression for E[TD ]. IV. S IMULATION R ESULTS Since the default ns-2 implementation [3], [4] allows for delaying the acknowledgement by at most two packets, we made modifications to ns-2 code to accomodate for a more general delayed acknowledgement parameter, which we denote as d. We also used a large value of the timer associated with the receiver employing the delayed acknowledgement option; this does not result in frequent delayed acknowledgement timer expiry since there are very less collisions in the network. The simulations also allowed for exponential backoff at the MAC layer, though it was not invoked too frequently due to small amount of collision for the cases of N equal to 2 and N equal to 3, as reported here. Since we are not assuming an exponential backoff, the successive congestion windows CW are equal thus the mean of the successive backoff timers are also same and equal to 1 CW p = 2 MAC layer slots. Thus E[TD ] can be approximated as   CW − 1 CW + TR + 3TS + TC + TT D + TM A . DIF S + CW + 2 2 In Table I, we report the various parameters as obtained from ns-2 simulation traces. These values are required for computation of the expressions of E[TA ] and E[TD ] above.

Using the values from Table I, the TCP throughput (taking MAC layer collision into account, but without exponential backoff, as in the previous section), is given by, T

W (N − 1)(E[TA ] + W E[TD ]) W . (N − 1)[0.002064 + 0.014125W ]

= =

(5)

Throughpu,t T(W), (Packets per second) -->

75

70

65

60

Simulation: 2 nodes, Exponential Backoff Timer Simulation: 2 nodes, Uniform Backoff Timer 2 nodes, Analysis Simulation: 2 nodes, Uniform Backoff Timer, d=1 55 1

2

3

4

5

6

TCP Window Size, W, (Packets) -->

Fig. 4. Plot showing throughput of TCP obtained from simulation and analysis for the case of two nodes (N = 2).

40

Throughpu,t T(W), (Packets per second) -->

38

36

34

32

30

28 Simulation: 3 nodes, Exponential Backoff Timer Simulation: 3 nodes, Uniform Backoff Timer 3 nodes, Analysis Simulation: 3 nodes, Uniform Backoff Timer, d=1

26 1

2

3

4

5

TCP Window Size, W, (Packets) -->

Fig. 5. Plot showing throughput of TCP obtained from simulation and analysis for the case of three nodes (N = 3).

Figure 4 and Figure 5 show the TCP throughput obtained from ns-2 simulation and analysis (Equation 5) for two (N = 2) and three (N = 3) nodes, respectively. The throughput T (W ) corresponding to simulations is the throughput achieved by a TCP session in 1000 simulation seconds. T (W ) from analysis is as obtained from Equation 5. N is the number of nodes (either 2 or 3). W is the (fixed) TCP window size. The delayed acknowledgement parameter d is equal to W .

6

From Figure 4 and Figure 5, we see that the simulation results match very well with the analysis and that the difference in throughput obtained by using an Exponential backoff timer or a Uniform backoff timer is negligible. Also, there were very few MAC layer collisions (of RTS) hence the exponential backoff was invoked very infrequently, thus justifying our asusmption of no exponential backoff for the mean value of the backoff timer. The figures also show the throughput achieved by TCP session as obtained from simulation for d = 1 and uniformly distributed backoff timer value. It is seen that using the delayed acknowledgement option results in significant improvement in performance. According to [12], in this network the throughput achieved by a standard TCP session (without delayed acknowledgements) will be maximised when W = 1 packets. We saw, from analysis and simulations, that by using the delayed acknowledgement option, the TCP performance can be improved significantly by increasing the TCP window size. This gain in performance was obtained by reducing the feedback traffic which, in the given network, competes with the TCP DATA packets for transmission in the forward direction. Since we are using delayed acknowledgement with d = W , we do not see a trend as observed in [12] where the throughput first increases with W and then reduces. However, for window sizes larger than a threshold, we should get a reduction in throughput since there will be more frequent collisions at the MAC layer. This threshold will depend on the number of nodes in the network and was not achieved in the results reported here. Remark: It is easy to extend the analysis to consider various aspects of the IEEE 802.11 protocol that have not been considered here. In particular, we can easily incorporate the following: • Delayed acknowledgement with d < W , in particular, d = 1. Though we have some results for general d, we do not present them here as they do not differ significantly from those presented in this paper. These results with d ≤ W suggest that the TCP performance increases as d ↑ W. • The assumption of no exponential backoff was seen not to affect the results much. In general though one should consider the exponential backoff mechanism, which can be easily modeled using our approach by suitably enhancing the state variables. (Similar comments hold for uniformly distributed backoff timer value.) • We have assumed that the TCP window size is fixed (W ) throughout its sojourn. In the simulations reported in the paper, this assumption indeed holds owing to small amount of MAC layer collision. In general, however, for large windows, a TCP session can suffer losses owing to excessive MAC layer collisions. Thus a model considering detailed TCP window evolution and its reaction to losses will be required. This can be easily done by using our model in conjunction with models similar to those proposed in [11].

V. C ONCLUSION In this paper, we have considered a general methodology for modeling TCP over 802.11 networks and have applied it to study the effect of ACK thinning due to delayed acknowledgement option of TCP. The results in this paper suggest significant improvement in TCP performance as the delayed acknowledgement parameter d increases to the TCP window size W . The novelty in the paper is the analytic modeling of TCP over IEEE 802.11 based networks with a delayed acknowledgement parameter, and, a TCP window size of W (> 2) packets. We believe that the results in this paper will be useful towards the understanding of more complicated scenarios such as the performance of TCP over multi-hop ad hoc networks. R EFERENCES [1] IEEE Computer Society LAN MAN Standards Committee. Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. New York, 1997. IEEE Std. 802.11-1997. [2] V. Bharghavan, A. Demers, S. Shenker, and L, Zhang. MACAW: A Media Access Protocol for Wireless LANs. In Proc. ACM SIGCOMM Conference (SIGCOMM’94), August 1994. [3] K. Fall and K. Varadhan, ns Notes and Documentation. Technical report, UC Berkeley, LBL, USC/ISI, and Xerox PARC, November 1997. [4] CMU Monarch Group. CMU Monarch extensions to ns. http://www.monarch.cs.cmu.edu/. [5] G. Holland and N. Vaidya, “Analysis of TCP Performance over Mobile Ad Hoc Networks”, ACM Mobicom, Seattle, Washington, 1999. [6] A. A. Kherani and R. Shorey, “ Throughput Analysis of TCP in MultiHop Wireless Networks with IEEE 802.11 MAC”, in IEEE WCNC 2004, Atlanta, USA, March 2004. [7] E. Altman and T. Jimenez, “Improving TCP over multihop networks using delayed ACK”, extended abstract, MADNET’03, Sophia-Antipolis, March 2003. [8] Z. Fu, P. Zerfos, H. Luo, S. Lu, L. Zhang and M. Gerla, “The Impact of Multihop Wireless Channel on TCP Throughput and Loss”, IEEE INFOCOM’03, San Francisco , March 2003. [9] V. Ramarathinam and M. A. Labrador,“Performance Analysis of TCP over Static Ad Hoc Networks”. 15th International Conference on Parallel and Distributed Computing Systems (PDCS 2002), September 2002. [10] F. Cali, M. Conti and E. Gregori, “Dynamic tuning of the IEEE 802.11 protocol to achieve a theoretical throughput limit”, IEEE/ACM Transactions on Networking, Volume 8, Issue 6, Dec. 2000 [11] M. Garetto, R. Lo Cigno, M. Meo and M. A. Marsan; “A Detailed and Accurate Closed Queueing Network Model of Many Interacting TCP Flows”, Infocom 2001, Anchorage, Alaska, USA, April 22-26, 2001 [12] K. Chen, Y. Xue, and K. Nahrstedt “On Setting TCP’s Congestion Window Limit in Mobile Ad Hoc Networks”. ICC’03. [13] R. W. Wolff, Stochastic Modeling and the Theory of Queues, Prentice Hall, 1989. [14] A. Kumar, D. Manjunath and J. Kuri, “Communication Networking: An Analytical Approach”, To be published by Morgan Kaufman Publishers, San Francisco, USA.

Suggest Documents