View previous topic :: View next topic |
Author |
Message |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sat Sep 10, 2005 6:37 pm Post subject: Packet Shaping RTNETLINK errors |
|
|
I'm trying to get packet shaping working as per the excellent HOWTO available on the gentoo-wiki, but no matter what I try I constantly get the following errors:
Code: | RTNETLINK answers: Invalid argument
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
|
I've tried a few different scripts, and I'm positive that I have all of the correct kernel options compiled in (or at least all of the ones mentioned in the HOWTO). I can post my .config if requested, although I thought that might be a bit of overkill for an opening post.
I am currently running gentoo-sources 2.6.12-r10 and I've tried both the latest stable and masked versions of iproute 2. Can somebody please point me in the right direction with this? |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sat Sep 10, 2005 8:19 pm Post subject: |
|
|
This usually means that either a) your kernel or b) your tc binary does not support QoS (or at least the schedulers you're trying to use), or c) that you're using errornous commands, although that's not very probable.
So I think most likely is that you're just lacking QoS support in your kernel...
PS: post the QoS related part of your .config Code: | grep -E "(NET_SCH|QOS)" .config | should return all =y (unless you use them as modules, in which case you need to make sure these are loaded).
PPS: post the tc commands you're using |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 1:36 pm Post subject: |
|
|
I am currently running version 2.6.11.20050330 of iproute2, which provides tc if I'm correct, so there's surely no problem there. Unless perhaps I'm missing a required USE flag? Just a thought. My other details are as follows.
The QoS part of my .config:
Code: | CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CLK_JIFFIES=y
# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
# CONFIG_NET_SCH_CLK_CPU is not set
CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_SCH_RED=y
CONFIG_NET_SCH_SFQ=y
CONFIG_NET_SCH_TEQL=y
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_DSMARK=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_QOS=y
|
And the shaping script that I'm trying to use:
Code: | #!/bin/bash
DEV=ppp0
UPSTREAM=1200
DOWNSTREAM=410
BURST=32
#
## Status report #
#
if [ "$1" = "status" ]
then
tc -s class ls dev $DEV
tc -s qdisc ls dev $DEV
exit
fi
#
## Start and stop #
#
tc qdisc del dev $DEV root 2> /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null
if [ "$1" = "stop" ]
then
exit
fi
#
## EGRESS (upstream)
#
# Install HTB qdisc with three classes and rate limting
tc qdisc add dev $DEV root handle 1: htb default 30 r2q 2
tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPSTREAM}kbit ceil ${UPSTREAM}kbit burst 2k cburst 2k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate $[4*$UPSTREAM/10]kbit ceil ${UPSTREAM}kbit prio 1
tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[3*$UPSTREAM/10]kbit ceil ${UPSTREAM}kbit prio 2
tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[3*$UPSTREAM/10]kbit ceil $[6*$UPSTREAM/10]kbit prio 3 burst 1024 cburst 1024
# Install qdiscs to maximise the efficiency of each class
tc qdisc add dev $DEV parent 1:10 handle 10: pfifo limit 25
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
# Apply filtering based on packets matched in the firewall
tc filter add dev $DEV parent 1: prio 0 protocol ip handle 10 fw flowid 1:10
tc filter add dev $DEV parent 1: prio 0 protocol ip handle 20 fw flowid 1:20
tc filter add dev $DEV parent 1: prio 0 protocol ip handle 30 fw flowid 1:30
#
## INGRESS (downstream)
#
# Attach ingress qdisc
tc qdisc add dev $DEV handle ffff: ingress
# Police everything but high priority traffic
tc filter add dev $DEV parent ffff: protocol ip prio 1 handle 30 fw police rate ${DOWNSTREAM}kbit burst ${BURST}kbit drop flowid :1
|
I didn't write this script, but I do know that it works. I previously used it on a gateway using a 2.4 kernel (back when they were the latest thing around, ah, the memories... ). |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun Sep 11, 2005 2:04 pm Post subject: |
|
|
Hi,
kernel settings look okay, then. Try to replace with , run the script, post the output - this causes not only the results of commands, but the commands themselves to be printed, should make things easier to debug. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 2:59 pm Post subject: |
|
|
That's a useful little tip, I'll remember that, thanks. Anyway, here's the output from the script:
Code: | + DEV=ppp0
+ UPSTREAM=410
+ DOWNSTREAM=1200
+ BURST=32
+ '[' '' = status ']'
+ tc qdisc del dev ppp0 root
+ tc qdisc del dev ppp0 ingress
+ '[' '' = stop ']'
+ tc qdisc add dev ppp0 root handle 1: htb default 30 r2q 2
RTNETLINK answers: Invalid argument
+ tc class add dev ppp0 parent 1: classid 1:1 htb rate 410kbit ceil 410kbit burst 2k cburst 2k
RTNETLINK answers: No such file or directory
+ tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 164kbit ceil 410kbit prio 1
RTNETLINK answers: No such file or directory
+ tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 123kbit ceil 410kbit prio 2
RTNETLINK answers: No such file or directory
+ tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 123kbit ceil 246kbit prio 3 burst 1024 cburst 1024
RTNETLINK answers: No such file or directory
+ tc qdisc add dev ppp0 parent 1:10 handle 10: pfifo limit 25
RTNETLINK answers: No such file or directory
+ tc qdisc add dev ppp0 parent 1:20 handle 20: sfq perturb 10
RTNETLINK answers: No such file or directory
+ tc qdisc add dev ppp0 parent 1:30 handle 30: sfq perturb 10
RTNETLINK answers: No such file or directory
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 10 fw flowid 1:10
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 20 fw flowid 1:20
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 30 fw flowid 1:30
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc qdisc add dev ppp0 handle ffff: ingress
+ tc filter add dev ppp0 parent ffff: protocol ip prio 1 handle 30 fw police rate 1200kbit burst 32kbit drop flowid :1
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
|
From looking at that ouput, I'm thinking that it all may stem from the very first error which happens after this line:
Code: | tc qdisc add dev ppp0 root handle 1: htb default 30 r2q 2 |
So because something's not right there, the rest of the script fails because it has nothing to work with? I'm trying to understand this all a bit better as I go... |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun Sep 11, 2005 3:21 pm Post subject: |
|
|
Arny wrote: | Code: | tc qdisc add dev ppp0 root handle 1: htb default 30 r2q 2 |
So because something's not right there, the rest of the script fails because it has nothing to work with? I'm trying to understand this all a bit better as I go... |
Are you sure your kernel has HTB support enabled? The command is perfectly fine, I use the exact same one on my router, just tried it on my Gentoo box, no error. Must be your kernel. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 3:58 pm Post subject: |
|
|
It's definitely compiled into the kernel. Should I try setting it as a module, and if so, do I need to load the module or will tc take care of that? |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun Sep 11, 2005 4:17 pm Post subject: |
|
|
You sure you actually BOOTED the kernel you compiled HTB in? Yes, please try it as module - then we can at least tell by looking at lsmod wether it is actually loaded properly or not. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 4:21 pm Post subject: |
|
|
I'm absolutely positive I've booted the right kernel, I've been very careful with that as this is a new system and I've been getting everything setup (i.e. there've been a few duds in there ;P). I'll try it as a module and see how we go. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 5:11 pm Post subject: |
|
|
Ok, recompiled and booted with HTB as a module, here's the relevant output of lsmod:
Code:
Module Size Used by
sch_sfq 4512 -
sch_htb 15360 -
However, when I run the script I get this now:
Code: | + DEV=ppp0
+ UPSTREAM=410
+ DOWNSTREAM=1200
+ BURST=32
+ '[' '' = status ']'
+ tc qdisc del dev ppp0 root
+ tc qdisc del dev ppp0 ingress
+ '[' '' = stop ']'
+ tc qdisc add dev ppp0 root handle 1: htb default 30 r2q 2
+ tc class add dev ppp0 parent 1: classid 1:1 htb rate 410kbit ceil 410kbit burst 2k cburst 2k
+ tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 164kbit ceil 410kbit prio 1
+ tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 123kbit ceil 410kbit prio 2
+ tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 123kbit ceil 246kbit prio 3 burst 1024 cburst 1024
+ tc qdisc add dev ppp0 parent 1:10 handle 10: pfifo limit 25
+ tc qdisc add dev ppp0 parent 1:20 handle 20: sfq perturb 10
+ tc qdisc add dev ppp0 parent 1:30 handle 30: sfq perturb 10
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 10 fw flowid 1:10
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 20 fw flowid 1:20
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 30 fw flowid 1:30
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc qdisc add dev ppp0 handle ffff: ingress
+ tc filter add dev ppp0 parent ffff: protocol ip prio 1 handle 30 fw police rate 1200kbit burst 32kbit drop flowid :1
RTNETLINK answers: Invalid argument
We have an error talking to the kernel |
How do those lines look to you? Of interest, I ran the script a second time and it crashed the network interface (I'm loggin in via ssh). I'm still at a loss.
Last edited by Arny on Sun Sep 11, 2005 5:50 pm; edited 1 time in total |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun Sep 11, 2005 5:34 pm Post subject: |
|
|
Arny wrote: |
+ tc qdisc add dev ppp0 root handle 1: htb default 30 r2q 2
+ tc class add dev ppp0 parent 1: classid 1:1 htb rate 410kbit ceil 410kbit burst 2k cburst 2k
+ tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 164kbit ceil 410kbit prio 1
+ tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 123kbit ceil 410kbit prio 2
+ tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 123kbit ceil 246kbit prio 3 burst 1024 cburst 1024 |
...
Interesting to see that the HTB stuff now works. So it was indeed missing from the kernel earlier. As for the other errors: Same story, I think. Some of the QoS stuff still missing. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Sun Sep 11, 2005 5:53 pm Post subject: |
|
|
Ok, I've done the obvious and compiled everything as a module but nothing's changed still those same four errors. Everything under QoS and IP Netfilter Configuration is compiled as module. If you've got any other ideas I'll gladly give them a go tomorrow. |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Sep 12, 2005 12:57 pm Post subject: |
|
|
I still think something's missing in your kernel. I think the classifiers and filter stuff are actually below the QoS menu point. Are those all enabled too? Really sorry if I turn out to be wrong, but I just can't come up with another explanation than the kernel. |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Mon Sep 12, 2005 3:41 pm Post subject: |
|
|
I appreciate you taking the time to help me out. Anyway, absolutely everything is compiled as either a module or directly in under QoS; I've been through and checked several times. However, one several guides I've seen one option mentioned that needs to be enabled which I can't see anywhere called Traffic Policing. It's supposed to be under QoS as well, but I don't see it there. Any chance that's the problem? |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Sep 12, 2005 5:33 pm Post subject: |
|
|
Well it's all that stuff below QoS:
(Weird menu structure, I think this was completely different in 2.4)
Code: |
│ │[*] QoS and/or fair queueing ---> │ │
│ │<*> Firewall based classifier │ │
│ │<*> U32 classifier │ │
│ │[*] U32 classifier performance counters │ │
│ │[*] classify input device (slows things u32/fw) │ │
│ │[ ] Use nfmark as a key in U32 classifier │ │
│ │<*> Special RSVP classifier │ │
│ │<*> Special RSVP classifier for IPv6 │ │
│ │[*] Extended Matches │ │
│ │(32) Stack size │ │
│ │<*> Simple packet data comparison │ │
│ │<*> Multi byte comparison │ │
│ │<*> U32 hashing key │ │
│ │<*> Metadata │ │
│ │< > Textsearch │ │
│ │[*] Packet ACTION │ │
│ │<*> Policing Actions │ │
│ │<*> generic Actions │ │
│ │[*] generic Actions probability │ │
│ │<*> Packet In/Egress redirecton/mirror Actions │ │
│ │< > iptables Actions │ │
│ │<*> Generic Packet Editor Actions │ │
│ │<*> Simple action │ │
|
|
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Mon Sep 12, 2005 11:36 pm Post subject: |
|
|
Yep I've got all of that, but I think I've finally narrowed it down. When the script is trying to load the cls_fw module it's returning this error:
Code: | FATAL: Error inserting cls_fw (/lib/modules/2.6.12-gentoo-r10/kernel/net/sched/cls_fw.ko): Unknown symbol in module, or unknown parameter (see dmesg) |
And then dmesg gives me:
Code: | cls_fw: Unknown symbol tcf_action_exec |
I'm off to work now so I haven't got time to fiddle with this, but if you (or anyone) thinks of anything I can do to solve this in the meantime, let me know. |
|
Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Sep 13, 2005 6:39 am Post subject: |
|
|
I usually just update to the latest kernel when it seems that there's a bug in my current version.  |
|
Back to top |
|
 |
Arny n00b

Joined: 13 Oct 2004 Posts: 57
|
Posted: Tue Sep 13, 2005 10:46 am Post subject: |
|
|
Since I couldn't find any help by googling that error, I updated to 2.6.13-r1 and the script ran with no errors!
Annoyingly simple solution after all of that
Anyway, thanks for all of your help. |
|
Back to top |
|
 |
zefrer n00b

Joined: 13 Nov 2003 Posts: 16
|
Posted: Thu Oct 20, 2005 2:51 am Post subject: |
|
|
Well I'm a little late but I do have a solution to your problem.
If you're changing kernels make sure your symlink points to the kernel you are planning to use on next reboot(even if the kernel you are currently using is different)
Then re-emerge iproute2 and iptables.
Next configure your new kernel and make sure to enable the new options in Device Drivers->Networking->QoS that only show up if you re-emerge iproute2 on the new kernel! That's all  |
|
Back to top |
|
 |
|