All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hocking James A <JAHOCKING@qinetiq.com>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] DSCP remarking + GRED at one go?
Date: Mon, 31 Mar 2003 16:08:50 +0000	[thread overview]
Message-ID: <marc-lartc-104912699408766@msgid-missing> (raw)
In-Reply-To: <marc-lartc-104910731021038@msgid-missing>

Hi Titus,

I just tried this, and it seems you can. See script below. I did it quite
quickly, so there may be an error somewhere - every 30 seconds or so it
prints out an error on the commandline (something like - dsmark_dequeue:
unsupported protocol 2054), but it remarks packets correctly, and then
enqueues them in the right place, so it is functional.

The basic idea is use the root dsmark qdisc to remark packets as usual. As a
child to this set up another dsmark qdisc which matches packets using
tcindex as usual, and within this qdisc set up your classful qdisc, and
GRED...

Regards,
James

==========================
#!/bin/bash

#Test to see if you can mark and use GRED with dsmark simultaneously.
#Takes outgoing HTTP traffic, marks it af11 and queues it in GRED

DEV='eth0'

tc qdisc del dev $DEV root

#DSMARK - for marking
tc qdisc add dev $DEV root handle 1:0 dsmark indices 64

#Marking classes
tc class change dev $DEV parent 1:0 classid 1:1 dsmark mask 0x3 value 0x28
tc class change dev $DEV parent 1:0 classid 1:2 dsmark mask 0x3 value 0x0

#Filters - second one matches everything the first one missed
tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 match ip dport 80
0xffff flowid 1:1
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip tos 0x0
0x0 classid 1:2

#DSMARK - matching on DSCP
tc qdisc add dev $DEV parent 1: handle 2: dsmark indices 64 default_index
0x1 set_tc_index

#Filter to get DSCP from TOS
tc filter add dev $DEV parent 2: protocol ip prio 1 tcindex mask 0xfc shift
2 pass_on

#Sets tcindex of packets marked af11 to 1
tc filter add dev $DEV parent 2: protocol ip prio 1 handle 0x0a tcindex
classid 2:1

#HTB
tc qdisc add dev $DEV parent 2: handle 3: htb default 20

#This class allows sharing of bandwidth (note the b/ws are random figures)
tc class add dev $DEV parent 3: classid 3:1 htb rate 300kbit burst 20kbit

#Leaf classes
tc class add dev $DEV parent 3:1 classid 3:10 htb rate 100kbit burst 20kbit
tc class add dev $DEV parent 3:1 classid 3:20 htb rate 200kbit burst 20kbit

#Leaf qdisc - GRED 
tc qdisc add dev $DEV parent 3:10 gred setup DPs 3 default 2 grio
tc qdisc change dev $DEV parent 3:10 gred limit 60KB min 15KB max 45KB burst
20 avpkt 1000 bandwidth 300kbit DP 1 probability 0.02 prio 2
tc qdisc change dev $DEV parent 3:10 gred limit 60KB min 15KB max 45KB burst
20 avpkt 1000 bandwidth 300kbit DP 2 probability 0.04 prio 3
tc qdisc change dev $DEV parent 3:10 gred limit 60KB min 15KB max 45KB burst
20 avpkt 1000 bandwidth 300kbit DP 0 probability 0.06 prio 4

#Leaf filter - best effort defaults to class 3:20
tc filter add dev $DEV parent 3:0 protocol ip prio 1 handle 1 tcindex
classid 3:10

==========================

> -----Original Message-----
> From: Hoon Titus [mailto:hoontitu@comp.nus.edu.sg]
> Sent: 31 March 2003 11:41
> To: lartc@mailman.ds9a.nl
> Subject: [LARTC] DSCP remarking + GRED at one go?
> 
> 
> Daer all,
> 
> Is it possible to do DSCP remarking + GRED at one go using tc?
> 
> The examples that I found on the Net is either doing DSCP 
> remark or GRED
> but not both.
> 
> I have read the IETF draft 
> draft-almesberger-wajhak-diffserv-linux-00.txt
> @
> http://snafu.freedom.org/linux2.2/docs/draft-almesberger-wajha
> k-diffserv-linux-00.txt
> and it mentioned in Figure 7 that it is possible to change 
> the DS field.
> 
> Can anyone enlighten me? :-)
> 
> Thanks and Regards,
> Titus
> 
> 
> 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 

The Information contained in this E-Mail and any subsequent correspondence
is private and is intended solely for the intended recipient(s).
For those other than the recipient any disclosure, copying, distribution,
or any action taken or omitted to be taken in reliance on such information
is prohibited and may be unlawful.

Emails and other electronic communication with QinetiQ may be monitored.
Calls to our Customer Contact Centre may be recorded for quality control,
regulatory and monitoring purposes.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2003-03-31 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-31 10:40 [LARTC] DSCP remarking + GRED at one go? Hoon Titus
2003-03-31 16:08 ` Hocking James A [this message]
2003-04-01  5:05 ` Hoon Titus
2003-04-01  6:30 ` Rinse Kloek
2003-04-01  8:52 ` Hoon Titus

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-104912699408766@msgid-missing \
    --to=jahocking@qinetiq.com \
    --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.