Traffic priority how ?

Hi to everybody
I just want to make only traffic priority by port ot type of service not shape traffic just to be shure that for example
even there is havy downloading ssh or icmp will be go first after pop3 and all other traffic will be last like P2P .
I'm  i can't find how to do it i try with PRIO but without sucsess.

Any advices ?
LVL 3
snedelchevAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Artysystem administratorCommented:
start from here: http://lartc.org/howto/
then go here: http://www.lartc.org/manpages/
then man tc

CBQ for you is reasonable as it seems for me. Don't forget to limit outbound rate.
Also note, that you cannot control incoming traffic very well.
Artysystem administratorCommented:
This chapter of that link is most useful :-)
http://lartc.org/howto/lartc.qdisc.html
snedelchevAuthor Commented:
I'm familiar with this technologies . I need some example of using PRIO qdisk with TBF if it's needed to make priorities of the traffic.
Artysystem administratorCommented:
I compiled kernel with support of all possible IP features.
It works fine for me.

1) Remember you may prioritize only outgoing packets

2) you have 3 classes in PRIO queue:
1 - icmp or ssh
2 - pop3
3 - all other

3) You are attaching to the interface itself, not to another queue discipline, so your parent will be 'root', read

tc qdisc add dev eth0 parent root prio bands 3

4) To see what is your class id:
'tc -s qdisc'
For me it was 8001:

5)  Now you should create filter to sort your traffic between classes, read http://lartc.org/howto/lartc.qdisc.filters.html , chapter 9.6.1 is what you want.

# ssh traffic goes to queue 1 (8001:1) most priority
tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip dport 22 0xffff flowid 8001:1
tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip sport 22 0xffff flowid 8001:1
# icmp is an ip proto number 1
tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip protocol 1 0xff flowid 8001:1
# http goes to queue number 2 (8001:2) normal proprity
tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip dport 80 0xffff flowid 8001:2
tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip sport 80 0xffff flowid 8001:2
# all other traffic is default (method from larc site doesnt' work, you may also try to mark all traffic in iptable then to specify here)

6) Check that filters are in-place:
tc show filter dev eth0

Other useful link (for common knowledge of traffic control): http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Traffic-Control-HOWTO.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.