diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 0a4fcd6d3..8a46d2f21 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -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> args) - Bug 2461 - CommandLine should handle non-option arguments - Bug 2801 - FdNetDevice device MTU is not set correctly diff --git a/scratch/scratch-simulator.cc b/scratch/scratch-simulator.cc index aa7cc6fa4..acd414dbc 100644 --- a/scratch/scratch-simulator.cc +++ b/scratch/scratch-simulator.cc @@ -25,6 +25,10 @@ main (int argc, char *argv[]) { NS_LOG_UNCOND ("Scratch Simulator"); + Time retry = std::pow (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 (); } diff --git a/src/aodv/model/aodv-routing-protocol.cc b/src/aodv/model/aodv-routing-protocol.cc index 61f47c270..35705dbf3 100644 --- a/src/aodv/model/aodv-routing-protocol.cc +++ b/src/aodv/model/aodv-routing-protocol.cc @@ -1100,8 +1100,10 @@ RoutingProtocol::ScheduleRreqRetry (Ipv4Address dst) } else { - // Binary exponential backoff - retry = std::pow (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");