LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Thread Tools Search this Thread
Old 02-27-2008, 06:52 AM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Distribution: Suse , Fedora, CentOS, Mandrake, Solaris 8-10, Ubuntu, Debian
Posts: 1,527
Thanked: 0
IPTABLES and QOS


[Log in to get rid of this advertisement]
Can anyone point me in the right direction for setting up QOS and prioritization of packets. I have a small office with VOIP appliances and wanted to know the correct way to approach QOS for the VOIP phones and data thanks
metallica1973 is offline     Reply With Quote
Old 02-28-2008, 12:53 AM   #2
fmyhr
LQ Newbie
 
Registered: Feb 2008
Distribution: debian, mepis, kubuntu
Posts: 11
Thanked: 0
Hi,

I've played with this in the past. With real-time data streams like VOIP it's all about latency (and jitter - variations in latency). If you can't deliver your VOIP packet within x ms, you might as well drop it, it's useless.

Some tips:

If your uplink is relatively slow (like ADSL), choose an MTU smaller than default 1500 to limit jitter. Figure jitter = time to send largest possible packet. (Large data packet "getting in the way" of your VOIP stream.) In my case, jitter of around 20ms seemed ok, I ended up using MTU 736 to achieve this. (For DSL there are "magic" MTU's that give best efficiency, 736 was one such for me.)

Use a tbf at the root of your egress queue that limits the rate to slightly less than your unmanaged upload speed. This is so that your linux machine, rather than any buffer in your uplink device, controls the queue. Use a small bucket size to limit jitter (think jitter = time to send full bucket). In case you had to use small MTU in previous step, the bucket size will ideally be MTU size. Small buckets lead to problems with metering--new tokens are available only once (I think) each "jiffie". Newer kernels allow you to set HZ to 1000, this helps.

Inside your tbf use a prio that gives VOIP packets priority over data packets.

Inside the prio for VOIP, use another tbf to limit max bandwidth that all your VOIP calls can use. Use a smaller rate than in your root tbf. This ensures that you'll always be able to get SOME data out. Use a high enough rate to accommodate the bandwidth of the maximum number of simultaneous VOIP calls you expect. Hopefully you'll have enough upload bandwidth to go around.

Inside the prio for data, use whatever queuing you like for data packets. I like hfsc here.

Instead of the above scheme, you could try using hfsc at the root of the queue and specify realtime bandwidth for your VOIP data. That's how I started but ran into some problems. Those problems could have been caused by my own ignorance though, as I was just starting with QoS. I haven't gone back to try the hfsc at root again. It does seem more elegant than the scheme above. Please let me know if you try it and it works :-)

In case you need some references for QoS:
http://www.tldp.org/HOWTO/html_singl...Control-HOWTO/
http://edseek.com/~jasonb/articles/t...ing/index.html
http://www.opalsoft.net/qos/DS.htm
http://lartc.org/howto/
http://linux-ip.net/articles/hfsc.en/

Have fun!
Frank
fmyhr is offline     Reply With Quote
Old 02-28-2008, 05:07 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Distribution: Suse , Fedora, CentOS, Mandrake, Solaris 8-10, Ubuntu, Debian
Posts: 1,527
Thanked: 0

Original Poster
Wow, my brain is on fire. It will take a bit for me to get this stuff but do you have any IPTABLES/firewall examples of these examples by chance?

Last edited by metallica1973; 02-28-2008 at 05:26 PM..
metallica1973 is offline     Reply With Quote
Old 02-28-2008, 06:03 PM   #4
Deleriux
Member
 
Registered: Nov 2003
Posts: 89
Thanked: 0
Personally I use the hbf but its the same kind of thing on a classful qdisc.

For iptables you can use the CLASSIFY target to drop certain packets into certain queues - I find it simpler than using the tc filter mechanism which feels somewhat cryptic to me.

If your linux box acts as a gateway (has two interfaces) you can setup egress qdiscs on both interfaces and therefore manage traffic going in and coming out.
Deleriux is offline     Reply With Quote
Old 02-28-2008, 07:49 PM   #5
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Distribution: Suse , Fedora, CentOS, Mandrake, Solaris 8-10, Ubuntu, Debian
Posts: 1,527
Thanked: 0

Original Poster
I will look into this. many thanks
metallica1973 is offline     Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is QoS? tarballedtux Linux - Networking 2 08-02-2007 11:38 AM
implementing QoS with iptables TOS chain blkdog Linux - Networking 0 07-13-2007 01:35 PM
SuSE 9.2 router - configuring for real QoS with iptables danny2055 Linux - Networking 2 05-04-2005 04:33 PM
QoS setting Zohair Linux - Networking 1 03-25-2005 05:15 AM
QoS and nat fr_laz Linux - Networking 0 01-27-2005 01:49 PM


All times are GMT -5. The time now is 03:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration