On Jul 30, 7:10 pm, igrandi <
imad.gra...@googlemail.com> wrote:
> Thank you for your answer. Could you please give further details: i
> did't get how it could be done using a queue; i think that i need
> rather a new net device. For the traffic shaper that i would build,
Right now, all NetDevices work thus:
When they receive a packet from higher layer, they call their
Queue's Enqueue-function.
If line is idle (clear to send), they immediately call Dequeue and
send out the packet.
If the line is busy, at next opportunity the device Dequeues next
packet from queue.
It's up to the Queue implementation to decide what packet comes back
to the NetDevice for it to send out. Thus, a Queue class can easily
act as whatever you need - priority queuing, RED, WRED, etc.
So basically, what happens to the packet after between Enqueue and
Dequeue is a black box - Droptail treats them as a simple FIFO buffer,
but the designs can obviously be much more complex.
I've myself created a priority queuing Queue class that is in fact
nothing more than three normal DropTail queues - upon Enqueue, it
decides based on packet contents which "sub-queue" it stores it in,
and upon Dequeue, it just checks what is the highest priority non-
empty queue.
So Queuing is simply a black box for netdevices. You don't need to
create your own device for traffic shaping.
You might take a look at the patch in
http://www.nsnam.org/bugzilla/show_bug.cgi?id=920
- it doesn't implement the PQ as a separate queue yet - you see, I
originally followed your line of thinking and patched
PointToPointNetDevice directly. I really should make an updated patch
that instead inherits from Queue class...