diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 8fde1749e..371dcb1a1 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -27,6 +27,7 @@ Bugs fixed ---------- - Bug 1132 - useless for loops in block-ack-test-suite.cc - Bug 2183 - LiIonEnergySourceHelper is not in the energy wscript +- Bug 2003 - Missing DSSS short PLCP preamble Known issues ------------ diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 6703f9586..5ceee13c7 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -334,6 +334,14 @@ ApWifiMac::GetSupportedRates (void) const return rates; } +CapabilityInformation +ApWifiMac::GetCapabilities (void) const +{ + CapabilityInformation capabilities; + capabilities.SetShortPreamble (m_phy->GetShortPlcpPreamble ()); + return capabilities; +} + HtCapabilities ApWifiMac::GetHtCapabilities (void) const { @@ -417,6 +425,7 @@ ApWifiMac::SendProbeResp (Mac48Address to) probe.SetSsid (GetSsid ()); probe.SetSupportedRates (GetSupportedRates ()); probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ()); + probe.SetCapabilities (GetCapabilities ()); if (m_htSupported || m_vhtSupported) { probe.SetHtCapabilities (GetHtCapabilities ()); @@ -459,7 +468,7 @@ ApWifiMac::SendAssocResp (Mac48Address to, bool success) } assoc.SetSupportedRates (GetSupportedRates ()); assoc.SetStatusCode (code); - + assoc.SetCapabilities (GetCapabilities ()); if (m_htSupported || m_vhtSupported) { assoc.SetHtCapabilities (GetHtCapabilities ()); @@ -494,6 +503,7 @@ ApWifiMac::SendOneBeacon (void) beacon.SetSsid (GetSsid ()); beacon.SetSupportedRates (GetSupportedRates ()); beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ()); + beacon.SetCapabilities (GetCapabilities ()); if (m_htSupported || m_vhtSupported) { beacon.SetHtCapabilities (GetHtCapabilities ()); @@ -630,6 +640,8 @@ ApWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr) //rate set is compatible with our Basic Rate set MgtAssocRequestHeader assocReq; packet->RemoveHeader (assocReq); + CapabilityInformation capabilities = assocReq.GetCapabilities (); + m_stationManager->AddSupportedPlcpPreamble (from, capabilities.IsShortPreamble ()); SupportedRates rates = assocReq.GetSupportedRates (); bool problem = false; for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++) diff --git a/src/wifi/model/ap-wifi-mac.h b/src/wifi/model/ap-wifi-mac.h index 99e710155..349522dc2 100644 --- a/src/wifi/model/ap-wifi-mac.h +++ b/src/wifi/model/ap-wifi-mac.h @@ -24,11 +24,12 @@ #define AP_WIFI_MAC_H #include "regular-wifi-mac.h" +#include "capability-information.h" #include "ht-capabilities.h" +#include "vht-capabilities.h" #include "amsdu-subframe-header.h" #include "supported-rates.h" #include "ns3/random-variable-stream.h" -#include "vht-capabilities.h" namespace ns3 { @@ -180,6 +181,12 @@ private: * Forward a beacon packet to the beacon special DCF. */ void SendOneBeacon (void); + /** + * Return the Capability information of the current AP. + * + * \return the Capability information that we support + */ + CapabilityInformation GetCapabilities (void) const; /** * Return the HT capability of the current AP. * diff --git a/src/wifi/model/capability-information.cc b/src/wifi/model/capability-information.cc index 32504ce3f..547853e8b 100644 --- a/src/wifi/model/capability-information.cc +++ b/src/wifi/model/capability-information.cc @@ -47,6 +47,16 @@ CapabilityInformation::SetIbss (void) Set (1); } +void +CapabilityInformation::SetShortPreamble (bool shortPreamble) +{ + NS_LOG_FUNCTION (this); + if (shortPreamble) + { + Set (5); + } +} + bool CapabilityInformation::IsEss (void) const { @@ -61,6 +71,13 @@ CapabilityInformation::IsIbss (void) const return Is (1); } +bool +CapabilityInformation::IsShortPreamble (void) const +{ + NS_LOG_FUNCTION (this); + return Is (5); +} + void CapabilityInformation::Set (uint8_t n) { diff --git a/src/wifi/model/capability-information.h b/src/wifi/model/capability-information.h index 64405e24a..8ab08315d 100644 --- a/src/wifi/model/capability-information.h +++ b/src/wifi/model/capability-information.h @@ -46,6 +46,14 @@ public: * in the capability information field. */ void SetIbss (void); + /** + * Set the short preamble bit + * in the capability information field. + * + * shortPreamble the short preamble bit + * + */ + void SetShortPreamble (bool shortPreamble); /** * Check if the Extended Service Set (ESS) bit @@ -63,6 +71,14 @@ public: * field is set to 1 */ bool IsIbss (void) const; + /** + * Check if the short preamble bit + * in the capability information field is set to 1. + * + * \return short preamble bit in the capability information + * field is set to 1 + */ + bool IsShortPreamble (void) const; /** * Return the serialized size of capability diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index aeb1734a1..905ba8d6e 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -1422,6 +1422,10 @@ MacLow::CalculateOverallTxTime (Ptr packet, { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; @@ -1458,6 +1462,10 @@ MacLow::CalculateTransmissionTime (Ptr packet, { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; @@ -1862,6 +1870,10 @@ MacLow::StartDataTxTimers (WifiTxVector dataTxVector) { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; @@ -1946,6 +1958,10 @@ MacLow::SendDataPacket (void) { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; @@ -2176,6 +2192,10 @@ MacLow::SendDataAfterCts (Mac48Address source, Time duration) { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; @@ -2814,6 +2834,10 @@ MacLow::StopMpduAggregation (Ptr peekedPacket, WifiMacHeader peeke { preamble = WIFI_PREAMBLE_HT_MF; } + else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ())) + { + preamble = WIFI_PREAMBLE_SHORT; + } else { preamble = WIFI_PREAMBLE_LONG; diff --git a/src/wifi/model/mgt-headers.cc b/src/wifi/model/mgt-headers.cc index fa627ae24..dea4b1246 100644 --- a/src/wifi/model/mgt-headers.cc +++ b/src/wifi/model/mgt-headers.cc @@ -185,6 +185,18 @@ MgtProbeResponseHeader::GetSupportedRates (void) const return m_rates; } +void +MgtProbeResponseHeader::SetCapabilities (CapabilityInformation capabilities) +{ + m_capability = capabilities; +} + +CapabilityInformation +MgtProbeResponseHeader::GetCapabilities (void) const +{ + return m_capability; +} + void MgtProbeResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities) { @@ -357,16 +369,34 @@ MgtAssocRequestHeader::SetSupportedRates (SupportedRates rates) m_rates = rates; } +void +MgtAssocRequestHeader::SetListenInterval (uint16_t interval) +{ + m_listenInterval = interval; +} + +void +MgtAssocRequestHeader::SetCapabilities (CapabilityInformation capabilities) +{ + m_capability = capabilities; +} + +CapabilityInformation +MgtAssocRequestHeader::GetCapabilities (void) const +{ + return m_capability; +} + void MgtAssocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities) { m_htCapability = htcapabilities; } -void -MgtAssocRequestHeader::SetListenInterval (uint16_t interval) +HtCapabilities +MgtAssocRequestHeader::GetHtCapabilities (void) const { - m_listenInterval = interval; + return m_htCapability; } void @@ -381,12 +411,6 @@ MgtAssocRequestHeader::GetVhtCapabilities (void) const return m_vhtCapability; } -HtCapabilities -MgtAssocRequestHeader::GetHtCapabilities (void) const -{ - return m_htCapability; -} - Ssid MgtAssocRequestHeader::GetSsid (void) const { @@ -512,6 +536,18 @@ MgtAssocResponseHeader::SetSupportedRates (SupportedRates rates) m_rates = rates; } +void +MgtAssocResponseHeader::SetCapabilities (CapabilityInformation capabilities) +{ + m_capability = capabilities; +} + +CapabilityInformation +MgtAssocResponseHeader::GetCapabilities (void) const +{ + return m_capability; +} + void MgtAssocResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities) { diff --git a/src/wifi/model/mgt-headers.h b/src/wifi/model/mgt-headers.h index c71522991..b51cf1bfd 100644 --- a/src/wifi/model/mgt-headers.h +++ b/src/wifi/model/mgt-headers.h @@ -31,7 +31,6 @@ #include "supported-rates.h" #include "ssid.h" #include "ht-capabilities.h" -#include "ht-capabilities.h" #include "vht-capabilities.h" namespace ns3 { @@ -64,6 +63,12 @@ public: * \param interval the listen interval */ void SetListenInterval (uint16_t interval); + /** + * Set the Capability information. + * + * \param capabilities Capability information + */ + void SetCapabilities (CapabilityInformation capabilities); /** * Set the HT capabilities. * @@ -77,18 +82,23 @@ public: */ void SetVhtCapabilities (VhtCapabilities vhtcapabilities); /** - * Return the VHT capabilities. - * - * \return VHT capabilities - */ - VhtCapabilities GetVhtCapabilities (void) const; - + * Return the Capability information. + * + * \return Capability information + */ + CapabilityInformation GetCapabilities (void) const; /** * Return the HT capabilities. * * \return HT capabilities */ HtCapabilities GetHtCapabilities (void) const; + /** + * Return the VHT capabilities. + * + * \return VHT capabilities + */ + VhtCapabilities GetVhtCapabilities (void) const; /** * Return the Service Set Identifier (SSID). @@ -153,6 +163,18 @@ public: * \return the supported rates */ SupportedRates GetSupportedRates (void); + /** + * Return the Capability information. + * + * \return Capability information + */ + CapabilityInformation GetCapabilities (void) const; + /** + * Set the Capability information. + * + * \param capabilities Capability information + */ + void SetCapabilities (CapabilityInformation capabilities); /** * Return the HT capabilities. * @@ -318,30 +340,42 @@ public: * \return the supported rates */ SupportedRates GetSupportedRates (void) const; + /** + * Return the Capability information. + * + * \return Capability information + */ + CapabilityInformation GetCapabilities (void) const; /** * Return the HT capabilities. * * \return HT capabilities */ HtCapabilities GetHtCapabilities (void) const; - /** - * Set the VHT capabilities. - * - * \param vhtcapabilities VHT capabilities - */ - void SetVhtCapabilities (VhtCapabilities vhtcapabilities); /** * Return the VHT capabilities. * * \return VHT capabilities */ VhtCapabilities GetVhtCapabilities (void) const; + /** + * Set the Capability information. + * + * \param capabilities Capability information + */ + void SetCapabilities (CapabilityInformation capabilities); /** * Set the HT capabilities. * * \param htcapabilities HT capabilities */ void SetHtCapabilities (HtCapabilities htcapabilities); + /** + * Set the VHT capabilities. + * + * \param vhtcapabilities VHT capabilities + */ + void SetVhtCapabilities (VhtCapabilities vhtcapabilities); /** * Set the Service Set Identifier (SSID). * diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index dce8ce634..abadcc5f7 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -222,6 +222,7 @@ StaWifiMac::SendAssociationRequest (void) MgtAssocRequestHeader assoc; assoc.SetSsid (GetSsid ()); assoc.SetSupportedRates (GetSupportedRates ()); + assoc.SetCapabilities (GetCapabilities ()); if (m_htSupported || m_vhtSupported) { assoc.SetHtCapabilities (GetHtCapabilities ()); @@ -558,6 +559,8 @@ StaWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr) { MgtAssocResponseHeader assocResp; packet->RemoveHeader (assocResp); + CapabilityInformation capabilities = assocResp.GetCapabilities (); + m_stationManager->AddSupportedPlcpPreamble (hdr->GetAddr2 (), capabilities.IsShortPreamble ()); if (m_assocRequestEvent.IsRunning ()) { m_assocRequestEvent.Cancel (); @@ -655,6 +658,14 @@ StaWifiMac::GetSupportedRates (void) const return rates; } +CapabilityInformation +StaWifiMac::GetCapabilities (void) const +{ + CapabilityInformation capabilities; + capabilities.SetShortPreamble (m_phy->GetShortPlcpPreamble ()); + return capabilities; +} + HtCapabilities StaWifiMac::GetHtCapabilities (void) const { diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h index 73d96487e..8173fbe6a 100644 --- a/src/wifi/model/sta-wifi-mac.h +++ b/src/wifi/model/sta-wifi-mac.h @@ -28,6 +28,7 @@ #include "ns3/traced-callback.h" #include "supported-rates.h" #include "amsdu-subframe-header.h" +#include "capability-information.h" namespace ns3 { @@ -171,13 +172,19 @@ private: */ void SetState (enum MacState value); /** - * Return the HT capability of the current AP. + * Return the Capability information of the current STA. + * + * \return the Capability information that we support + */ + CapabilityInformation GetCapabilities (void) const; + /** + * Return the HT capability of the current STA. * * \return the HT capability that we support */ HtCapabilities GetHtCapabilities (void) const; /** - * Return the VHT capability of the current AP. + * Return the VHT capability of the current STA. * * \return the VHT capability that we support */ diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index c511d8b6e..48aa76380 100755 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -262,7 +262,7 @@ WifiPhy::GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble, WifiTxV return WifiPhy::GetErpOfdmRate6Mbps (); case WIFI_MOD_CLASS_DSSS: case WIFI_MOD_CLASS_HR_DSSS: - if (preamble == WIFI_PREAMBLE_LONG) + if (preamble == WIFI_PREAMBLE_LONG || payloadMode == WifiPhy::GetDsssRate1Mbps ()) { //(Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012) return WifiPhy::GetDsssRate1Mbps (); @@ -326,7 +326,7 @@ WifiPhy::GetPlcpHeaderDuration (WifiTxVector txVector, WifiPreamble preamble) return MicroSeconds (4); case WIFI_MOD_CLASS_DSSS: case WIFI_MOD_CLASS_HR_DSSS: - if (preamble == WIFI_PREAMBLE_SHORT) + if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000)) { //(Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012) return MicroSeconds (24); @@ -378,7 +378,7 @@ WifiPhy::GetPlcpPreambleDuration (WifiTxVector txVector, WifiPreamble preamble) return MicroSeconds (16); case WIFI_MOD_CLASS_DSSS: case WIFI_MOD_CLASS_HR_DSSS: - if (preamble == WIFI_PREAMBLE_SHORT) + if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000)) { //(Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012) return MicroSeconds (72); diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index aa8211e87..78e58de34 100755 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -1219,6 +1219,14 @@ public: * \return true if Greenfield is supported, false otherwise */ virtual bool GetGreenfield (void) const = 0; + /** + * \param shortPreamble Enable or disable short PLCP preamble + */ + virtual void SetShortPlcpPreamble (bool shortPreamble) = 0; + /** + * \return true if short PLCP preamble is supported, false otherwise + */ + virtual bool GetShortPlcpPreamble (void) const = 0; /** * \return the channel width */ diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index e748f549b..a86dcc86a 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -479,6 +479,15 @@ WifiRemoteStationManager::Reset (Mac48Address address) AddSupportedMcs (address, GetDefaultMcs ()); } +void +WifiRemoteStationManager::AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported) +{ + NS_LOG_FUNCTION (this << address << isShortPreambleSupported); + NS_ASSERT (!address.IsGroup ()); + WifiRemoteStationState *state = LookupState (address); + state->m_shortPreamble = isShortPreambleSupported; +} + void WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode) { @@ -1305,6 +1314,7 @@ WifiRemoteStationManager::LookupState (Mac48Address address) const state->m_channelWidth = m_wifiPhy->GetChannelWidth (); state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval (); state->m_greenfield = m_wifiPhy->GetGreenfield (); + state->m_shortPreamble = m_wifiPhy->GetShortPlcpPreamble (); state->m_rx = 1; state->m_tx = 1; state->m_ness = 0; @@ -1401,6 +1411,12 @@ WifiRemoteStationManager::GetGreenfieldSupported (Mac48Address address) const return LookupState (address)->m_greenfield; } +bool +WifiRemoteStationManager::GetShortPreambleSupported (Mac48Address address) const +{ + return LookupState (address)->m_shortPreamble; +} + WifiMode WifiRemoteStationManager::GetDefaultMode (void) const { @@ -1560,6 +1576,12 @@ WifiRemoteStationManager::GetGreenfield (const WifiRemoteStation *station) const return station->m_state->m_greenfield; } +bool +WifiRemoteStationManager::GetShortPreamble (const WifiRemoteStation *station) const +{ + return station->m_state->m_shortPreamble; +} + bool WifiRemoteStationManager::GetAggregation (const WifiRemoteStation *station) const { diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index e6136ccee..4c5750c01 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -243,6 +243,15 @@ public: * false otherwise */ bool GetGreenfieldSupported (Mac48Address address) const; + /** + * Return whether the station supports short PLCP preamble or not. + * + * \param address the address of the station + * + * \return true if short PLCP preamble is supported by the station, + * false otherwise + */ + bool GetShortPreambleSupported (Mac48Address address) const; /** * Add a given Modulation and Coding Scheme (MCS) index to * the set of basic MCS. @@ -285,7 +294,6 @@ public: */ WifiMode GetNonUnicastMode (void) const; - /** * Invoked in an AP upon disassociation of a * specific STA. @@ -314,6 +322,14 @@ public: */ void AddAllSupportedModes (Mac48Address address); + /** + * Record whether the short PLCP preamble is supported by the station. + * + * \param address the address of the station + * \param isShortPreambleSupported whether or not short PLCP preamble is supported by the station + */ + void AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported); + /** * Return whether the station state is brand new. * @@ -712,6 +728,15 @@ protected: * false otherwise */ bool GetGreenfield (const WifiRemoteStation *station) const; + /** + * Return whether the station supports short PLCP preamble or not. + * + * \param station the station being queried + * + * \return true if short PLCP preamble is supported by the station, + * false otherwise + */ + bool GetShortPreamble (const WifiRemoteStation *station) const; /** * Return the number of receive antennas the station has. * @@ -1114,7 +1139,8 @@ struct WifiRemoteStationState uint32_t m_ness; //!< Number of streams in beamforming of the remote station bool m_stbc; //!< Flag if STBC is used by the remote station bool m_aggregation; //!< Flag if MPDU aggregation is used by the remote station - bool m_greenfield; //!< Flag if green field is used by the remote station + bool m_greenfield; //!< Flag if greenfield is used by the remote station + bool m_shortPreamble; //!< Flag if short PLCP preamble is used by the remote station }; /** diff --git a/src/wifi/model/yans-wifi-phy.cc b/src/wifi/model/yans-wifi-phy.cc index b191260ce..e7b568a26 100644 --- a/src/wifi/model/yans-wifi-phy.cc +++ b/src/wifi/model/yans-wifi-phy.cc @@ -167,6 +167,12 @@ YansWifiPhy::GetTypeId (void) MakeBooleanAccessor (&YansWifiPhy::GetGreenfield, &YansWifiPhy::SetGreenfield), MakeBooleanChecker ()) + .AddAttribute ("ShortPlcpPreambleEnabled", + "Whether or not short PLCP preamble is enabled.", + BooleanValue (false), + MakeBooleanAccessor (&YansWifiPhy::GetShortPlcpPreamble, + &YansWifiPhy::SetShortPlcpPreamble), + MakeBooleanChecker ()) .AddAttribute ("ChannelWidth", "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.", UintegerValue (20), @@ -1278,6 +1284,18 @@ YansWifiPhy::GetGreenfield (void) const return m_greenfield; } +bool +YansWifiPhy::GetShortPlcpPreamble (void) const +{ + return m_plcpPreamble; +} + +void +YansWifiPhy::SetShortPlcpPreamble (bool preamble) +{ + m_plcpPreamble = preamble; +} + void YansWifiPhy::SetChannelWidth (uint32_t channelwidth) { diff --git a/src/wifi/model/yans-wifi-phy.h b/src/wifi/model/yans-wifi-phy.h index e8fae6241..5d4d91fd1 100644 --- a/src/wifi/model/yans-wifi-phy.h +++ b/src/wifi/model/yans-wifi-phy.h @@ -386,6 +386,18 @@ public: * \return true if Greenfield is supported, false otherwise */ virtual bool GetGreenfield (void) const; + /** + * Enable or disable short PLCP preamble. + * + * \param sets short PLCP preamble is supported or not + */ + virtual void SetShortPlcpPreamble (bool preamble); + /** + * Return whether short PLCP preamble is supported. + * + * \returns if short PLCP preamble is supported or not + */ + virtual bool GetShortPlcpPreamble (void) const; /** * Return channel width. * @@ -528,7 +540,7 @@ private: bool m_greenfield; //!< Flag if GreenField format is supported bool m_guardInterval; //!< Flag if short guard interval is used uint32_t m_channelWidth; //!< Channel width - + bool m_plcpPreamble; //!< Flag if short PLCP preamble is used /** * This vector holds the set of transmission modes that this diff --git a/src/wifi/test/tx-duration-test.cc b/src/wifi/test/tx-duration-test.cc index 02f2cf921..c45dc3a71 100644 --- a/src/wifi/test/tx-duration-test.cc +++ b/src/wifi/test/tx-duration-test.cc @@ -223,10 +223,10 @@ TxDurationTest::DoRun (void) && CheckTxDuration (1024, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4096 + 192) && CheckTxDuration (1025, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4100 + 192) && CheckTxDuration (1026, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4104 + 192) - && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8184 + 96) - && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8192 + 96) - && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8200 + 96) - && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8208 + 96) + && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8184 + 192) + && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8192 + 192) + && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8200 + 192) + && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8208 + 192) && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8184 + 192) && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8192 + 192) && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8200 + 192)