[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Processing delay
Hi,
I hope I've understand you problem:
You have an agent; it receives a packet and process it; during this
process, if the agent
receives another packet, he discards or enqueue it.
A simple solution is to have a flag and test it in handle (recv) method
of the agent. If
flags = busy, discard the packet.To give values to the variable flag:
when the agent
receives a packet, he puts flag=busy and generates an event (at-event)
to set flag=idle
in the desired amount of time using a new method added to the agent.
$ns at expr [ [$ns now] + $delay_time] ] "$ self set_flag $idle"
This solution has the adventage thas is completely implemented in Otcl.
Regards,
Guillermo
Yukio Hashimoto wrote:
> Hi. ns-users:
>
> I want to apply processing delay to an agent.
>
> Agent works like:
> 1. receive a packet
> 2. make new packets and send them
> 3. do nothing during processing delay
> 4. back to 1. (process next packet)
>
> I used Timer, but it causes a problem that the agent can receive a
> packet and send new packets before timeout.
>
> Does anyone know how to solve this problem?
>
> Thanks in advance.
>
> --Yukio HASHIMOTO