public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] netem: allow using seeded PRNG for loss and corruption events
@ 2023-08-14  2:31 Francois Michel
  2023-08-14  2:31 ` [PATCH net-next 1/3] [PATCH 1/3] netem: add prng attribute to netem_sched_data Francois Michel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Francois Michel @ 2023-08-14  2:31 UTC (permalink / raw)
  Cc: Francois Michel, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	Stephen Hemminger, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

From: François Michel <francois.michel@uclouvain.be>

In order to reproduce bugs or performance evaluation of
network protocols and applications, it is useful to have
reproducible test suites and tools. This patch adds
a way to specify a PRNG seed for generating netem
loss and corruption events. Initializing the qdisc
with the same seed leads to the exact same loss
and corruption patterns. If no seed is specified, the 
qdisc adopts the classical behaviour, i.e. using the
unseeded get_random_u32() for generating these events.

This patch can be and has been tested using tc from
the following iproute2-next fork:
git@github.com:francoismichel/iproute2-next.git

For instance, setting the seed 42424242 on the loopback
with a loss rate of 10% will systematically drop the 5th,
12th and 24th packet when sending 25 packets.

François Michel (3):
  netem: add prng attribute to netem_sched_data
  netem: allow using a seeded PRNG for generating random losses
  netem: allow using seeded PRNG for correlated loss events

 include/uapi/linux/pkt_sched.h |  1 +
 net/sched/sch_netem.c          | 62 ++++++++++++++++++++++++++--------
 2 files changed, 48 insertions(+), 15 deletions(-)


base-commit: f614a29d6ca6962139b0eb36b985e3dda80258a6
-- 
2.41.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-14 21:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14  2:31 [PATCH net-next 0/3] netem: allow using seeded PRNG for loss and corruption events Francois Michel
2023-08-14  2:31 ` [PATCH net-next 1/3] [PATCH 1/3] netem: add prng attribute to netem_sched_data Francois Michel
2023-08-14  2:31 ` [PATCH net-next 2/3] [PATCH 2/3] netem: allow using a seeded PRNG for generating random losses Francois Michel
2023-08-14 15:49   ` Stephen Hemminger
2023-08-14 20:14     ` François Michel
2023-08-14 21:01       ` Stephen Hemminger
2023-08-14  2:31 ` [PATCH net-next 3/3] [PATCH 3/3] netem: allow using seeded PRNG for correlated loss events Francois Michel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox