23 #include "ns3/boolean.h"
24 #include "ns3/pointer.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/trace-source-accessor.h"
51 m_low = CreateObject<MacLow> ();
57 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);
275 m_low->SetCtsToSelfSupported (enable);
281 return m_low->GetCtsToSelfSupported ();
289 m_low->SetSlotTime (slotTime);
295 return m_low->GetSlotTime ();
303 m_low->SetSifs (sifs);
309 return m_low->GetSifs ();
328 m_low->SetRifs (rifs);
334 return m_low->GetRifs();
341 m_low->SetPifs (pifs);
347 return m_low->GetPifs ();
354 m_low->SetAckTimeout (ackTimeout);
360 return m_low->GetAckTimeout ();
367 m_low->SetCtsTimeout (ctsTimeout);
373 return m_low->GetCtsTimeout ();
380 m_low->SetBasicBlockAckTimeout (blockAckTimeout);
386 return m_low->GetBasicBlockAckTimeout ();
393 m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
399 return m_low->GetCompressedBlockAckTimeout ();
406 m_low->SetAddress (address);
412 return m_low->GetAddress ();
432 m_low->SetBssid (bssid);
438 return m_low->GetBssid ();
444 m_low->SetPromisc ();
456 <<
") does not support Enqueue() with from address");
531 m_edca[ac]->GotAddBaResponse (&respHdr, from);
547 m_low->DestroyBlockAckAgreement (from, delBaHdr.
GetTid ());
555 m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
562 NS_FATAL_ERROR (
"Unsupported Action field in Block Ack Action frame");
583 i != packets.end (); ++i)
585 ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
586 (*i).second.GetDestinationAddr ());
640 m_low->CreateBlockAckAgreement (&respHdr, originator,
654 .AddAttribute (
"QosSupported",
655 "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
660 .AddAttribute (
"HtSupported",
661 "This Boolean attribute is set to enable 802.11n support at this STA",
666 .AddAttribute (
"CtsToSelfSupported",
667 "Use CTS to Self when using a rate that is not in the basic set rate",
672 .AddAttribute (
"DcaTxop",
"The DcaTxop object",
675 MakePointerChecker<DcaTxop> ())
676 .AddAttribute (
"VO_EdcaTxopN",
677 "Queue that manages packets belonging to AC_VO access class",
680 MakePointerChecker<EdcaTxopN> ())
681 .AddAttribute (
"VI_EdcaTxopN",
682 "Queue that manages packets belonging to AC_VI access class",
685 MakePointerChecker<EdcaTxopN> ())
686 .AddAttribute (
"BE_EdcaTxopN",
687 "Queue that manages packets belonging to AC_BE access class",
690 MakePointerChecker<EdcaTxopN> ())
691 .AddAttribute (
"BK_EdcaTxopN",
692 "Queue that manages packets belonging to AC_BK access class",
695 MakePointerChecker<EdcaTxopN> ())
696 .AddTraceSource (
"TxOkHeader",
697 "The header of successfully transmitted packet",
699 "ns3::WifiMacHeader::TracedCallback")
700 .AddTraceSource (
"TxErrHeader",
701 "The header of unsuccessfully transmitted packet",
703 "ns3::WifiMacHeader::TracedCallback")
734 NS_FATAL_ERROR (
"Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
742 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.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
AttributeValue implementation for Boolean.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Callback< void > m_linkUp
Callback when a link is up.
MacTxMiddle * m_txMiddle
TX middle (aggregation etc.)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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)
#define NS_FATAL_ERROR(msg)
Fatal error handling.
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...
This class handles duplicate detection and recomposition of fragments.
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
TracedCallback< const WifiMacHeader & > m_txErrCallback
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Handles sequence numbering of IEEE 802.11 data frames.
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...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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)
void RemovePhyListener(Ptr< WifiPhy > phy)
Remove current registered listener for Phy events.
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)
virtual void ResetWifiPhy(void)
removes attached WifiPhy device from this MAC.
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()
Destructor implementation.
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
DcfManager * m_dcfManager
DCF manager (access to channel)
virtual Ptr< WifiPhy > GetWifiPhy(void) const
void SetEifsNoDifs(Time eifsNoDifs)
void SetCtsTimeout(Time ctsTimeout)
virtual ~RegularWifiMac()
virtual bool SupportsSendFrom(void) const
The IEEE 802.11 SSID Information Element.
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()
Initialize() implementation.
bool GetHtSupported() const
Return whether the device supports QoS.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
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 ...
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...