22 #include "ns3/pointer.h"
24 #include "ns3/string.h"
25 #include "ns3/qos-tag.h"
26 #include "ns3/mac-low.h"
27 #include "ns3/dcf-manager.h"
28 #include "ns3/mac-rx-middle.h"
29 #include "ns3/mgt-headers.h"
48 .AddConstructor<OcbWifiMac> ()
58 m_low = CreateObject<WaveMacLow> ();
62 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
64 i->second->SetLow (
m_low);
96 tid = tid > 7 ? 0 : tid;
101 m_dca->Queue (vsc, hdr);
122 NS_LOG_WARN (
"in OCB mode we should not call SetSsid");
164 NS_LOG_WARN (
"in OCB mode the like will never down, so linkDown will never be called");
231 m_dca->Queue (packet, hdr);
289 NS_LOG_DEBUG (
"cannot find VscCallback for OrganizationIdentifier=" << oi);
292 bool succeed = cb (
this, oi,packet, from);
296 NS_LOG_DEBUG (
"vsc callback could not handle the packet successfully");
316 dcf->SetMinCw ((cwmin + 1) / 4 - 1);
317 dcf->SetMaxCw ((cwmin + 1) / 2 - 1);
318 dcf->SetAifsn (aifsn);
322 dcf->SetMinCw ((cwmin + 1) / 2 - 1);
323 dcf->SetMaxCw (cwmin);
324 dcf->SetAifsn (aifsn);
328 dcf->SetMinCw (cwmin);
329 dcf->SetMaxCw (cwmax);
330 dcf->SetAifsn (aifsn);
334 dcf->SetMinCw (cwmin);
335 dcf->SetMaxCw (cwmax);
336 dcf->SetAifsn (aifsn);
340 dcf->SetMinCw (cwmin);
341 dcf->SetMaxCw (cwmax);
342 dcf->SetAifsn (aifsn);
357 uint32_t cwmax = 1023;
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
#define NS_LOG_FUNCTION(parameters)
void ConfigureEdca(uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum AcIndex ac)
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual ~OcbWifiMac(void)
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
bool IsNull(void) const
Check for null implementation.
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
#define NS_ASSERT(condition)
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
VendorSpecificContentManager m_vscManager
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...
void NotifyRxDrop(Ptr< const Packet > packet)
static const Mac48Address WILDCARD_BSSID
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...
virtual void SetLinkDownCallback(Callback< void > linkDown)
Ptr< WifiPhy > m_phy
Wifi PHY.
virtual Ssid GetSsid(void) const
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...
#define NS_FATAL_ERROR(msg)
fatal error handling
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
If a qos tag is attached to the packet, returns a value < 8.
void DeregisterVscCallback(OrganizationIdentifier &oi)
virtual void SetLinkUpCallback(Callback< void > linkUp)
SetLinkUpCallback and SetLinkDownCallback will be overloaded In OCB mode, stations can send packets d...
virtual void SetBssid(Mac48Address bssid)
Ptr< EdcaTxopN > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
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.
base class for all MAC-level wifi objects.
virtual Ssid GetSsid(void) const
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
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.
static TypeId GetTypeId(void)
the organization identifier is a public organizationally unique identifier assigned by the IEEE...
Ptr< DcaTxop > GetDcaTxop(void) const
Accessor for the DCF object.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
static Mac48Address GetBroadcast(void)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
#define NS_LOG_LOGIC(msg)
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
void RemoveReceiveVscCallback(OrganizationIdentifier oi)
Ptr< EdcaTxopN > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void SetLinkUpCallback(Callback< void > linkUp)
OFDM PHY for the 5 GHz band (Clause 17)
DcfManager * m_dcfManager
DCF manager (access to channel)
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual void SetLinkDownCallback(Callback< void > linkDown)
The IEEE 802.11 SSID Information Element.
virtual void SetSsid(Ssid ssid)
VscCallback FindVscCallback(OrganizationIdentifier &oi)
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
virtual Mac48Address GetBssid(void) const
#define NS_LOG_DEBUG(msg)
virtual Mac48Address GetAddress(void) const
NS_LOG_COMPONENT_DEFINE("OcbWifiMac")
virtual void SetBssid(Mac48Address bssid)
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
void AddReceiveVscCallback(OrganizationIdentifier oi, VscCallback cb)
void AddHeader(const Header &header)
Add header to this packet.