[ns] Clearing a queue at a node in ns-2
smythek@u.washington.edu
smythek at u.washington.edu
Fri Jun 9 16:08:23 PDT 2006
...I'd even be willing to just make the queue "blocked" at the node, but I can't seem to access the blocked_ variable from mac-802_11.cc (which is where I need to have this queue stuff happen). Can anyone help?
Kathy
On Fri, 9 Jun 2006, Shafiq Hashmi wrote:
> If you want to stop queueing at all, then
>
> in queue.cc, within void Queue::recv(Packet* p, Handler*) method, comment
> everything else but the line
> target_->recv(p, &qh_);
>
> I dont know whether will it answer your problem or not.
>
> Shafiq
>
>
>
>
>
>
> ----- Original Message ----- From: <smythek at u.washington.edu>
> To: "Pedro Vale Estrela" <pedro.estrela at gmail.com>
> Cc: <ns-users at ISI.EDU>
> Sent: Friday, June 09, 2006 6:32 PM
> Subject: Re: [ns] Clearing a queue at a node in ns-2
>
>
>>
>> Whoah, that is too complicated for me. I don't know ns-2 very well. What
>> do you mean by:
>> "make a pointer to the ITF" -- doesn't it have a pointer (uptarget_)?
>> According to the diagram on pg 145 I should do uptarget_
>> ->downtarget_->reset()
>> since
>> uptarget will take me to the LL, downtarget will take me to the IFq, and
>> reset will reset the queue for that node.
>>
>> But this doesn't work. Uptarget_ gives me an NsObject instead of a LL
>> object...
>>
>>
>>
>> On Fri, 9 Jun 2006, Pedro Vale Estrela wrote:
>>
>>>
>>> Yes,
>>>
>>> http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf
>>> pag 145,
>>>
>>> - at your C++ MAC module, make a pointer to the ITF;
>>> - either search the C++ NODE methods for getting the pointer
>>> reference you need (you want the reverse of the downtarget_ on the ITF;
>>> for
>>> making this, search the code that sets the downtarget_ variable in C++ in
>>> the ITF; (tip: use DDD, put a breakpoint somewhere in mobilenode.cc)
>>> in that moment, set something like:
>>> downtarget_->my_ITF_ = this;
>>>
>>> - then at the appropriate time, call reset() of it.
>>> my_ITF->reset();
>>>
>>> Of course that this is not good C++ Object-Orientation practices, but use
>>> it
>>> to simply try your ideia; if it works nice, then make the same thing with
>>> provte variables and public set/get methods.
>>>
>>>
>>> You can also perform the same trick by:
>>> Calling TCL / searching the ITF object you want based on the current MAC
>>> object / call reset of it. The benefit is that you can fine tune this
>>> method
>>> without recompiling NS2 each time.
>>>
>>>
>>> If this works, please put this on the NS2 WIKI!
>>> Pedro Vale Estrela
>>>
>>>
>>>> Hi ns,
>>>>
>>>> I'd like to clear a node's queue from the mac-layer in my simulation
>>>> after
>>>> I've received a certain packet. Can I call a PacketQueue function like
>>>> "reset()" from the mac layer? If not, how would I clear the queue?
>>>>
>>>> Thanks!
>>>>
>>>> Kathy
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
More information about the Ns-users
mailing list