This post will explain how to do traffic shaping with openwrt. It’s using a script which you can easily customize to your own needs.
What is traffic shaping?
Traffic shaping is slowing down certain packets.
Why slowing packets down? I want to go as fast as possible!
On a typical network you have different types of traffic f.e.
- web browsing
- smtp traffic for sending/receiving emails
Some types af traffic require a lot of bandwidth. Other types of traffic require a small amount of bandwidth but require a low latency. By shaping certain traffic you can create room for other traffic. Without shaping, your openwrt internet router would behave like a brainless fifo queue. With a correctly configured traffic shaper, your openwrt internet router will intelligently prioritize packets based on a number of criteria.
Why shaping traffic?
I started doing traffic shaping because I noticed problems with call quality using voip phones. I’m using Siemens Gigaset C610 IP. These call quality problems happened during whenever backups where sent to a cloud provider. While it’s important to take regular backups, I didn’t want those backups to have an influence on my voip traffic. At all times, the voip traffic needs a higher priority then backups.
Howto to start traffic shaping with OpenWRT?
In order to start traffic shaping with OpenWRT, you have to install some packages.
Install required packages
# opkg update # opkg install tc kmod-sched
Run script at boot time
Add this line to /etc/rc.local . Make sure you insert the line before the ‘exit 0’.
In a future post I’ll show what I gained with traffic shaping with openwrt.
Traffic shaper benchmark
Update on 2013/05/03 : added kmod-sched to the list of packages to install
Update on 2013/05/08 : added link to benchmark post.