0806.1089/analysis.tex
1: \section{TCP Fairness Analysis} \label{sec:analysis}
2: 
3: %In order to analyze the fairness and the throughput of TCP access
4: %in the infrastructure BSS, we conduct a simple but comprehensive
5: %and insightful joint analytical and simulation study.
6: 
7: %In the first part of the analysis, we assume that there are no
8: %packet losses in any of the TCP connections neither in the forward
9: %or the backward streams. Moreover, let each TCP connection have
10: %equal maximum congestion window size. These assumptions are made
11: %to simplify the analytical approach. In the sequel, we will also
12: %discuss the cases where these assumptions are released. We will
13: %discuss the necessary conditions to be satisfied for fair access
14: %if congestion window sizes of individual TCP connections differ.
15: %We will show how the packet losses at the AP buffer leads to
16: %unfair access.
17: 
18: The TCP unfairness problem originating from the uplink/downlink
19: access asymmetry can be resolved if packet drops at the AP buffer
20: are prevented such as in the unrealistic case of infinitely long
21: AP queue. In this case, congestion windows of all TCP flows
22: whether in the downlink or uplink reach up to the receiver
23: advertised congestion window limit and stay at this value. This
24: results in fair access in opposed to the fact that the access is
25: asymmetric in the 802.11 infrastructure BSS as described in
26: Section \ref{subsec:problem}. As the infinitely long queue
27: assumption is unrealistic, the exact same result of no packet
28: drops can be achieved if TCP senders are throttled by limiting the
29: number of packets in flight, i.e., the TCP congestion windows are
30: assigned regarding the available AP bandwidth in the downlink. In
31: this section, we propose a simple and novel analytical model to
32: calculate the maximum congestion window limit of each TCP flow
33: that prevents packet losses at the AP buffer, therefore provides
34: fair and efficient TCP access in the BSS.
35: 
36: Each random access system exhibits cyclic behavior. The cycle time
37: is defined as the average duration in which an arbitrary tagged
38: station successfully transmits one packet on average. Our
39: analytical method for calculating the TCP congestion window limit
40: that achieves fair and efficient access is based on the cycle time
41: analysis previously proposed for 802.11 MAC performance modeling
42: \cite{Medepalli05},\cite{Inan07_Globecom_Cycle}. The simple cycle
43: time analysis assesses the asymptotic performance of the DCF
44: accurately (when each contending AC always has a packet in
45: service). We use the approach in \cite{Medepalli05} to derive the
46: explicit mathematical expression for the average DCF cycle time
47: when necessary. In Section \ref{sec:CTAP}, we will describe the
48: necessary extensions to employ the cycle time analysis in the
49: proposed analysis. Due to space limititations, the reader is
50: referred to \cite{Medepalli05},\cite{Inan07_Globecom_Cycle} for
51: details on the derivation of cycle time.
52: 
53: %In saturation\footnotemark\footnotetext{Saturation is the limit
54: %reached by the system when each station \textit{always} has a
55: %packet to transmit. Conversely, in nonsaturation, the
56: %(nonsaturated) stations experience idle times since they sometimes
57: %have no packet to send.}, the downlink ends up having $1/(N +1)$
58: %share of the total access opportunities in an infrastructure BSS
59: %with $N$ stations as described in Section \ref{subsec:problem}.
60: 
61: 
62: %The TCP unfairness problem originating from this bandwidth
63: %asymmetry can be resolved by providing the AP (i.e., the downlink)
64: %a higher share of the bandwidth such that no packet drops occur at
65: %the AP queue\footnotemark\footnotetext{Note that an infinitely
66: %long AP queue also prevents packet drops. In this asymptotical
67: %case, fair access can be achieved. On the other hand, this
68: %solution is far from being practical.}. This objective can be
69: %achieved when the network is operating in nonsaturation. In other
70: %words, this simply translates to throttling TCP senders by
71: %limiting the number of packets in flight, i.e., the congestion
72: %window of each TCP flow. In this section, we calculate the maximum
73: %congestion window size of each TCP flow that prevents packet
74: %losses at the AP buffer, therefore provides fair and efficient TCP
75: %access in the BSS.
76: 
77: %If the AP gets a higher share of the bandwidth such that this
78: %share prevents packet drops at the AP queue, fair TCP access can
79: %be achieved. Providing the AP a predetermined share of the total
80: %transmissions can be achieved by limiting the number of packets in
81: %flight (i.e., the network being in
82: %nonsaturation\footnotemark\footnotetext{Saturation is the limit
83: %reached by the system when each station \textit{always} has a
84: %packet to transmit. In nonsaturation, the (nonsaturated) stations
85: %experience idle times when they have no packet to send.}).
86: %Otherwise, in saturation, the AP ends up having a very limited
87: %share of the bandwidth as described in Section
88: %\ref{subsec:problem}. The approach of limiting the number of
89: %packets in flight simply translates to limiting the congestion
90: %window of each TCP flow. In this section, we calculate the maximum
91: %congestion window size of each TCP flow that prevents packet
92: %losses in the AP buffer.
93: 
94: We consider a typical network topology where a TCP connection is
95: initiated between a wireless station and a wired station either in
96: the downlink or the uplink of the WLAN. The WLAN traffic is
97: relayed to the wired network through the AP and vice versa. Let
98: Round Trip Time (RTT) denote the average length of the interval
99: from the time a TCP data packet is generated until the
100: corresponding TCP ACK packet arrives. RTT is composed of three
101: main components as follows.
102: \begin{itemize}
103: \item \textbf{Wired Link Delay ($LD$):} The flow-specific average propagation
104: delay of the packet between the AP and the wired node.
105: %Since we
106: %investigate the fairness in the wireless link, we assume that $LD$
107: %is constant for each connection. In the first part of the
108: %analysis, we assume each connection has equal $LD$. We will also
109: %release this assumption later on.
110: \item \textbf{Queueing Delay
111: ($QD$):} The average delay experienced by a packet at the wireless
112: station buffer until it reaches to the head of the queue. Note
113: that due to the unequal traffic load at the AP and the stations,
114: $QD_{AP}$ and $QD_{STA}$ may highly differ.
115: \item \textbf{Wireless
116: Medium Access Delay ($AD$):} The average access delay experienced
117: by a packet from the time it reaches to the head of the MAC queue
118: until the transmission is completed successfully.
119: \end{itemize}
120: \noindent Then, RTT is calculated as
121: follows\footnotemark\footnotetext{RTT is calculated as in
122: (\ref{eq:RTTcalc}) irrespective of the direction of the TCP
123: connection. On the other hand, specific values of $AD$ and $QD$
124: depend on the packet size, the number of contending stations, etc.
125: Therefore, RTT of an uplink connection may differ from RTT of a
126: downlink connection.}.
127: \begin{equation}\label{eq:RTTcalc}
128: RTT = 2 \cdot LD + QD_{AP} + QD_{STA} + AD_{AP} + AD_{STA}
129: \end{equation}
130: 
131: %The average throughput of TCP connection is determined by the
132: %number of packets that can be transmitted successfully in one RTT
133: %(before the TCP ACK of the first packet arrives). Therefore, TCP
134: %throughput is either limited by the length of RTT or the
135: %congestion window size.
136: 
137: %As it is discussed in Section \ref{subsec:problem}, at high load,
138: %the AP can get only $1/N$ share of the total transmissions over a
139: %long time interval which results in unfair access between the TCP
140: %connections. On the other hand,
141: 
142: For the first part of the analysis, each TCP data packet is
143: assumed to be acknowledged by a TCP ACK packet where this
144: assumption is later released and the delayed TCP ACK algorithm is
145: considered.
146: 
147: We claim that if the system is to be stabilized at a point such
148: that no packet drops occur at the AP queue, then the following
149: conditions should hold.
150: \begin{itemize}
151: \item \textit{All the non-AP stations are in nonsaturated
152: condition.}
153: 
154: Let's assume a station has $X$ packets (TCP data or ACK) in its
155: queue. A new packet is generated only if the station receives
156: packets (TCP ACK or data) from the AP (as a result of ACK-oriented
157: rate control of TCP). Let $Y>1$ users to be active. Every station
158: (including the AP) sends one packet successfully every cycle time
159: \cite{Medepalli05}. In the stable case, while the tagged station
160: sends $Y$ packets every $Y$ cycle time, it receives only one
161: packet. Note that the AP also sends $Y$ packets during $Y$ cycle
162: times, but on the average, $Y-1$ of these packets are destined to
163: the stations other than the tagged one. Therefore, after $Y$ cycle
164: times, the tagged stations queue size will drop down to $X-Y+1$.
165: Since $Y>1$, the tagged stations queue will get empty eventually.
166: A new packet will only be created when the AP sends a TCP packet
167: to the tagged station which will be served before it receives
168: another packet (on average). This proves that all the non-AP
169: stations are in nonsaturated condition if no packet losses occur
170: at the AP.
171: \item \textit{The AP contends with at most one station at a time on
172: average.}
173: 
174: Following the previous claim, a non-AP station (which is
175: nonsaturated) can have a packet ready for transmission if the AP
176: has previously sent a packet to the station. There may be
177: transient cases where the instantaneous number of active stations
178: may become larger than 1. On the other hand, as we have previously
179: shown, when $Y>1$, the queue at any non-AP station eventually
180: empties. If we assume the transient duration being very short, the
181: number actively contending stations on average is one. Therefore,
182: at each DCF cycle time, the AP and a distinct station will
183: transmit a packet successfully.
184: \end{itemize}
185: 
186: We define $CT_{AP}$ as the duration of the average cycle time
187: during which the AP sends an arbitrary packet (TCP data or ACK)
188: successfully. We will derive $CT_{AP}$ in Section \ref{sec:CTAP}.
189: Let the average duration between two successful packet
190: transmissions of an arbitrary flow at the AP (or at the non-AP
191: station) be $CT_{flow}$. Assuming there are $n_{up}$ and
192: $n_{down}$ upload and download TCP connections respectively, we
193: make the following approximation based on our claims that the AP
194: contends with one station on average and the TCP access will be
195: fair if no packet drops are observed at the AP buffer
196: \begin{equation}\label{eq:CTflow}
197: CT_{flow} \cong (n_{up}+n_{down}) \cdot CT_{AP}.
198: \end{equation}
199: \noindent As it will be shown by comparing with simulation results
200: in Section \ref{subsec:analysis_evaluation}, the approximation in
201: (\ref{eq:CTflow}) leads to analytically correct results.
202: 
203: Then, the throughput of each station (whether it is running an
204: uplink or a downlink TCP connection) is limited by $1/CT_{flow}$
205: (in terms of packets per second). We can also write the TCP
206: throughput using $W_{lim}/RTT$, where we define $W_{lim}$ as the
207: TCP congestion window limit for a TCP connection.
208: %We calculate $W_{lim}$ such that if a flow uses a congestion
209: %window limit larger than $W_{lim}$, this results in packet losses
210: %at the AP buffer. As described in Section \ref{subsec:problem},
211: %the drop of a TCP data packet (for downlink TCP connections)
212: %directly results in a timeout or the generation of duplicate TCP
213: %ACKs. On the other hand, due to the cumulative nature of TCP ACK
214: %packets, the uplink flows can still maintain their high throughput
215: %if the ACK drop ratio does not go over a threshold. As a result,
216: %unfair resource allocation in the WLAN is observed.
217: Following our previous claims, $QD_{STA}=0$ (the stations are
218: nonsaturated), $QD_{AP}=(BS_{AP}-1)\cdot CT_{AP}$ (we consider the
219: limiting case when the AP buffer is full, but no packet drop is
220: observed), and $AD_{AP}+AD_{STA}=CT_{AP}$ (the AP contends with
221: one station on average), where $BS_{AP}$ is the buffer size of the
222: AP MAC queue. Using $1/CT_{flow}=W_{lim}/RTT$, we find
223: \begin{equation}\label{eq:w_lim}
224: W_{lim}= \frac{2\cdot
225: LD}{CT_{flow}}+\frac{BS_{AP}}{n_{up}+n_{down}}.
226: \end{equation}
227: \noindent Note that $CT_{flow}$ is an indication of the bandwidth
228: at the bottleneck (at the AP). If the data rate exceeds this
229: bandwidth, the excess data will be queued at the AP, eventually
230: overflowing the AP buffer. We calculate $W_{lim}$ considering a
231: full AP buffer, therefore, $W_{lim}$ is the \textit{maximum}
232: congestion window limit for a TCP connection that prevents the
233: packet drops at the AP queue of size $BS_{AP}$.
234: 
235: We can make following observations from (\ref{eq:w_lim}).
236: 
237: \begin{itemize}
238: \item $W_{lim}$ is a function of $LD$. Therefore, $W_{lim}$
239: is flow-specific and varies among connections with different $LD$.
240: \item The first term is the effective number of
241: packets that are in flight in the wired link for any flow, while
242: the second term is the number of packets that are in the AP buffer
243: for the same flow.
244: \end{itemize}
245: 
246: \subsection{Delayed TCP Acknowledgements}
247: 
248: In the delayed TCP ACK mechanism, the TCP receiver acknowledges
249: every $b$ TCP data packets ($b>1$). A typical value (widely used
250: in practice) is $b=2$.
251: 
252: The use of delayed TCP ACK mechanism changes the system dynamics.
253: On the other hand, we still employ our assumption that the AP
254: contends one station at a time on the average to calculate
255: $CT_{AP}$. As will be shown by comparison with simulation results
256: in Section \ref{subsec:analysis_evaluation}, this assumption still
257: leads to analytically accurate results.
258: 
259: We update (\ref{eq:CTflow}) and (\ref{eq:w_lim}) accordingly for
260: delayed TCP acknowledgments. Let the average duration between two
261: successful packet transmissions of the flow at the non-AP station
262: be $CT_{flow,del}$ when delayed TCP acknowledgment mechanism is
263: used. Each uplink flow completes the successful transmission of
264: $b$ packets in an interval of average length $b\cdot
265: CT_{flow,del}$. When the access is fair, the AP transmits $b$ data
266: packets for each downlink flow (i.e., a total of $b\cdot
267: n_{down}$), and one ACK packet for each uplink flow (i.e., a total
268: of $n_{up}$ ACK packets) during the same interval. Then,
269: 
270: %$CT_{flow,del}$ is calculated considering that an ACK packet
271: %transmission at the AP corresponds to the generation of $b$ data
272: %packets in the uplink.
273: 
274: \begin{equation}\label{eq:CTflow_del}
275: CT_{flow,del} \cong (\frac{n_{up}}{b}+n_{down}) \cdot CT_{AP}
276: \end{equation}
277: \begin{equation}\label{eq:w_lim_del}
278: W_{lim}= \frac{2\cdot
279: LD}{CT_{flow,del}}+\frac{BS_{AP}}{n_{up}/b+n_{down}}
280: \end{equation}
281: 
282: \subsection{Calculating $CT_{AP}$}\label{sec:CTAP}
283: 
284: We are interested in the case when there are two active
285: (saturated) stations (as the AP contends with one station at a
286: time). The average cycle time in this scenario can easily be
287: calculated using the model in \cite{Medepalli05}. In our case, the
288: AP sends the TCP ACK packets of the uplink TCP connections and the
289: TCP data packets of the downlink TCP connections which contend
290: with the TCP ACK packets of the downlink TCP connections and the
291: TCP data packets of the uplink connections that are generated at
292: the stations. Note that the cycle time varies according to the
293: packet size of contending stations. Then,
294: \begin{equation}
295: \label{eq:CTAP} CT_{AP} = \sum_{p_{1} \in S} {\rm
296: Pr}(p_{AP}=p_{1}) \sum_{p_{2} \in S} {\rm
297: Pr}(p_{STA}=p_{2})~CT_{p_{1},p_{2}}
298: \end{equation}
299: 
300: \noindent where $S=\{ACK, DATA\}$ is the set of different types of
301: packets, ${\rm Pr}(p_{AP}=p_{1})$ is the probability that the AP
302: is sending a packet of type $p_{1}$, ${\rm Pr}(p_{STA}=p_{2})$ is
303: the probability that the non-AP station is sending a packet of
304: type $p_{2}$, and $CT_{p_{1},p_{2}}$ is the average cycle time
305: when one station is using a packet of type $p_{1}$ and the other
306: is using a packet type of $p_{2}$. We differentiate between the
307: data and the ACK packets because the size of the packets thus the
308: cycle time duration depends on the packet type.
309: 
310: Using simple probability theory, we can calculate ${\rm
311: Pr}(p_{AP})$ and ${\rm Pr}(p_{STA})$ as follows
312: \begin{equation}
313: \label{eq:pAP} \setlength{\nulldelimiterspace}{0pt} {\rm
314: Pr}(p_{AP}=p_{1}) =
315: \left\{ \\
316: \begin{IEEEeqnarraybox}[\relax][c]{ll} \frac{n_{down}}{n_{up}/b+n_{down}}, & ~ {\rm if} ~ p_{1} = DATA \\
317: \frac{n_{up}/b}{n_{up}/b+n_{down}}, & ~ {\rm if} ~ p_{1}=ACK,
318: \end{IEEEeqnarraybox}
319: \right.
320: \end{equation}
321: \begin{equation}
322: \label{eq:pSTA} \setlength{\nulldelimiterspace}{0pt} {\rm
323: Pr}(p_{STA}=p_{2}) =
324: \left\{ \\
325: \begin{IEEEeqnarraybox}[\relax][c]{ll} \frac{n_{up}}{n_{down}/b+n_{up}}, & ~ {\rm if} ~ p_{2} = DATA \\
326: \frac{n_{down}/b}{n_{down}/b+n_{up}}, & ~ {\rm if} ~ p_{2}=ACK.
327: \end{IEEEeqnarraybox}
328: \right.
329: \end{equation}
330: