base class for all MAC-level wifi objects. More...
#include "wifi-mac.h"
Public Types | |
typedef Callback< void, Ptr< const Packet >, Mac48Address, Mac48Address > | ForwardUpCallback |
This type defines the callback of a higher layer that a WifiMac(-derived) object invokes to pass a packet up the stack. More... | |
Public Member Functions | |
virtual void | ConfigureStandard (WifiStandard standard)=0 |
virtual void | DoDispose () |
Destructor implementation. More... | |
virtual void | Enqueue (Ptr< Packet > packet, Mac48Address to)=0 |
virtual void | Enqueue (Ptr< Packet > packet, Mac48Address to, Mac48Address from)=0 |
virtual Mac48Address | GetAddress (void) const =0 |
virtual Mac48Address | GetBssid (void) const =0 |
Ptr< NetDevice > | GetDevice (void) const |
Return the device this PHY is associated with. More... | |
Ptr< HeConfiguration > | GetHeConfiguration (void) const |
Ptr< HtConfiguration > | GetHtConfiguration (void) const |
virtual bool | GetShortSlotTimeSupported (void) const =0 |
virtual Ssid | GetSsid (void) const =0 |
virtual TypeOfStation | GetTypeOfStation (void) const =0 |
Return the type of station. More... | |
Ptr< VhtConfiguration > | GetVhtConfiguration (void) const |
virtual Ptr< WifiPhy > | GetWifiPhy (void) const =0 |
virtual Ptr< WifiRemoteStationManager > | GetWifiRemoteStationManager (void) const =0 |
void | NotifyPromiscRx (Ptr< const Packet > packet) |
void | NotifyRx (Ptr< const Packet > packet) |
void | NotifyRxDrop (Ptr< const Packet > packet) |
void | NotifyTx (Ptr< const Packet > packet) |
void | NotifyTxDrop (Ptr< const Packet > packet) |
virtual void | ResetWifiPhy (void)=0 |
Remove currently attached WifiPhy device from this MAC. More... | |
virtual void | SetAddress (Mac48Address address)=0 |
void | SetDevice (const Ptr< NetDevice > device) |
Sets the device this PHY is associated with. More... | |
virtual void | SetForwardUpCallback (ForwardUpCallback upCallback)=0 |
virtual void | SetLinkDownCallback (Callback< void > linkDown)=0 |
virtual void | SetLinkUpCallback (Callback< void > linkUp)=0 |
virtual void | SetPromisc (void)=0 |
Sets the interface in promiscuous mode. More... | |
virtual void | SetShortSlotTimeSupported (bool enable)=0 |
Enable or disable short slot time feature. More... | |
virtual void | SetSsid (Ssid ssid)=0 |
virtual void | SetTypeOfStation (TypeOfStation type)=0 |
This method is invoked by a subclass to specify what type of station it is implementing. More... | |
virtual void | SetWifiPhy (Ptr< WifiPhy > phy)=0 |
virtual void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager)=0 |
virtual bool | SupportsSendFrom (void) const =0 |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
void | ConfigureDcf (Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac) |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Attributes | |
Ptr< NetDevice > | m_device |
Pointer to the device. More... | |
TracedCallback< Ptr< const Packet > > | m_macPromiscRxTrace |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). More... | |
TracedCallback< Ptr< const Packet > > | m_macRxDropTrace |
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer during reception. More... | |
TracedCallback< Ptr< const Packet > > | m_macRxTrace |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). More... | |
TracedCallback< Ptr< const Packet > > | m_macTxDropTrace |
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer before being queued for transmission. More... | |
TracedCallback< Ptr< const Packet > > | m_macTxTrace |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, before being queued for transmission. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
base class for all MAC-level wifi objects.
This class encapsulates all the low-level MAC functionality DCA, EDCA, etc) and all the high-level MAC functionality (association/disassociation state machines).
ns3::WifiMac is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 160 bytes (on a 64-bit architecture).
Definition at line 70 of file wifi-mac.h.
typedef Callback<void, Ptr<const Packet>, Mac48Address, Mac48Address> ns3::WifiMac::ForwardUpCallback |
This type defines the callback of a higher layer that a WifiMac(-derived) object invokes to pass a packet up the stack.
packet | the packet that has been received. |
from | the MAC address of the device that sent the packet. |
to | the MAC address of the device that the packet is destined for. |
Definition at line 208 of file wifi-mac.h.
|
protected |
dcf | the DCF to be configured |
cwmin | the minimum contention window for the DCF |
cwmax | the maximum contention window for the DCF |
isDsss | flag to indicate whether PHY is DSSS or HR/DSSS |
ac | the access category for the DCF |
Configure the DCF with appropriate values depending on the given access category.
Definition at line 127 of file wifi-mac.cc.
References ns3::AC_BE, ns3::AC_BE_NQOS, ns3::AC_BK, ns3::AC_UNDEF, ns3::AC_VI, ns3::AC_VO, ns3::MicroSeconds(), NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Txop::SetAifsn(), ns3::Txop::SetMaxCw(), ns3::Txop::SetMinCw(), and ns3::Txop::SetTxopLimit().
Referenced by ns3::RegularWifiMac::ConfigureContentionWindow().
|
pure virtual |
standard | the wifi standard to be configured |
This method completes the configuration process for a requested PHY standard. Subclasses should implement this method to configure their DCF queues according to the requested standard.
Implemented in ns3::RegularWifiMac, ns3::OcbWifiMac, and ns3::MeshWifiInterfaceMac.
|
virtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Reimplemented in ns3::ApWifiMac, ns3::OcbWifiMac, ns3::RegularWifiMac, and ns3::MeshWifiInterfaceMac.
Definition at line 79 of file wifi-mac.cc.
References m_device.
Referenced by ns3::RegularWifiMac::DoDispose().
|
pure virtual |
packet | the packet to send. |
to | the address to which the packet should be sent. |
The packet should be enqueued in a TX queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC.
Implemented in ns3::RegularWifiMac, ns3::StaWifiMac, ns3::ApWifiMac, ns3::AdhocWifiMac, ns3::OcbWifiMac, and ns3::MeshWifiInterfaceMac.
|
pure virtual |
packet | the packet to send. |
to | the address to which the packet should be sent. |
from | the address from which the packet should be sent. |
The packet should be enqueued in a TX queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC. The extra parameter "from" allows this device to operate in a bridged mode, forwarding received frames without altering the source address.
Implemented in ns3::RegularWifiMac, ns3::ApWifiMac, and ns3::MeshWifiInterfaceMac.
|
pure virtual |
Implemented in ns3::RegularWifiMac.
|
pure virtual |
Implemented in ns3::RegularWifiMac, and ns3::OcbWifiMac.
Return the device this PHY is associated with.
Definition at line 91 of file wifi-mac.cc.
References m_device.
Referenced by GetHeConfiguration(), GetHtConfiguration(), and GetVhtConfiguration().
Ptr< HeConfiguration > ns3::WifiMac::GetHeConfiguration | ( | void | ) | const |
Definition at line 198 of file wifi-mac.cc.
References GetDevice(), and ns3::WifiNetDevice::GetHeConfiguration().
Referenced by ns3::RegularWifiMac::GetHeCapabilities(), ns3::ApWifiMac::GetHeOperation(), ns3::RegularWifiMac::GetHeSupported(), and ns3::StaWifiMac::UpdateApInfoFromAssocResp().
Ptr< HtConfiguration > ns3::WifiMac::GetHtConfiguration | ( | void | ) | const |
Definition at line 184 of file wifi-mac.cc.
References GetDevice(), and ns3::WifiNetDevice::GetHtConfiguration().
Referenced by ns3::RegularWifiMac::GetHeCapabilities(), ns3::RegularWifiMac::GetHtCapabilities(), ns3::ApWifiMac::GetHtOperation(), ns3::RegularWifiMac::GetHtSupported(), and ns3::RegularWifiMac::GetVhtCapabilities().
|
pure virtual |
Implemented in ns3::RegularWifiMac.
|
pure virtual |
Implemented in ns3::RegularWifiMac, and ns3::OcbWifiMac.
Referenced by GetTypeId().
|
static |
Get the type ID.
Definition at line 38 of file wifi-mac.cc.
References GetSsid(), m_macPromiscRxTrace, m_macRxDropTrace, m_macRxTrace, m_macTxDropTrace, m_macTxTrace, ns3::MakeSsidAccessor(), ns3::MakeSsidChecker(), ns3::MakeTraceSourceAccessor(), ns3::TypeId::SetParent(), and SetSsid().
|
pure virtual |
Ptr< VhtConfiguration > ns3::WifiMac::GetVhtConfiguration | ( | void | ) | const |
Definition at line 191 of file wifi-mac.cc.
References GetDevice(), and ns3::WifiNetDevice::GetVhtConfiguration().
Referenced by ns3::RegularWifiMac::GetVhtCapabilities(), and ns3::RegularWifiMac::GetVhtSupported().
Implemented in ns3::RegularWifiMac.
|
pure virtual |
Implemented in ns3::RegularWifiMac.
packet | the packet we received promiscuously |
Public method used to fire a MacPromiscRx trace. Implemented for encapsulation purposes.
Definition at line 115 of file wifi-mac.cc.
References m_macPromiscRxTrace.
packet | the packet we received |
Public method used to fire a MacRx trace. Implemented for encapsulation purposes.
Definition at line 109 of file wifi-mac.cc.
References m_macRxTrace.
packet | the packet we received but is not destined for us |
Public method used to fire a MacRxDrop trace. Implemented for encapsulation purposes.
Definition at line 121 of file wifi-mac.cc.
References m_macRxDropTrace.
Referenced by ns3::OcbWifiMac::Receive(), ns3::ApWifiMac::Receive(), and ns3::StaWifiMac::Receive().
packet | the packet being enqueued |
Public method used to fire a MacTx trace. Implemented for encapsulation purposes. Note this trace indicates that the packet was accepted by the device only. The packet may be dropped later (e.g. if the queue is full).
Definition at line 97 of file wifi-mac.cc.
References m_macTxTrace.
packet | the packet being dropped |
Public method used to fire a MacTxDrop trace. This trace indicates that the packet was dropped before it was queued for transmission (e.g. when a STA is not associated with an AP).
Definition at line 103 of file wifi-mac.cc.
References m_macTxDropTrace.
Referenced by ns3::StaWifiMac::Enqueue(), and ns3::ApWifiMac::Enqueue().
|
pure virtual |
Remove currently attached WifiPhy device from this MAC.
Implemented in ns3::RegularWifiMac.
|
pure virtual |
address | the current address of this MAC layer. |
Implemented in ns3::RegularWifiMac, ns3::ApWifiMac, and ns3::AdhocWifiMac.
Sets the device this PHY is associated with.
device | the device this PHY is associated with |
Definition at line 85 of file wifi-mac.cc.
References m_device.
Referenced by AmpduAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), and HeAggregationTest::DoRunSubTest().
|
pure virtual |
upCallback | the callback to invoke when a packet must be forwarded up the stack. |
Implemented in ns3::RegularWifiMac.
|
pure virtual |
linkDown | the callback to invoke when the link becomes down. |
Implemented in ns3::RegularWifiMac, and ns3::OcbWifiMac.
|
pure virtual |
linkUp | the callback to invoke when the link becomes up. |
Implemented in ns3::RegularWifiMac, ns3::ApWifiMac, ns3::AdhocWifiMac, ns3::OcbWifiMac, and ns3::MeshWifiInterfaceMac.
|
pure virtual |
Sets the interface in promiscuous mode.
Enables promiscuous mode on the interface. Note that any further filtering on the incoming frame path may affect the overall behavior.
Implemented in ns3::RegularWifiMac.
|
pure virtual |
Enable or disable short slot time feature.
enable | true if short slot time is to be supported, false otherwise |
Implemented in ns3::RegularWifiMac.
|
pure virtual |
ssid | the current SSID of this MAC layer. |
Implemented in ns3::RegularWifiMac, and ns3::OcbWifiMac.
Referenced by GetTypeId().
|
pure virtual |
This method is invoked by a subclass to specify what type of station it is implementing.
This is something that the channel access functions need to know.
type | the type of station. |
Implemented in ns3::RegularWifiMac.
phy | the physical layer attached to this MAC. |
Implemented in ns3::StaWifiMac, and ns3::RegularWifiMac.
|
pure virtual |
stationManager | the station manager attached to this MAC. |
Implemented in ns3::RegularWifiMac, and ns3::ApWifiMac.
|
pure virtual |
The interface may or may not support sending from arbitrary address. This function returns true if sending from arbitrary address is supported, false otherwise.
Implemented in ns3::RegularWifiMac, ns3::ApWifiMac, and ns3::MeshWifiInterfaceMac.
Pointer to the device.
Definition at line 299 of file wifi-mac.h.
Referenced by DoDispose(), GetDevice(), and SetDevice().
|
private |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition).
This is a promiscuous trace.
Definition at line 322 of file wifi-mac.h.
Referenced by GetTypeId(), and NotifyPromiscRx().
|
private |
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer during reception.
Definition at line 337 of file wifi-mac.h.
Referenced by GetTypeId(), and NotifyRxDrop().
|
private |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition).
This is a non- promiscuous trace.
Definition at line 330 of file wifi-mac.h.
Referenced by GetTypeId(), and NotifyRx().
|
private |
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer before being queued for transmission.
Definition at line 314 of file wifi-mac.h.
Referenced by GetTypeId(), and NotifyTxDrop().
|
private |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, before being queued for transmission.
Definition at line 307 of file wifi-mac.h.
Referenced by GetTypeId(), and NotifyTx().