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

Re: [ns] [bug] A bug in nortel DiffServ implementation?



Xuan Chen wrote:
> 
> Thanks for reporting the bug (especially by using our bug report page!)!
> 
> I fixed the bug by forcing the redq to update its states after
> BOTH enqueueing and dequeueing. So that, the idle flag will be set to 1 if
> the incoming packet is actually dropped. Any comments are appreciated!
> 
> You can check out the daily snapshot tomorrow to get these changes.
> 
> Cheers,
> -chen

Hi Chen!

Thanks for releasing a bug fix so fast.

I downloaded the fixed version and had a look at it. Results are looking
much better now, but I think there is another problem now:

As redQueue::updateREDStateVar is now called from enqueue and dequeue I
think the value of idletime_ could now be wrong in some cases.

Let's take the following situation: 

simulationtime  idle_  idletime_  action
---------------------------------------------------------
< t1            0      --         normal operation with queuelength > 0
t1              1      t1         dequeue, queuelength is now 0 so
marked as idle
t2              0      t1         enqueue, but packet dropped
t2              1      t2         at the end of enqueue
updateREDStateVar is 
                                  called to correct the wrong value in
idle_ but 
                                  also idletime_ is set now to new time
t2
t3              --     t2         next packet arrives and m ist
calculated with t2 
                                  as the value of idletime_ but it
should be t1!

the result is that at time t3 we calculate m(t2) but it should be m(t1)
because in fact the queue was idle since t1.

To fix that, the value of idletime_ must only be set in the call from
dequeue but not when updateREDStateVar is called from enqueue.

I think a better solution then first assigning a wrong value to idle_
and correcting it afterwards in the next step if the packet got dropped
is to call updateREDStateVar only from dequeue as it was and 
take care in enqueue that the value of idle_ is set correctly.

This means to remove the lines from the beginning of redQueue::enque
where idle_ is set to 0 and do the 
decission if idle_ has to be set to 0 at the end of redQueue::enque when
we know if the packet has been enqueued or dropped.
 
Best regards,
Thilo