Re: [ns] Clearing a queue at a node in ns-2
> But this doesn't work. Uptarget_ gives me an NsObject instead of a LL > object... try casting it to an c++ LL object. Mind that this will only be a quick fix to see if it works - its terrible programming ! Pedro Vale Estrela > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: sexta-feira, 9 de Junho de 2006 23:33 > To: Pedro Vale Estrela > Cc: ns-users@ISI.EDU > 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 > >> > >> > >> > > > > > > >
Re: [ns] Clearing a queue at a node in ns-2
Here is what I put in my code: ll_->ifq_->reset(); which caused a segmentation fault initially. Those usually happen with NULL pointers, so I changed it to this statement: if (ll_!=NULL){ ll_->ifq_->reset(); } but I found out that this "if" statement is never stepped into! Can anyone help me out?? 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: <[EMAIL PROTECTED]> > To: "Pedro Vale Estrela" <[EMAIL PROTECTED]> > Cc: > 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 >>>> >>>> >>>> >>> >>> >>> >> >> >> > > >
Re: [ns] Clearing a queue at a node in ns-2
Yes, I'd want to stop queueing at that _particular_ node... but won't commenting everything out stop it everywhere (I still want it to continue at all the other nodes... it's an interesting simulation!). Thanks, 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: <[EMAIL PROTECTED]> > To: "Pedro Vale Estrela" <[EMAIL PROTECTED]> > Cc: > 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 >>>> >>>> >>>> >>> >>> >>> >> >> >> > > >
Re: [ns] Clearing a queue at a node in ns-2
...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: <[EMAIL PROTECTED]> > To: "Pedro Vale Estrela" <[EMAIL PROTECTED]> > Cc: > 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 >>>> >>>> >>>> >>> >>> >>> >> >> >> > > >
Re: [ns] Clearing a queue at a node in ns-2
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: <[EMAIL PROTECTED]> To: "Pedro Vale Estrela" <[EMAIL PROTECTED]> Cc: 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 >>> >>> >>> >> >> >> > > >
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 >> >> >> > > >
Re: [ns] Clearing a queue at a node in ns-2
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 > > >
[ns] Clearing a queue at a node in ns-2
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