2

Hello I'm trying to limiting the bandwidth on my iperf udp test (iperf -u). I use tc qdisc and class to make some assured rate and ceiling rate for it. However, I don't know what filter I should use to limit the UDP performance? I tried several matching criteria like:

$ sudo tc filter add dev $DEV parent 1: prio 1 u32 match ip src 10.0.0.1 match ip protocol 17 0xffff flowid 1:20
$ sudo tc filter add dev $DEV parent 1: prio 1 u32 match ip src 10.0.0.1 match ip protocol 17 0xff flowid 1:20
$ sudo tc filter add dev $DEV parent 1: prio 1 u32 match udp src 10.0.0.1 flowid 1:20

But none of them work. I tried many times but it seems the UDP iperf (iperf -s -u and iperf -c -u ip) result stays the same which is 1.05 Mbps.

Does anyone know how to filter the UDP the right way?

  • If you are using SNAT on this machine, the matching is done after SNAT and thus the rule never see 10.0.0.1. – Fabrice Avaux Jan 6 '15 at 15:49
1

tc-filter shapes traffic of sent control packets and can not control received packets. So, when you use udp, iperf doesn't need a reply, the speeds stays the same. When you use tcp, iperf needs an ack, so it works... I guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.