base class for all MAC-level wifi objects. More...
#include <regular-wifi-mac.h>
Public Types | |
typedef Callback< void, Ptr < Packet >, Mac48Address, Mac48Address > | ForwardUpCallback |
Public Member Functions | |
void | SetSlot (Time slotTime) |
void | SetSifs (Time sifs) |
void | SetEifsNoDifs (Time eifsNoDifs) |
void | SetPifs (Time pifs) |
void | SetCtsTimeout (Time ctsTimeout) |
void | SetAckTimeout (Time ackTimeout) |
Time | GetPifs (void) const |
Time | GetSifs (void) const |
Time | GetSlot (void) const |
Time | GetEifsNoDifs (void) const |
Time | GetCtsTimeout (void) const |
Time | GetAckTimeout (void) const |
virtual Mac48Address | GetAddress (void) const |
virtual Ssid | GetSsid (void) const |
virtual void | SetAddress (Mac48Address address) |
virtual void | SetSsid (Ssid ssid) |
virtual void | SetBssid (Mac48Address bssid) |
virtual Mac48Address | GetBssid (void) const |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to, Mac48Address from) |
virtual bool | SupportsSendFrom (void) const |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to)=0 |
virtual void | SetWifiPhy (Ptr< WifiPhy > phy) |
virtual Ptr< WifiPhy > | GetWifiPhy () const |
virtual void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager) |
virtual Ptr < WifiRemoteStationManager > | GetWifiRemoteStationManager () const |
virtual void | SetForwardUpCallback (ForwardUpCallback upCallback) |
virtual void | SetLinkUpCallback (Callback< void > linkUp) |
virtual void | SetLinkDownCallback (Callback< void > linkDown) |
virtual void | SetBasicBlockAckTimeout (Time blockAckTimeout) |
virtual Time | GetBasicBlockAckTimeout (void) const |
virtual void | SetCompressedBlockAckTimeout (Time blockAckTimeout) |
virtual Time | GetCompressedBlockAckTimeout (void) const |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::RegularWifiMac. | |
Protected Types | |
typedef std::map< AcIndex, Ptr < EdcaTxopN > > | EdcaQueues |
Protected Member Functions | |
virtual void | DoStart () |
virtual void | DoDispose () |
virtual void | FinishConfigureStandard (enum WifiPhyStandard standard) |
void | SetTypeOfStation (TypeOfStation type) |
virtual void | Receive (Ptr< Packet > packet, const WifiMacHeader *hdr) |
virtual void | TxOk (const WifiMacHeader &hdr) |
virtual void | TxFailed (const WifiMacHeader &hdr) |
void | ForwardUp (Ptr< Packet > packet, Mac48Address from, Mac48Address to) |
virtual void | DeaggregateAmsduAndForward (Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr) |
virtual void | SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Mac48Address originator) |
void | SetQosSupported (bool enable) |
bool | GetQosSupported () const |
Protected Attributes | |
MacRxMiddle * | m_rxMiddle |
MacTxMiddle * | m_txMiddle |
Ptr< MacLow > | m_low |
DcfManager * | m_dcfManager |
Ptr< WifiPhy > | m_phy |
Ptr< WifiRemoteStationManager > | m_stationManager |
ForwardUpCallback | m_forwardUp |
Callback< void > | m_linkUp |
Callback< void > | m_linkDown |
Ssid | m_ssid |
Ptr< DcaTxop > | m_dca |
EdcaQueues | m_edca |
bool | m_qosSupported |
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).
typedef std::map<AcIndex, Ptr<EdcaTxopN> > ns3::RegularWifiMac::EdcaQueues [protected] |
This type defines a mapping between an Access Category index, and a pointer to the corresponding channel access function
typedef Callback<void, Ptr<Packet>, Mac48Address, Mac48Address> ns3::RegularWifiMac::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 ot the device that the packet is destined for. |
virtual void ns3::RegularWifiMac::DeaggregateAmsduAndForward | ( | Ptr< Packet > | aggregatedPacket, | |
const WifiMacHeader * | hdr | |||
) | [protected, virtual] |
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
aggregatedPacket | the Packet containing the A-MSDU. | |
hdr | a pointer to the MAC header for aggregatedPacket . |
virtual void ns3::RegularWifiMac::DoDispose | ( | ) | [protected, virtual] |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden 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.
virtual void ns3::RegularWifiMac::DoStart | ( | ) | [protected, virtual] |
This method is called only once by Object::Start. If the user calls Object::Start multiple times, DoStart is called only the first time.
Subclasses are expected to override this method and _chain up_ to their parent's implementation once they are done. It is safe to call GetObject and AggregateObject from within this method.
Reimplemented from ns3::Object.
virtual void ns3::RegularWifiMac::Enqueue | ( | Ptr< const Packet > | packet, | |
Mac48Address | to | |||
) | [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 channel access function determines that access is granted to this MAC.
Implements ns3::WifiMac.
Implemented in ns3::MeshWifiInterfaceMac, ns3::AdhocWifiMac, ns3::ApWifiMac, and ns3::StaWifiMac.
virtual void ns3::RegularWifiMac::Enqueue | ( | Ptr< const Packet > | packet, | |
Mac48Address | to, | |||
Mac48Address | from | |||
) | [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 channel access function determines that access is 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.
Implements ns3::WifiMac.
Reimplemented in ns3::MeshWifiInterfaceMac, and ns3::ApWifiMac.
virtual void ns3::RegularWifiMac::FinishConfigureStandard | ( | enum WifiPhyStandard | standard | ) | [protected, virtual] |
standard | the phy standard to be used |
This method is called by ns3::WifiMac::ConfigureStandard to complete the configuration process for a requested phy standard.
This method may be overriden by a derived class (e.g., in order to apply DCF or EDCA parameters specific to the usage model it is dealing with), in which case the reimplementation may choose to deal with certain values in the WifiPhyStandard enumeration, and chain up to this implementation to deal with the remainder.
Implements ns3::WifiMac.
Reimplemented in ns3::MeshWifiInterfaceMac.
Time ns3::RegularWifiMac::GetAckTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
virtual Mac48Address ns3::RegularWifiMac::GetAddress | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
virtual Mac48Address ns3::RegularWifiMac::GetBssid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Time ns3::RegularWifiMac::GetCtsTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Time ns3::RegularWifiMac::GetEifsNoDifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Time ns3::RegularWifiMac::GetPifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
bool ns3::RegularWifiMac::GetQosSupported | ( | ) | const [protected] |
Get accessor for the m_qosSupported
member
Time ns3::RegularWifiMac::GetSifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Time ns3::RegularWifiMac::GetSlot | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
virtual Ssid ns3::RegularWifiMac::GetSsid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
static TypeId ns3::RegularWifiMac::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::RegularWifiMac.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
Attributes defined in parent class ns3::WifiMac:
TraceSources defined for this type:
TraceSources defined in parent class ns3::WifiMac:
Reimplemented from ns3::WifiMac.
Reimplemented in ns3::MeshWifiInterfaceMac, ns3::AdhocWifiMac, ns3::ApWifiMac, and ns3::StaWifiMac.
virtual Ptr<WifiRemoteStationManager> ns3::RegularWifiMac::GetWifiRemoteStationManager | ( | ) | const [virtual] |
virtual void ns3::RegularWifiMac::Receive | ( | Ptr< Packet > | packet, | |
const WifiMacHeader * | hdr | |||
) | [protected, virtual] |
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has been received. The implementation is intended to capture logic that is going to be common to all (or most) derived classes. Specifically, handling of Block Ack managment frames is dealt with here.
This method will need, however, to be overriden by derived classes so that they can perform their data handling before invoking the base version.
packet | the packet that has been received. | |
hdr | a pointer to the MAC header of the received frame. |
virtual void ns3::RegularWifiMac::SendAddBaResponse | ( | const MgtAddBaRequestHeader * | reqHdr, | |
Mac48Address | originator | |||
) | [protected, virtual] |
This method can be called to accept a received ADDBA Request. An ADDBA Response will be constructed and queued for transmission.
reqHdr | a pointer to the received ADDBA Request header. | |
originator | the MAC address of the originator. |
void ns3::RegularWifiMac::SetAckTimeout | ( | Time | ackTimeout | ) | [virtual] |
ackTimeout | the duration of an ACK timeout. |
Implements ns3::WifiMac.
virtual void ns3::RegularWifiMac::SetAddress | ( | Mac48Address | address | ) | [virtual] |
address | the current address of this MAC layer. |
Implements ns3::WifiMac.
Reimplemented in ns3::AdhocWifiMac, and ns3::ApWifiMac.
virtual void ns3::RegularWifiMac::SetBssid | ( | Mac48Address | bssid | ) | [virtual] |
bssid | the BSSID of the network that this device belongs to. |
void ns3::RegularWifiMac::SetCtsTimeout | ( | Time | ctsTimeout | ) | [virtual] |
ctsTimeout | the duration of a CTS timeout. |
Implements ns3::WifiMac.
void ns3::RegularWifiMac::SetEifsNoDifs | ( | Time | eifsNoDifs | ) | [virtual] |
eifsNoDifs | the duration of an EIFS minus DIFS. |
This value is used to calculate the EIFS depending on AIFSN.
Implements ns3::WifiMac.
virtual void ns3::RegularWifiMac::SetForwardUpCallback | ( | ForwardUpCallback | upCallback | ) | [virtual] |
upCallback | the callback to invoke when a packet must be forwarded up the stack. |
virtual void ns3::RegularWifiMac::SetLinkDownCallback | ( | Callback< void > | linkDown | ) | [virtual] |
linkDown | the callback to invoke when the link becomes down. |
Implements ns3::WifiMac.
virtual void ns3::RegularWifiMac::SetLinkUpCallback | ( | Callback< void > | linkUp | ) | [virtual] |
linkUp | the callback to invoke when the link becomes up. |
Implements ns3::WifiMac.
Reimplemented in ns3::MeshWifiInterfaceMac, ns3::AdhocWifiMac, and ns3::ApWifiMac.
void ns3::RegularWifiMac::SetPifs | ( | Time | pifs | ) | [virtual] |
pifs | the pifs duration. |
Implements ns3::WifiMac.
void ns3::RegularWifiMac::SetQosSupported | ( | bool | enable | ) | [protected] |
Set accessor for the m_qosSupported
member
void ns3::RegularWifiMac::SetSifs | ( | Time | sifs | ) | [virtual] |
sifs | the sifs duration |
Implements ns3::WifiMac.
void ns3::RegularWifiMac::SetSlot | ( | Time | slotTime | ) | [virtual] |
slotTime | the slot duration |
Implements ns3::WifiMac.
virtual void ns3::RegularWifiMac::SetSsid | ( | Ssid | ssid | ) | [virtual] |
ssid | the current ssid of this MAC layer. |
Implements ns3::WifiMac.
void ns3::RegularWifiMac::SetTypeOfStation | ( | TypeOfStation | type | ) | [protected] |
This method is invoked by a subclass to specify what type of station it is implementing. This is something that the channel access functions (instantiated within this class as EdcaTxopN's) need to know.
type | the type of station. |
phy | the physical layer attached to this MAC. |
Implements ns3::WifiMac.
virtual void ns3::RegularWifiMac::SetWifiRemoteStationManager | ( | Ptr< WifiRemoteStationManager > | stationManager | ) | [virtual] |
stationManager | the station manager attached to this MAC. |
Implements ns3::WifiMac.
Reimplemented in ns3::ApWifiMac.
Ptr<DcaTxop> ns3::RegularWifiMac::m_dca [protected] |
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-QoS peers.
EdcaQueues ns3::RegularWifiMac::m_edca [protected] |
This is a map from Access Category index to the corresponding channel access function
bool ns3::RegularWifiMac::m_qosSupported [protected] |
This Boolean is set true
iff this WifiMac is to model 802.11e/WMM style Quality of Service. It is exposed through the attribute system.
At the moment, this flag is the sole selection between QoS and non-QoS operation for the STA (whether IBSS, AP, or non-AP). Ultimately, we will want a QoS-enabled STA to be able to fall back to non-QoS operation with a non-QoS peer. This'll require further intelligence - i.e., per-association QoS state. Having a big switch seems like a good intermediate stage, however.