aodv: (fixes #2517, 2911) Binary exponential backoff problem
This commit is contained in:
@@ -32,6 +32,7 @@ New user-visible features
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 2911 - aodv: Binary exponential backoff can become unlimited
|
||||
- Bug 2901 - Add CommandLine::Parse (const std::vector<std::string>> args)
|
||||
- Bug 2461 - CommandLine should handle non-option arguments
|
||||
- Bug 2801 - FdNetDevice device MTU is not set correctly
|
||||
|
||||
@@ -25,6 +25,10 @@ main (int argc, char *argv[])
|
||||
{
|
||||
NS_LOG_UNCOND ("Scratch Simulator");
|
||||
|
||||
Time retry = std::pow<uint16_t> (2, 3 - 1) * Seconds (3);
|
||||
uint16_t backoffFactor = 3 - 1;
|
||||
Time retry2 = Seconds (3) * (1 << backoffFactor);
|
||||
std::cout << "Retry " << retry.GetSeconds () << " " << retry2.GetSeconds () << std::endl;
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
@@ -1100,8 +1100,10 @@ RoutingProtocol::ScheduleRreqRetry (Ipv4Address dst)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Binary exponential backoff
|
||||
retry = std::pow<uint16_t> (2, rt.GetRreqCnt () - 1) * m_netTraversalTime;
|
||||
NS_ABORT_MSG_UNLESS (rt.GetRreqCnt () > 0, "Unexpected value for GetRreqCount ()");
|
||||
uint16_t backoffFactor = rt.GetRreqCnt () - 1;
|
||||
NS_LOG_LOGIC ("Applying binary exponential backoff factor " << backoffFactor);
|
||||
retry = m_netTraversalTime * (1 << backoffFactor);
|
||||
}
|
||||
m_addressReqTimer[dst].Schedule (retry);
|
||||
NS_LOG_LOGIC ("Scheduled RREQ retry in " << retry.GetSeconds () << " seconds");
|
||||
|
||||
Reference in New Issue
Block a user