Skip to contentSkip to conversation

can anyone help me to solve this problem?

LARTC Folke Aeon 2 participants 10 messages Oct 25, 2002 – Oct 26, 2002

lore
Share & tools
lore

Folke Aeon

author
#0 lore raw

hi,

my purpose is to setup qdiscs at the egress according to the diffserv classes. and it has to be color-aware scheme. i have planed to mark the packets at the ingress qdisc and setup the proper dscp value at egress and still at the egress, directed those packets marked with proper dscp into different qdiscs.

BUT my trouble is , since i also use have to direct all packets into mpls layer , i cannot do the dscp marking at the egress . because the mpls header is added at the step immediately after the packet passes through system routing table. thus, when the packets goes into the egress queue, there is already a mpls header on the packet. i cannot setup proper filter based on the index value marked at the ingress. thought i still not quite sure whether it is because of the mpls header that influences my purpose,i think i'd better mark the dscp value at the ingress qdisc. but i because i have to classify the packets into different diffserv classed based on their CIR and BURST value, i cannot simply use iptables at the PREROUTING table to mark the dscp value.

Network
-----------+-----------

            |
  +---------+---------+
  |     PREROUTING    |
  +---------+---------+
            |
    +-------+-------+
    |      QOS      |
    |    INGRESS    |
    +-------+-------+
            |
    +-------+-------+
    |    ROUTING    |
    |     TABLE     | <------after the packet passes
    +-------+-------+        this section it has a
            |                mpls header with it.
  +---------+---------+
  |    POSTROUTING    |
  +---------+---------+
            |
     +------+------+
     |     QOS     |
     |    EGRESS   |
     +------+------+
            |

-----------+-----------
Network

does anybody have some good idea to
solve my problem?

thanks in advance .
any help will be appreciated.:)

folke.

_________________________________________________________________
Internet access plans that fit your lifestyle -- join MSN.
http://resourcecenter.msn.com/access/plans/default.asp

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw
Quoted 6 lines · Folke Aeon

BUT my trouble is , since i also use have to direct all packets into mpls layer , i cannot do the dscp marking at the egress . because the mpls header is added at the step immediately after the packet passes through system routing table.

You can explicitly classify on the DSCP, i.e. without using tcindex. If you need to explicitly skip the MPLS header, you may use a construct like this:

field mpls_hdr = raw if meta_protocol = ETH_P_MPLS; /* or whatever */ field ip_hdr = mpls_hrd[4]; /* skip shim header */

...

    do_whatever if ip_dscp = some_value;

...

Quoted 5 lines

on the packet. i cannot setup proper filter based on the index value marked at the ingress. thought i still not quite sure whether it is because of the mpls header that influences my purpose,

That's odd, yes. If MPLS clears skb->tc_index, that would be a bug.

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
author
#2 lore raw
In reply to Folke Aeon

Thanks Werner, :)

i still want to know whether i can mark the
dscp at the ingress qdisc or not , for if i cannot do this , then at the egress qdisc i still have no dscp to use . :(

Quoted 37 lines

From: Werner Almesberger <[email protected]>
To: Folke Aeon <[email protected]>
CC: Subject: Re: [LARTC] can anyone help me to solve this problem?
Date: Fri, 25 Oct 2002 14:39:14 -0300

Quoted 6 lines · Folke Aeon

BUT my trouble is , since i also use have to direct all packets into mpls layer , i cannot do the dscp marking at the egress . because the mpls header is added at the step immediately after the packet passes through system routing table.

You can explicitly classify on the DSCP, i.e. without using tcindex. If you need to explicitly skip the MPLS header, you may use a construct like this:

field mpls_hdr = raw if meta_protocol = ETH_P_MPLS; /* or whatever */ field ip_hdr = mpls_hrd[4]; /* skip shim header */

...

    do_whatever if ip_dscp = some_value;

...

Quoted 5 lines

on the packet. i cannot setup proper filter based on the index value marked at the ingress. thought i still not quite sure whether it is because of the mpls header that influences my purpose,

That's odd, yes. If MPLS clears skb->tc_index, that would be a bug.

- Werner

--

Quoted 7 lines

_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina [email protected]
/ /_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

_________________________________________________________________
Unlimited Internet access for only $21.95/month.  Try MSN!
http://resourcecenter.msn.com/access/plans/2monthsfree.asp

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

author
#3 lore raw
In reply to Folke Aeon
Quoted 8 lines

you may use a construct like this:

field mpls_hdr = raw if meta_protocol = ETH_P_MPLS; /* or whatever */ field ip_hdr = mpls_hrd[4]; /* skip shim header */

...

    do_whatever if ip_dscp = some_value;

...

well , would you please tell me where should i
add these ?

thanks :)

folke.

_________________________________________________________________
Get a speedy connection with MSN Broadband.  Join now!
http://resourcecenter.msn.com/access/plans/freeactivation.asp

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#4 lore raw
In reply to Folke Aeon
Quoted 2 lines · Folke Aeon

i still want to know whether i can mark the
dscp at the ingress qdisc or not

No, you can't. You might be able to perform the same classification at egress, though. If all else fails, you might be able to accomplish some marking based on ingress decisions with IMQ. (Well, or fix MPLS to preserve skb->tc_index.)

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#5 lore raw
In reply to Folke Aeon
Quoted 2 lines · Folke Aeon

well , would you please tell me where should i
add these ?

In your tcng configuration file. Of course, if you like things a bit more cryptic, you can also try to do this with plain u32 :-)

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
author
#6 lore raw
In reply to Folke Aeon
Quoted 5 lines
Quoted 2 lines · Folke Aeon

i still want to know whether i can mark the
dscp at the ingress qdisc or not

No, you can't. You might be able to perform the same classification

why not ? can't i port some of the dsmark functions to
the ingress qdisc to do this? for you see the following will return the :1 as tcindex value , is that it? tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: protocol ip prio 2 u32 \

    match ip ....
    flowid :1

then why can't i make to it return a value as the dscp value and directly stores it into the TOS field in the ip header?
if this is possible, would you please give me some
instructions on how to achieve this?

Quoted 2 lines

at egress, though. If all else fails, you might be able to accomplish some marking based on ingress decisions with IMQ.

can IMQ classify packets based on their RATE and BURST ?
if it cannot , then it wouldn't do any help to me . :(

Quoted 1 line

(Well, or fix MPLS to preserve skb->tc_index.)

to be frank i am not quite familiar with this stuff.
i just do everything according to the installation guide shipped with the mpls-patch downloaded at sf.net/mpls-linux/ :(

_________________________________________________________________
Unlimited Internet access -- and 2 months free!  Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

author
#7 lore raw
In reply to Folke Aeon

hi , Werner :)

i do the following modification to the net/sched/sch_ingress.c
ingress_enqueue() function , i simply add the following lines after the line 169: skb->tc_index = TC_H_MIN(res.classid);

if (skb->tc_index > 0xf || skb->tc_index = 0) {
	switch (skb->protocol) {
		case __constant_htons(ETH_P_IP):
		  	ipv4_change_dsfield(skb->nh.iph,
			    0x3,skb->tc_index);
			break;
		case __constant_htons(ETH_P_IPV6):
			ipv6_change_dsfield(skb->nh.ipv6h,
			    0x3,skb->tc_index);
			break;
		default:
			break;
	};
};

it works currently, but wonder whether there will be any negative influence or not. would you please give some comment on this ?

again , thanks for your precious time.

another thing, i noticed that since the dsmark dequeue function does not support mpls protocol, so when a mpls packet arrives, it complains "unsupported protocol". Although the tcindex value is still there, it just cannot use it . i think this is where the problem lies in.

folke.

_________________________________________________________________
Surf the Web without missing calls! Get MSN Broadband.
http://resourcecenter.msn.com/access/plans/freeactivation.asp

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#8 lore raw
In reply to Folke Aeon
Quoted 2 lines · Folke Aeon

can IMQ classify packets based on their RATE and BURST ?
if it cannot , then it wouldn't do any help to me . :(

I haven't used IMQ myself, but I'd expect it to work with policing, etc., like everywhere else, yes.

Quoted 5 lines
Quoted 1 line

(Well, or fix MPLS to preserve skb->tc_index.)

to be frank i am not quite familiar with this stuff.
i just do everything according to the installation guide shipped with the mpls-patch downloaded at sf.net/mpls-linux/ :(

I suppose, on
http://lists.sourceforge.net/lists/listinfo/mpls-linux-general
they could help you, if you described the problem.

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#9 lore raw
In reply to Folke Aeon
Quoted 3 lines · Folke Aeon

it works currently, but wonder whether there will be any negative influence or not. would you please give some comment on this ?

It should work. You just have to be aware that your kernel is doing some odd things ...

Quoted 3 lines

another thing, i noticed that since the dsmark dequeue function does not support mpls protocol, so when a mpls packet arrives, it complains "unsupported protocol".

Only if you try to change the DS field.

Quoted 2 lines

Although the tcindex value is still there, it just cannot use it . i think this is where the problem lies in.

No. tc_index does not have to equal the DSCP or DS field. In dsmark, tc_index is an index to a table with DS field changes. All you need to do is to reserve a tc_index value for non-IP traffic, and only mark IP traffic with other values than that.

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/