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

(-)a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dcf-manager.cc (-1 / +1 lines)
 Lines 764-770   DcfManager::NotifyNavStartNow (Time duration) Link Here 
764
void
764
void
765
DcfManager::NotifyAckTimeoutStartNow (Time duration)
765
DcfManager::NotifyAckTimeoutStartNow (Time duration)
766
{
766
{
767
  NS_ASSERT (m_lastAckTimeoutEnd < Simulator::Now ());
767
  NS_ASSERT (m_lastAckTimeoutEnd <= Simulator::Now ());
768
  m_lastAckTimeoutEnd = Simulator::Now () + duration;
768
  m_lastAckTimeoutEnd = Simulator::Now () + duration;
769
}
769
}
770
void
770
void
(-)a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/mac-low.cc (-19 / +41 lines)
 Lines 1595-1607   MacLow::NormalAckTimeout (void) Link Here 
1595
{
1595
{
1596
  NS_LOG_FUNCTION (this);
1596
  NS_LOG_FUNCTION (this);
1597
  NS_LOG_DEBUG ("normal ack timeout");
1597
  NS_LOG_DEBUG ("normal ack timeout");
1598
  // XXX: should check that there was no rx start before now.
1598
  
1599
  // Should check that there was no rx start before now.
1599
  // we should restart a new ack timeout now until the expected
1600
  // we should restart a new ack timeout now until the expected
1600
  // end of rx if there was a rx start before now.
1601
  // end of rx if there was a rx start before now.
1601
  m_stationManager->ReportDataFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
1602
  if(m_phy->IsStateRx()){
1602
  MacLowTransmissionListener *listener = m_listener;
1603
    Time timeUntilIdle = m_phy->GetDelayUntilIdle();
1603
  m_listener = 0;
1604
    NotifyAckTimeoutStartNow (timeUntilIdle);
1604
  listener->MissedAck ();
1605
    m_normalAckTimeoutEvent = Simulator::Schedule (timeUntilIdle, &MacLow::NormalAckTimeout, this);
1606
    NS_LOG_DEBUG ("Still in Rx, rescheduling ack timeout");
1607
  }
1608
  else{
1609
    m_stationManager->ReportDataFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
1610
    MacLowTransmissionListener *listener = m_listener;
1611
    m_listener = 0;
1612
    listener->MissedAck ();
1613
  }
1605
}
1614
}
1606
void
1615
void
1607
MacLow::FastAckTimeout (void)
1616
MacLow::FastAckTimeout (void)
 Lines 1615-1624   MacLow::FastAckTimeout (void) Link Here 
1615
      NS_LOG_DEBUG ("fast Ack idle missed");
1624
      NS_LOG_DEBUG ("fast Ack idle missed");
1616
      listener->MissedAck ();
1625
      listener->MissedAck ();
1617
    }
1626
    }
1618
  else
1627
  else if(m_phy->IsStateRx()){
1619
    {
1628
    Time timeUntilIdle = m_phy->GetDelayUntilIdle();
1620
      NS_LOG_DEBUG ("fast Ack ok");
1629
    NotifyAckTimeoutStartNow (timeUntilIdle);
1621
    }
1630
    m_fastAckTimeoutEvent = Simulator::Schedule (timeUntilIdle, &MacLow::FastAckTimeout, this);
1631
    NS_LOG_DEBUG ("Still in Rx, rescheduling fast ack timeout");
1632
  }
1622
}
1633
}
1623
void
1634
void
1624
MacLow::BlockAckTimeout (void)
1635
MacLow::BlockAckTimeout (void)
 Lines 1626-1635   MacLow::BlockAckTimeout (void) Link Here 
1626
  NS_LOG_FUNCTION (this);
1637
  NS_LOG_FUNCTION (this);
1627
  NS_LOG_DEBUG (m_currentHdr.GetAddr1 () << " " << m_currentHdr.GetAddr3 () << " " <<  "block ack timeout");
1638
  NS_LOG_DEBUG (m_currentHdr.GetAddr1 () << " " << m_currentHdr.GetAddr3 () << " " <<  "block ack timeout");
1628
1639
1629
  m_stationManager->ReportDataFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
1640
  if(m_phy->IsStateRx()){
1630
  MacLowTransmissionListener *listener = m_listener;
1641
    Time timeUntilIdle = m_phy->GetDelayUntilIdle();
1631
  m_listener = 0;
1642
    NotifyAckTimeoutStartNow (timeUntilIdle);
1632
  listener->MissedBlockAck ();
1643
    m_blockAckTimeoutEvent = Simulator::Schedule (timeUntilIdle, &MacLow::BlockAckTimeout, this);
1644
    NS_LOG_DEBUG ("Still in Rx, rescheduling block ack timeout");
1645
  }
1646
  else{
1647
    m_stationManager->ReportDataFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
1648
    MacLowTransmissionListener *listener = m_listener;
1649
    m_listener = 0;
1650
    listener->MissedBlockAck ();
1651
  }
1633
}
1652
}
1634
void
1653
void
1635
MacLow::SuperFastAckTimeout ()
1654
MacLow::SuperFastAckTimeout ()
 Lines 1643-1654   MacLow::SuperFastAckTimeout () Link Here 
1643
      NS_LOG_DEBUG ("super fast Ack failed");
1662
      NS_LOG_DEBUG ("super fast Ack failed");
1644
      listener->MissedAck ();
1663
      listener->MissedAck ();
1645
    }
1664
    }
1646
  else
1665
  else if(m_phy->IsStateRx()){
1647
    {
1666
    Time timeUntilIdle = m_phy->GetDelayUntilIdle();
1648
      //TODO: fix
1667
    NotifyAckTimeoutStartNow (timeUntilIdle);
1649
      NS_LOG_DEBUG ("super fast Ack ok");
1668
    m_superFastAckTimeoutEvent = Simulator::Schedule (timeUntilIdle, &MacLow::SuperFastAckTimeout, this);
1650
      listener->GotAck (0.0, WifiMode (), NULL);
1669
    
1651
    }
1670
    //TODO: fix
1671
    NS_LOG_DEBUG ("super fast Ack timeout while still in receive, rescheduling");
1672
    //listener->GotAck (0.0, WifiMode (), NULL);
1673
  }
1652
}
1674
}
1653
  
1675
  
1654
void MacLow::CancelBlockAckTimeoutTimer (void){
1676
void MacLow::CancelBlockAckTimeoutTimer (void){

Return to bug 1909