Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tel Hai Academic College Department of Computer Science Prof. Reuven Aviv Markov Models for data flow In Computer Networks Resource: Fayez Gebali, Analysis.

Similar presentations


Presentation on theme: "Tel Hai Academic College Department of Computer Science Prof. Reuven Aviv Markov Models for data flow In Computer Networks Resource: Fayez Gebali, Analysis."— Presentation transcript:

1 Tel Hai Academic College Department of Computer Science Prof. Reuven Aviv Markov Models for data flow In Computer Networks Resource: Fayez Gebali, Analysis of Computer and Communication Networks

2 Contents Leaky Bucket Model Token Bucket Model Virtual Scheduling Model

3 Traffic Shaping Needs to control shape of traffic into a network (routers)  a. Volume of input data to a net in a specified period  b. Max rate at which the traffic is sent (rate limiting). Two Methods Leaky bucket  Impose a hard limit on data transmission rate Token bucket  Controlling volume of traffic  Impose a limit on average data transmission rate, but allows a certain amount of burstiness

4 Leaky Bucket Computer-Router Connection Data traffic non-uniform, has burstiness. Computer uses a leaky buffer to control rate of departure If input data rate a less than specified b  leaky bucket transmits data same rate a Else Leaky Bucket buffers data  transmits it at average rate equal to specified b If the buffer is full then excess data is discarded.

5 Leaky Bucket Algorithm: Limiting Rate Specified rate b is 1 packet per 3 time units Packets 3-7 arrive at higher rates, buffered,  transmitted at b rate If buffer size is 3, when 10 arrives buffer is full (with 7-9)

6 Leaky Buffer (LB) at work Data rate at the input is indicated by the grey areas Data rate at the output is indicated by the black lines Average input data rate from source to LB: in Average output rate: out if LB non-empty out = b ; if empty out = min( in, b ) A Queuing model M/M/1/B  With state dependent departure probability

7 Leaky Bucket: Arrival Process (Bernoulli) One packet arrives, at the most, during Timestep  a: Probability of arrival of 1 packet/Timestep also average number of arriving packets/Timestep a : average arrivals rate (bps) T: Timestep (sec) A: Packet size (bits) a = a*A/T a  a T/A) what should we choose for T?

8 Leaky Bucket: Choice of Time step l Line Rate (sometimes called Line bandwidth)  Max possible input rate, in bps Continuous train of bits  1/  l bit Transmission time Time step T = packet transmission time = A/  l (Sec)  a = ( a / l )  Note: Leaky bucket bound rate b is smaller: b < l

9 Leaky Bucket: Departure process c: probability of departure of a packet during time step  also average number of packets departing in a time step If buffer empty and in < b c = 1 Else (packets queued, then depart)  Bernoulli Departure process (Departure/No Departure)  Average rate of departure out = b bps/sec  Average rate of departures per time step: c = ( b T)/A = b / l packets/Timesteps State dependent departure probability c = b / l or c =1

10 M/M/1/B Model for Leaky Bucket States: Packets in Bucket Parameters: a = a / 1 c: if buffer empty, c=1 else c = b / l B bucket size Steady state probabilities Ps = s s={s 0, s 1, s 2, …s B }

11 Max Burst, and Bucket Size Data is a mix of regular data and bursts (packet train) a = p* reg + (1-p)  p is the mix parameter  Burst data rate  (packets/sec) Typically  > b and  > reg (but of course  lin ) Assume we allow bursts up to T B sec long Number of packets in max burst:  T B  Packets beyond that bound should be discarded Design Bucket size B =  T B (packets) Bucket holds one max burst

12 M/M/1/B Model for Leaky Bucket: Performance From the M/M/1/B analysis we have:  Throughput: Th = c(1-bs 0 ) (packets per timestep)  Loss rate = s B ad (packets per timestep)  Packet Loss Probability: L = s B ad/ a  Average Queue size: Q a =  k ks k  Average Wait time in the Leaky Buffer:  W = Q a /Th in timesteps In addition: Max burst length (in sec): T B = B/ 

13 Numerical Example (Gebali): Parameters reg = 1; b = 1.5;  = 4; l = 50 Mbps; All in Mbps assume that 70% of actual input rate are from bursts  Average input rate  a = 1*0.3 + 4*0.7 = 3.1 Mbps B = 5 packets Average packet size: A = 400 bits

14 Numerical Example (Gebali) – Results Arrival probability: a = a /  l = 0.062  b = 1-a Departure probability: c = b /  l = 0.03  d = 1-c The steady state probability vector  s = [0.0121 0.0258 0.0551 0.1177 0.2516 0.5377] t s 5 = 0.5377 probability of LB to be in state 5 (full)  53.77% of the time the LB is full (drops packets) Timestep: T = 200  sec Max Burst length 500  sec

15 Numerical Example (Gebali) – cont’d Throughput: Th = 0.0297 packets/timestep Loss rate: Na(lost) = 0.0323 packets/timestep Loss probability: L = 1.0432*10 -8 Q a = 4.1843 packets W = 141.0713 timesteps

16 Token Bucket Algorithm

17 Token Bucket (Buffer) Algorithm Credit-based algorithm: Controls the volume of traffic arriving from a source. Tokens (credits) issued continuously, fixed rate t into a Token Bucket (TB). If Bucket is full, tokens thrown away Packets arrive to a router, variable rate, average a For each admitted packet, a token is removed from the TB Packets for which no token exist:  a portion is buffered in a Packet Buffer (PB) waiting until enough tokens arrive to the Token Bucket  excess packets discarded, or tagged as non-conforming

18 Token Bucket Algorithm Token rate t : 1 per 3 timesteps Packets 4-8 arrive at rate higher than t. 4, 5 pass automatically because tokens available. 6, 7 arrive when TB empty. They wait in PB

19 Data and Token Rates Grey area: Data arrival rate at the input of the router Black lines: output rate – enter into router Dotted line: Token rate Bursts: Output rate exceeds token rate for short time  Bigger Token Buffer allows for longer bursts

20 M/M/1/B Model: States of the system State: a pair (occupancy of TB, occupancy of PB) Case 1: Packet Buffer is empty (all packets admitted)  Token buffer can be in any state  B t+1 states of Token Buffer 0, 1, 2, … B t Packet Buffer not empty (some packets were not admitted)  This is when Token Bucket is empty  B p states of Packet Buffer: 1, 2, …B p +1 Altogether B p + B t +1 states

21 Example: B t = 4 B p = 3 If TB increases or decreases occupancy, PB is empty, and stays empty  if packet arrives it departs immediately If PB increases occupancy, TB becomes or stays empty

22 Model basic parameters (1) Source regular data rate: reg bps Source burst rate:  bps  Average data rate: a = p* reg + (1-p)  in  Mbps Token generation (arrival) rate (fixed) t in bps/Sec   > t > a At a time step, a max of 1 token can arrive at the TB  Probability Token arrival in a timestep: a = t / l ;  Probability non-arrival of token in timestep: b = 1-a

23 Model basic parameters (2) At a time step, a max of 1 token can leaves the TB.  Probability token leaves in a timestep: c  Probability no token leaves in a timestep: d = 1-c Note: Token leaves means that a packet arrives ( and departs)  Hence Probability packet arrives also c  c also average number of packet arrivals in timestep c = a / l  Probability no packet arrives in timestep: d = 1- c

24 TB Occupancy states transition probabilities Probability that TB stays at same occupancy: ac+bd  Token arrives, packet arrive and leaves OR no token arrives and no packet arrives Probability that TB increases its occupancy by 1: ad  Token arrives but no packet arrives Probability that TB decreases its occupancy by 1: bc  No token arrives but one packet arrived (and departs, so one token departs)

25 PB Occupancy states transition probabilities Probability that PB stays at same occupancy: ac+bd  Token arrives, packet arrive and leaves OR no token arrives and no packet arrives Probability that PB increases its occupancy by 1: bc  No Token arrives but one packet arrives (not admitted, stays in the packet buffer) Probability that PB decreases its occupancy by 1: ad  One token arrives but no packet arrived

26 Example State Transition Graph (B t = 4, B p =3)

27 The Transition Probability Matrix (B t + B p +1) X (B t + B p +1) matrix

28 Token Bucket Performance: M/M/1/B Model (1) Throughput Th: average num of packet/timsetep got through  Calculate probabilities s i of all states, multiply each by probability that a packet leaves  Easier method: Consider lost packets  Probability packet lost: arrives, no token arrives, PB full b*c*s B t +B p +1  Average num of packet lost in timestep: Na(Lost) = Pr(packet lost) = b*c*s B t +B p +1  Average Num of arriving packets in timestep: Na(in) = c  Th = Na(in) – Na(lost) = c(1 - b*s B t +B p +1 )

29 Token Bucket Performance: M/M/1/B Model (2) Loss probability:  L = Na(lost)/Na(in)  L = b*c*s B t +B p +1 /c = b*s B t +B p +1 Efficiency:  = Th/Na(in) = 1-L = 1 - b*s B t +B p +1

30 Average Queues Lengths States s k, k = 2 to 5  k-1 tokens States s k, k = 6 to 8  k -5 packets Average numbers of tokens, packets Q t =  k ks k+1 k runs from 1 to B t Q p =  k ks k+B t + 1 k runs from 1 to B p  W = Q p /Th

31 Numerical Example (Gebali): Model Parameters Average regular input rate: reg = 10 Mbps Max Burst rate:  = 50Mbps  Assume that 40% of actual input rate are from bursts a = 0.6*10 + 0.4*50 = 26 Mbps Token rate: t = 15 Mbps Line rate: l = 100 Mbps Token Buffer size: B t = 2 packets Packet Buffer size: B p = 3 packets Packet size A = 400 bits

32 Numerical Example: Results (1) Token departure probability: c = a / l = 0.26 Transition Probability Matrix ( State probabilities at equilibrium: s = [0.0641 0.0322 0.0162 0.1276 0.2541 0.5059] t  50.59% of the time packet buffer is full!

33 Numerical Example: Results (2) Rate of Packet arrivals:  Na(in) = c = 0.26 packet/timestep Rate of Packet lost:  Na(lost) = b*c*s B t +B p +1 = 0.1118 packets/timestep Throughput: Th = Na(in) – Na(lost) = 0.1482 packets/timestep Efficiency:  = 0.57 Average length of the queue in the Packet Buffer:  Q a = 2.1533 Average wait time in the queue in the packet buffer  W = 14.5284 timesteps

34 Numerical Example: Results (3) What happens if we double the size of the TB or the PB Performance (e.g. throughput) improved by some amount Doubling the Packet Buffer doubles the delay without too much improvement in throughput compared with doubling the token Buffer Size 

35 Virtual Scheduling Algorithm Used in ATM switches Flow of Cells (53 Bytes each) arrive from host to switch  Purpose: identify whether the flow conforms to agreed limits of cells arrival rate Upon arrival of cell, VS algorithm calculates the Theoretical Arrival Time (TAT) of the next cell:  TAT = 1/ a  a : expected agreed average data rate (cells/sec) Cells arrive later “conform” to the agreement Cells arrive earlier by  or more are “non conforming”  t < TAT –  non-conforming cells

36 Virtual Scheduling

37 Conforming and Non-conforming arrivals Conforming conforming Non conforming non conforming cells beyond some limit are discarded

38 Virtual Scheduling: M/M/1/B Model A “non conformance penalty counter” CTR Event t < TAT –D (“non-conforming” cell):  penalty  Probability c, CTR++ Event t > TAT (“conforming” cell):  credit  Probability a, CTR-- Event: TAT –  ≤ t ≤ TAT (conforming cell): Probability b, No credit or penalty, CTR unchanged a + b + c = 1 State: value of CTR (Number of “net penalties”) Each event: State transition CTR ≤ B; non-conforming cells when CTR = B dropped

39 M/M/1/B Model: State Transition Diagram B=5 State 0: Packet arrives, defined non-conforming, Prob. c, CTR++  No arrival, Prob. 1-c, CTR stays 0 Same as Token Packet Diagram, with Token Buffer size 1

40 M/M/1/B Model: State Transition Diagram State 5 (max): Conforming Packet arrives, credit: Prob. a, CTR—  Either Conforming packet arrives, no credit, OR  Non conforming packet arrives,  Probability 1-a, CTR unchanged States k = 1,2,3,4  “non-conforming” cell: Probability c, CTR++  “conforming, with credit” cell : Probability a, CTR--  “Conforming, no credit” cell: Probability b CTR unchanged

41 Transition Matrix Result: state probabilities in equilibrium s = [s 0, s1, s 2, … s B ]

42 Performance Model parameters: a (Cells/sec), a, b, c, B dropped packet: Non-conforming packet & CTR = B  Probability L = c*s B Average rate of dropped packets Na(lost) = L a (Cells/Sec Efficiency (also called probability of acceptance):  p a =  = 1 - L = 1-c*s B Throughput: Th = a *p a = (1-c*s B )* a (Cells/sec) Note: Cells in a burst are all non-conforming  Max Burst size = B

43 Numerical example (1) a = 150Mbps cell size = 424 bits  a = 150*10 6 /424 cells/sec = 0.354*10 6 cells/sec a = 0.2, b = 0.5, c = 0.3, B = 5 s = [0.0481 0.0722 0.1081 0.1624 0.2436] t L = 0.1096 Na(lost) = 16.44*10 6 cells/sec P a = 0.8904 Th = 133.5564 cells/sec

44 Numerical example (2) What happens if B = 2 instead of 5? Reduced penalty counter means that more lost cells, decreased efficiency and throughput


Download ppt "Tel Hai Academic College Department of Computer Science Prof. Reuven Aviv Markov Models for data flow In Computer Networks Resource: Fayez Gebali, Analysis."

Similar presentations


Ads by Google