* [LARTC] tc is giving an error: RTNETLINK answers: File exists
@ 2006-09-14 22:14 fourcentsshy
2006-09-14 22:31 ` Leigh Sharpe
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: fourcentsshy @ 2006-09-14 22:14 UTC (permalink / raw)
To: lartc
Hello,
I'm using tc to limit the bandwidth of our wireless customers. I have a
working script, but I'm not happy with it. I'm trying to write a more
sophisticated script, but when I run it, it give me this error:
RTNETLINK answers: File exists
I have no idea what this error means or how to fix it. Here is a portion
of the script (the whole script shapes several interfaces):
IDEV='eth5'
TC='/sbin/tc'
IPS='/etc/sysconfig/shaper/shape.ips'
# high priority destination ports - I'll fill these in later (when this
# thing works)
HIGHPORT# low priority destination ports
LOWPORT
$TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell 8\
avpkt 1000 mpu 64
$TC class add dev $IDEV parent 1: classid 1:1 est 1sec 8sec cbq\
bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
prio 0 bounded isolated
cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do
if [ "x$IP" = "x" ]; then
continue
fi
# I use the last byte of the customer's IP's for the handle, which range
# from 76 to 135 ATM.
HANDLE="${IP##*.}"
# I get the error from the next line. Because it fails to create the
# qdisc all the rest fail too.
$TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\
bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
$TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\
est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
maxburst 20 avpkt 1000 prio 1 bounded isolated
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\
est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
maxburst 20 avpkt 1000 prio 2
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est 1sec\
8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot 1514\
maxburst 20 avpkt 1000 prio 3
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est 1sec\
8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot 1514\
maxburst 20 avpkt 1000 prio 4
$TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\
perturb 15
$TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\
perturb 15
$TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\
perturb 15
$TC filter add dev $IDEV parent 1: protocol ip prio 16\
u32 match ip src $IP flowid $HANDLE:
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\
u32 match ip tos 0x10 0xff flowid $HANDLE:1
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\
u32 match ip protocol 1 0xff flowid $HANDLE:1
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\
u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\
0x0000 0xffc0 at 2 flowid $HANDLE:1
for a in $HIGHPORT; do
$TC filter add dev $IDEV parent 1:0 protocol ip prio 14\
u32 match ip dport $a 0xffff flowid $HANDLE:1
done
for a in $LOWPORT; do
$TC filter add dev $IDEV parent 1:0 protocol ip prio 16\
u32 match ip dport $a 0xffff flowid $HANDLE:3
done
$TC filter add dev $IDEV parent 1:0 protocol ip prio 15\
u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2
done
There are bound to other problems with this script, but until I can get
past the current one, I'm dead in the water. TIA
William Murphy
Network Administrator
Velocity Technologies, Inc.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
@ 2006-09-14 22:31 ` Leigh Sharpe
2006-09-14 23:11 ` fourcentsshy
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Leigh Sharpe @ 2006-09-14 22:31 UTC (permalink / raw)
To: lartc
This is usually because you are attempting to create a class ID or a Qdisc ID which already exists.
Check what value $HANDLE is on each iteration, perhaps using an echo on each pass to display it. I think you'll find it is trying to use the same value twice.
Regards,
Leigh
Leigh Sharpe
Network Systems Engineer
Pacific Wireless
Ph +61 3 9584 8966
Mob 0408 009 502
email lsharpe@pacificwireless.com.au
web www.pacificwireless.com.au
-----Original Message-----
From: fourcentsshy [mailto:fourcentsshy@velotech.net]
Sent: Friday, September 15, 2006 8:15 AM
To: lartc@mailman.ds9a.nl
Subject: [LARTC] tc is giving an error: RTNETLINK answers: File exists
Hello,
I'm using tc to limit the bandwidth of our wireless customers. I have a
working script, but I'm not happy with it. I'm trying to write a more
sophisticated script, but when I run it, it give me this error:
RTNETLINK answers: File exists
I have no idea what this error means or how to fix it. Here is a portion
of the script (the whole script shapes several interfaces):
IDEV='eth5'
TC='/sbin/tc'
IPS='/etc/sysconfig/shaper/shape.ips'
# high priority destination ports - I'll fill these in later (when this
# thing works)
HIGHPORT# low priority destination ports
LOWPORT
$TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell 8\
avpkt 1000 mpu 64
$TC class add dev $IDEV parent 1: classid 1:1 est 1sec 8sec cbq\
bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
prio 0 bounded isolated
cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do
if [ "x$IP" = "x" ]; then
continue
fi
# I use the last byte of the customer's IP's for the handle, which range
# from 76 to 135 ATM.
HANDLE="${IP##*.}"
# I get the error from the next line. Because it fails to create the
# qdisc all the rest fail too.
$TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\
bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
$TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\
est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
maxburst 20 avpkt 1000 prio 1 bounded isolated
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\
est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
maxburst 20 avpkt 1000 prio 2
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est 1sec\
8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot 1514\
maxburst 20 avpkt 1000 prio 3
$TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est 1sec\
8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot 1514\
maxburst 20 avpkt 1000 prio 4
$TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\
perturb 15
$TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\
perturb 15
$TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\
perturb 15
$TC filter add dev $IDEV parent 1: protocol ip prio 16\
u32 match ip src $IP flowid $HANDLE:
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\
u32 match ip tos 0x10 0xff flowid $HANDLE:1
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\
u32 match ip protocol 1 0xff flowid $HANDLE:1
$TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\
u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\
0x0000 0xffc0 at 2 flowid $HANDLE:1
for a in $HIGHPORT; do
$TC filter add dev $IDEV parent 1:0 protocol ip prio 14\
u32 match ip dport $a 0xffff flowid $HANDLE:1
done
for a in $LOWPORT; do
$TC filter add dev $IDEV parent 1:0 protocol ip prio 16\
u32 match ip dport $a 0xffff flowid $HANDLE:3
done
$TC filter add dev $IDEV parent 1:0 protocol ip prio 15\
u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2
done
There are bound to other problems with this script, but until I can get
past the current one, I'm dead in the water. TIA
William Murphy
Network Administrator
Velocity Technologies, Inc.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
2006-09-14 22:31 ` Leigh Sharpe
@ 2006-09-14 23:11 ` fourcentsshy
2006-09-15 4:36 ` gypsy
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: fourcentsshy @ 2006-09-14 23:11 UTC (permalink / raw)
To: lartc
On Fri, 2006-09-15 at 08:31 +1000, Leigh Sharpe wrote:
> This is usually because you are attempting to create a class ID or a
Qdisc ID which already exists.
> Check what value $HANDLE is on each iteration, perhaps using an echo
on each pass to display it. I think you'll find it is trying to use the
same value twice.
>
>
> Regards,
> Leigh
>
> Leigh Sharpe
> Network Systems Engineer
> Pacific Wireless
> Ph +61 3 9584 8966
> Mob 0408 009 502
> email lsharpe@pacificwireless.com.au
> web www.pacificwireless.com.au
>
Thanks for the quick reply. Not only have I tried that, I inserted an
exit statement after the first iteration (to limit the info). The first
qdisc in the loop has the handle 1:76 and it's parent is 1:1. The only
other qdisc is the root qdisc that is created before the loop. The
script also does a reset, deleting any existing qdiscs, classes or
filters, before creating any new ones. Is there a limit to how large the
handle can be?
Cheers,
William Murphy
Network Administrator
Velocity Technologies, Inc.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
2006-09-14 22:31 ` Leigh Sharpe
2006-09-14 23:11 ` fourcentsshy
@ 2006-09-15 4:36 ` gypsy
2006-09-15 4:40 ` gypsy
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gypsy @ 2006-09-15 4:36 UTC (permalink / raw)
To: lartc
fourcentsshy wrote:
>
> Hello,
>
> I'm using tc to limit the bandwidth of our wireless customers. I have a
> working script, but I'm not happy with it. I'm trying to write a more
> sophisticated script, but when I run it, it give me this error:
>
> RTNETLINK answers: File exists
>
> I have no idea what this error means or how to fix it.
It means pretty much what it says. There is already a record matching
closely enough that it is duplicated.
> Here is a portion
> of the script (the whole script shapes several interfaces):
>
> IDEV='eth5'
> TC='/sbin/tc'
> IPS='/etc/sysconfig/shaper/shape.ips'
> # high priority destination ports - I'll fill these in later (when this
> # thing works)
> HIGHPORT> # low priority destination ports
> LOWPORT>
> $TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell 8\
> avpkt 1000 mpu 64
> $TC class add dev $IDEV parent 1: classid 1:1 est 1sec 8sec cbq\
> bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
> prio 0 bounded isolated
>
> cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do
> if [ "x$IP" = "x" ]; then
> continue
> fi
>
> # I use the last byte of the customer's IP's for the handle, which range
> # from 76 to 135 ATM.
>
> HANDLE="${IP##*.}"
>
> # I get the error from the next line. Because it fails to create the
> # qdisc all the rest fail too.
>
> $TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\
> bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
>
> $TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\
> est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> maxburst 20 avpkt 1000 prio 1 bounded isolated
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\
> est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> maxburst 20 avpkt 1000 prio 2
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est 1sec\
> 8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot 1514\
> maxburst 20 avpkt 1000 prio 3
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est 1sec\
> 8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot 1514\
> maxburst 20 avpkt 1000 prio 4
> $TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\
> perturb 15
> $TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\
> perturb 15
> $TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\
> perturb 15
> $TC filter add dev $IDEV parent 1: protocol ip prio 16\
> u32 match ip src $IP flowid $HANDLE:
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\
> u32 match ip tos 0x10 0xff flowid $HANDLE:1
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\
> u32 match ip protocol 1 0xff flowid $HANDLE:1
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\
> u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\
> 0x0000 0xffc0 at 2 flowid $HANDLE:1
>
> for a in $HIGHPORT; do
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 14\
> u32 match ip dport $a 0xffff flowid $HANDLE:1
> done
> for a in $LOWPORT; do
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 16\
> u32 match ip dport $a 0xffff flowid $HANDLE:3
> done
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 15\
> u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2
> done
>
> There are bound to other problems with this script, but until I can get
> past the current one, I'm dead in the water. TIA
You do not say which line or lines is causing the error so this is a
guess.
Run `tc -s filter show dev $IDEV' sending the output to a file because
there will be a lot of it. I think you will find a ton of "duplicate"
filters.
Set prio to the same value (16 or 10 perhaps) for each and every line in
your `$TC filter' lines.
--
gypsy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
` (2 preceding siblings ...)
2006-09-15 4:36 ` gypsy
@ 2006-09-15 4:40 ` gypsy
2006-09-15 19:47 ` fourcentsshy
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gypsy @ 2006-09-15 4:40 UTC (permalink / raw)
To: lartc
fourcentsshy wrote:
> Is there a limit to how large the
> handle can be?
Yes. The handle is in hex, so I _think_ the max is 255. Maybe Stef
Coene's web site or a search of this mailing list will give you the
RIGHT answer. I hate getting old; I should remember what the max here
is.
--
gypsy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
` (3 preceding siblings ...)
2006-09-15 4:40 ` gypsy
@ 2006-09-15 19:47 ` fourcentsshy
2006-09-16 16:14 ` gypsy
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: fourcentsshy @ 2006-09-15 19:47 UTC (permalink / raw)
To: lartc
On Thu, 2006-09-14 at 21:36 -0700, gypsy wrote:
> fourcentsshy wrote:
> >
> > Hello,
> >
> > I'm using tc to limit the bandwidth of our wireless customers. I have a
> > working script, but I'm not happy with it. I'm trying to write a more
> > sophisticated script, but when I run it, it give me this error:
> >
> > RTNETLINK answers: File exists
> >
> > I have no idea what this error means or how to fix it.
>
> It means pretty much what it says. There is already a record matching
> closely enough that it is duplicated.
>
That is what puzzles me the most. If you look at the script, I create
the root qdisc, add a class to it and when I try to add a qdisc to that
class on the first iteration in the loop, I get the error right off. The
script also deletes all qdiscs, classes and filters before it creates
any new ones. On the first iteration of the loop, the handle is 1:76
with it's parent 1:1, which should be unique, since it's only the second
qdisc created.
As Leigh Sharpe suggested, I had already inserted echo statements into
the script so I could examine what was really going on. For this device,
the error takes place on the third command. the command sequence take
place like this:
/sbin/tc qdisc add dev eth5 root handle 1: cbq bandwidth 1600Kbit\
cell 8 avpkt 1000 mpu 64
/sbin/tc class add dev eth5 parent 1: classid 1:1 est 1sec 8sec cbq\
bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
prio 0 bounded isolated
/sbin/tc qdisc add dev eth5 parent 1:1 handle 1:76 cbq\
bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
RTNETLINK answers: File exists
Like I said, I start by resetting all the devices on the machine, so
there is no possible way there can be any existing qdisc with a handle
of 1:76 for that device, yet I get the error anyway. The script is setup
as a service to be run at startup, so checking the status after running
the script for that device, I get this:
[qdisc - eth5]
qdisc cbq 1: rate 1600Kbit (bounded,isolated) prio no-transmit
Sent 139719 bytes 181 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 5120 undertime 0
------------------------
[class - eth5]
class cbq 1:11 parent 1:1 leaf 8236: rate 700000bit prio 2
Sent 13814 bytes 42 pkt (dropped 0, overlimits 0 requeues 0)
rate 11792bit 4pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 306884 undertime 0
class cbq 1: root rate 100000Kbit (bounded,isolated) prio no-transmit
Sent 60 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 81 undertime 0
class cbq 1:10 parent 1:1 leaf 8235: rate 750000bit prio 1
Sent 6712 bytes 48 pkt (dropped 0, overlimits 0 requeues 0)
rate 2008bit 2pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 148506 undertime 0
class cbq 1:1 parent 1: rate 800000bit (bounded,isolated) prio
no-transmit
Sent 20526 bytes 90 pkt (dropped 0, overlimits 0 requeues 0)
rate 13800bit 7pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 57889 undertime 0
class cbq 1:12 parent 1:1 leaf 8237: rate 700000bit prio 3
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 329838 undertime 0
Maybe I'm blind, but I don't see any qdisc or class with a handle of
1:76. Something else is wrong, but I don't see it.
> > Here is a portion
> > of the script (the whole script shapes several interfaces):
> >
> > IDEV='eth5'
> > TC='/sbin/tc'
> > IPS='/etc/sysconfig/shaper/shape.ips'
> > # high priority destination ports - I'll fill these in later (when this
> > # thing works)
> > HIGHPORT> > # low priority destination ports
> > LOWPORT> >
> > $TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell 8\
> > avpkt 1000 mpu 64
> > $TC class add dev $IDEV parent 1: classid 1:1 est 1sec 8sec cbq\
> > bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
> > prio 0 bounded isolated
> >
> > cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do
> > if [ "x$IP" = "x" ]; then
> > continue
> > fi
> >
> > # I use the last byte of the customer's IP's for the handle, which range
> > # from 76 to 135 ATM.
> >
> > HANDLE="${IP##*.}"
> >
> > # I get the error from the next line. Because it fails to create the
> > # qdisc all the rest fail too.
> >
> > $TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\
> > bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
> >
> > $TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\
> > est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> > maxburst 20 avpkt 1000 prio 1 bounded isolated
> > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\
> > est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> > maxburst 20 avpkt 1000 prio 2
> > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est 1sec\
> > 8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot 1514\
> > maxburst 20 avpkt 1000 prio 3
> > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est 1sec\
> > 8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot 1514\
> > maxburst 20 avpkt 1000 prio 4
> > $TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\
> > perturb 15
> > $TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\
> > perturb 15
> > $TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\
> > perturb 15
> > $TC filter add dev $IDEV parent 1: protocol ip prio 16\
> > u32 match ip src $IP flowid $HANDLE:
> > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\
> > u32 match ip tos 0x10 0xff flowid $HANDLE:1
> > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\
> > u32 match ip protocol 1 0xff flowid $HANDLE:1
> > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\
> > u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\
> > 0x0000 0xffc0 at 2 flowid $HANDLE:1
> >
> > for a in $HIGHPORT; do
> > $TC filter add dev $IDEV parent 1:0 protocol ip prio 14\
> > u32 match ip dport $a 0xffff flowid $HANDLE:1
> > done
> > for a in $LOWPORT; do
> > $TC filter add dev $IDEV parent 1:0 protocol ip prio 16\
> > u32 match ip dport $a 0xffff flowid $HANDLE:3
> > done
> > $TC filter add dev $IDEV parent 1:0 protocol ip prio 15\
> > u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2
> > done
> >
> > There are bound to other problems with this script, but until I can get
> > past the current one, I'm dead in the water. TIA
>
> You do not say which line or lines is causing the error so this is a
> guess.
I inserted a comment in the script that points out which command causes
the error. It's the first command inside the loop.
>
> Run `tc -s filter show dev $IDEV' sending the output to a file because
> there will be a lot of it. I think you will find a ton of "duplicate"
> filters.
I inserted an exit statement right after the command that give the
error. The script never gets to the statements that creates the filters.
Checking the status of the service would display the filters along with
the qdiscs and classes, but there are none.
>
> Set prio to the same value (16 or 10 perhaps) for each and every line in
> your `$TC filter' lines.
If I ever get this script working, I'll do that. ;-)
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
` (4 preceding siblings ...)
2006-09-15 19:47 ` fourcentsshy
@ 2006-09-16 16:14 ` gypsy
2006-09-18 20:33 ` fourcentsshy
2006-09-19 18:47 ` fourcentsshy
7 siblings, 0 replies; 9+ messages in thread
From: gypsy @ 2006-09-16 16:14 UTC (permalink / raw)
To: lartc
fourcentsshy wrote:
> the script so I could examine what was really going on. For this device,
> the error takes place on the third command. the command sequence take
> place like this:
>
> /sbin/tc qdisc add dev eth5 root handle 1: cbq bandwidth 1600Kbit\
> cell 8 avpkt 1000 mpu 64
>
> /sbin/tc class add dev eth5 parent 1: classid 1:1 est 1sec 8sec cbq\
> bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
> prio 0 bounded isolated
>
> /sbin/tc qdisc add dev eth5 parent 1:1 handle 1:76 cbq\
> bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
This says to me "cell", not "ceil". That's a mistake.
> RTNETLINK answers: File exists
>
> Like I said, I start by resetting all the devices on the machine, so
> there is no possible way there can be any existing qdisc with a handle
> of 1:76 for that device, yet I get the error anyway. The script is setup
> as a service to be run at startup, so checking the status after running
> the script for that device, I get this:
=--snip--=
> error. The script never gets to the statements that creates the filters.
> Checking the status of the service would display the filters along with
> the qdiscs and classes, but there are none.
>
> >
> > Set prio to the same value (16 or 10 perhaps) for each and every line in
> > your `$TC filter' lines.
>
> If I ever get this script working, I'll do that. ;-)
One more thing.
You can send your commands to a database (mysql or whatever). Once
disallowing duplicate records and again allowing dups. The difference
is the Bad Boy.
I use HTB not CBQ but I still think the parameter is "ceil" not "cell"
and fixing that will help or solve.
--
gypsy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
` (5 preceding siblings ...)
2006-09-16 16:14 ` gypsy
@ 2006-09-18 20:33 ` fourcentsshy
2006-09-19 18:47 ` fourcentsshy
7 siblings, 0 replies; 9+ messages in thread
From: fourcentsshy @ 2006-09-18 20:33 UTC (permalink / raw)
To: lartc
On Sat, 2006-09-16 at 09:14 -0700, gypsy wrote:
> fourcentsshy wrote:
> > the script so I could examine what was really going on. For this device,
> > the error takes place on the third command. the command sequence take
> > place like this:
> >
> > /sbin/tc qdisc add dev eth5 root handle 1: cbq bandwidth 1600Kbit\
> > cell 8 avpkt 1000 mpu 64
> >
> > /sbin/tc class add dev eth5 parent 1: classid 1:1 est 1sec 8sec cbq\
> > bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
> > prio 0 bounded isolated
> >
> > /sbin/tc qdisc add dev eth5 parent 1:1 handle 1:76 cbq\
> > bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
> This says to me "cell", not "ceil". That's a mistake.
I wish that were true. It would make this problem so much easier to
solve. The HTB classes use the ceil parameter, but CBQ qdiscs use the
cell parameter for packet transmission time calculations. The manual
says it has a reasonable default, but the working script I have didn't
shape properly until I played with it.
ATM, since I'm debugging the script, its setup to exit after the 3rd tc
command I've listed above. tc doesn't seem to care what handle I give
the second qdisc. I've tried many different handles and every time I get
the same error:
RTNETLINK answers: File exists.
I've even tried running those very same lines on different machines,
with different Linux distros on them. I keep getting the same error on
them as well. It would be helpful if the device let me know which file
it's talking about. The working script only adds CBQ classes to CBQ
classes. Is it possible that its forbidden to add a CBQ qdisc to a CBQ
class?
>
> =--snip--=
> One more thing.
> You can send your commands to a database (mysql or whatever). Once
> disallowing duplicate records and again allowing dups. The difference
> is the Bad Boy.
I do love mysql and work with it almost daily (great fun). I thought
about writing a customer database for the very reason you mentioned, but
dups are not the problem. I do have a working script that uses the same
resource file with no problems. It limits customer bandwidth nicely and
even uses the same method of choosing handles, but there is a minor
problem with load balancing. I'd very much like to fix that.
>
> I use HTB not CBQ but I still think the parameter is "ceil" not "cell"
> and fixing that will help or solve.
When I first started playing with tc, I tried using HTBs because they
looked easier to work with. I couldn't get them to work, so I tried the
CBQs. They didn't work either. It turned out that one of our technicians
has installed an older version of Fedora on the gateway server and that
version of tc was broken. I upgraded it to FC4 and the script came
alive. Since the script was working, I didn't bother to switch back to
the HTBs (but I'm strongly considering doing just that).
Thanks for your time. I guess I'll keep trying different things.
Cheers,
William Murphy
Velocity Technologies, Inc.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
` (6 preceding siblings ...)
2006-09-18 20:33 ` fourcentsshy
@ 2006-09-19 18:47 ` fourcentsshy
7 siblings, 0 replies; 9+ messages in thread
From: fourcentsshy @ 2006-09-19 18:47 UTC (permalink / raw)
To: lartc
I've solved the problem. It turns out tc didn't like the sequence the
commands were in. The script was set up to create a qdisc for each
customer and attach a rate limiting class to it. It looked like this:
1: root qdisk
|
1:1 child class
/|\
/ | \
/ | \
/ | \
1:76 1:77 1:78... customer qdiscs
| | |
76: 77: 78: rate limiting classes
/|\ ...
/ | \
/ | \
/ | \
76:1 76:2 76:3 child classes to handle load balancing
My bad. It should have looked like this:
1: root qdisk
|
1:1 child class
/|\
/ | \
/ | \
/ | \
1:76 1:77 1:78... customer rate limiting classes
| | |
76: 77: 78: customer qdiscs
/|\ ...
/ | \
/ | \
/ | \
76:1 76:2 76:3 child classes to handle load balancing
I had rewritten the script to use HTBs, yet the same error occured.
That's when I noticed the problem with the handles. switching the 2
commands fixed it.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-09-19 18:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
2006-09-14 22:31 ` Leigh Sharpe
2006-09-14 23:11 ` fourcentsshy
2006-09-15 4:36 ` gypsy
2006-09-15 4:40 ` gypsy
2006-09-15 19:47 ` fourcentsshy
2006-09-16 16:14 ` gypsy
2006-09-18 20:33 ` fourcentsshy
2006-09-19 18:47 ` fourcentsshy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.