A Proof of Quasi-Independence Of Sliding Window Flow Control and Go-Back-N Error Recovery Under Independent Packet Errors ? Amarnath Mukherjee GIT -LCB- CC -LCB- 94/28 Last Revised : June 26 , 1995 Abstract A quasi-independence result holds for the go-back-n automatic repeat request -LRB- ARQ -RRB- protocol and the sliding window flow control protocol if packet errors are independent . The result is independent of the magnitude of the packet error probability or the cost of an error . A parallel result for the selective repeat ARQ protocol , however , does not appear to hold . College of Computing Georgia Institute of Technology Atlanta , Georgia 30332 -LCB- 0280 ? To be published in Computer Networks and ISDN Systems . This research was supported in part by the National Science Foundation under grant NCR91-16117 . Parts of this paper were presented as evidence of quasi-independence in Sigmetrics 1990 -LSB- 7 -RSB- . The proof of quasi-independence -LRB- Section 4 -RRB- is new . 1 Introduction The objective of this paper is to show that under certain conditions , the performance of the go-back-n error recovery protocol and the sliding window flow control protocol are quasiindependent . Specifically , if E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- is the expected time to transmit an N packet message with retransmissions using a fixed send window of size w ; E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- is the expected time to transmit the N packets over an error free channel with same window size , E -LSB- TerrCost -LRB- N ; p -RRB- -RSB- is the expected cumulative cost of retransmissions , and p is the probability of error in either the data packet or its acknowledgment , then under the assumption of independent packet errors , E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- = E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- + E -LSB- TerrCost -LRB- N ; p -RRB- -RSB- + o -LRB- p -RRB- ; -LRB- 1 -RRB- where o -LRB- p -RRB- =p ! as p ! : Notice that E -LSB- TerrCost -LRB- N ; p -RRB- -RSB- in -LRB- 1 -RRB- is independent of the window size w : Figure 1 shows a few examples of the accuracy of the quasi-independence assumption . Previous analytical studies have focussed on either flow control strategy or error control strategy in isolation -LRB- e.g. , -LSB- 2 , 3 , 5 , 8 , 6 , 10 -RSB- -RRB- . The complexity of analyses has usually precluded a simultaneous study of both . Quasi-independence asserts that sliding-window flow control -LRB- with a fixed window size -RRB- and go-back-n error recovery are orthogonal when packet errors are independent . The result is of course provably valid only for the models studied . -LRB- 1 -RRB- is easy to show when the window does not close -LRB- see for example -LSB- 6 -RSB- -RRB- . For the case when the window does close , however , no such proof was known , although we have observed it empirically in many of our measurements and simulations over the past several years . The purpose of this paper is to give a proof for this observation . The result is valid only if packet errors are independent . An example scenario where this might be true is a mobile host environment where communication is achieved through packet radio or Infra Red , and the dominant cause of packet errors is white noise in the medium . A scenario where this assumption does not apply is where the channel is relatively error free and most packet errors are caused by buffer overflows at intermediate switches . The quasi-independence property does not , however , hold for the selective repeat protocol , even for independent packet errors . In particular , if E -LSB- Tsr -LRB- N ; w ; p -RRB- -RSB- denotes the expected time to transmit N packets with a window size w using selective repeat , then E -LSB- Tsr -LRB- N ; w ; p -RRB- -RSB- = E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- + f -LRB- N ; w ; p ; o -RRB- ; -LRB- 2 -RRB- where f -LRB- N ; w ; p ; o -RRB- is the expected cost due to errors using selective repeat with a window size w and time-out o -LRB- fixed or variable -RRB- , and E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- is as defined earlier for go-back-n . Based on simulation experiments , our conjecture is that f -LRB- N ; w ; p ; o -RRB- is of the form Npq o -LRB- w ; p -RRB- + o -LRB- p -RRB- ; where q = 1 ? p : However , we do not have an exact form for o -LRB- w ; p -RRB- ; except for trivial special cases . Hence , we do not address selective repeat in this paper . For the go-back-n protocol , however , quasi-independence holds for all values of p and all values of w ; no matter how large or small . This is shown first through a Petri-Net example I , III , III , III , III , II050100150200250 -LRB- a -RRB- p0 = 0.01 , tau = 10 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II I , III , III , III , III , II050010001500 -LRB- b -RRB- p0 = 0.01 , tau = 1000 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II Each set of barplots in these two figures shows the time to transmit N = 64 packets using -LRB- I -RRB- the quasi-independence assumption -LRB- the left bar , marked I -RRB- , and -LRB- II -RRB- a detailed model for go-back-n -LRB- the right bar , marked II -RRB- . Model I computes E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- from a simple window flow control model with no errors and adds E -LSB- TerrCost -LRB- N ; p -RRB- -RSB- to it , resulting in the right hand side of Equation -LRB- 1 -RRB- . Model II computes E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- from a more detailed go-back-n model . The models that were used to compute these numbers are described in Section 3 . In part -LRB- a -RRB- , the contribution of the error-free component dominates the error-component . In part -LRB- b -RRB- , the reverse is true : the contribution of the error component dominates over the errorfree component . In both cases , however , their sum add up to that obtained by Model II . p0 ; w and o are parameters of the model . p0 and o control the contribution of the error component . w ; the window size , controls the contribution of the error-free component . While the two models yield similar numbers for go-back-n , it can be shown that they do not do so for selective-repeat . Figure 1 : Comparison of the expected time to transmit N = 64 packets as computed from two different models . in Section 3 and then proved in Sections 4 and 5 . The paper is organized as follows . Section 2 presents the protocol definitions and system model . Section 3 illustrates quasi-independence through an example . Section 4 gives the proof of the main result of the paper . It is assumed here that transmission times and other delays are exponentially distributed . Section 5 bounds the error due to a quasi-independence assumption for the case when the transmission times and other delays are deterministic . Section 6 presents our conclusions . 2 Preliminaries 2.1 Protocol Definitions We assume that the sender has a window of size w . This is the upper limit on the number of packets that it is allowed to transmit without waiting for an acknowledgment . The sliding window protocol , in conjunction with the go-back-n and selective-repeat retransmission strategies , works as follows . When a packet successfully reaches a receiver , it is always ACKed if it is in-sequence . An error is detected at the sender by either a timer interrupt or by a NACK from the receiver . At this point , if the sender backs up to the first packet in error and restarts the transmission , the strategy is referred to as go-back-n -LSB- 9 -RSB- . If , on the other hand , the sender retransmits only that packet which is in error , the strategy is called selective-repeat . The state machine of go-back-n is simpler than that of selective repeat . Also , the selective repeat protocol may require a large receive buffer to cache packets which are received correctly , but out of order . While go-back-n can operate with one receive buffer only , it may be appropriate to allocate additional buffers for re-sequencing out-of-order packets if necessary . 2.2 System and Error Models We assume that the mean transmission time of a packet at the sender is 1 = > = when its window size allows it to transmit a packet . When the window is not open , however , the sender is inhibited from transmitting . The analysis will consider two cases : -LRB- i -RRB- the transmission time and other delays are all exponentially distributed , and -LRB- ii -RRB- they are all deterministic . At the lower levels of protocol stack where the protocol is usually implemented , the coefficient of variation of the transmission time is likely to be less than one but greater than zero . The analysis attempts to capture these two extreme cases . The performance measure of interest is the expected time to transmit a large multi-packet message consisting of N packets . 3 An Illustration of Quasi-Independence 3.1 Petri-Net Models In this section , we present an illustration of the quasi-independence property of window flow control protocol and the go-back-n error recovery protocol when packet errors are independent . In -LSB- 6 -RSB- , this result was shown to hold when the window did not close , i.e. , it was shown that E -LSB- Tgbn -LRB- N ; w = 1 ; p -RRB- -RSB- = E -LSB- TnoErrors -LRB- N ; w = 1 -RRB- -RSB- + Np q o ; -LRB- 3 -RRB- CreditsUsed AckAvail DataRecvd RdytoRecv RecvData -LRB- l3 -RRB- RdytoSend WaitAck Transmit -LRB- l1 -RRB- RecvAck -LRB- l2 -RRB- CreditsAvail GenAck -LRB- l4 -RRB- N W Figure 2 : Simple sliding window flow control : Model I where ffl E -LSB- Tgbn -LRB- N ; w = 1 ; p -RRB- -RSB- denotes the expected time to transmit N packets in the presence of errors using go-back-n , ffl E -LSB- TnoErrors -LRB- N ; w = 1 -RRB- -RSB- denotes the time it would take to transmit N packets in an error free channel , ffl o is the average cost of an error using go-back-n , and ffl -LRB- Np = q -RRB- o was the -LRB- computed -RRB- extra cost due to errors , using go-back-n . Observe that o is independent of w ; so the expected cost due to errors -LSB- second term on the right hand side of -LRB- 3 -RRB- -RSB- was not dependent on the window size . In this section , we investigate with a Petri-Net example , the accuracy of this result when the window may close , even with high probability and both p and o may be small or large . Figure 2 shows a Generalized Stochastic Petri Net -LRB- GSPN -RRB- model -LSB- 4 -RSB- of a simple sliding window flow control protocol ignoring all errors and retransmissions . This model will be used to compute E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- ; corresponding to the first term on the right hand side of -LRB- 3 -RRB- . The protocol , or more accurately , its Petri-Net representation , works as follows . If the place RdytoSend has a token , the sender can send a packet provided the place CreditsAvail has a token as well . The mean time1 to send a packet is 1 = > = 1 . When a packet is sent , one token from each of the above two places is removed ; one is added to the place WaitAck where the sender waits for an acknowledgment . Another is added to the place CreditsUsed which is subsequently used 1On Notation : Since there are several timed transitions in this model , and we need to distinguish them , the subscripts > = i i 2 f1 ; 2 ; 3 ; 4g are introduced . Hopefully , this will not confuse the reader . The > = defined earlier as the mean send rate when the sender 's window is open is the same as > = 1 in the Petri-Net models . CreditsUsed DataRecvd RdytoRecv RecvData -LRB- l3 -RRB- GenAck -LRB- l4 -RRB- RdytoSend timeout -LRB- 1/t -RRB- success -LRB- q -RRB- RecvAck -LRB- l2 -RRB- AckAvail N SuccessWait failedWait Lsuc transmit -LRB- l1 -RRB- CreditsAvail W fail -LRB- p -RRB- Figure 3 : Sliding window flow control with go-back-n retransmission : Model II by the receiver of the data . The transition RecvData can fire when the receiver has a token in RdytoRecv and a token is available in CreditsUsed . Upon receipt of the data , the receiver sends an acknowledgment packet which takes a mean time of 1 = > = 4 . For analytical tractability , we assume here and in future that all packets are separately acknowledged . Notice that there are no errors in this model . For future reference , we shall call this Model I. Figure 3 shows the GSPN model of the same sliding window protocol , but this time it includes the go-back-n retransmission strategy . In case of an error , all packets from the first packet in error are retransmitted . In the Petri-Net model , we suppress transmission of those packets which follow the erroneous one by using an inhibit arc from the failedWait place into the transmit transition . In a real implementation , these packets would actually have been transmitted -LRB- and then retransmitted following a timeout or a negative acknowledgment -RRB- . The inhibit arc would be an approximation if these additional packets were to increase the error rate by increasing the level of congestion in the network . However , since this paper is on independent packet errors , that is not of concern . A successful packet follows the same path as in Model I . In case of an error , however , a token is deposited in the place failedWait . This inhibits further transmission at the sender . After a timeout interval of o , the token in restored to the RdytoSend place and normal transmission begins . A packet error could occur at different points in transit . Let the aggregate probability of error -LRB- of the packet or its acknowledgement -RRB- be p : If the probability of error in data and acknowledgment packets are pd and pa ; respectively , then p = 1 ? -LRB- 1 ? pd -RRB- -LRB- 1 ? pa -RRB- : In the numerical examples that follow , we assume that both data and ACK packets have the same probability of failure , p0 ; so that p = 1 ? -LRB- 1 ? p0 -RRB- 2 : This is , however , not necessary for quasiindependence to hold -LRB- see Section 4 -RRB- . 3.2 Analysis of the Petri-Nets 3.2.1 Analysis of Model I To study the effect of window size on throughput and round-trip time of packets , we assume that the number of packets to be sent , N ; is at least equal to the window size w ; see Figure 2 . This ensures that the sender always has a packet to send , and its transmission is delayed only if the window closes . Let N be the average number of tokens in the place WaitAck . Let ae = Pr -LSB- CreditsAvail is not empty -RSB- , which is the probability that the window is not closed . Then the throughput into the box marked with dashed lines is ? 1 = > = 1ae : -LRB- 4 -RRB- Let RI be the average time spent by a token in the box . By Little 's law , we have RI = N = > = 1ae ; which implies that the expected number of packets initiated by the sender per round-trip time is RI > = 1ae . The expected time to transmit N packets and receive the ACK for the last one , E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- I , is given by E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- I = RI -LRB- N RI > = 1ae -RRB- + RI = N > = 1ae + RI : -LRB- 5 -RRB- Since N and ae can be computed using a Petri Net analyzer and RI can be computed from N ; E -LSB- TnoErrors -LRB- N ; w -RRB- -RSB- I is easily obtained . As before , let p be the aggregate probability of failure of a packet or its acknowledgment , and let q = 1 ? p : It was shown in -LSB- 6 -RSB- that , if the windows never closed then -LRB- 3 -RRB- holds even for generally distributed processing and transmission times . We shall show next that -LRB- 3 -RRB- holds approximately even when the window may close . 3.2.2 Analysis of Model II Consider the analysis of the go-back-n protocol with independent packet errors as modeled by the Petri-Net in Figure 3 . Let ? trans = effective throughput through transition transmit , ? fail = throughput through transition failure , ? suc = throughput through transition success , and r = Pr -LSB- token in failedWait -RSB- . Then , applying Little 's Law to the box surrounding failedWait , we get ? fail = r = o ; since o is the expected time spent in the place failedWait . Now , noting that ? fail = p?trans , we have ? suc = q?trans = -LRB- q =p -RRB- ? fail ; which simplifies to ? suc = r -LRB- op = q -RRB- : -LRB- 6 -RRB- The average cycle time of a token in the successful path is obtained by applying Little 's Law to the box around the place SuccessWait : RII = N -LRB- SuccessWait -RRB- ? suc : The expected time to transmit N packets is then given by E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- II = N ? suc + RII : -LRB- 7 -RRB- 3.2.3 Comparison of the Two Models In Figures 1 and 4 , we show the time to transmit N = 64 packets as calculated by the two models . We vary the parameters p , o and w . The values of > = 1 ; > = 2 ; > = 3 and > = 4 are assigned according to those reported in -LSB- 11 -RSB- , i.e. , > = 1 ? 1 = time to copy a data packet from the sending host 's memory onto the wire = 2.17 msec ; > = 2 ? 1 = time to copy an acknowledgment packet from the wire into the sending host 's memory = 0.17 msec ; > = 3 ? 1 = time to copy the data packet from the wire into the receiving host 's memory = 1.35 msec ; and > = 4 ? 1 = time to copy an acknowledgment packet from the receiving host onto the wire = 0.22 msec . The time to complete an N-packet transmission is obtained by first solving the two GSPN models and then using their outputs as inputs to -LRB- 3 -RRB- , -LRB- 5 -RRB- , -LRB- 6 -RRB- and -LRB- 7 -RRB- . We observe that the time predicted by extrapolating Model I -LRB- in accordance with -LRB- 3 -RRB- -RRB- is remarkably close to that obtained by solving Model II . -LRB- See Figures 1 and 4 . -RRB- This is true whether the error-free component dominates over the component that is due to error in Model I , or vice versa , or when both components are comparable in magnitude . In Figures 5 -LRB- a -RRB- - -LRB- b -RRB- , we study the sensitivity of the result further . For instance , Figure 5 -LRB- a -RRB- shows the probability that the window equals to zero for different experiments using Model I. -LRB- All experiments in Figures 1 and 4 use the same error free model because the latter is independent of o and p0 :-RRB- We observe that the probability of window-closing varies over a significant range , from :0009 to :4450 . Similarly , the probability of not being in the failedWait state in Model II is shown in 5 -LRB- b -RRB- . It shows the proportion of time spent in transmitting a useful packet to being in an erroneous state in the exact model -LRB- Model II -RRB- . This too varies over a wide range , indicating that the quasi-independence assumption is fairly robust . Let us now consider conditions under which the two models would in fact be equal . Comparing Model I and Model II , we see from -LRB- 3 -RRB- , -LRB- 5 -RRB- , -LRB- 6 -RRB- and -LRB- 7 -RRB- , that the two models yield -LRB- asymptotically -RRB- identical results if 1 ? 1 + op q = 1 ? suc : For convenience , let us denote h = op = q . Then for the previous condition to hold , we require that 1 > = 1ae + h = h r ; or r = 1 1 + 1 > = 1aeh : -LRB- 8 -RRB- I , III , III , III , III , II0100200300400 -LRB- a -RRB- p0 = 0.01 , tau = 100 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II I , III , III , III , III , II0100200300 -LRB- b -RRB- p0 = 0.001 , tau = 1000 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II I , III , III , III , III , II050100150200250 -LRB- c -RRB- p0 = 0.0001 , tau = 1000 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II I , III , III , III , III , II050100150200250 -LRB- d -RRB- p0 = 0.00001 , tau = 1000 . E -LSB- T_N -RSB- -LRB- msec -RRB- w = 1w = 2w = 4w = 8w = 16Mod . I : Error-Free PartMod . I : Error ComponentModel II Figure 4 : Comparison of the expected time to transmit N = 64 packets as obtained from Models I and II . We observe that the Model I and Model II results are approximately equal for all values of p0 ; w ; and o considered . In -LRB- a -RRB- , p0 = 10 ? 2 ; and o = 100 : This results in comparable contributions from the error-free component and the error component as seen from the Model I bar plots . In -LRB- b -RRB- , -LRB- c -RRB- and -LRB- d -RRB- , o is fixed at 1000 and p0 is varied from 10 ? 3 through 10 ? 5 ; resulting in progressively decreasing contribution of the error-component . ? ? ? ? ? -LRB- a -RRB- Pr -LRB- window closes in Model I. -RRB- wPr -LRB- window closes in Model I -RRB- 510150.00.20.40.60.81.0 + + + + + x x x x x ? ? ? ? ? -LRB- b -RRB- Pr -LRB- FailedWait = 0 -RRB- ; p0 = 0.01 . wPr -LRB- failedWait = 0 -RRB- 510150.00.20.40.60.81.0 tau = 10tau = 100tau = 1000 Figure 5 : Sensitivity analysis of quasi-independence . These two plots show that -LRB- a -RRB- the probability of window-closing in Model I and -LRB- b -RRB- the probability of not being in the failedWait state in Model II vary over a wide range . Quasi-independence holds , nevertheless . Now , if the expected useful time spent per packet is tgood and the wasted time is tbad , then from Model I and our quasi-independence hypothesis we have tgood = 1 > = 1 ae and tbad = op = q = h. -LRB- 8 -RRB- says that the expected times derived from the two models will be equivalent if r = 1 1 + tgood tbad ; i.e. , Pr -LSB- failedWait = 1 -RSB- = tbad tgood + tbad This would , by itself , make perfect sense if tgood was somehow obtained from Model II . We are , however , calculating tgood = 1 > = 1ae from Model I and r from Model II . The two models will be close if the probability that the window is open given that we are not in the midst of handling an error in the second model , is close to ae ; the probability that the window is open in the first model . The results from the Petri-Net analysis suggest that this is so . 4 Proof of Quasi-Independence for Exponentially Distributed Times 4.1 Markov Model In this section , we prove the quasi-independence property when all times are exponentially distributed -LRB- as in the GSPN example in the previous section -RRB- . The expected time to transmit N packets with sliding window is derived using a Continuous Time Markov Process . The state of the system consists of a pair of tuples -LRB- i ; j -RRB- where i is the number of packets that will not require retransmission and j is the number of these i packets whose acknowledgments are still outstanding . Clearly j < = w ; if the window size is w . In addition , we have the states fi corresponding to the states where an error occurs after i packets have been successfully transmitted -LRB- see Figure 6 -RRB- . The sender transmits with a mean rate > = ; and the acknowledgments return with a mean rate ? . Let the packet error probability be p ; and let q = 1 ? p : Figure 6 shows the state transition diagram of the ensuing Markov Process . The initial state is -LRB- 0,0 -RRB- . When a packet is transmitted there can be two possible next states . If the transmission is going to be successful -LRB- ultimately -RRB- , we designate the next state as -LRB- 1,1 -RRB- . Else , the packet will fail and the next state is f0 . The rate into -LRB- 1,1 -RRB- is > = q and that into f0 is >=p : Once a packet fails , we assume that it is detected after a mean time o = 1 = fl : Therefore , in Figure 6 , we denote the rate from f0 to -LRB- 0,0 -RRB- by . The rest of the arcs in the figure follow a similar argument . Note that for all j , a failure transition from -LRB- i ; j -RRB- is into fi and the recovery arc from fi is only into -LRB- i ; 0 -RRB- . This is a property of the go-back-n protocol : all the packets which are transmitted before a failure are represented by i. By the time the sender detects the failure of packet i + 1 and acts upon it , the outstanding acknowledgments of all packets up to packet i must have returned to the sender for it to consider packet i + 1 as the first failure and the point of beginning a retransmission . 0,0 1,0 1,1 2,0 2,1 2,2 w f f 1 f 2 N ,0 N ,1 N ,2 N , w lq lq lq g g lp lq lp m m m mm m lp lq g lp lq lp Figure 6 : Go-Back-N with Window Flow Control : State Transition Diagram . 4.2 Analysis of the model We next consider the transient analysis of this Markov Process . We set -LRB- 0,0 -RRB- as the initial state and -LRB- N ,0 -RRB- as the final state and are interested in computing E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- ; the time to complete an N-packet transmission . Here , E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- is the expected time to absorption into -LRB- N ,0 -RRB- for this Markov Process . To compute the expected time to absorption , we use the algorithm in -LSB- 1 -RSB- . Let ? represent the vector2 of times spent in each of the states before absorption . Let Q be the transition rate matrix obtained from the original transition rate matrix by deleting the rows and columns involving the absorbing states . Also , let P -LRB- 0 -RRB- be the initial probability distribution of the non-absorbing states . Then the mean time spent in each state before absorption can be computed by solving for ? -LRB- see -LSB- 1 -RSB- -RRB- in ? Q = ? P -LRB- 0 -RRB- : -LRB- 9 -RRB- The expected time to absorption is then given by E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- = X i ; j ? i ; j ; -LRB- 10 -RRB- where ? i ; j are the individual components of ? . The solution of -LRB- 9 -RRB- for the Markov Process in Figure 6 is especially simple . For the states -LRB- 0,0 -RRB- and f0 ; we have ? 0 ; 0 = 1 > = q ; and ? f0 = p = q : For other states -LRB- i ; j -RRB- , -LRB- 9 -RRB- yields ? i ; j h > = 1fj < w ; i < Ng + ? 1fj > 0g i = > = q?i ? 1 ; j ? 11fi > 0 ; j > 0g + ?? i ; j +11 fj < i ; j < wg + ? fi1fj = 0g ; -LRB- 11 -RRB- and ? fi = >=p ? i ; 01fi < Ng ; -LRB- 12 -RRB- where 1fCg = ae 1 ; if C = true ; ; otherwise . -LRB- 11 -RRB- and -LRB- 12 -RRB- are similar to ` flow equations , ' where we equate all the ` flows ' into state -LRB- i ; j -RRB- with all the ` flows ' out of -LRB- i ; j -RRB- : It turns out that for all states -LRB- i ; j -RRB- ; j > in level i , we have all the values needed to compute ? i ; j , if we index through j from its highest possible value in state i downwards . Once these values are available , ? i ; 0 and ? fi are given in terms of each other and the other known values . This is a considerable simplification over using a general Gaussian elimination algorithm to solve -LRB- 9 -RRB- . The solution to the system of equations in -LRB- 11 -RRB- and -LRB- 12 -RRB- agrees with the results in -LSB- 6 -RSB- , when the window size is infinite . To see this , consider w > i ; i.e. , the window does not close at the ith level . Then iX j = 0 ? i ; j = 1 > = q : 2The individual components of ? are -LRB- ? -RRB- ; where = -LRB- i ; j -RRB- represent the states of the Markov process in Figure 6 . For the purposes of the matrix multiplication in -LRB- 9 -RRB- , ? is to be interpreted as a one dimensional vector , subscripted by the s . The expected time to transmit N packets is , therefore , E -LSB- Tgbn -LRB- N ; w = 1 ; p -RRB- -RSB- = N ? 1 > = q + p = q ? = N ? 1 > = + p = q ? 1 > = + 1 ?? ; -LRB- 13 -RRB- which was shown in -LSB- 6 -RSB- . 4.3 Proof of Quasi-Independence We begin this investigation with the solution to -LRB- 9 -RRB- for the Markov Chain in Figure 6 . For states -LRB- 0 ; 0 -RRB- and f0 we have : ? ? 0 ; 0 > = + ? f0 = ? 1 -LRB- 14 -RRB- and ? 0 ; 0 >=p ? ? f0 = -LRB- 15 -RRB- These may be obtained from Figure 6 by inspection . From -LRB- 14 -RRB- and -LRB- 15 -RRB- , ? 0 ; 0 = 1 > = q -LRB- 16 -RRB- and ? f0 = p = q : -LRB- 17 -RRB- For states -LRB- 1 , * -RRB- we have : > = q ? 0 ; 0 ? -LRB- > = + ? -RRB- ? 1 ; 1 = -LRB- 18 -RRB- ? f1 ? > = ? 1 ; 0 + ?? 1 ; 1 = -LRB- 19 -RRB- ? ? f1 + >=p -LRB- ? 1 ; 0 + ? 1 ; 1 -RRB- = -LRB- 20 -RRB- From -LRB- 16 -RRB- and -LRB- 18 -RRB- , we have ? 1 ; 1 = 1 > = + ? -LRB- 21 -RRB- and from -LRB- 19 -RRB- -LRB- 20 -RRB- and -LRB- 21 -RRB- , we have ? f1 = p = q ; and ? 1 ; 0 + ? 1 ; 1 = 1 > = q Proceeding this way , one may verify that as long as w > m ; i.e. , the window size is greater than the current row in Figure 6 , the following is true : m X j = 0 ? m ; j = 1 > = q ; and ? fm = >=p m X j = 0 ? m ; j = p = q We next investigate ? m ; j for different values of m for the cases p = and p > : Case p = ; m < w : m X j = 0 ? m ; j = m ? 1 X j = 0 ? m ? 1 ; j = 1 = > = -LRB- 22 -RRB- Proof : : Trivial . Case p = ; m > = w : w ? 1 X j = 1 -LRB- > = + ? -RRB- ? m ; j + ?? m ; w + > = ? m ; 0 = > = w ? 1 X j = 0 ? m ? 1 ; j + ? wX j = 1 ? m ; j -RRB- w ? 1 X j = 0 ? m ; j = w ? 1 X j = 0 ? m ? 1 ; j = 1 = > = -LRB- 23 -RRB- The last equality follows from taking m = w and -LRB- 22 -RRB- and then progressively increasing m : Case p > ; m < w : m ? 1 X j = 0 ? m ; j = m ? 1 X j = 0 ? m ? 1 ; j = 1 > = q -LRB- 24 -RRB- ? fm = >=p m X j = 0 ? m ; j = p = q -LRB- 25 -RRB- Case p > ; m > = w : w ? 1 X j = 1 -LRB- > = + ? -RRB- ? m ; j + ?? m ; w + > = ? m ; 0 = > = q w ? 1 X j = 0 ? m ? 1 ; j + ? wX j = 1 ? m ; j + ? fm -LRB- 26 -RRB- But ? fm = >=p w ? 1 X j = 0 ? m ; j -LRB- 27 -RRB- Putting this in -LRB- 26 -RRB- , taking it to the left hand side , and canceling out the > = q factor , we get w ? 1 X j = 0 ? m ; j = w ? 1 X j = 0 ? m ? 1 ; j = 1 > = q -LRB- 28 -RRB- As before , the last equality follows from taking m = w and -LRB- 24 -RRB- and then progressively increasing m : From -LRB- 27 -RRB- and -LRB- 28 -RRB- , we have ? fm = p = q : -LRB- 29 -RRB- Let us denote ? m ; j -LRB- p -RRB- and ? fm -LRB- p -RRB- as the values of ? m ; j and ? fm when the error probability is p : Then for p > ; we have from -LRB- 23 -RRB- and -LRB- 28 -RRB- , ? fm -LRB- p -RRB- + wX j = 0 ? m ; j -LRB- p -RRB- = 1 > = -LRB- 1 ? p -RRB- + ? m ; w -LRB- p -RRB- + p = q ; -LRB- 30 -RRB- ? fm -LRB- 0 -RRB- + wX j = 0 ? m ; j -LRB- 0 -RRB- = 1 > = + ? m ; w -LRB- 0 -RRB- : -LRB- 31 -RRB- Let the left hand side of -LRB- 30 -RRB- and -LRB- 31 -RRB- be denoted as Tm -LRB- p -RRB- and Tm -LRB- 0 -RRB- respectively . Then Tm -LRB- p -RRB- ? Tm -LRB- 0 -RRB- = p = q > = + -LRB- ? m ; w -LRB- p -RRB- ? ? m ; w -LRB- 0 -RRB- -RRB- + p = q = p q -LRB- 1 > = + 1 -RRB- + p ? 0m ; w -LRB- 0 -RRB- + o -LRB- p -RRB- = p q -LRB- 1 > = + 1 + q ? 0m ; w -LRB- 0 -RRB- -RRB- + o -LRB- p -RRB- : -LRB- 32 -RRB- Now , let SN -LRB- p -RRB- = PN ? 1 m = 0 Tm -LRB- p -RRB- : Then , summing over m in -LRB- 32 -RRB- , we get SN -LRB- p -RRB- ! SN -LRB- 0 -RRB- + N ? 1 X m = 0 p q ? 1 = > = + 1 = fl + q ? 0m ; w -LRB- 0 -RRB- ? ; -LRB- 33 -RRB- where ? 0m ; w -LRB- 0 -RRB- is defined as zero for m < w : In practice , the timeout 1 = fl will dominate over ? 0m ; w -LRB- 0 -RRB- and 1 = > = ; so the effect of the latter two is negligible on SN -LRB- p -RRB- : Notice also that SN -LRB- p -RRB- is equal to E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- : This analysis corroborates and extends the Petri Net analysis results presented earlier . We summarize the result in the following proposition : Proposition 1 The expected time to transmit N packets under go-back-n error recovery and window flow control when errors are independent is given by : E -LSB- Tgbn -LRB- N ; w ; p -RRB- -RSB- = SN -LRB- p -RRB- = SN -LRB- 0 -RRB- + N ? 1 X m = 0 p q ? 1 = > = + 1 = fl + q ? 0m ; w -LRB- 0 -RRB- ? + o -LRB- p -RRB- : 5 Proof of Quasi-Independence for Deterministic Times We show in this section that for deterministic transmission times and delays , sliding window flow control and go-back-n retransmission strategies are quasi-independent . In particular , we bound the possible error resulting from the use of an error free component and an error-relatedcomponent . Figure 7 -LRB- a -RRB- shows the timing diagram of a typical sequence of packet transmissions when there are no errors . All times shown have been normalized to a packet transmission time or a slot . We assume in the subsequent analysis that all times are integral multiples of a slot . Here N ; the total number of packets is 12 ; the window , w = 5 ; and roundtrip time , r is equal to the timeout , o = 6 . The total time to transmit 12 packets for this case is 20 slots . When roundtrip time , r < = w , the window does not close . Its performance , studied in -LSB- 6 -RSB- , was shown to obey the quasi-independence property -LRB- Equation -LRB- 3 -RRB- in Section 3 -RRB- . Here , we consider the case r > w , i.e. , when the window does close . The time to transmit N packets when there are no errors is now given by -LRB- see Figure 7 -LRB- a -RRB- -RRB- TnoErrors -LRB- N ; w ; r -RRB- = 8 < : dN = wer + N mod w ; if N mod w < > 0 ; -LRB- N = w -RRB- r + w ; otherwise : -LRB- 34 -RRB- Figure 7 -LRB- b -RRB- shows the timing diagram if Packet 2 is in error the first time it is transmitted , but the recovery is successful and all other packet transmissions are successful . We observe that it takes 26 slots which in this case is TnoErrors + o . This is in general true , except in special cases . For example , if Packet 3 were to be in error instead , the timing diagram will be as shown in Figure 7 -LRB- c -RRB- . We observe that the total time taken is now 25 slots instead of 26 : The reason for this difference is the dichotomy in -LRB- 34 -RRB- . When Packet 3 is in error , there are 10 remaining packets that need to be transmitted , and 10 mod w is zero -LRB- because the window size , w = 5 -RRB- . However , when Packet 2 is in error , there are 11 packets remaining at the beginning of the retransmission , and 11 mod w is not zero . In general , if the remaining number of packets are not exactly divisible by w , a cost of o is incurred as one would expect . However , if a packet error is at a point where the remaining number of packets is exactly divisible by w , the additional cost of the failure is o ? 1 instead of o . Therefore , for any sequence of k errors , Tgbn -LRB- N ; w ; r ; o ; k -RRB- ; the total time to transmit the N packets is bounded by TnoErrors -LRB- N ; w ; r -RRB- + k -LRB- o ? 1 -RRB- < = Tgbn -LRB- N ; w ; r ; o ; k -RRB- < = TnoErrors -LRB- N ; w ; r -RRB- + ko -LRB- 35 -RRB- Clearly , both limits can be reached . In -LSB- 6 -RSB- , it was shown that errors in the go-back-n protocol obeyed the negative binomial distribution : Pr -LSB- k errorsjN packets -RSB- = N + k ? 1 k ! pkqN -LRB- 36 -RRB- The expectation of this distribution is Np = q : Using this and -LRB- 34 -RRB- and -LRB- 35 -RRB- , we have E -LSB- TnoErrors -LRB- N ; w ; r -RRB- -RSB- + -LRB- Np = q -RRB- -LRB- o ? 1 -RRB- < = E -LSB- Tgbn -LRB- N ; w ; r ; o -RRB- -RSB- < = E -LSB- TnoErrors -LRB- N ; w ; r -RRB- -RSB- + -LRB- Np = q -RRB- o : -LRB- 37 -RRB- -LRB- 37 -RRB- bounds the error in the orthogonality hypothesis . For Np o 1 and o AE 1 ; it is reasonably accurate to address error control and flow control separately . 6 Concluding Remarks Go-back-n error recovery protocol and sliding-window flow control protocol are quasi-independent when packet errors are independent , and transmission times and delays in the system are either all exponentially distributed or all deterministic . Quasi-independence refers to the fact that the expected time to transmit an N-packet message can be approximately decomposed into sum of two separate components : one obtained by modeling window flow control in an error free channel , and the other obtained by modeling go-back-n in the absence of windows . 15 1 2 3 4 5 8 1211109876543 r = 6 time 10 51 1 2 76 9 10 20 1211 -LRB- a -RRB- No Errors . 1 X 2 retransmitted 1 5 10 15 20 25 12111098765432 1 2 3 4 5 6 2 3 4 5 6 7 8 9 10 11 12 r = 6 time t = 6 -LRB- b -RRB- Packet 2 is in error the first time it is transmitted . X 1 2 3 4 5 6 7 3 4 5 6 7 8 9 10 11 12 1 5 10 15 20 25 1 2 3 4 5 6 7 8 9 10 11 12 r = 6 3 retransmitted time t = 6 -LRB- c -RRB- Packet 3 is in error the first time . Figure 7 : Timing diagram of sliding window flow control with deterministic transmission times . Window size , w = 5 ; round-trip time , r = 6 ; per packet transmission time is 1 ; time to detect an error , o = 6 ; and total number of packets , N = 12 : Arrows pointing upwards indicate data transmission , arrows pointing downwards represent ACKs . -LRB- a -RRB- Case : No Errors . The time to transmit all packets and receive the acknowledgments is 20 : -LRB- b -RRB- Case : Packet 2 is in error . The time to transmit all packets successfully and receive ACKs is 26 ; which is equal to 20 + o : -LRB- c -RRB- Case : Packet 3 is in error . The time to transmit all packets successfully for this case is 25 ; not 26 : This is because at the beginning of retransmission of Packet 3 , the remaining number of packets is 10 ; and 10 mod w = : We observe that this causes one slot to be ` gained ' from 26 : 17 A similar straightforward result does not exist for selective repeat . This is because the cost per error in selective repeat is dependent on the window size even for independent packet errors . If the window is large enough to be always open for example , the cost of each error is the time to retransmit an erroneous packet . However , if the window were to close , the cost is a function of the packet in the window that was in error , the window size and the round-trip delay . It is possible to analyze this protocol with windows . However , no simple approximation corresponding to that of go-back-n is known . A question has been asked as to whether the result generalizes for rate-based flow control strategies . Since there is no unique rate based flow control strategy , it is a difficult question to answer . If transmission rates are dependent on congestion , then most likely , so are packet errors , in which case the quasi-independence will almost certainly not hold . -LRB- For example , see numerical examples for go-back-n with congestion-dependent errors in -LSB- 7 -RSB- . -RRB- However , if packet errors , transmission times and other system delays were independent , generally distributed random variables , and there were no windows , then -LRB- 3 -RRB- will hold -LSB- 6 , Section 6 -RSB- . We do not expect these assumptions to hold in practice for systems with rate based flow control . 7 Acknowledgments We wish to thank Larry Landweber and John Strikwerda for many stimulating discussions . References -LSB- 1 -RSB- Blake , J.T. , A.L. Reibman and K.S. Trivedi , \ Sensitivity Analysis of Reliability and Performability Measures for Multiprocessor Systems , '' Proceedings of the ACM Sigmetrics 1988 , pp 177-186 . -LSB- 2 -RSB- Fendick , K. , and M. Rodriguez , \ An adaptive framework for dynamic access to bandwidth at high speeds , '' Proc . of the ACM Sigcomm , San Francisco , pp 127-136 , August 1993 . -LSB- 3 -RSB- Konheim , A.G. , \ A Queueing Analysis of Two ARQ Protocols , '' IEEE Trans . Commun. , vol . COM-28 , pp 1004-1014 , July 1980 . -LSB- 4 -RSB- Marsan , A. , M.G. Balbo , and G. Conte , \ A Class of Generalized Stochastic Petri Nets , '' ACM Trans . on Computer Systems , vol 2 , May 1984 , pp 93-122 . -LSB- 5 -RSB- Mitra , D. , \ Asymptotically optimal design of congestion control for high speed data networks , '' IEEE Trans . Commun. , pp. 301-311 , February 1992 . -LSB- 6 -RSB- Mukherjee , A. , L.H. Landweber and J.C. Strikwerda , \ Evaluation of retransmission strategies in a local area network environment , '' Proc . ACM Sigmetrics/Performance , Berkeley , 1989 . -LSB- 7 -RSB- Mukherjee , A. , L.H. Landweber and J.C. Strikwerda , \ Simultaneous analysis of flow and error control strategies with Congestion-Dependent Errors , '' Proc . ACM Sigmetrics , Boulder , 1990 . -LSB- 8 -RSB- Mukherjee , A. and J.C. Strikwerda , \ Analysis of dynamic congestion control protocols | a Fokker-Planck approximation , '' Proc . ACM Sigcomm , Zurich , pp. 159-169 , September 1991 . -LSB- 9 -RSB- Tanenbaum , A.S. , Computer Networks , Prentice-Hall Inc. , Englewood Cliffs , NJ 07632 , 1988 . -LSB- 10 -RSB- Towsley , D. and J.K. Wolf , \ On the Statistical Analysis of Queue Lengths and Waiting Times for Statistical Multiplexors with ARQ Retransmission Schemes , '' IEEE Trans . Commun. , vol COM-27 , pp 693-702 , April 1979 . -LSB- 11 -RSB- Zwaenepoel , W. , \ Protocols for Large Data Transfers on Local Networks , Proc . of the ACM Sigcomm , pp 22-32 , 1985 .

O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O