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 .SetGroupName (
"Wave")
86 tid = tid > 7 ? 0 : tid;
91 m_dca->Queue (vsc, hdr);
112 NS_LOG_WARN (
"in OCB mode we should not call SetSsid");
118 NS_LOG_WARN (
"in OCB mode we should not call GetSsid");
127 NS_LOG_WARN (
"in OCB mode we should not call SetBsid");
133 NS_LOG_WARN (
"in OCB mode we should not call GetBssid");
154 NS_LOG_WARN (
"in OCB mode the like will never down, so linkDown will never be called");
218 m_dca->Queue (packet, hdr);
276 NS_LOG_DEBUG (
"cannot find VscCallback for OrganizationIdentifier=" << oi);
279 bool succeed = cb (
this, oi,packet, from);
283 NS_LOG_DEBUG (
"vsc callback could not handle the packet successfully");
304 dcf->SetMinCw ((cwmin + 1) / 4 - 1);
305 dcf->SetMaxCw ((cwmin + 1) / 2 - 1);
306 dcf->SetAifsn (aifsn);
310 dcf->SetMinCw ((cwmin + 1) / 2 - 1);
311 dcf->SetMaxCw (cwmin);
312 dcf->SetAifsn (aifsn);
316 dcf->SetMinCw (cwmin);
317 dcf->SetMaxCw (cwmax);
318 dcf->SetAifsn (aifsn);
322 dcf->SetMinCw (cwmin);
323 dcf->SetMaxCw (cwmax);
324 dcf->SetAifsn (aifsn);
328 dcf->SetMinCw (cwmin);
329 dcf->SetMaxCw (cwmax);
330 dcf->SetAifsn (aifsn);
346 uint32_t cwmax = 1023;
409 m_low = CreateObject<WaveMacLow> ();
410 (DynamicCast<WaveMacLow> (
m_low))->SetWaveNetDevice (device);
414 for (EdcaQueues::iterator i =
m_edca.begin (); i !=
m_edca.end (); ++i)
416 i->second->SetLow (
m_low);
417 i->second->CompleteConfig ();
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void NotifyWakeupNow(void)
Notify the DCF that the device has been resumed from sleep mode.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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.
void CancleTx(enum AcIndex ac)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
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 EnableForWave(Ptr< WaveNetDevice > device)
void NotifyRxDrop(Ptr< const Packet > packet)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static const Mac48Address WILDCARD_BSSID
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
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)
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
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...
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)
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
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.
void Suspend(void)
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity...
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
void MakeVirtualBusy(Time duration)
static Mac48Address GetBroadcast(void)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void NotifyChannelSwitching(void)
When a channel switching occurs, enqueued packets are removed.
void NotifySwitchingStartNow(Time duration)
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
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)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DcfManager * m_dcfManager
DCF manager (access to channel)
virtual void SetLinkDownCallback(Callback< void > linkDown)
void NotifyMaybeCcaBusyStartNow(Time duration)
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_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual Mac48Address GetAddress(void) const
void NotifySleepNow(void)
Notify the DCF that the device has been put in sleep mode.
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.)
void Reset(void)
To support MAC extension for multiple channel operation, Reset current MAC entity and flush its inter...
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
void NotifySwitchingStartNow(Time duration)
a unique identifier for an interface.
void Resume(void)
To support MAC extension for multiple channel operation, Resume the activity of suspended MAC entity...
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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.
STAs communicate with each directly outside the context of a BSSIn OCB mac mode,synchronization, association, dis-association and authentication of normal wifi are not used for wireless access in vehicular environments.