Limit rate of outgoing UDP packets per second

11,334

Solution 1

You have a couple of options. iptables and traffic shaping. For iptables, check out the how-to. In the Filtering Specifications section there is an example of using the Limit Extension to limit traffic.

The other option is traffic shaping, which can be (is?) complicated. Take a look at the Linux Advanced Routing & Traffic Control HOWTO for an introduction, in particular chapter 9.

Another option is to tune TeamSpeak. Try changing the codec used to one that is of a lower quality. I believe the TeamSpeak client has bandwidth limiting options. See if the server does too.

Solution 2

Thank you for you reply!

I ended up with this iptables code:

/sbin/iptables -A OUTPUT -p udp -m state --state NEW -j ACCEPT
/sbin/iptables -A OUTPUT -p udp -m limit --limit 10000/s -j ACCEPT
/sbin/iptables -A OUTPUT -p udp -j DROP

The maximum packet count in the limit module seems to be 10.000 pps.
Unfortunately to low for my needs.

I am going to check chapter 9 of the Linux HOWTO. Maybe i can handle it with traffic shaping.
If anybody knows another way it could work please let me know it.

Share:
11,334
Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    since Teamspeak version 3 sends lots of packets per user and our provider is getting problems with his infrastructure above 20.000 packets per second we have to limit it that our servers are not going to be shut down.

    Red a lot about iptables but was not able to find the right rules. Could you give me an advise how to manage that the server is not going to send more than 19k packets per seconds?

    We are running on debian 4

    Thanks in Advance
    Tim