LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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
  Search this Thread
Old 03-03-2008, 05:13 PM   #1
pdavis68
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Rep: Reputation: 0
Traffic prioritization


Is there an easy way to prioritize network traffic?

I've tried to read up on tc, but I don't really get it. It took me ages to figure out iptables and tc doesn't seem to make things any easier.

Basically, I want a very simple setup... I have a linux box that acts as my router (it's also a firewall, dbserver, and file server).

For traffic shaping, I basically want 2 classes of traffic. 1 class is pretty much everything and the other class would be traffic for a single app. I would want the traffic for that app to have priority over everything else. It's a fairly low-bandwidth app, but latency affects performance. I'd like to be able to let other apps that use the net continue to run, if possible and let them use up as much of the rest of the bandwidth as they want without disturbing this app.

How hard is that to do?
 
Old 03-05-2008, 04:49 AM   #2
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi

from your requirement - i dont think that you need tc - a simple iptables with -t mangle to classify or -m mark --mark will do the shaping.

just specify which protocol to have a higher priority than the other.

i'm not too fluent in traffic shaping command - so better to go to lartc.

HTH.
 
Old 03-05-2008, 07:14 AM   #3
pdavis68
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
I believe I still need tc. I believe the default handling is for packets to be processed in a FIFO, or as the tc documents call it, PFIFO, or pure-first in, first out queue.

I believe what I need to do is the mangle to set the TOS and then use TC to do a PRIO qdisc.

But I don't know specifically the steps to do this and have not been able to divine it from the docs.
 
Old 03-05-2008, 07:43 AM   #4
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi

true - the default traffic handling is FIFO. but by using tc - you will be forced to specifically reserved certain amount of BW for your app (or host) - is that what you need?

using -m mark or TOS --> your priority will be first to be deliver.

try here : http://www.linuxguruz.com/iptables/

HTH.
 
Old 03-07-2008, 12:57 PM   #5
pdavis68
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the info. I guess the only question I have about the TOS is where to do it.

Should it be in the mangle table's PREROUTING chain? That's what seems to make sense to me.

I'd recognize the traffic as going to and coming from a specific server, so I'd match just on packets to and from that server.
 
Old 06-19-2008, 06:02 AM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
I was just reading up on traffic shaping and found that thread - I know its old, but still:

Sorry - but I have to disagree with rossonieri#1

With iptables you can set marks of all kinds - but that does not change how the traffic is handeled.
Default is fifo
To change that - you need to use tc - and attach the qdisc you like/need/fits best - or even leave it at fifo

AFAIK only tc can put iptables marks to a use - sort the traffic according to those marks into the different qdiscs.
Without tc you can use those marks to do all kinds of things to packets - but would not change the qdics and the order and priority in which packets are sent out.
tc does not need iptables - but I find it a lot easier to use the iptables capabilities to mark packets by certain criteria and then use this mark in tc.

Only with tc will pdavis68 be able to prioritize his app.
 
  


Reply

Tags
iptables, priority, tc


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
Traffic shaping (limiting outgoing bandwidth of all TCP-traffic except FTP/HTTP) ffkodd Linux - Networking 3 10-25-2008 12:09 AM
SNMP MRTG RRDTOOL Configu of CPU memory Disk Port data traffic doc traffic manish_2479 Linux - Networking 1 06-19-2007 07:08 AM
Manufacturing/WorkLoad Que/Prioritization software? malaka56 Linux - Software 1 07-29-2005 10:41 PM
Wireless traffic stomps isdn traffic on gateway machine Radix999 Linux - Wireless Networking 0 11-14-2003 12:54 AM
Bandwith Prioritization bretthoward Linux - Networking 0 10-09-2001 01:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration