OSDN Git Service

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)
commit836af83b54e3e285c4a0cc06c24aeb737d3e0e18
tree3a8edeabfa792dfacb6e4996be69c206ae20f857
parent99803171ef04037092bf5eb29ae801e8b4d49a75
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