GPSR RESET HELLOINTERVAL

44 views
Skip to first unread message

jx_h...@foxmail.com

unread,
Mar 17, 2017, 11:23:10 AM3/17/17
to ns-3-users
hi all
i am tring to reset hellointerval when the simulation is runing.so i use Simulator::Schedule() to implement my reset.the code and output is shown blow.i initilized hellointerval to 4s and switch off JITTER.

it did output "change hi", however, actually the hellointerval did not changed.can anybody tell me why?



Konstantinos

unread,
Mar 17, 2017, 11:33:57 AM3/17/17
to ns-3-users
Hi,

With your Schedule method, you are setting the attribute with the helper class. This would have effect on new instances of GPRS created from that helper.
However, instances of GPSR which have already been created, are not affected. You will need to change the attribute for each instance created.
An easy method would be to use the Config::Set() and use the path to the attribute
For more details please refer to the manual

Regards,
K

Ng Tsunhian

unread,
Mar 18, 2017, 3:33:40 AM3/18/17
to ns-3-users
hi, Konstantinos
first of all, thanks a lot.i've read the document and finally chose using pointer to modify. i know use Cofig::Set() method would save much time. but the problem for me is the parameter----path. i don't know the path name is. did you know how to find the path i need quickly? is there any method to print all the path?

在 2017年3月17日星期五 UTC+8下午11:33:57,Konstantinos写道:

Ng Tsunhian

unread,
Mar 18, 2017, 8:45:00 AM3/18/17
to ns-3-users
i've read the infomation blow, and find the attribute path i need.
now, i have a new problem. i need to get the distance between two hello interval. so i need the trace source which about hello interval. since GPSR is not a default module of NS3. there is no document about GPSR. then i read gpsr.cc file, and find no any AddTraceSouce method used. what should i do? do i need to modify the source code to implement the trace source i need? or there are other ways?

在 2017年3月17日星期五 UTC+8下午11:33:57,Konstantinos写道:
Hi,

Konstantinos

unread,
Mar 18, 2017, 10:48:59 AM3/18/17
to ns-3-users
Hi,

I do not understand what you mean you need the distance between two hello interval. 
First, what do you mean by distance between two hello interval? Is the distance travelled by the node during that time?
Where do you want that information? If it is at the node who generates the hello, then no need to create trace source. A local temp variable can give you the previous position.
If it is at another node that receives the hello, again, no need to trace since you have that information received from the hello.

If you still want a trace source and there isn't one, yes, you need to implement it yourself

Regards,
K
Reply all
Reply to author
Forward
0 new messages