[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[altq:1847] Re: CBQ interna



Daniel Breest wrote:
> i have two questions concering cbq interna.
> First, i was wondering, why the cbq implementation uses not the existing
> fifoq as queuing discipline for a class but a cbq internal fifo implementation.
> That way, it is not easy, but nearly impossible to use a different elementary
> queueing discipline, for example a token bucket queue to shape the flow that
> is assigned to a cbq class. Well, i know that a class, that is not allowed
> to borrow bandwidth, effective does the shaping of a flow too. But, i think,
> for a guaranteed service flow, the allocated bandwidth can be higher than the
> one, originally defined in a simple traffic profile due to the error terms of
> a router. So, traffic will not be shaped to that profile but to the higher
> rate. Therefore it needs a additional component, which also allows the shaping
> against a more complex traffic profile (dual token bucket). Please correct
> me, if this is not quite correct.   
> What are the drawbacks, if the cbq or the hfsc scheduler works on a well
> defined queuing interface, say the already existing functions altq_enqueue and
> altq_dequeue, which are mapped to the discipline specific functions. Further,
> one needs to provide a dropall function and a function that provides the
> number of packets that are stored in the queuing discipline. A different way
> would be, to implement enhanced functionality via the more flexible request
> function. As far as i can see, one drawback is, that it is a lot of work.

token-bucket is a good conceptual model for a rate-regulated queue.
But it is expensive to implement in software, espeically when there
are many queues.
(note that CBQ was originally implemented by Van Jacobson and Sally
Floyd in 1995 when a PC had a 100MHz CPU.)

> Second, the chapter about cbq in the altq dissertation says, that when a
> class becomes backlogged, it is placed in a list of active classes. The pointer
> to the first active class for every priority level is stored in the "active"
> array in the rm_ifdat structure. As far as i can see, a class will be added
> to the active list in the rmc_newclass function and will never be removed from
> this list, in case the class is no longer backlogged. Is this analysis
> correct, and if so, why?

You are right.  An empty class is not removed from the active list in
the current implementation.
I seem to have confused CBQ with other discipline when I wrote it.
(and the array name is confusing enough for that...)

-Kenjiro