Hi all,
for a few experiments I would like to change on the fly the HelloInterval paramter on OLSR protocol.
I modified the olsr-routing-protocol.cc in this way:
void RoutingProtocol::HelloTimerStop (Time helloInterval)
{
m_helloTimer.Cancel();
m_helloInterval = helloInterval;
SendHello ();
m_helloTimer.Schedule (m_helloInterval);
}
And I call the this function from the simulator.
First I did this:
std::vector<Ptr<olsr::RoutingProtocol> > olsr_vector;
for (ii=0; ii< n_nodes ; ii++)
{
Ptr<Ipv4RoutingProtocol> prot = nodes.Get(ii)->GetObject<Ipv4>()->GetRoutingProtocol();
olsr_vector.push_back(DynamicCast<olsr::RoutingProtocol>(prot));
}
int intervalChange = 50;
Simulator::Schedule(Seconds(intervalChange),&changeValueOLSR,intervalChange,olsr_vector);
and when I need I call
void changeValueOLSR(int intervalChange , std::vector<Ptr<olsr::RoutingProtocol> > olsr_vector)
{
std::cout << "TEST " <<Simulator::Now ().GetSeconds () << std::endl;
double HelloInterval_BAYES = 2.0;
if(startMove == 1)
{
HelloInterval_BAYES = 0.1;
startMove = 0;
}
else
{
startMove = 1;
}
for(int ii=0; ii<9; ii++)
Simulator::Schedule(Seconds(intervalChange),&changeValueOLSR,intervalChange,olsr_vector);
}
The first thing I did was to see if I am changing m_helloInterval value with the same value it was assigned what happen to the throughput?
So in my case if HelloInterval_BAYES=2.0 .
I found the there are some difference regarding the throughput when I changed the the m_helloInterval.
The throughput is higher when I don't change the parameter than when I change the parameter but with the same value.
Do you think is something happen when I stop the timer and maybe the routing table are thrown away?
Thank you
Matteo