• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

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 ?
0
snedelchev
Asked:
snedelchev
  • 3
1 Solution
 
NopiusCommented:
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.
0
 
NopiusCommented:
This chapter of that link is most useful :-)
http://lartc.org/howto/lartc.qdisc.html
0
 
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.
0
 
NopiusCommented:
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
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now