Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: =?X-UNKNOWN?Q?=D8ystein_L=F8k=E5s=3B_NTNU=3B_H01?= <oystelok@unik.no>
To: lartc@vger.kernel.org
Subject: [LARTC] HTB and GRED
Date: Tue, 22 Jan 2002 12:21:12 +0000	[thread overview]
Message-ID: <marc-lartc-101170214401811@msgid-missing> (raw)

Hi all.

I am trying to implement diffserv on a router running linux using HTB. I
am not getting it to work!
My problem appears when I try to implement the AF classes. I am not able
to do the mapping from DSCP to GRED's DPs.
I have found some scripts implementing AF, but these use CBQ, and I want
to use HTB. I have tried to copy some scripts that works with CBQ and
"translate" them into HTB, but tc will not accept to assign a tcindex
filter to a HTB qdisc. I get a RTNETLINK error message, sying "no such
file or directory".
I do not quite understand the automatic creation of classes done by
tcindex.
Could anyone enlighten me?

My script with one AF class is as follows:

#Path:
TC=/home/oystelok/iproute2/tc/tc
$TC qdisc del dev eth0 root

#dsmark as root qdisc:
$TC qdisc add dev eth0 root handle 1:0 dsmark indices 64 set_tc_index 
$TC filter add dev eth0  parent 1:0 protocol ip prio 1 tcindex mask 0xfc
shift 2 pass_on

#Uses htb for link sharing
$TC qdisc add dev eth0 parent 1:0 handle 2:0 htb default 23

#Root class for htb, to make all the bandwidth available to AF and BE:
$TC class add dev eth0 parent 2:0 classid 2:1 htb rate 10Mbit burst 10kbit
cburst 1000

#EF class
$TC class add dev eth0 parent 2:1 classid 2:11 htb rate 5Mbit burst 5kbit
cburst 1000 

#Class for  AFxx and BE
$TC class add dev eth0 parent 2:1 classid 2:12 htb rate 5Mbit ceil 10Mbit
burst 5kbit cburst 1000 prio 1

#Class for AF1x
$TC class add dev eth0 parent 2:12 classid 2:21 htb rate 2Mbit ceil 10Mbit
burst 2kbit cburst 1000 prio 1
#Class for BE
$TC class add dev eth0 parent 2:12 classid 2:23 htb rate 1Mbit ceil 10Mbit
burst 2kbit cburst 1000 prio 2

#----Trying to configure GRED, does not succeed!!!-----
#Qdisc for AF1x
$TC qdisc add dev eth0 parent 2:21 handle 3:0 gred setup DPs 3 default 1

#Setup for AF11
$TC filter add dev eth0 parent 1:0 protocol ip  prio 2 handle 10 tcindex
classid 1:111
$TC qdisc change dev eth0 parent 2:21 gred min 8kbit max 10kbit burst 2
limit 200kbit avpkt 1000 probability 0.001 DP 1

#Setup for AF12
$TC filter add dev eth0 parent 1:0 protocol ip  prio 2 handle 12 tcindex
classid 1:112
$TC qdisc change dev eth0 parent 2:21 gred min 8kbit max 10kbit burst 2
limit 200kbit avpkt 1000 probability 0.001 DP 2

#Setup for AF13
$TC filter add dev eth0 parent 1:0 protocol ip  prio 2 handle 14 tcindex
classid 1:113
$TC qdisc change dev eth0 parent 2:21 gred min 8kbit max 10kbit burst 2
limit 200kbit avpkt 1000 probability 1.0 DP 3

#Qdisc for BE
$TC qdisc add dev eth0 parent 2:23 handle 5:0 red min 12kbit max 25kbit
burst 20 limit 200kbit avpkt 1000 bandwidth 10Mbit

#Filter for EF:
$TC filter add dev eth0 parent 2:0 protocol ip u32 match ip tos 0xb8 0xff
flowid 2:11
#Filter for AF1x:
$TC filter add dev eth0 parent 2:0 protocol ip u32 match ip tos 0x20 0xe0
flowid 2:21
#Filter for BE:
$TC filter add dev eth0 parent 2:0 protocol ip u32 match ip tos 0x00 0xff
flowid 2:23


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

             reply	other threads:[~2002-01-22 12:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-22 12:21 =?X-UNKNOWN?Q?=D8ystein_L=F8k=E5s=3B_NTNU=3B_H01?= [this message]
2002-01-22 13:20 ` [LARTC] HTB and GRED Martin Devera

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-101170214401811@msgid-missing \
    --to=oystelok@unik.no \
    --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