View | Details | Raw Unified | Return to bug 2517
Collapse All | Expand All

(-)a/src/aodv/model/aodv-routing-protocol.cc (-3 / +7 lines)
 Lines 1045-1059    Link Here 
1045
  m_addressReqTimer[dst].SetArguments (dst);
1045
  m_addressReqTimer[dst].SetArguments (dst);
1046
  RoutingTableEntry rt;
1046
  RoutingTableEntry rt;
1047
  m_routingTable.LookupRoute (dst, rt);
1047
  m_routingTable.LookupRoute (dst, rt);
1048
  Time retry;
1048
  Time retry = m_netTraversalTime;
1049
  if (rt.GetHop () < m_netDiameter)
1049
  if (rt.GetHop () < m_netDiameter)
1050
    {
1050
    {
1051
      retry = 2 * m_nodeTraversalTime * (rt.GetHop () + m_timeoutBuffer);
1051
      retry = 2 * m_nodeTraversalTime * (rt.GetHop () + m_timeoutBuffer);
1052
    }
1052
    }
1053
  else
1053
  else
1054
    {
1054
    {
1055
      // Binary exponential backoff
1055
      if (rt.GetRreqCnt () > 1)
1056
      retry = std::pow<uint16_t> (2, rt.GetRreqCnt () - 1) * m_netTraversalTime;
1056
        {
1057
          uint16_t backoffFactor = rt.GetRreqCnt () - 1;
1058
          NS_LOG_LOGIC ("Applying binary exponential backoff factor " << backoffFactor);
1059
          retry = m_netTraversalTime * (1 << backoffFactor);
1060
        }
1057
    }
1061
    }
1058
  m_addressReqTimer[dst].Schedule (retry);
1062
  m_addressReqTimer[dst].Schedule (retry);
1059
  NS_LOG_LOGIC ("Scheduled RREQ retry in " << retry.GetSeconds () << " seconds");
1063
  NS_LOG_LOGIC ("Scheduled RREQ retry in " << retry.GetSeconds () << " seconds");

Return to bug 2517