[Click] Rated Unqueue element

Eddie Kohler kohler at cs.ucla.edu
Mon Apr 3 03:02:52 EDT 2006


Hi,

> Thanks for the help, I am very new to click and programming in general.

Click can't be the easiest way to learn programming. :(

> I
> have tried implementing the code you suggested but am receiving the
> following error;
> 
> tosunqueue.cc:76: error: `ComparePackets' undeclared (first use this
> function)

You have not #include'd the header file that declares the ComparePackets 
element.  This seems like the first thing to fix.

> tosunqueue.cc:76: error: (Each undeclared identifier is reported only once
> for
>    each function it appears in.)
> tosunqueue.cc:76: error: parse error before string constant
> tosunqueue.cc:79: error: `what_you_want' undeclared (first use this
> function)
> tosunqueue.cc:79: warning: unused variable `String rate_str'
> 
> also I am not sure what you mean by the what_you_want field and where it
> should be declared. I have left it with this name so you can associate with
> it.
> 
> It may help if I told you exactly what I am trying to do. I am investigating
> AQM for priority based flows. I have written an element that sets the TOS
> field in the IP Header

Such an element already exists, it is called SetIPDSCP.

  and I am using this to differentiate between flows
> with values between 0-255, 255 being the highest priority.

You should not use all 8 bits of the TOS field, as 2 of them are now used for ECN.

  The element I am
> trying to create is based on the RatedUnqueue element. But I want my element
> to calculate the rate at which it should pull packets from the queue by
> using the TOS value of that flow to calculate a percentage of the max rate
> which is the parameter passed to the element at configuration. 

This assumes that the queue includes only one type of packet, right?  In which 
case why not have 256 queues, and set each queue's rate statically?

I need to
> calcualte the pull rate before the packets are pulled from the queue so
> that is why I want to use handlers to read the TOS value of the flows from
> the ComparePackets element and use this to calculate the rate at which to
> pull the packets from the upstream queue, I am not sure this is the best way
> to do it though. Do you know how exactly the
> _rate.set_rate(r, errh);
> line works in the RatedUnqueue element and can it be used outside of the
> configuration function. As I would like to use the read handlers to read in
> the TOS value of the flow, use this to calcuate the percentage of max rate
> for that flow and then use _rate.set_rate. At moment I am not sure how to
> do this as it seems this function must be used in the configuration stage.
> 
> Sorry about the long question. But I have been playing around with this for
> ages with no luck and need to get it done quite urgently.

It is unlikely you will be able to get this done urgently on your own.  Seek 
to simplify your problem.

Eddie


More information about the click mailing list