23 #include "ns3/boolean.h"
24 #include "ns3/pointer.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/trace-source-accessor.h"
52 m_low = CreateObject<MacLow> ();
58 m_dca = CreateObject<DcaTxop> ();
85 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
87 i->second->Initialize ();
113 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
125 m_low->SetWifiRemoteStationManager (stationManager);
127 m_dca->SetWifiRemoteStationManager (stationManager);
129 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
131 i->second->SetWifiRemoteStationManager (stationManager);
156 edca->SetAccessCategory (ac);
157 edca->CompleteConfig ();
158 m_edca.insert (std::make_pair (ac, edca));
165 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
167 i->second->SetTypeOfStation (type);
265 m_low->SetCtsToSelfSupported (enable);
271 return m_low->GetCtsToSelfSupported ();
279 m_low->SetSlotTime (slotTime);
285 return m_low->GetSlotTime ();
293 m_low->SetSifs (sifs);
299 return m_low->GetSifs ();
318 m_low->SetRifs (rifs);
324 return m_low->GetRifs();
331 m_low->SetPifs (pifs);
337 return m_low->GetPifs ();
344 m_low->SetAckTimeout (ackTimeout);
350 return m_low->GetAckTimeout ();
357 m_low->SetCtsTimeout (ctsTimeout);
363 return m_low->GetCtsTimeout ();
370 m_low->SetBasicBlockAckTimeout (blockAckTimeout);
376 return m_low->GetBasicBlockAckTimeout ();
383 m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
389 return m_low->GetCompressedBlockAckTimeout ();
396 m_low->SetAddress (address);
402 return m_low->GetAddress ();
422 m_low->SetBssid (bssid);
428 return m_low->GetBssid ();
434 m_low->SetPromisc ();
446 <<
") does not support Enqueue() with from address");
521 m_edca[ac]->GotAddBaResponse (&respHdr, from);
537 m_low->DestroyBlockAckAgreement (from, delBaHdr.
GetTid ());
545 m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
552 NS_FATAL_ERROR (
"Unsupported Action field in Block Ack Action frame");
573 i != packets.end (); ++i)
575 ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
576 (*i).second.GetDestinationAddr ());
630 m_low->CreateBlockAckAgreement (&respHdr, originator,
644 .AddAttribute (
"QosSupported",
645 "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
649 MakeBooleanChecker ())
650 .AddAttribute (
"HtSupported",
651 "This Boolean attribute is set to enable 802.11n support at this STA",
655 MakeBooleanChecker ())
656 .AddAttribute (
"CtsToSelfSupported",
657 "Use CTS to Self when using a rate that is not in the basic set rate",
661 MakeBooleanChecker ())
662 .AddAttribute (
"DcaTxop",
"The DcaTxop object",
665 MakePointerChecker<DcaTxop> ())
666 .AddAttribute (
"VO_EdcaTxopN",
667 "Queue that manages packets belonging to AC_VO access class",
670 MakePointerChecker<EdcaTxopN> ())
671 .AddAttribute (
"VI_EdcaTxopN",
672 "Queue that manages packets belonging to AC_VI access class",
675 MakePointerChecker<EdcaTxopN> ())
676 .AddAttribute (
"BE_EdcaTxopN",
677 "Queue that manages packets belonging to AC_BE access class",
680 MakePointerChecker<EdcaTxopN> ())
681 .AddAttribute (
"BK_EdcaTxopN",
682 "Queue that manages packets belonging to AC_BK access class",
685 MakePointerChecker<EdcaTxopN> ())
686 .AddTraceSource (
"TxOkHeader",
687 "The header of successfully transmitted packet",
689 .AddTraceSource (
"TxErrHeader",
690 "The header of unsuccessfully transmitted packet",
722 NS_FATAL_ERROR (
"Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
730 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
ERP-OFDM PHY (Clause 19, Section 19.5)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
void SetForwardCallback(ForwardUpCallback callback)
Set a callback to forward the packet up.
bool GetCtsToSelfSupported() const
Return whether the device supports CTS-to-self capability.
static TypeId GetTypeId(void)
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
virtual void SetCompressedBlockAckTimeout(Time blockAckTimeout)
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
#define NS_ASSERT(condition)
Callback< void > m_linkUp
Callback when a link is up.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
MacTxMiddle * m_txMiddle
TX middle (aggregation etc.)
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
virtual void SetSsid(Ssid ssid)
void SetSlot(Time slotTime)
virtual Time GetCompressedBlockAckTimeout(void) const
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
bool GetQosSupported() const
Return whether the device supports QoS.
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
virtual void SetLinkDownCallback(Callback< void > linkDown)
void SetHtSupported(bool enable)
Enable or disable HT support for the device.
Ptr< WifiPhy > m_phy
Wifi PHY.
virtual Ssid GetSsid(void) const
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
MacRxMiddle * m_rxMiddle
RX middle (de-fragmentation etc.)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
#define NS_FATAL_ERROR(msg)
fatal error handling
This class handles duplicate detection and recomposition of fragments.
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
TracedCallback< const WifiMacHeader & > m_txErrCallback
Handles sequence numbering of IEEE 802.11 data frames.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
virtual void SetBssid(Mac48Address bssid)
Ptr< EdcaTxopN > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
void SetLow(Ptr< MacLow > low)
Set MacLow associated with this EdcaTxopN.
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
Time GetCtsTimeout(void) const
virtual void SetForwardUpCallback(ForwardUpCallback upCallback)
void SetSuccess(void)
Set success bit to 0 (success).
void SetEifsNoDifs(Time eifsNoDifs)
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
virtual void SetBasicBlockAckTimeout(Time blockAckTimeout)
virtual void SetWifiPhy(Ptr< WifiPhy > phy)
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Ptr< DcaTxop > m_dca
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-Qo...
Ptr< EdcaTxopN > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
Ssid m_ssid
Service Set ID (SSID)
Ptr< DcaTxop > GetDcaTxop(void) const
Accessor for the DCF object.
base class for all MAC-level wifi objects.
void ConfigureDcf(Ptr< Dcf > dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
Time GetAckTimeout(void) const
void SetupPhyListener(Ptr< WifiPhy > phy)
Set up listener for Phy events.
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
virtual void SetAddress(Mac48Address address)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
virtual void SendAddBaResponse(const MgtAddBaRequestHeader *reqHdr, Mac48Address originator)
This method can be called to accept a received ADDBA Request.
Callback< void > m_linkDown
Callback when a link is down.
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
TracedCallback< const WifiMacHeader & > m_txOkCallback
Status code for association response.
Ptr< EdcaTxopN > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
OFDM PHY for the 5 GHz band (Clause 17)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
DcfManager * m_dcfManager
DCF manager (access to channel)
void SetEifsNoDifs(Time eifsNoDifs)
void SetCtsTimeout(Time ctsTimeout)
virtual ~RegularWifiMac()
virtual bool SupportsSendFrom(void) const
The IEEE 802.11 SSID Information Element.
virtual Ptr< WifiPhy > GetWifiPhy() const
bool m_htSupported
This Boolean is set true iff this WifiMac is to model 802.11n.
virtual Mac48Address GetBssid(void) const
void SetSlot(Time slotTime)
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
virtual Time GetBasicBlockAckTimeout(void) const
virtual Mac48Address GetAddress(void) const
Time GetEifsNoDifs() const
virtual void DoInitialize()
This method is called only once by Object::Initialize.
bool GetHtSupported() const
Return whether the device supports QoS.
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
TypeOfStation
Enumeration for type of station.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
virtual void SetPromisc(void)
Sets the interface in promiscuous mode.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void SetAckTimeout(Time ackTimeout)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
NS_LOG_COMPONENT_DEFINE("RegularWifiMac")
void AddHeader(const Header &header)
Add header to this packet.
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Time GetEifsNoDifs(void) const
void SetupEdcaQueue(enum AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...