Priority queuing using tc not working
Hello:
I am trying to set up priority based queue for my VOIP traffic. I am running a RedHat 8.0 machine that is masquerading my internal network which has my PC and a VOIP phone. All VOIP traffic goes to and from my PBX, which is at 10.0.0.20.
When I use my phone and try to download a file via FTP on my PC, all of the packets are going into the low priority queue.
I typed these commands:
echo 1 > /proc/sys/net/ipv4/ip_forward
# Create the priority queue
/sbin/tc qdisc add dev eth0 root handle 1: prio /sbin/tc qdisc add dev eth0 parent 1:1 handle 10: sfq /sbin/tc qdisc add dev eth0 parent 1:2 handle 20: sfq /sbin/tc qdisc add dev eth0 parent 1:3 handle 30: sfq
# Add filters to put high priority packets into queue 1:1
/sbin/tc filter add dev eth0 pref 1 protocol ip parent 1:0 u32 match ip src 10.0.0.20 flowid 1:10 /sbin/tc filter add dev eth0 pref 1 protocol ip parent 1:0 u32 match ip dst 10.0.0.20 flowid 1:10
# Add a filter to put all remaining packets into queue 1:2
/sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match ip dst 0.0.0.0/0 flowid 1:20
As you can see, from the output of '/sbin/tc -s qdisc ls dev eth0' there are no packets going into the high priority queue:
qdisc sfq 30: quantum 1514b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc sfq 20: quantum 1514b
Sent 432501 bytes 5118 pkts (dropped 0, overlimits 0)
qdisc sfq 10: quantum 1514b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc prio 1: bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 Sent 432501 bytes 5118 pkts (dropped 0, overlimits 0)
Here is the output of /sbin/tc -s filter ls dev eth0:
filter parent 1: protocol ip pref 1 u32
filter parent 1: protocol ip pref 1 u32 fh 801: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:20
match 00000000/00000000 at 16
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
match 0a000014/ffffffff at 12
filter parent 1: protocol ip pref 1 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10
match 0a000014/ffffffff at 16
filter parent 1: protocol ip pref 2 u32
filter parent 1: protocol ip pref 2 u32 fh 801: ht divisor 1
filter parent 1: protocol ip pref 2 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:20
match 00000000/00000000 at 16
filter parent 1: protocol ip pref 2 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
match 0a000014/ffffffff at 12
filter parent 1: protocol ip pref 2 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10
match 0a000014/ffffffff at 16
Any ideas why the high priority traffic is not getting separated from the rest?
Thanks,
Neil
Joseph:
Based on you comments, I deleted all of the qdiscs and then typed these commands:
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/tc qdisc add dev eth0 root handle 1: prio /sbin/tc qdisc add dev eth0 parent 1:1 handle 1:10 sfq
Immediately on typing this second command, I get this output:
Starting tc: RTNETLINK answers: File exists
Any ideas why I am getting this?
Thanks,
Neil.
--
Neil Aggarwal
JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development Websites, Ecommerce, Java, databases
Quoted 41 lines
-----Original Message-----
From: Joseph Watson [mailto:[email protected]]
Sent: Wednesday, October 23, 2002 8:22 PM
To: Neil Aggarwal
Subject: Re: [LARTC] Priority queuing using tc not workingQuoted 4 lines · Neil Aggarwal
Hello:
I am trying to set up priority based queue for my VOIP traffic. I am running a RedHat 8.0 machine that is masquerading my
internal network
Quoted 6 lines
which has my PC and a VOIP phone. All VOIP traffic goes to and from my PBX, which is at 10.0.0.20.
When I use my phone and try to download a file via FTP on my PC, all of the packets are going into the low priority queue.
Quoted 6 lines
I typed these commands:
echo 1 >/proc/sys/net/ipv4/ip_forward# Create the priority queue
/sbin/tcqdisc add dev eth0 root handle 1: prio/sbin/tcqdisc add dev eth0 parent 1:1 handle 10: sfq^^^ 1:10Quoted 1 line
/sbin/tcqdisc add dev eth0 parent 1:2 handle 20: sfq^^^ 1:20Quoted 1 line
/sbin/tcqdisc add dev eth0 parent 1:3 handle 30: sfq^^^ 1:30Quoted 3 lines
# Add filters to put high priority packets into queue 1:1
/sbin/tcfilter add dev eth0 pref 1 protocol ip parent 1:0u32 match ip
Quoted 1 line
src 10.0.0.20 flowid 1:10
/sbin/tcfilter add dev eth0 pref 1protocol ip
Quoted 2 lines
parent 1:0 u32 match ip dst 10.0.0.20 flowid 1:10
Quoted 13 lines
Quoted 2 lines
# Add a filter to put all remaining packets into queue 1:2
/sbin/tcfilter add dev eth0 protocol ip parent 1:0 prio 2u32 match ip
Quoted 1 line
dst 0.0.0.0/0 flowid 1:20
^^^
Here is the problem, You dont have a 1:10
or 1:20 qdisc unless you make the
above corrections.Signature · 3 lines
Regards Joseph Watson
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
I guess Probably this qdisc alread exist . Try to delete it and add it again and see what you are getting.
Nitin
Quoted 102 lines · --- Neil Aggarwal
Joseph:
Based on you comments, I deleted all of the qdiscs and
then typed these commands:
echo 1 >/proc/sys/net/ipv4/ip_forward
/sbin/tcqdisc add dev eth0 root handle 1:
prio
/sbin/tcqdisc add dev eth0 parent 1:1
handle 1:10 sfqImmediately on typing this second command, I get
this output:
Starting tc: RTNETLINK answers: File existsAny ideas why I am getting this?
Thanks,
Neil.--
Neil Aggarwal
JAMM Consulting, Inc. (972) 612-6056,
http://www.JAMMConsulting.com
Custom Internet Development Websites, Ecommerce,
Java, databasesQuoted 5 lines
-----Original Message-----
From: Joseph Watson [mailto:[email protected]]
Sent: Wednesday, October 23, 2002 8:22 PM
To: Neil Aggarwal
Subject: Re: [LARTC] Priority queuing using tc notworking
Quoted 3 lines
On Friday 18 October 2002 07:43 pm, Neil Aggarwal
Quoted 3 lines · wrote:
Quoted 3 lines
Hello:
I am trying to set up priority based queue for
my VOIP traffic.
Quoted 1 line
Quoted 1 line
I am running a RedHat 8.0 machine that is
masquerading my
Quoted 2 lines
internal network
Quoted 1 line
which has my PC and a VOIP phone. All VOIP
traffic goes to and from
Quoted 3 lines
Quoted 3 lines
my PBX, which is at 10.0.0.20.
When I use my phone and try to download a file
via FTP on my PC,
Quoted 1 line
Quoted 1 line
all of the packets are going into the low
priority queue.
Quoted 6 lines
Quoted 6 lines
I typed these commands:
echo 1 >/proc/sys/net/ipv4/ip_forward# Create the priority queue
/sbin/tcqdisc add dev eth0 root handle 1:prio
Quoted 1 line
Quoted 1 line
/sbin/tcqdisc add dev eth0 parent 1:1 handle10: sfq
Quoted 1 line
^^^Quoted 1 line
1:10Quoted 1 line
Quoted 1 line
/sbin/tcqdisc add dev eth0 parent 1:2 handle20: sfq
Quoted 1 line
^^^Quoted 1 line
1:20Quoted 1 line
Quoted 1 line
/sbin/tcqdisc add dev eth0 parent 1:3 handle30: sfq
Quoted 1 line
^^^Quoted 1 line
1:30Quoted 2 lines
Quoted 2 lines
# Add filters to put high priority packets
into queue 1:1
Quoted 1 line
Quoted 1 line
/sbin/tcfilter add dev eth0 pref 1 protocolip parent 1:0
Quoted 2 lines
u32 match ip
Quoted 1 line
src 10.0.0.20 flowid 1:10
/sbin/tcfilter adddev eth0 pref 1
Quoted 2 lines
protocol ip
Quoted 1 line
parent 1:0 u32 match ip dst 10.0.0.20 flowid
1:10
Quoted 2 lines
Quoted 2 lines
# Add a filter to put all remaining packets
into queue 1:2
Quoted 1 line
Quoted 1 line
/sbin/tcfilter add dev eth0 protocol ipparent 1:0 prio 2
Quoted 7 lines
u32 match ip
Quoted 1 line
dst 0.0.0.0/0 flowid 1:20
^^^
Here is the problem, You dont have a 1:10
or 1:20 qdisc unless you make the
above corrections.
Quoted 7 lines
Quoted 4 lines
Signature · 3 lines
Regards Joseph Watson_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/