diff -r 8359b3ac1ab0 src/aodv/model/aodv-routing-protocol.cc --- a/src/aodv/model/aodv-routing-protocol.cc Fri Jun 03 10:54:07 2011 -0700 +++ b/src/aodv/model/aodv-routing-protocol.cc Fri Jun 03 15:29:14 2011 -0700 @@ -105,7 +105,11 @@ MyRouteTimeout (Time (2 * std::max (PathDiscoveryTime, ActiveRouteTimeout))), HelloInterval (Seconds (1)), AllowedHelloLoss (2), - DeletePeriod (Time (5 * std::max (ActiveRouteTimeout, HelloInterval))), + // The current implementation using hello messages to maintain connectivity + // Per RFC 3561 + // DELETE_PERIOD must be at least ALLOWED_HELLO_LOSS * HELLO_INTERVAL + // TODO : Implement the case when EnableHello is set to False + DeletePeriod (2 * 1), NextHopWait (NodeTraversalTime + MilliSeconds (10)), TimeoutBuffer (2), BlackListTimeout (Time (RreqRetries * NetTraversalTime)), @@ -182,6 +186,15 @@ TimeValue (Seconds (15)), MakeTimeAccessor (&RoutingProtocol::DeletePeriod), MakeTimeChecker ()) + .AddAttribute (" DeletePeriod", "DeletePeriod is intended to provide an upper bound on the time for which an upstream node A " + "can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D." + "WARNING: must be overridden for the case when EnableHello is set to False. To be implemented" +// The current implementation using hello messages to maintain connectivity. Per RFC 3561 DELETE_PERIOD must be at least ALLOWED_HELLO_LOSS * HELLO_INTERVAL" +// "can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D." + " = 2 * 1", + TimeValue (Seconds (2)), + MakeTimeAccessor (&RoutingProtocol::DeletePeriod), + MakeTimeChecker ()) .AddAttribute ("TimeoutBuffer", "Its purpose is to provide a buffer for the timeout so that if the RREP is delayed" " due to congestion, a timeout is less likely to occur while the RREP is still en route back to the source.", UintegerValue (2), @@ -873,8 +886,11 @@ ScheduleRreqRetry (dst); if (EnableHello) { - m_htimer.Cancel (); - m_htimer.Schedule (HelloInterval - Time (0.01 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + if(!m_htimer.IsRunning ()) + { + m_htimer.Cancel (); + m_htimer.Schedule (HelloInterval - Time (0.01 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + } } } @@ -1137,8 +1153,11 @@ if (EnableHello) { - m_htimer.Cancel (); - m_htimer.Schedule (HelloInterval - Time (0.1 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + if (!m_htimer.IsRunning ()) + { + m_htimer.Cancel (); + m_htimer.Schedule (HelloInterval - Time (0.1 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + } } }