make sure that ack and cts delay take into account the fcs padding.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 18 Oct 2007 11:21:14 +0200
changeset 1994 72e228d070f4
parent 1993 e665fb7cea73
child 1995 ece7db093222
make sure that ack and cts delay take into account the fcs padding.
src/devices/wifi/wifi-net-device.cc
--- a/src/devices/wifi/wifi-net-device.cc	Wed Oct 17 17:49:56 2007 +0200
+++ b/src/devices/wifi/wifi-net-device.cc	Thu Oct 18 11:21:14 2007 +0200
@@ -116,9 +116,9 @@
   MacParameters *parameters = new MacParameters ();
   WifiMacHeader hdr;
   hdr.SetType (WIFI_MAC_CTL_CTS);
-  Time ctsDelay = m_phy->CalculateTxDuration (hdr.GetSize (), m_phy->GetMode (0), WIFI_PREAMBLE_LONG);
+  Time ctsDelay = m_phy->CalculateTxDuration (hdr.GetSize () + 4, m_phy->GetMode (0), WIFI_PREAMBLE_LONG);
   hdr.SetType (WIFI_MAC_CTL_ACK);
-  Time ackDelay = m_phy->CalculateTxDuration (hdr.GetSize (), m_phy->GetMode (0), WIFI_PREAMBLE_LONG);
+  Time ackDelay = m_phy->CalculateTxDuration (hdr.GetSize () + 4, m_phy->GetMode (0), WIFI_PREAMBLE_LONG);
   parameters->Initialize (ctsDelay, ackDelay);
   m_parameters = parameters;
 
@@ -155,6 +155,7 @@
   Time difs = m_parameters->GetSifs () + 
     m_parameters->GetSlotTime () + 
     m_parameters->GetSlotTime ();
+  // see 802.11 p85 section 9.2.10
   Time eifs = difs + m_parameters->GetSifs () + 
     m_phy->CalculateTxDuration (2+2+6+4, m_phy->GetMode (0), WIFI_PREAMBLE_LONG);
   dca->SetDifs (difs);