]> git.baikalelectronics.ru Git - kernel.git/commit
netem: support delivering packets in delayed time slots
authorDave Taht <dave.taht@gmail.com>
Wed, 8 Nov 2017 23:12:28 +0000 (15:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Nov 2017 01:15:47 +0000 (10:15 +0900)
commitaed0aade5dcc8d210426647e76fa191b831e9db7
tree3a8edeabfa792dfacb6e4996be69c206ae20f857
parentceb20df43f3b941a5007a2d907e14d4f4aacca7b
netem: support delivering packets in delayed time slots

Slotting is a crude approximation of the behaviors of shared media such
as cable, wifi, and LTE, which gather up a bunch of packets within a
varying delay window and deliver them, relative to that, nearly all at
once.

It works within the existing loss, duplication, jitter and delay
parameters of netem. Some amount of inherent latency must be specified,
regardless.

The new "slot" parameter specifies a minimum and maximum delay between
transmission attempts.

The "bytes" and "packets" parameters can be used to limit the amount of
information transferred per slot.

Examples of use:

tc qdisc add dev eth0 root netem delay 200us \
         slot 800us 10ms bytes 64k packets 42

A more correct example, using stacked netem instances and a packet limit
to emulate a tail drop wifi queue with slots and variable packet
delivery, with a 200Mbit isochronous underlying rate, and 20ms path
delay:

tc qdisc add dev eth0 root handle 1: netem delay 20ms rate 200mbit \
         limit 10000
tc qdisc add dev eth0 parent 1:1 handle 10:1 netem delay 200us \
         slot 800us 10ms bytes 64k packets 42 limit 512

Signed-off-by: Dave Taht <dave.taht@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/pkt_sched.h
net/sched/sch_netem.c