# HG changeset patch # User Mathieu Lacage # Date 1192699339 -7200 # Node ID 454a63cf65498843e401fd8773cdbd312b40546e # Parent ece7db093222387e5b4abc88e42837e215763302 cts, rts, and ack sizes must take into account fcs padding diff -r ece7db093222 -r 454a63cf6549 src/devices/wifi/mac-low.cc --- a/src/devices/wifi/mac-low.cc Thu Oct 18 11:21:40 2007 +0200 +++ b/src/devices/wifi/mac-low.cc Thu Oct 18 11:22:19 2007 +0200 @@ -540,21 +540,21 @@ { WifiMacHeader ack; ack.SetType (WIFI_MAC_CTL_ACK); - return ack.GetSize (); + return ack.GetSize () + 4; } uint32_t MacLow::GetRtsSize (void) const { WifiMacHeader rts; rts.SetType (WIFI_MAC_CTL_RTS); - return rts.GetSize (); + return rts.GetSize () + 4; } uint32_t MacLow::GetCtsSize (void) const { WifiMacHeader cts; cts.SetType (WIFI_MAC_CTL_CTS); - return cts.GetSize (); + return cts.GetSize () + 4; } Time MacLow::GetSifs (void) const @@ -621,7 +621,7 @@ txTime += GetSifs () * Scalar (2); } txTime += m_phy->CalculateTxDuration (dataSize, dataMode, WIFI_PREAMBLE_LONG); - if (params.MustWaitAck ()) + if (params.MustWaitAck ()) { WifiMode ackMode = GetAckTxModeForData (m_currentHdr.GetAddr1 (), dataMode); txTime += GetSifs (); @@ -786,11 +786,11 @@ } rts.SetDurationUs (duration.GetMicroSeconds ()); - MY_DEBUG ("tx RTS to="<< rts.GetAddr1 () << ", mode=" << rtsTxMode); - Time txDuration = m_phy->CalculateTxDuration (GetRtsSize (), rtsTxMode, WIFI_PREAMBLE_LONG); Time timerDelay = txDuration + GetCtsTimeout (); + MY_DEBUG ("tx RTS to="<< rts.GetAddr1 () << ", mode=" << rtsTxMode << ", cts timeout=" << GetCtsTimeout ()); + NS_ASSERT (m_ctsTimeoutEvent.IsExpired ()); m_ctsTimeoutEvent = Simulator::Schedule (timerDelay, &MacLow::CtsTimeout, this);