Skip to content

Commit

Permalink
netem: markov loss model transition fix
Browse files Browse the repository at this point in the history
The transition from markov state "3 => lost packets within a burst
period" to "1 => successfully transmitted packets within a gap period"
has no *additional* loss event. The loss already happen for transition
from 1 -> 3, this additional loss will make things go wild.

E.g. transition probabilities:

p13:   10%
p31:  100%

Expected:

Ploss = p13 / (p13 + p31)
Ploss = ~9.09%

... but it isn't. Even worse: we get a double loss - each time.
So simple don't return true to indicate loss, rather break and return
false.

Signed-off-by: Hagen Paul Pfeifer <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Stefano Salsano <[email protected]>
Cc: Fabio Ludovici <[email protected]>
Signed-off-by: Hagen Paul Pfeifer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
hgn authored and davem330 committed Oct 25, 2013
1 parent b45bd46 commit 4a3ad7b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ static bool loss_4state(struct netem_sched_data *q)
clg->state = 2;
else if (clg->a3 < rnd && rnd < clg->a2 + clg->a3) {
clg->state = 1;
return true;
} else if (clg->a2 + clg->a3 < rnd) {
clg->state = 3;
return true;
Expand Down

0 comments on commit 4a3ad7b

Please sign in to comment.