Modelling TCP with Markov chains Keith Briggs Keith.Briggs@bt.com more.btexact.com/people/briggsk2/ 2002 June 17 typeset in L A T E X2e on a linux system Modelling TCP p.1/30
Outline Markov chain basics Mini-TCP toy model Markov chain perturbations Results for mini-tcp NewReno analysis Modelling TCP p.2/30
Aims To build accurate models of various TCP algorithms To analyze them and compare mean behaviour such as throughput To study short-term behaviour (transient response) To generalize to non-markovian dynamics To design new TCPs for multicast, wireless etc. Software tool for easy analysis of modified algorithms? Modelling TCP p.3/30
TCP Sits between IP layer and applications Provides rate control and reliable transmission Full duplex Adjusts send rate to adapt to congestion and receiver buffer Adjust rate seeing only ACKs from receiver Modelling TCP p.4/30
TCP history BSD early 1980s Jacobson 1988 (old)tahoe, (new)reno, Westwood, MSWin (proprietary), Linux from BSD bugs? Modelling TCP p.5/30
TCP terminology segment (packet): 20 byte header, up to 64K bytes data window: continuous burst of segments timeout: indicates lost packet congestion window: current estimate of maximum window size to avoid congestion threshold: crossover point between slow-start (exponential) phase and congestion-avoidance phase Modelling TCP p.6/30
TCP segment header source destination sequence number acknowledgement number flags window size checksum urgent options data Modelling TCP p.7/30
Markov chain terminology 1 States : matrix of transition probabilities : positive, stochastic matrix Modelling TCP p.8/30
Markov chain terminology 2 Stationary distribution : Normalization: Fundamental matrix: To compute : find 1d kernel (rank( )=, e.g. by LU) of or iterate Modelling TCP p.9/30
! My idea: and therefore everything else depends on a loss probability, so do all calculations in computer algebra as power series in (Even the iteration!) Modelling TCP p.10/30
mini-tcp 1 Toy model to explain Markov chain method: Window if packet lost else Modelling TCP p.11/30
mini-tcp 2 (with, loss probability=, ) Modelling TCP p.12/30
mini-tcp 3 My software computes: Modelling TCP p.13/30
mini-tcp 4 My software computes: Expectation value of window size: Compare exact formula: Modelling TCP p.14/30
mini-tcp 5 4.0 3.5 3.0 E[w] 2.5 2.0 1.5 0.0 0.1 0.2 0.3 0.4 0.5 p Expected window size: exact, series, simulation *. Modelling TCP p.15/30
Sparsity 1 Do not store matrix; just compute elements as needed becomes a function Modelling TCP p.16/30
Rate of change of Recall fundamental matrix: Define group inverse of to be Then Thus can compute all required quantities Modelling TCP p.17/30
Markov chain perturbation theory 1 changed?, how is stationary distribution Entrywise: Modelling TCP p.18/30
Markov chain perturbation theory 2 tr Modelling TCP p.19/30
Example of computation of is dense! E.g. row 0: Can avoid density in practice by computing products Modelling TCP p.20/30
Example of computation of For mini-tcp: derivative of wrt : Modelling TCP p.21/30
NewReno TCP 1 State variables: second round round was : window size : first of two rounds; : lost packets in previous : backoff factor in previous Modelling TCP p.22/30
NewReno TCP 2 No packets lost: Modelling TCP p.23/30
NewReno TCP 3 One or more packets lost: Modelling TCP p.24/30
NewReno TCP 4 Exponential backoff (for ): Modelling TCP p.25/30
Sparsity 2 With, this gives 71 allowed states out of a possible states, giving a sparsity of about 5% Modelling TCP p.26/30
NewReno TCP 5 - typical output Modelling TCP p.27/30
Mean first passage time Let be the matrix whose element is the mean time for first transition from state to state. Then diag diag Mini-TCP: Modelling TCP p.28/30
Conclusion Can now analyze more-or-less automatically any TCP version Try new algorithms specialized for multicast or peer-to-peer? Modelling TCP p.29/30
References S L Campbell and C D Meyer, Generalized inverses of linear transformations, Dover 1991. J Padhye et al., A stochastic model of TCP Reno congestion avoidance and control, University of Massachusetts. CMPSCI Technical report 99-02. Modelling TCP p.30/30