23 #include "ns3/boolean.h"
24 #include "ns3/pointer.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/trace-source-accessor.h"
49 m_low = CreateObject<MacLow> ();
55 m_dca = CreateObject<DcaTxop> ();
82 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
84 i->second->Initialize ();
110 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
125 m_dca->SetWifiRemoteStationManager (stationManager);
127 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
129 i->second->SetWifiRemoteStationManager (stationManager);
154 edca->SetAccessCategory (ac);
155 edca->CompleteConfig ();
156 m_edca.insert (std::make_pair (ac, edca));
163 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
165 i->second->SetTypeOfStation (type);
470 <<
") does not support Enqueue() with from address");
544 m_edca[ac]->GotAddBaResponse (&respHdr, from);
567 m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
573 NS_FATAL_ERROR (
"Unsupported Action field in Block Ack Action frame");
592 i != packets.end (); ++i)
594 ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
595 (*i).second.GetDestinationAddr ());
662 .SetGroupName (
"Wifi")
663 .AddAttribute (
"QosSupported",
664 "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
669 .AddAttribute (
"HtSupported",
670 "This Boolean attribute is set to enable 802.11n support at this STA",
675 .AddAttribute (
"VhtSupported",
676 "This Boolean attribute is set to enable 802.11ac support at this STA",
681 .AddAttribute (
"CtsToSelfSupported",
682 "Use CTS to Self when using a rate that is not in the basic set rate",
687 .AddAttribute (
"DcaTxop",
"The DcaTxop object",
690 MakePointerChecker<DcaTxop> ())
691 .AddAttribute (
"VO_EdcaTxopN",
692 "Queue that manages packets belonging to AC_VO access class",
695 MakePointerChecker<EdcaTxopN> ())
696 .AddAttribute (
"VI_EdcaTxopN",
697 "Queue that manages packets belonging to AC_VI access class",
700 MakePointerChecker<EdcaTxopN> ())
701 .AddAttribute (
"BE_EdcaTxopN",
702 "Queue that manages packets belonging to AC_BE access class",
705 MakePointerChecker<EdcaTxopN> ())
706 .AddAttribute (
"BK_EdcaTxopN",
707 "Queue that manages packets belonging to AC_BK access class",
710 MakePointerChecker<EdcaTxopN> ())
711 .AddTraceSource (
"TxOkHeader",
712 "The header of successfully transmitted packet",
714 "ns3::WifiMacHeader::TracedCallback")
715 .AddTraceSource (
"TxErrHeader",
716 "The header of unsuccessfully transmitted packet",
718 "ns3::WifiMacHeader::TracedCallback")
747 NS_FATAL_ERROR (
"Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
755 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.
void Dispose(void)
Dispose of this Object.
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Simulation virtual time values and global simulation resolution.
#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.
HT OFDM PHY for the 5 GHz band (clause 20)
bool GetVhtSupported() const
Return whether the device supports VHT.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
void SetPromisc(void)
Enable promiscuous mode.
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.
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
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)
Report a fatal error with a message and terminate.
bool GetQosSupported() const
Return whether the device supports QoS.
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
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...
Time GetCompressedBlockAckTimeout() const
Return Compressed Block ACK timeout of this MacLow.
virtual void SetLinkDownCallback(Callback< void > linkDown)
void SetHtSupported(bool enable)
Enable or disable HT support for the device.
HT OFDM PHY for the 2.4 GHz band (clause 20)
Ptr< WifiPhy > m_phy
Wifi PHY.
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
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.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Handles sequence numbering of IEEE 802.11 data frames.
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
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.
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
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.
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
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.
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
bool m_vhtSupported
This Boolean is set true iff this WifiMac is to model 802.11ac.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
virtual void SetAddress(Mac48Address address)
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
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
void SetHtSupported(bool enable)
Enable or disable HT capability support.
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.
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
void SetVhtSupported(bool enable)
Enable or disable VHT support for the device.
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
void SetPhy(Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
The IEEE 802.11 SSID Information Element.
Time GetSlotTime(void) const
Return slot duration of this MacLow.
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)
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
virtual Time GetBasicBlockAckTimeout(void) const
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
virtual Mac48Address GetAddress(void) const
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
Time GetEifsNoDifs() const
virtual void DoInitialize()
Initialize() implementation.
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
bool GetHtSupported() const
Return whether the device supports HT.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
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.
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
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...