Schedule an event to run at simulation time

62 views
Skip to first unread message

Mehran Zamani

unread,
Feb 7, 2016, 11:43:01 AM2/7/16
to ns-3-users
Hi
I have a problem in scheduling an event to run all over the simulation time beside other events. I appreciate you if you could help me.
exactly, I wanna schedule a function in order to be capable to receive parameters of hello packets of OLSR for all nodes. 
best regards

Konstantinos

unread,
Feb 8, 2016, 4:10:16 AM2/8/16
to ns-3-users
Hi Mehran,

Could you please explain your scenario a bit more clearly? 
What do you mean you want to receive HELLO parameters for all nodes? 
Every OLSR node is capable of receiving HELLO messages from any neighbor (node within the comm. range). 
Where do you want to have this 'special' function? 

Regards,
K.

Mehran Zamani

unread,
Feb 8, 2016, 6:42:02 AM2/8/16
to ns-3-users
Hi Konstantinos
i added a parameter to the field in reserved space of hello message header so i could get it when a node send a hello message.
when a node want to send the hello message, i initialize the parameter with proper value. when a node receive a hello packet, i need that parameter so i want to store it as feature of it's 1 hop neighbor.
i think i need to schedule an event that starts when a hello packet is received and after that i store that parameter in my variable but i study Simulator::Schedule and i can't find a way to run whenever 
a hello message is received because this class need to specify the exact time to run that event but i want to run it on this condition(hello packet reception). there is another way to do it by listening to a socket which
hello packet is sent but problem is that i don't have access to that socket. the socket is declared in olsr routing protocol class. this way i need to know every node special socket which send hello packet thorough it.   




Konstantinos

unread,
Feb 8, 2016, 7:05:21 AM2/8/16
to ns-3-users
Hi,

You are making your life difficult.

HELLO packets are received by nodes and the current contents are stored to the neighbor table (see ProcessHello method).
All you need to do, is to add another column to that table (i.e. another variable in each entry) and assign the value you receive.
No need to scheduling.

K.
Reply all
Reply to author
Forward
0 new messages