Wifi MAC high model for an ad-hoc Wifi MAC. More...
#include "adhoc-wifi-mac.h"
Public Member Functions | |
| AdhocWifiMac () | |
| ~AdhocWifiMac () override | |
| int64_t | AssignStreams (int64_t stream) override |
| Assign a fixed random variable stream number to the random variables used by this model. | |
| bool | CanForwardPacketsTo (Mac48Address to) const override |
| Return true if packets can be forwarded to the given destination, false otherwise. | |
| Ptr< Txop > | GetTxopFor (AcIndex ac) const override |
| Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer, otherwise. | |
| void | SetLinkUpCallback (Callback< void > linkUp) override |
| Public Member Functions inherited from ns3::WifiMac | |
| WifiMac () | |
| WifiMac (const WifiMac &)=delete | |
| ~WifiMac () override | |
| void | BlockUnicastTxOnLinks (WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds, bool exceptMgt=false) |
| Block the transmission on the given links of all unicast frames (except management frames, if requested) addressed to the station with the given address for the given reason. | |
| void | Enqueue (Ptr< Packet > packet, Mac48Address to) |
| void | Enqueue (Ptr< Packet > packet, Mac48Address to, Mac48Address from) |
| void | Enqueue (Ptr< Packet > packet, Mac48Address to, Mac48Address from, uint8_t tid) |
| void | EnqueueMgt (const WifiMacHeader &macHdr, const std::list< std::reference_wrapper< const Header > > &headers, uint8_t linkId) |
| Enqueue a management frame. | |
| Mac48Address | GetAddress () const |
| OriginatorAgreementOptConstRef | GetBaAgreementEstablishedAsOriginator (Mac48Address recipient, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr=std::nullopt) const |
| RecipientAgreementOptConstRef | GetBaAgreementEstablishedAsRecipient (Mac48Address originator, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr=std::nullopt) const |
| BlockAckReqType | GetBarTypeAsOriginator (const Mac48Address &recipient, uint8_t tid) const |
| BlockAckReqType | GetBarTypeAsRecipient (Mac48Address originator, uint8_t tid) const |
| BlockAckType | GetBaTypeAsOriginator (const Mac48Address &recipient, uint8_t tid) const |
| BlockAckType | GetBaTypeAsRecipient (Mac48Address originator, uint8_t tid) const |
| Mac48Address | GetBssid (uint8_t linkId) const |
| Ptr< ChannelAccessManager > | GetChannelAccessManager (uint8_t linkId=SINGLE_LINK_OP_ID) const |
| Get the Channel Access Manager associated with the given link. | |
| Ptr< WifiNetDevice > | GetDevice () const |
| Return the device this PHY is associated with. | |
| std::set< linkId_t > | GetDisabledLinks (Mac48Address mldAddr) |
| Get the set of links that have been disabled for the given MLD, i.e., no TID is mapped onto such links both in the DL direction and the UL direction. | |
| bool | GetDsssSupported (uint8_t linkId) const |
| Return whether the device supports DSSS on the given link. | |
| EhtCapabilities | GetEhtCapabilities (uint8_t linkId) const |
| Return the EHT capabilities of the device for the given link. | |
| Ptr< EhtConfiguration > | GetEhtConfiguration () const |
| bool | GetEhtSupported () const |
| Return whether the device supports EHT. | |
| bool | GetEhtSupported (const Mac48Address &address) const |
| bool | GetErpSupported (uint8_t linkId) const |
| Return whether the device supports ERP on the given link. | |
| ExtendedCapabilities | GetExtendedCapabilities () const |
| Return the extended capabilities of the device. | |
| Ptr< FrameExchangeManager > | GetFrameExchangeManager (uint8_t linkId=SINGLE_LINK_OP_ID) const |
| Get the Frame Exchange Manager associated with the given link. | |
| uint32_t | GetFrameRetryLimit () const |
| He6GhzBandCapabilities | GetHe6GhzBandCapabilities (uint8_t linkId) const |
| Return the HE 6GHz band capabilities of the device for the given 6 GHz link. | |
| HeCapabilities | GetHeCapabilities (uint8_t linkId) const |
| Return the HE capabilities of the device for the given link. | |
| Ptr< HeConfiguration > | GetHeConfiguration () const |
| bool | GetHeSupported () const |
| Return whether the device supports HE. | |
| bool | GetHeSupported (const Mac48Address &address) const |
| HtCapabilities | GetHtCapabilities (uint8_t linkId) const |
| Return the HT capabilities of the device for the given link. | |
| Ptr< HtConfiguration > | GetHtConfiguration () const |
| bool | GetHtSupported (const Mac48Address &address) const |
| bool | GetHtSupported (uint8_t linkId) const |
| Return whether the device supports HT on the given link. | |
| std::optional< uint8_t > | GetLinkForPhy (Ptr< const WifiPhy > phy) const |
| Get the ID of the link (if any) on which the given PHY is operating. | |
| std::optional< uint8_t > | GetLinkForPhy (std::size_t phyId) const |
| Get the ID of the link (if any) on which the given PHY is operating. | |
| virtual std::optional< uint8_t > | GetLinkIdByAddress (const Mac48Address &address) const |
| Get the ID of the link having the given MAC address, if any. | |
| const std::set< uint8_t > & | GetLinkIds () const |
| Mac48Address | GetLocalAddress (const Mac48Address &remoteAddr) const |
| Get the local MAC address used to communicate with a remote STA. | |
| Ptr< WifiMacQueueScheduler > | GetMacQueueScheduler () const |
| Get the wifi MAC queue scheduler. | |
| uint32_t | GetMaxAmpduSize (AcIndex ac) const |
| Return the maximum A-MPDU size of the given Access Category. | |
| uint16_t | GetMaxAmsduSize (AcIndex ac) const |
| Return the maximum A-MSDU size of the given Access Category. | |
| uint16_t | GetMaxBaBufferSize (std::optional< Mac48Address > address=std::nullopt) const |
| Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device, if any, or by this device, otherwise, based on the supported standard. | |
| std::optional< Mac48Address > | GetMldAddress (const Mac48Address &remoteAddr) const |
| uint16_t | GetMpduBufferSize () const |
| uint8_t | GetNLinks () const |
| Get the number of links (can be greater than 1 for 11be devices only). | |
| bool | GetQosSupported () const |
| Return whether the device supports QoS. | |
| Ptr< QosTxop > | GetQosTxop (AcIndex ac) const |
| Accessor for a specified EDCA object. | |
| Ptr< QosTxop > | GetQosTxop (uint8_t tid) const |
| Accessor for a specified EDCA object. | |
| bool | GetRobustAVStreamingSupported () const |
| Return whether the device supports Robust AV Streaming. | |
| Ssid | GetSsid () const |
| std::optional< std::reference_wrapper< const WifiTidLinkMapping > > | GetTidToLinkMapping (Mac48Address mldAddr, WifiDirection dir) const |
| Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction. | |
| bool | GetTxBlockedOnLink (AcIndex ac, const WifiContainerQueueId &queueId, uint8_t linkId, WifiQueueBlockedReason reason=WifiQueueBlockedReason::REASONS_COUNT) const |
| Check whether the transmission of the packets in the given container queue of the given Access Category are blocked on the given link for the given reason (if any). | |
| Ptr< Txop > | GetTxop () const |
| Accessor for the Txop object. | |
| Ptr< WifiMacQueue > | GetTxopQueue (AcIndex ac) const |
| Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer, otherwise. | |
| TypeOfStation | GetTypeOfStation () const |
| Return the type of station. | |
| VhtCapabilities | GetVhtCapabilities (uint8_t linkId) const |
| Return the VHT capabilities of the device for the given link. | |
| Ptr< VhtConfiguration > | GetVhtConfiguration () const |
| bool | GetVhtSupported (const Mac48Address &address) const |
| bool | GetVhtSupported (uint8_t linkId) const |
| Return whether the device supports VHT on the given link. | |
| Ptr< WifiPhy > | GetWifiPhy (uint8_t linkId=SINGLE_LINK_OP_ID) const |
| Ptr< WifiRemoteStationManager > | GetWifiRemoteStationManager (uint8_t linkId=0) const |
| virtual bool | HasFramesToTransmit (uint8_t linkId) |
| Check if the MAC has frames to transmit over the given link. | |
| bool | Is6GhzBand (uint8_t linkId) const |
| Indicate if a given link is on the 6 GHz band. | |
| virtual void | NotifyChannelReleased (Ptr< Txop > txop, uint8_t linkId) |
| Notify that the given TXOP has released the channel on the given link. | |
| virtual void | NotifyChannelSwitching (uint8_t linkId) |
| Notify that channel on the given link has been switched. | |
| void | NotifyPromiscRx (Ptr< const Packet > packet) |
| virtual void | NotifyRequestAccess (Ptr< Txop > txop, uint8_t linkId) |
| Notify that the given TXOP is requesting channel access on the given link. | |
| void | NotifyRx (Ptr< const Packet > packet) |
| void | NotifyRxDrop (Ptr< const Packet > packet) |
| void | NotifyTx (Ptr< const Packet > packet) |
| void | NotifyTxDrop (Ptr< const Packet > packet) |
| WifiMac & | operator= (const WifiMac &)=delete |
| void | ResetWifiPhys () |
| Remove currently attached WifiPhy objects from this MAC. | |
| virtual void | SetAddress (Mac48Address address) |
| void | SetBssid (Mac48Address bssid, uint8_t linkId) |
| void | SetChannelAccessManagers (const std::vector< Ptr< ChannelAccessManager > > &caManagers) |
| void | SetCtsToSelfSupported (bool enable) |
| Enable or disable CTS-to-self feature. | |
| void | SetDevice (const Ptr< WifiNetDevice > device) |
| Sets the device this PHY is associated with. | |
| void | SetForwardUpCallback (ForwardUpCallback upCallback) |
| void | SetFrameExchangeManagers (const std::vector< Ptr< FrameExchangeManager > > &feManagers) |
| void | SetFrameRetryLimit (uint32_t limit) |
| Set the frame retry limit. | |
| void | SetLinkDownCallback (Callback< void > linkDown) |
| virtual void | SetMacQueueScheduler (Ptr< WifiMacQueueScheduler > scheduler) |
| Set the wifi MAC queue scheduler. | |
| void | SetMpduBufferSize (uint16_t size) |
| void | SetPromisc () |
| Sets the interface in promiscuous mode. | |
| void | SetRobustAVStreamingSupported (bool enable) |
| Enable or disable Robust AV Streaming support for the device. | |
| void | SetSsid (Ssid ssid) |
| void | SetTypeOfStation (TypeOfStation type) |
| This method is invoked by a subclass to specify what type of station it is implementing. | |
| virtual void | SetWifiPhys (const std::vector< Ptr< WifiPhy > > &phys) |
| void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager) |
| void | SetWifiRemoteStationManagers (const std::vector< Ptr< WifiRemoteStationManager > > &stationManagers) |
| virtual bool | SupportsSendFrom () const |
| bool | TidMappedOnLink (Mac48Address mldAddr, WifiDirection dir, uint8_t tid, uint8_t linkId) const |
| Check whether the given TID is mapped on the given link in the given direction for the given MLD. | |
| void | UnblockUnicastTxOnLinks (WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds) |
| Unblock the transmission on the given links of all unicast frames addressed to the station with the given address for the given reason. | |
| Public Member Functions inherited from ns3::Object | |
| Object () | |
| Caller graph was not generated because of its size. | |
| ~Object () override | |
| Destructor. | |
| void | AggregateObject (Ptr< Object > other) |
| Aggregate two Objects together. | |
| void | Dispose () |
| Dispose of this Object. | |
| AggregateIterator | GetAggregateIterator () const |
| Get an iterator to the Objects aggregated to this one. | |
| TypeId | GetInstanceTypeId () const final |
| Get the most derived TypeId for this Object. | |
| template<> | |
| Ptr< Object > | GetObject () const |
| Specialization of () for objects of type ns3::Object. | |
| template<typename T> | |
| Ptr< T > | GetObject () const |
| Get a pointer to the requested aggregated Object. | |
| template<> | |
| Ptr< Object > | GetObject (TypeId tid) const |
| Specialization of (TypeId tid) for objects of type ns3::Object. | |
| template<typename T> | |
| Ptr< T > | GetObject (TypeId tid) const |
| Get a pointer to the requested aggregated Object by TypeId. | |
| void | Initialize () |
| Invoke DoInitialize on all Objects aggregated to this one. | |
| bool | IsInitialized () const |
| Check if the object has been initialized. | |
| void | UnidirectionalAggregateObject (Ptr< Object > other) |
| Aggregate an Object to another Object. | |
| Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| Default constructor. | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. | |
| void | Ref () const |
| Increment the reference count. | |
| void | Unref () const |
| Decrement the reference count. | |
| Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| Virtual destructor. | |
| void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
| Get the value of an attribute, raising fatal errors if unsuccessful. | |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
| Get the value of an attribute without raising errors. | |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| Set a single attribute, raising fatal errors if unsuccessful. | |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| Set a single attribute without raising errors. | |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| Connect a TraceSource to a Callback with a context. | |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| Connect a TraceSource to a Callback without a context. | |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected with a context. | |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
| Static Public Member Functions inherited from ns3::WifiMac | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
| Static Public Member Functions inherited from ns3::Object | |
| static TypeId | GetTypeId () |
| Register this type. | |
| Static Public Member Functions inherited from ns3::ObjectBase | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Private Member Functions | |
| void | CancelPendingBeacon () |
| Cancel the remaining IBSS random delay and flush any Beacon waiting in the beacon queue. | |
| void | DoCompleteConfig () override |
| Allow subclasses to complete the configuration of the MAC layer components. | |
| void | DoDispose () override |
| Destructor implementation. | |
| void | DoInitialize () override |
| Initialize() implementation. | |
| void | Enqueue (Ptr< WifiMpdu > mpdu, Mac48Address to, Mac48Address from) override |
| Time | GetBeaconInterval () const |
| CapabilityInformation | GetCapabilities () const |
| Return the Capability information of the IBSS. | |
| DsssParameterSet | GetDsssParameterSet () const |
| Return the DSSS Parameter Set that we support. | |
| EdcaParameterSet | GetEdcaParameterSet () const |
| Return the EDCA Parameter Set of the IBSS. | |
| EhtOperation | GetEhtOperation () const |
| Return the EHT operation of the IBSS. | |
| ErpInformation | GetErpInformation () const |
| Return the ERP information of the IBSS. | |
| HeOperation | GetHeOperation () const |
| Return the HE operation of the IBSS. | |
| HtOperation | GetHtOperation () const |
| Return the HT operation of the IBSS. | |
| AllSupportedRates | GetSupportedRates () const |
| Return an instance of SupportedRates that contains all rates that we support (including HT rates). | |
| VhtOperation | GetVhtOperation () const |
| Return the VHT operation of the IBSS. | |
| void | Receive (Ptr< const WifiMpdu > mpdu, uint8_t linkId) override |
| This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has been received on the given link. | |
| void | ReceiveBeacon (Ptr< const WifiMpdu > mpdu, linkId_t linkId) |
| Process the Beacon frame received on the given link. | |
| void | ReceiveProbeRequest (Ptr< const WifiMpdu > mpdu, linkId_t linkId) |
| Process the Probe Request frame received on the given link. | |
| void | SendOneBeacon () |
| Forward a beacon packet for transmission. | |
| void | SetAllCapabilities (Mac48Address address) |
| Fill in the same capabilities as this device for a given new peer. | |
| void | SetBeaconGeneration (bool enable) |
| Enable or disable beacon generation. | |
| void | SetBeaconInterval (Time interval) |
| void | TbttTimeout () |
| Called at each target beacon transmission time (TBTT). | |
Private Attributes | |
| AcIndex | m_beaconAc |
| the access category to use for beacons | |
| EventId | m_beaconEvent |
| Event to generate one beacon after the IBSS random delay. | |
| Time | m_beaconInterval |
| the beacon interval | |
| Ptr< RandomVariableStream > | m_beaconJitter |
| Uniform [0, 1] RV for the initial TBTT offset and the per-TBTT delay. | |
| Ptr< Txop > | m_beaconTxop |
| Dedicated Txop for beacons. | |
| bool | m_enableBeaconGeneration |
| Flag whether beacons are being generated. | |
| bool | m_enableBeaconJitter |
| Flag whether the first TBTT is delayed by a random fraction of BeaconInterval. | |
| EventId | m_tbttEvent |
| Event for the next TBTT. | |
Additional Inherited Members | |
| Public Types inherited from ns3::WifiMac | |
| 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. | |
| typedef void(* | IcfDropCallback) (const IcfDropInfo &info) |
| TracedCallback signature for ICF drop events. | |
| using | IcfDropTracedCallback = TracedCallback<const IcfDropInfo&> |
| TracedCallback for ICF drop events typedef. | |
| using | MgtFrameType |
| type of the management frames | |
| using | MgtResponseFrameType |
| type of the management response frames | |
| using | OriginatorAgreementOptConstRef |
| optional const reference to OriginatorBlockAckAgreement | |
| using | RecipientAgreementOptConstRef |
| optional const reference to RecipientBlockAckAgreement | |
| Protected Member Functions inherited from ns3::WifiMac | |
| void | ApplyTidLinkMapping (const Mac48Address &mldAddr, WifiDirection dir) |
| Apply the TID-to-Link Mapping negotiated with the given MLD for the given direction by properly configuring the queue scheduler. | |
| virtual void | ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax) |
| virtual void | DeaggregateAmsduAndForward (Ptr< const WifiMpdu > mpdu) |
| This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack. | |
| void | DestroyAllBlockAckAgreements (Mac48Address remoteAddr) |
| Destroy all the Block Ack agreements established with the given remote station. | |
| void | DoDispose () override |
| Destructor implementation. | |
| void | DoInitialize () override |
| Initialize() implementation. | |
| void | EnqueueDisassociation (Mac48Address addr1, uint8_t linkId) |
| Prepare and enqueue a Disassociation frame. | |
| void | ForwardUp (Ptr< const Packet > packet, Mac48Address from, Mac48Address to) |
| Forward the packet up to the device. | |
| Ptr< QosTxop > | GetBEQueue () const |
| Accessor for the AC_BE channel access function. | |
| Ptr< QosTxop > | GetBKQueue () const |
| Accessor for the AC_BK channel access function. | |
| LinkEntity & | GetLink (uint8_t linkId) const |
| Get a reference to the link associated with the given ID. | |
| const std::map< uint8_t, std::unique_ptr< LinkEntity > > & | GetLinks () const |
| bool | GetShortSlotTimeSupported () const |
| Ptr< QosTxop > | GetVIQueue () const |
| Accessor for the AC_VI channel access function. | |
| Ptr< QosTxop > | GetVOQueue () const |
| Accessor for the AC_VO channel access function. | |
| void | HandleQueuesUponAssocStateChanged (Mac48Address remoteAddr, const std::set< uint8_t > &linkIds, bool isDisassoc) |
| This function performs the operations that APs and non-AP STAs need to take on their queues in case of disassociation or (re)association. | |
| void | NotifyConstructionCompleted () override |
| Notifier called once the ObjectBase is fully constructed. | |
| void | RecordCapabilities (const MgtFrameType &frame, const Mac48Address &addr, uint8_t linkId) |
| Update capabilities information from the given management frame. | |
| void | ResetRemoteInfo (Mac48Address remoteAddr, uint8_t linkId) |
| Reset the information about the given remote station from the remote station manager operating on the given link. | |
| void | RestoreQueuesAfterReassoc (Mac48Address remoteAddr) |
| Queues that have been blocked (and not flushed) upon disassociation or reassociation need to be restored in case of successful association. | |
| void | SetShortSlotTimeSupported (bool enable) |
| Enable or disable short slot time feature. | |
| void | SwapLinks (std::map< uint8_t, uint8_t > links) |
| Swap the links based on the information included in the given map. | |
| void | UpdateTidToLinkMapping (const Mac48Address &mldAddr, WifiDirection dir, const WifiTidLinkMapping &mapping) |
| Update the TID-to-Link Mappings for the given MLD in the given direction based on the given negotiated mappings. | |
| Protected Member Functions inherited from ns3::Object | |
| Object (const Object &o) | |
| Copy an Object. | |
| virtual void | NotifyNewAggregate () |
| Notify all Objects aggregated to this one of a new Object being aggregated. | |
| Protected Member Functions inherited from ns3::ObjectBase | |
| void | ConstructSelf (const AttributeConstructionList &attributes) |
| Complete construction of ObjectBase; invoked by derived classes. | |
| Protected Attributes inherited from ns3::WifiMac | |
| Callback< void > | m_linkDown |
| Callback when a link is down. | |
| Callback< void > | m_linkUp |
| Callback when a link is up. | |
| Ptr< MacRxMiddle > | m_rxMiddle |
| RX middle (defragmentation etc.). | |
| Ptr< WifiMacQueueScheduler > | m_scheduler |
| wifi MAC queue scheduler | |
| UniformRandomBitGenerator | m_shuffleLinkIdsGen |
| random number generator to shuffle link IDs | |
| Ptr< MacTxMiddle > | m_txMiddle |
| TX middle (aggregation etc.). | |
| Ptr< Txop > | m_txop |
| TXOP used for transmission of frames to non-QoS peers. | |
| Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Wifi MAC high model for an ad-hoc Wifi MAC.
As per IEEE 802.11-2024, sec. 11.1.3.5 (Beacon generation in an IBSS), if beacon generation is enabled, TBTTs occur every BeaconInterval. At each TBTT a random delay in [0, 2 * aCWmin * aSlotTime] is applied before transmitting a Beacon. If a Beacon from the same IBSS is received before that delay expires, the remaining delay and any pending Beacon are cancelled.
Note that The first TBTT may be further delayed by BeaconJitter.
Definition at line 44 of file adhoc-wifi-mac.h.
| ns3::AdhocWifiMac::AdhocWifiMac | ( | ) |
Definition at line 96 of file adhoc-wifi-mac.cc.
References ns3::ADHOC_STA, ns3::CreateObjectWithAttributes(), m_beaconTxop, m_enableBeaconGeneration, ns3::WifiMac::m_txMiddle, NS_LOG_FUNCTION, and ns3::WifiMac::SetTypeOfStation().
Referenced by GetTypeId().
|
override |
Definition at line 107 of file adhoc-wifi-mac.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
| stream | first stream index to use |
Reimplemented from ns3::WifiMac.
Definition at line 189 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::AssignStreams(), m_beaconJitter, m_beaconTxop, and NS_LOG_FUNCTION.
|
private |
Cancel the remaining IBSS random delay and flush any Beacon waiting in the beacon queue.
Definition at line 330 of file adhoc-wifi-mac.cc.
References m_beaconEvent, m_beaconTxop, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ReceiveBeacon(), and SetBeaconGeneration().
|
overridevirtual |
Return true if packets can be forwarded to the given destination, false otherwise.
| to | the address to which the packet should be sent |
Implements ns3::WifiMac.
Definition at line 225 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetWifiRemoteStationManager(), and m_enableBeaconGeneration.
|
overrideprivatevirtual |
Allow subclasses to complete the configuration of the MAC layer components.
Implements ns3::WifiMac.
Definition at line 200 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::LinkEntity::channelAccessManager, ns3::WifiMac::GetLink(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetQosTxop(), ns3::WifiMac::GetTxop(), m_beaconAc, m_beaconTxop, NS_LOG_FUNCTION, and ns3::StaticCast().
|
overrideprivatevirtual |
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.
Caller graph was not generated because of its size.
Reimplemented from ns3::Object.
Definition at line 138 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::DoDispose(), m_beaconEvent, m_beaconTxop, m_enableBeaconGeneration, m_tbttEvent, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() 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.
Definition at line 113 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::DoInitialize(), ns3::WifiMac::GetAddress(), GetBeaconInterval(), ns3::Time::GetMicroSeconds(), m_beaconEvent, m_beaconJitter, m_beaconTxop, m_enableBeaconGeneration, m_enableBeaconJitter, m_tbttEvent, ns3::MicroSeconds(), NS_ABORT_MSG_IF, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and TbttTimeout().
|
overrideprivatevirtual |
| mpdu | the MPDU to send. |
| to | the address to which the packet should be sent. |
| from | the address from which the packet should be sent. |
Subclasses need to implement this method to finalize the MAC header of the MPDU (MAC addresses and ToDS/FromDS flags) and enqueue the MPDU in a TX queue.
Implements ns3::WifiMac.
Definition at line 270 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetAddress(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetQosTxop(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetWifiRemoteStationManager(), m_enableBeaconGeneration, ns3::WifiMac::NotifyTxDrop(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, SetAllCapabilities(), ns3::SINGLE_LINK_OP_ID, and ns3::StaticCast().
|
private |
Definition at line 183 of file adhoc-wifi-mac.cc.
References m_beaconInterval.
Referenced by DoInitialize(), GetTypeId(), SendOneBeacon(), and TbttTimeout().
|
private |
Return the Capability information of the IBSS.
Definition at line 562 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetErpSupported(), ns3::WifiMac::GetShortSlotTimeSupported(), ns3::WifiMac::GetWifiPhy(), ns3::CapabilityInformation::SetIbss(), ns3::CapabilityInformation::SetShortPreamble(), ns3::CapabilityInformation::SetShortSlotTime(), and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
|
private |
Return the DSSS Parameter Set that we support.
Definition at line 553 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetDsssSupported(), ns3::WifiMac::GetWifiPhy(), NS_ASSERT, ns3::DsssParameterSet::SetCurrentChannel(), and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
|
private |
Return the EDCA Parameter Set of the IBSS.
Definition at line 582 of file adhoc-wifi-mac.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::Time::GetMicroSeconds(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetQosTxop(), NS_ASSERT, ns3::EdcaParameterSet::SetBeAci(), ns3::EdcaParameterSet::SetBeAifsn(), ns3::EdcaParameterSet::SetBeCWmax(), ns3::EdcaParameterSet::SetBeCWmin(), ns3::EdcaParameterSet::SetBeTxopLimit(), ns3::EdcaParameterSet::SetBkAci(), ns3::EdcaParameterSet::SetBkAifsn(), ns3::EdcaParameterSet::SetBkCWmax(), ns3::EdcaParameterSet::SetBkCWmin(), ns3::EdcaParameterSet::SetBkTxopLimit(), ns3::EdcaParameterSet::SetQosInfo(), ns3::EdcaParameterSet::SetViAci(), ns3::EdcaParameterSet::SetViAifsn(), ns3::EdcaParameterSet::SetViCWmax(), ns3::EdcaParameterSet::SetViCWmin(), ns3::EdcaParameterSet::SetViTxopLimit(), ns3::EdcaParameterSet::SetVoAci(), ns3::EdcaParameterSet::SetVoAifsn(), ns3::EdcaParameterSet::SetVoCWmax(), ns3::EdcaParameterSet::SetVoCWmin(), ns3::EdcaParameterSet::SetVoTxopLimit(), and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
|
private |
Return the EHT operation of the IBSS.
Definition at line 732 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetEhtSupported(), ns3::WifiMac::GetWifiPhy(), NS_ASSERT, ns3::EhtOperation::SetMaxRxNss(), ns3::EhtOperation::SetMaxTxNss(), and ns3::WIFI_EHT_MAX_MCS_INDEX.
Referenced by SendOneBeacon().
|
private |
Return the ERP information of the IBSS.
Definition at line 574 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetErpSupported(), NS_ASSERT, and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
|
private |
Return the HE operation of the IBSS.
Definition at line 699 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetHeConfiguration(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetWifiPhy(), ns3::HeOperation::m_6GHzOpInfo, ns3::HeOperation::BssColorInfo::m_bssColor, ns3::HeOperation::m_bssColorInfo, ns3::HeOperation::OpInfo6GHz::m_chCntrFreqSeg0, ns3::HeOperation::OpInfo6GHz::m_chCntrFreqSeg1, ns3::HeOperation::OpInfo6GHz::m_chWid, ns3::HeOperation::OpInfo6GHz::m_primCh, NS_ASSERT, ns3::HeOperation::SetMaxHeMcsPerNss(), ns3::WIFI_PHY_BAND_6GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by SendOneBeacon().
|
private |
Return the HT operation of the IBSS.
Definition at line 628 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetHtConfiguration(), ns3::WifiMac::GetHtSupported(), ns3::WifiMac::GetWifiPhy(), ns3::NanoSeconds(), NS_ASSERT, NS_LOG_DEBUG, ns3::HtOperation::SetPrimaryChannel(), ns3::HtOperation::SetRxHighestSupportedDataRate(), ns3::HtOperation::SetSecondaryChannelOffset(), ns3::HtOperation::SetStaChannelWidth(), ns3::HtOperation::SetTxMaxNSpatialStreams(), ns3::HtOperation::SetTxMcsSetDefined(), ns3::SINGLE_LINK_OP_ID, and ns3::WIFI_MOD_CLASS_HT.
Referenced by SendOneBeacon().
|
private |
Return an instance of SupportedRates that contains all rates that we support (including HT rates).
Definition at line 533 of file adhoc-wifi-mac.cc.
References ns3::AllSupportedRates::AddBssMembershipSelectorRate(), ns3::AllSupportedRates::AddSupportedRate(), ns3::WifiMac::GetHtSupported(), ns3::WifiMac::GetWifiPhy(), NS_LOG_DEBUG, and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer, otherwise.
| ac | the given Access Category |
Reimplemented from ns3::WifiMac.
Definition at line 215 of file adhoc-wifi-mac.cc.
References ns3::AC_BEACON, ns3::WifiMac::GetTxopFor(), and m_beaconTxop.
|
static |
Get the type ID.
Definition at line 49 of file adhoc-wifi-mac.cc.
References AdhocWifiMac(), ns3::WifiMac::WifiMac(), ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::DEFAULT_BEACON_INTERVAL(), GetBeaconInterval(), m_beaconAc, m_beaconJitter, m_enableBeaconJitter, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), SetBeaconGeneration(), SetBeaconInterval(), and ns3::TypeId::SetParent().
|
private |
Return the VHT operation of the IBSS.
Definition at line 664 of file adhoc-wifi-mac.cc.
References ns3::VhtOperation::GetChannelWidth(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::GetWifiPhy(), NS_ASSERT, ns3::VhtOperation::SetChannelCenterFrequencySegment0(), ns3::VhtOperation::SetChannelCenterFrequencySegment1(), ns3::VhtOperation::SetChannelWidth(), ns3::VhtOperation::SetMaxVhtMcsPerNss(), and ns3::SINGLE_LINK_OP_ID.
Referenced by SendOneBeacon().
|
overrideprivatevirtual |
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has been received on the given link.
The implementation is intended to capture logic that is going to be common to all (or most) derived classes. Specifically, handling of Block Ack management frames is dealt with here.
This method will need, however, to be overridden by derived classes so that they can perform their data handling before invoking the base version.
The given link may be undefined in some cases (e.g., in case of QoS Data frames received in the context of a Block Ack agreement – because the BlockAckManager does not have to record the link each buffered MPDU has been received on); in such a cases, the value of linkId should be WIFI_LINKID_UNDEFINED.
| mpdu | the MPDU that has been received. |
| linkId | the ID of the given link |
Reimplemented from ns3::WifiMac.
Definition at line 411 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::DeaggregateAmsduAndForward(), ns3::WifiMac::ForwardUp(), ns3::WifiMac::GetWifiRemoteStationManager(), m_enableBeaconGeneration, ns3::WifiMac::NotifyRxDrop(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::WifiMac::Receive(), ReceiveBeacon(), ReceiveProbeRequest(), SetAllCapabilities(), ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE, ns3::WIFI_MAC_MGT_BEACON, ns3::WIFI_MAC_MGT_PROBE_REQUEST, ns3::WIFI_MAC_MGT_REASSOCIATION_REQUEST, and ns3::WIFI_MAC_MGT_REASSOCIATION_RESPONSE.
Process the Beacon frame received on the given link.
| mpdu | the MPDU containing the Beacon frame |
| linkId | the ID of the given link |
Definition at line 470 of file adhoc-wifi-mac.cc.
References CancelPendingBeacon(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMac::GetSsid(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::WifiMacHeader::IsBeacon(), ns3::CapabilityInformation::IsIbss(), ns3::MgtBeaconHeader::m_capability, m_enableBeaconGeneration, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and ns3::WifiMac::RecordCapabilities().
Referenced by Receive().
Process the Probe Request frame received on the given link.
| mpdu | the MPDU containing the Probe Request frame |
| linkId | the ID of the given link |
Definition at line 508 of file adhoc-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr2(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::WifiMacHeader::IsProbeReq(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::WifiMac::RecordCapabilities().
Referenced by Receive().
|
private |
Forward a beacon packet for transmission.
Definition at line 346 of file adhoc-wifi-mac.cc.
References ns3::Create(), ns3::WifiMac::GetAddress(), GetBeaconInterval(), ns3::Mac48Address::GetBroadcast(), GetCapabilities(), GetDsssParameterSet(), ns3::WifiMac::GetDsssSupported(), GetEdcaParameterSet(), ns3::WifiMac::GetEhtCapabilities(), GetEhtOperation(), ns3::WifiMac::GetEhtSupported(), GetErpInformation(), ns3::WifiMac::GetErpSupported(), ns3::WifiMac::GetExtendedCapabilities(), ns3::WifiMac::GetHe6GhzBandCapabilities(), ns3::WifiMac::GetHeCapabilities(), GetHeOperation(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetHtCapabilities(), GetHtOperation(), ns3::WifiMac::GetHtSupported(), ns3::Time::GetMicroSeconds(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetSsid(), GetSupportedRates(), ns3::WifiMac::GetVhtCapabilities(), GetVhtOperation(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::Is6GhzBand(), ns3::MgtBeaconHeader::m_beaconInterval, m_beaconTxop, ns3::MgtBeaconHeader::m_capability, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetType(), ns3::SINGLE_LINK_OP_ID, and ns3::WIFI_MAC_MGT_BEACON.
Referenced by TbttTimeout().
|
private |
Fill in the same capabilities as this device for a given new peer.
| Address | the MAC address of the peer |
Definition at line 231 of file adhoc-wifi-mac.cc.
References ns3::WifiMac::GetEhtCapabilities(), ns3::WifiMac::GetEhtSupported(), ns3::WifiMac::GetHe6GhzBandCapabilities(), ns3::WifiMac::GetHeCapabilities(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetHtCapabilities(), ns3::WifiMac::GetHtSupported(), ns3::WifiMac::GetVhtCapabilities(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::WifiMac::Is6GhzBand(), and ns3::SINGLE_LINK_OP_ID.
Referenced by Enqueue(), and Receive().
|
private |
Enable or disable beacon generation.
| enable | enable or disable beacon generation |
Definition at line 150 of file adhoc-wifi-mac.cc.
References CancelPendingBeacon(), m_enableBeaconGeneration, m_tbttEvent, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and TbttTimeout().
Referenced by GetTypeId().
|
private |
| interval | the interval between two beacon transmissions. |
Definition at line 166 of file adhoc-wifi-mac.cc.
References ns3::Time::GetMicroSeconds(), m_beaconInterval, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
overridevirtual |
| linkUp | the callback to invoke when the link becomes up. |
Reimplemented from ns3::WifiMac.
Definition at line 302 of file adhoc-wifi-mac.cc.
References NS_LOG_FUNCTION, and ns3::WifiMac::SetLinkUpCallback().
|
private |
Called at each target beacon transmission time (TBTT).
Schedules the next TBTT and a Beacon transmission after the IBSS random delay.
Definition at line 314 of file adhoc-wifi-mac.cc.
References GetBeaconInterval(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetQosTxop(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetWifiPhy(), m_beaconAc, m_beaconEvent, m_beaconJitter, m_tbttEvent, NS_ABORT_MSG_IF, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), SendOneBeacon(), ns3::SINGLE_LINK_OP_ID, ns3::StaticCast(), TbttTimeout(), and ns3::Time::US.
Referenced by DoInitialize(), SetBeaconGeneration(), and TbttTimeout().
|
private |
the access category to use for beacons
Definition at line 192 of file adhoc-wifi-mac.h.
Referenced by DoCompleteConfig(), GetTypeId(), and TbttTimeout().
|
private |
Event to generate one beacon after the IBSS random delay.
Definition at line 199 of file adhoc-wifi-mac.h.
Referenced by CancelPendingBeacon(), DoDispose(), DoInitialize(), and TbttTimeout().
|
private |
the beacon interval
Definition at line 191 of file adhoc-wifi-mac.h.
Referenced by GetBeaconInterval(), and SetBeaconInterval().
|
private |
Uniform [0, 1] RV for the initial TBTT offset and the per-TBTT delay.
Definition at line 194 of file adhoc-wifi-mac.h.
Referenced by AssignStreams(), DoInitialize(), GetTypeId(), and TbttTimeout().
Dedicated Txop for beacons.
Definition at line 189 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), AssignStreams(), CancelPendingBeacon(), DoCompleteConfig(), DoDispose(), DoInitialize(), GetTxopFor(), and SendOneBeacon().
|
private |
Flag whether beacons are being generated.
Definition at line 190 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), CanForwardPacketsTo(), DoDispose(), DoInitialize(), Enqueue(), Receive(), ReceiveBeacon(), and SetBeaconGeneration().
|
private |
Flag whether the first TBTT is delayed by a random fraction of BeaconInterval.
Definition at line 195 of file adhoc-wifi-mac.h.
Referenced by DoInitialize(), and GetTypeId().
|
private |
Event for the next TBTT.
Definition at line 198 of file adhoc-wifi-mac.h.
Referenced by DoDispose(), DoInitialize(), SetBeaconGeneration(), and TbttTimeout().