Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: "Ronan LAVIEC" <ronan.laviec@club-internet.fr>
To: lartc@vger.kernel.org
Subject: [LARTC] Incomprehensive problem with tc filter & mangle...
Date: Tue, 07 Jan 2003 21:44:53 +0000	[thread overview]
Message-ID: <marc-lartc-104197594226744@msgid-missing> (raw)

First of all, hi !!!
And please be comprehensive for my poor english, cause I'm French and French
do not speak very well foreign language :o).

So my problem :

I use -j MARK in mangle table to catch packets with tc filter and to put
them in one or another class, but this doesn't work.

Here is the script I try to use to do QoS :

# This script try to give priority to small packets traffic
# This is due to always have good ping in online game, even if some
uploading are on.

UPLINK\x124
UPLINK_OTHERp

LAN_IFACE=eth1
EXT_IFACE=ppp0

# Mark all packets
$IPTABLES -t mangle -A PREROUTING -i $LAN_IFACE -m length --length 0:200 -j
MARK --set-mark 10
$IPTABLES -t mangle -A PREROUTING -i $LAN_IFACE -m length --length
200:400 -j MARK --set-mark 15
$IPTABLES -t mangle -A PREROUTING -i $LAN_IFACE -m length --length
400:800 -j MARK --set-mark 20
$IPTABLES -t mangle -A PREROUTING -i $LAN_IFACE -m length --length
800:1500 -j MARK --set-mark 25

$TC qdisc del dev $EXT_IFACE root    2> /dev/null > /dev/null
$TC qdisc del dev $EXT_IFACE ingress 2> /dev/null > /dev/null

$TC qdisc add dev $EXT_IFACE root handle 1: htb default 20

$TC class add dev $EXT_IFACE parent 1: classid 1:1 htb rate ${UPLINK}kbit
burst 6k

$TC class add dev $EXT_IFACE parent 1:1 classid 1:10 htb rate ${UPLINK}kbit
\
   burst 6k prio 1
$TC class add dev $EXT_IFACE parent 1:1 classid 1:20 htb rate
${UPLINK_OTHER}kbit \
   burst 6k prio 2

$TC qdisc add dev $EXT_IFACE parent 1:10 handle 10: sfq perturb 10
$TC qdisc add dev $EXT_IFACE parent 1:20 handle 20: sfq perturb 10

# The rules that's didn't work, and I don't now why.
$TC filter add dev $EXT_IFACE parent 1: protocol ip prio 15 \
   handle 10 fw classid 1:10
$TC filter add dev $EXT_IFACE parent 1: protocol ip prio 20 \
   handle 15 fw classid 1:10

# End of rc.qos

I don't now why this doesn't work, because filter rules are setting up, a
"tc filter show" gives :

filter parent 1: protocol ip pref 15 fw
filter parent 1: protocol ip pref 15 fw handle 0xa classid 1:10
filter parent 1: protocol ip pref 20 fw
filter parent 1: protocol ip pref 20 fw handle 0xf classid 1:10

But "tc class show" always gives :

class htb 1:1 root rate 124Kbit ceil 124Kbit burst 6Kb/8 mpu 0b cburst
1757b/8 mpu 0b level 7
 Sent 205068 bytes 151 pkts (dropped 0, overlimits 0)
 rate 2122bps 1pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 217601 ctokens: -8773

class htb 1:10 parent 1:1 leaf 10: prio 1 quantum 1587 rate 124Kbit ceil
124Kbit burst 6Kb/8 mpu 0b cburst 1757b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 317109 ctokens: 90735

class htb 1:20 parent 1:1 leaf 20: prio 2 quantum 1000 rate 70Kbit ceil
70Kbit burst 6Kb/8 mpu 0b cburst 1688b/8 mpu 0b level 0
 Sent 205068 bytes 151 pkts (dropped 0, overlimits 0)
 rate 2029bps 1pps
 lended: 151 borrowed: 0 giants: 0
 tokens: 385463 ctokens: -21851

This is always the default option that is used, it's as if the filter
weren't there.

And as this is my firts attempt to make something like this, I do not
necessaraly understand all the subtibility of tc rules (like u32 matches).

Ronan LAVIEC.

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2003-01-07 21:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-07 21:44 Ronan LAVIEC [this message]
2003-01-07 23:55 ` [LARTC] Incomprehensive problem with tc filter & mangle Victor Cassar
2003-01-08 10:50 ` Ronan LAVIEC
2003-01-08 18:32 ` Stef Coene
2003-01-08 18:57 ` Ronan LAVIEC
2003-01-08 19:07 ` Stef Coene
2003-01-13  6:47 ` hanhbnetfilter

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-104197594226744@msgid-missing \
    --to=ronan.laviec@club-internet.fr \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox