Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infrastructure BSS. More...
#include <ap-wifi-mac.h>
Public Member Functions | |
ApWifiMac () | |
virtual | ~ApWifiMac () |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to) |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to, Mac48Address from) |
Time | GetBeaconInterval (void) const |
virtual void | SetAddress (Mac48Address address) |
void | SetBeaconInterval (Time interval) |
virtual void | SetLinkUpCallback (Callback< void > linkUp) |
virtual void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager) |
void | StartBeaconing (void) |
virtual bool | SupportsSendFrom (void) const |
![]() | |
RegularWifiMac () | |
virtual | ~RegularWifiMac () |
Time | GetAckTimeout (void) const |
virtual Mac48Address | GetAddress (void) const |
virtual Time | GetBasicBlockAckTimeout (void) const |
virtual Mac48Address | GetBssid (void) const |
virtual Time | GetCompressedBlockAckTimeout (void) const |
Time | GetCtsTimeout (void) const |
Time | GetEifsNoDifs (void) const |
Time | GetPifs (void) const |
Time | GetSifs (void) const |
Time | GetSlot (void) const |
virtual Ssid | GetSsid (void) const |
virtual Ptr< WifiPhy > | GetWifiPhy () const |
virtual Ptr < WifiRemoteStationManager > | GetWifiRemoteStationManager () const |
void | SetAckTimeout (Time ackTimeout) |
virtual void | SetBasicBlockAckTimeout (Time blockAckTimeout) |
virtual void | SetBssid (Mac48Address bssid) |
virtual void | SetCompressedBlockAckTimeout (Time blockAckTimeout) |
void | SetCtsTimeout (Time ctsTimeout) |
void | SetEifsNoDifs (Time eifsNoDifs) |
virtual void | SetForwardUpCallback (ForwardUpCallback upCallback) |
virtual void | SetLinkDownCallback (Callback< void > linkDown) |
void | SetPifs (Time pifs) |
virtual void | SetPromisc (void) |
Sets the interface in promiscuous mode. | |
void | SetSifs (Time sifs) |
void | SetSlot (Time slotTime) |
virtual void | SetSsid (Ssid ssid) |
virtual void | SetWifiPhy (Ptr< WifiPhy > phy) |
![]() | |
void | ConfigureStandard (enum WifiPhyStandard standard) |
Time | GetMaxPropagationDelay (void) const |
Time | GetMsduLifetime (void) const |
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 | SetForwardUpCallback (Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > upCallback)=0 |
void | SetMaxPropagationDelay (Time delay) |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::ApWifiMac. |
Private Member Functions | |
virtual void | DeaggregateAmsduAndForward (Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr) |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
void | ForwardDown (Ptr< const Packet > packet, Mac48Address from, Mac48Address to) |
void | ForwardDown (Ptr< const Packet > packet, Mac48Address from, Mac48Address to, uint8_t tid) |
bool | GetBeaconGeneration (void) const |
SupportedRates | GetSupportedRates (void) const |
virtual void | Receive (Ptr< Packet > packet, const WifiMacHeader *hdr) |
void | SendAssocResp (Mac48Address to, bool success) |
void | SendOneBeacon (void) |
void | SendProbeResp (Mac48Address to) |
void | SetBeaconGeneration (bool enable) |
virtual void | TxFailed (const WifiMacHeader &hdr) |
virtual void | TxOk (const WifiMacHeader &hdr) |
Private Attributes | |
Ptr< DcaTxop > | m_beaconDca |
EventId | m_beaconEvent |
Time | m_beaconInterval |
bool | m_enableBeaconGeneration |
Wi-Fi AP state machine
Handle association, dis-association and authentication, of STAs within an infrastructure BSS.
Definition at line 39 of file ap-wifi-mac.h.
ns3::ApWifiMac::ApWifiMac | ( | ) |
Definition at line 67 of file ap-wifi-mac.cc.
References ns3::AP, m_beaconDca, ns3::RegularWifiMac::m_dcfManager, m_enableBeaconGeneration, ns3::RegularWifiMac::m_low, NS_LOG_FUNCTION, ns3::DcaTxop::SetAifsn(), ns3::DcaTxop::SetLow(), ns3::DcaTxop::SetManager(), ns3::DcaTxop::SetMaxCw(), ns3::DcaTxop::SetMinCw(), and ns3::RegularWifiMac::SetTypeOfStation().
|
virtual |
Definition at line 83 of file ap-wifi-mac.cc.
References NS_LOG_FUNCTION.
|
privatevirtual |
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack. We override the WifiMac version here because, as an AP, we also need to think about redistributing to other associated STAs.
aggregatedPacket | the Packet containing the A-MSDU. |
hdr | a pointer to the MAC header for aggregatedPacket . |
Definition at line 542 of file ap-wifi-mac.cc.
References ns3::MsduAggregator::Deaggregate(), ForwardDown(), ns3::RegularWifiMac::ForwardUp(), ns3::RegularWifiMac::GetAddress(), ns3::WifiMacHeader::GetQosTid(), and NS_LOG_DEBUG.
Referenced by Receive().
|
privatevirtual |
Definition at line 89 of file ap-wifi-mac.cc.
References ns3::EventId::Cancel(), m_beaconDca, m_beaconEvent, m_enableBeaconGeneration, and NS_LOG_FUNCTION.
|
privatevirtual |
Definition at line 567 of file ap-wifi-mac.cc.
References ns3::EventId::Cancel(), m_beaconDca, m_beaconEvent, m_enableBeaconGeneration, ns3::Simulator::ScheduleNow(), SendOneBeacon(), and ns3::Object::Start().
|
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::RegularWifiMac.
Definition at line 255 of file ap-wifi-mac.cc.
References ns3::MacLow::GetAddress(), and ns3::RegularWifiMac::m_low.
|
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.
Reimplemented from ns3::RegularWifiMac.
Definition at line 245 of file ap-wifi-mac.cc.
References ForwardDown(), ns3::WifiRemoteStationManager::IsAssociated(), ns3::Mac48Address::IsBroadcast(), ns3::RegularWifiMac::m_stationManager, and NS_LOG_FUNCTION.
|
private |
Definition at line 173 of file ap-wifi-mac.cc.
References ns3::RegularWifiMac::m_qosSupported, and ns3::QosUtilsGetTidForPacket().
Referenced by DeaggregateAmsduAndForward(), Enqueue(), and Receive().
|
private |
Definition at line 198 of file ap-wifi-mac.cc.
References ns3::RegularWifiMac::GetAddress(), ns3::RegularWifiMac::m_dca, ns3::RegularWifiMac::m_edca, ns3::RegularWifiMac::m_qosSupported, ns3::WifiMacHeader::NORMAL_ACK, NS_ASSERT, NS_LOG_FUNCTION, ns3::QosUtilsMapTidToAc(), ns3::DcaTxop::Queue(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetQosAckPolicy(), ns3::WifiMacHeader::SetQosNoAmsdu(), ns3::WifiMacHeader::SetQosNoEosp(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetQosTxopLimit(), ns3::WifiMacHeader::SetType(), ns3::WifiMacHeader::SetTypeData(), and ns3::WIFI_MAC_QOSDATA.
|
private |
Definition at line 123 of file ap-wifi-mac.cc.
References m_enableBeaconGeneration.
Referenced by GetTypeId().
Time ns3::ApWifiMac::GetBeaconInterval | ( | void | ) | const |
Definition at line 129 of file ap-wifi-mac.cc.
References m_beaconInterval.
Referenced by GetTypeId().
|
private |
Definition at line 270 of file ap-wifi-mac.cc.
References ns3::SupportedRates::AddSupportedRate(), ns3::WifiRemoteStationManager::GetBasicMode(), ns3::WifiMode::GetDataRate(), ns3::WifiPhy::GetMode(), ns3::WifiRemoteStationManager::GetNBasicModes(), ns3::WifiPhy::GetNModes(), ns3::RegularWifiMac::m_phy, ns3::RegularWifiMac::m_stationManager, and ns3::SupportedRates::SetBasicRate().
Referenced by SendAssocResp(), SendOneBeacon(), and SendProbeResp().
|
static |
This method returns the TypeId associated to ns3::ApWifiMac.
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::RegularWifiMac:
Attributes defined in parent class ns3::WifiMac:
No TraceSources defined for this type.
TraceSources defined in parent class ns3::RegularWifiMac:
TraceSources defined in parent class ns3::WifiMac:
Reimplemented from ns3::RegularWifiMac.
Definition at line 48 of file ap-wifi-mac.cc.
References GetBeaconGeneration(), GetBeaconInterval(), ns3::MicroSeconds(), SetBeaconGeneration(), SetBeaconInterval(), and ns3::TypeId::SetParent().
|
privatevirtual |
Definition at line 400 of file ap-wifi-mac.cc.
References ns3::WifiRemoteStationManager::AddSupportedMode(), ns3::Packet::Copy(), DeaggregateAmsduAndForward(), ForwardDown(), ns3::RegularWifiMac::ForwardUp(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), ns3::RegularWifiMac::GetAddress(), ns3::WifiRemoteStationManager::GetBasicMode(), ns3::WifiMode::GetDataRate(), ns3::WifiPhy::GetMode(), ns3::WifiRemoteStationManager::GetNBasicModes(), ns3::WifiPhy::GetNModes(), ns3::WifiMacHeader::GetQosTid(), ns3::Packet::GetSize(), ns3::MgtAssocRequestHeader::GetSupportedRates(), ns3::WifiRemoteStationManager::IsAssociated(), ns3::WifiMacHeader::IsAssocReq(), ns3::Mac48Address::IsBroadcast(), ns3::WifiMacHeader::IsData(), ns3::WifiMacHeader::IsDisassociation(), ns3::WifiMacHeader::IsFromDs(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsMgt(), ns3::WifiMacHeader::IsProbeReq(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), ns3::SupportedRates::IsSupportedRate(), ns3::WifiMacHeader::IsToDs(), ns3::RegularWifiMac::m_phy, ns3::RegularWifiMac::m_stationManager, ns3::WifiMac::NotifyRxDrop(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::RecordDisassociated(), ns3::WifiRemoteStationManager::RecordWaitAssocTxOk(), ns3::Packet::RemoveHeader(), SendAssocResp(), and SendProbeResp().
|
private |
Definition at line 315 of file ap-wifi-mac.cc.
References ns3::Packet::AddHeader(), ns3::RegularWifiMac::GetAddress(), GetSupportedRates(), ns3::RegularWifiMac::m_dca, NS_LOG_FUNCTION, ns3::DcaTxop::Queue(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetAssocResp(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::StatusCode::SetFailure(), and ns3::StatusCode::SetSuccess().
Referenced by Receive().
|
private |
Definition at line 348 of file ap-wifi-mac.cc.
References ns3::Packet::AddHeader(), ns3::RegularWifiMac::GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::Time::GetMicroSeconds(), ns3::RegularWifiMac::GetSsid(), GetSupportedRates(), m_beaconDca, m_beaconEvent, m_beaconInterval, NS_LOG_FUNCTION, ns3::DcaTxop::Queue(), ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetBeacon(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), and ns3::MgtProbeResponseHeader::SetSsid().
Referenced by DoStart(), SetBeaconGeneration(), and StartBeaconing().
|
private |
Definition at line 290 of file ap-wifi-mac.cc.
References ns3::Packet::AddHeader(), ns3::RegularWifiMac::GetAddress(), ns3::Time::GetMicroSeconds(), ns3::RegularWifiMac::GetSsid(), GetSupportedRates(), m_beaconInterval, ns3::RegularWifiMac::m_dca, NS_LOG_FUNCTION, ns3::DcaTxop::Queue(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetProbeResp(), and ns3::MgtProbeResponseHeader::SetSsid().
Referenced by Receive().
|
virtual |
address | the current address of this MAC layer. |
Reimplemented from ns3::RegularWifiMac.
Definition at line 99 of file ap-wifi-mac.cc.
References ns3::RegularWifiMac::SetBssid().
|
private |
Definition at line 108 of file ap-wifi-mac.cc.
References ns3::EventId::Cancel(), m_beaconEvent, m_enableBeaconGeneration, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendOneBeacon().
Referenced by GetTypeId().
void ns3::ApWifiMac::SetBeaconInterval | ( | Time | interval | ) |
interval | the interval between two beacon transmissions. |
Definition at line 155 of file ap-wifi-mac.cc.
References ns3::Time::GetMicroSeconds(), m_beaconInterval, NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by GetTypeId().
|
virtual |
linkUp | the callback to invoke when the link becomes up. |
Reimplemented from ns3::RegularWifiMac.
Definition at line 143 of file ap-wifi-mac.cc.
References NS_LOG_FUNCTION.
|
virtual |
stationManager | the station manager attached to this MAC. |
Reimplemented from ns3::RegularWifiMac.
Definition at line 135 of file ap-wifi-mac.cc.
References m_beaconDca, NS_LOG_FUNCTION, and ns3::DcaTxop::SetWifiRemoteStationManager().
void ns3::ApWifiMac::StartBeaconing | ( | void | ) |
Start beacon transmission immediately.
Definition at line 166 of file ap-wifi-mac.cc.
References NS_LOG_FUNCTION, and SendOneBeacon().
|
virtual |
Reimplemented from ns3::RegularWifiMac.
Definition at line 264 of file ap-wifi-mac.cc.
|
privatevirtual |
Definition at line 386 of file ap-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiRemoteStationManager::IsWaitAssocTxOk(), ns3::RegularWifiMac::m_stationManager, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WifiRemoteStationManager::RecordGotAssocTxFailed().
|
privatevirtual |
Definition at line 372 of file ap-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiRemoteStationManager::IsWaitAssocTxOk(), ns3::RegularWifiMac::m_stationManager, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WifiRemoteStationManager::RecordGotAssocTxOk().
Definition at line 126 of file ap-wifi-mac.h.
Referenced by ApWifiMac(), DoDispose(), DoStart(), SendOneBeacon(), and SetWifiRemoteStationManager().
|
private |
Definition at line 129 of file ap-wifi-mac.h.
Referenced by DoDispose(), DoStart(), SendOneBeacon(), and SetBeaconGeneration().
|
private |
Definition at line 127 of file ap-wifi-mac.h.
Referenced by GetBeaconInterval(), SendOneBeacon(), SendProbeResp(), and SetBeaconInterval().
|
private |
Definition at line 128 of file ap-wifi-mac.h.
Referenced by ApWifiMac(), DoDispose(), DoStart(), GetBeaconGeneration(), and SetBeaconGeneration().