From 9d9bbea98e725fdf0bb5590f19b3b6f70067e627 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Wed, 27 Nov 2019 19:22:07 +0100 Subject: [PATCH] policing BEFORE shaping --- src/mpLinkCharacteristics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mpLinkCharacteristics.py b/src/mpLinkCharacteristics.py index 1d51063..6228301 100644 --- a/src/mpLinkCharacteristics.py +++ b/src/mpLinkCharacteristics.py @@ -53,11 +53,11 @@ class MpLinkCharacteristics: for n in self.netemAt: cmd = cmd + "sleep " + str(n.delta) cmd = cmd + " && tc qdisc del dev " + ifname + " root " - cmd = cmd + " && tc qdisc add dev {} root handle 5:0 tbf rate {}mbit burst {} latency {}ms".format(ifname, self.bandwidth, 1500 * int(self.queueSize), self.queuingDelay) - cmd = cmd + " && tc qdisc add dev {} handle ffff: ingress".format(ifname) - cmd = cmd + " && tc filter add dev {} parent ffff: u32 match u32 0 0 police rate {}mbit burst {} drop".format(ifname, self.bandwidth, int(self.queueSize) * 1500) + cmd = cmd + " && tc filter add dev {} root handle 5:0 u32 match u32 0 0 police rate {}mbit burst {} drop".format(ifname, self.bandwidth, int(self.queueSize) * 1500) + cmd = cmd + " && tc qdisc add dev {} parent 5:0 handle 5:1 tbf rate {}mbit burst 15000 latency {}ms".format(ifname, self.bandwidth, self.queuingDelay) + # cmd = cmd + " && tc qdisc add dev {} handle ffff: ingress".format(ifname) - cmd = cmd + " && tc qdisc add dev {} parent 5:0 handle 10: netem {} delay {}ms limit 1000000 &&".format(ifname, n.cmd, self.delay) + cmd = cmd + " && tc qdisc add dev {} parent 5:1 handle 10: netem {} delay {}ms limit 1000000 &&".format(ifname, n.cmd, self.delay) cmd = cmd + " true &" return cmd