From: "Tim Carr" <tcarr@rim.net>
To: lartc@vger.kernel.org
Subject: [LARTC] Anyone seen this?
Date: Thu, 31 Oct 2002 19:59:46 +0000 [thread overview]
Message-ID: <marc-lartc-103609443808983@msgid-missing> (raw)
I'm moving my old HTB script over from my old slackware install (using older iproute2, version iproute2-ss991023) onto my brand-spanking-new Debian 3.0r0 (woody) machine, running newer version iproute2-ss010824. But in the new version of "tc", the very first command of the script gives "RTNETLINK answers: Invalid argument". However, if I use the OLD tc (991023), it works fine (and so does the rest of my script). Therefore it's not my kernel etc; it must be some difference on the cmd-line between the two versions of iproute2. But no matter how hard i try, I can't find out what the new syntax should be. Here's the line that's failing:
tc qdisc add dev eth0 root handle 1: htb default 13
Any ideas how to make that work with the new version?
Also, here's my HTB/SFQ setup for my house, I wonder if one of you genii could have a look over it and tell me the crap parts and how to improve :) My setup is one cablemodem connection with 25k/sec max upstream, and about 100k/sec downstream. I have 3 main classes (if that's the right word), one for SSH traffic, one for ACKs, and one for the personal PCs of the 3 guys that live in our house (including me). Here goes:
------------------------
#!/bin/sh
tc qdisc del dev eth0 root handle 1: htb default 13 1>/dev/null 2>/dev/null
tc qdisc add dev eth0 root handle 1: htb default 13
UPRATE="21"
SINGLE_HUMAN_CEIL="19"
NON_CRITICAL="14"
SINGLE_HUMAN_UPRATE="4"
CRIT_SSH="2"
CRIT_NONSSH="5"
# root
tc class add dev eth0 parent 1: classid 1:1 htb rate ${UPRATE}kbps ceil ${UPRATE}kbps burst 2k
# child 1 - PCs (tim/peter/brian/router PCs) - has leaves underneath
tc class add dev eth0 parent 1:1 classid 1:2 htb rate ${NON_CRITICAL}kbps ceil ${UPRATE}kbps burst 2k prio 3
# child 2 - time critical traffic (interactive traffic, etc) - has no leaves!
tc class add dev eth0 parent 1:1 classid 1:3 htb rate ${CRIT_SSH}kbps ceil ${UPRATE}kbps burst 2k prio 1
# child 3 - time critical traffic (interactive traffic, etc) - has no leaves!
tc class add dev eth0 parent 1:1 classid 1:4 htb rate ${CRIT_NONSSH}kbps ceil ${UPRATE}kbps burst 2k prio 2
# 1:10 tim
tc class add dev eth0 parent 1:2 classid 1:10 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio
3
# 1:11 peter
tc class add dev eth0 parent 1:2 classid 1:11 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio
3
# 1:12 brian
tc class add dev eth0 parent 1:2 classid 1:12 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio
3
# 1:13 default - includes this router
tc class add dev eth0 parent 1:2 classid 1:13 htb rate 2kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio 3
# use SFQ (stochastic fair queueing) for everything
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10
tc qdisc add dev eth0 parent 1:12 handle 12: sfq perturb 10
tc qdisc add dev eth0 parent 1:13 handle 13: sfq perturb 10
tc qdisc add dev eth0 parent 1:3 handle 3: sfq perturb 10
tc qdisc add dev eth0 parent 1:4 handle 4: sfq perturb 10
# matchings
# match any ACK packets to interactive (critical traffic)
tc filter add dev eth0 parent 1: protocol ip prio 5 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:4
# match ping packets to critical traffic
tc filter add dev eth0 parent 1: protocol ip prio 7 u32 \
match ip protocol 1 0xff flowid 1:4
# match SSH (not scp) to critical traffic
tc filter add dev eth0 parent 1: protocol ip prio 6 u32 \
match ip tos 0x10 0xff flowid 1:3
# match packets MARKed by iptables for individual PCs
tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 10 fw flowid 1:10
tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 11 fw flowid 1:11
tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 12 fw flowid 1:12
-------------------------
It works, but i'm not sure if it could be improved at all. I don't know much about burst/prio settings for HTB, and even less about the SFQ stuff i'm using with perturb 10. Also, I get some warnings about HTB's quantums in various log files, none of which I understand.
All help welcome!
many thanks,
tim
-----------------------------------
Tim Carr
Co-op Student - Unix Group
RIM Canada
(519) 888-7465 x2561
WATERLOO HANDMADE EMAIL PROJECT:
This email is made from natural Jute fibers by artisans
working at the Handmade Email Project. Your
correspondence revives a traditional craft and helps
create employment for underpriviledged co-op students
working the rural areas of Waterloo.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next reply other threads:[~2002-10-31 19:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-31 19:59 Tim Carr [this message]
2002-10-31 21:28 ` [LARTC] Anyone seen this? Stef Coene
2002-11-01 15:29 ` Tim Carr
2002-11-01 15:43 ` Tim Carr
2002-11-01 15:43 ` Luc Brouard
2002-11-01 16:10 ` Stef Coene
2002-11-01 16:47 ` Tim Carr
2002-11-01 17:03 ` Stef Coene
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-lartc-103609443808983@msgid-missing \
--to=tcarr@rim.net \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.