22 #include "ns3/mesh-wifi-interface-mac.h"
23 #include "ns3/mesh-wifi-beacon.h"
25 #include "ns3/boolean.h"
26 #include "ns3/wifi-phy.h"
27 #include "ns3/dcf-manager.h"
28 #include "ns3/mac-rx-middle.h"
29 #include "ns3/mac-low.h"
30 #include "ns3/dca-txop.h"
31 #include "ns3/random-variable-stream.h"
32 #include "ns3/simulator.h"
33 #include "ns3/yans-wifi-phy.h"
34 #include "ns3/pointer.h"
35 #include "ns3/double.h"
36 #include "ns3/trace-source-accessor.h"
37 #include "ns3/qos-tag.h"
50 .AddConstructor<MeshWifiInterfaceMac> ()
51 .AddAttribute (
"BeaconInterval",
59 .AddAttribute (
"RandomStart",
60 "Window when beacon generating starts (uniform random) in seconds",
66 .AddAttribute (
"BeaconGeneration",
67 "Enable/Disable Beaconing.",
152 int64_t currentStream = stream;
156 currentStream += (*i)->AssignStreams (currentStream);
158 return (currentStream - stream);
235 for (PluginList::const_iterator i =
m_plugins.end () - 1; i !=
m_plugins.begin () - 1; i--)
237 bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to));
272 m_edca[ac]->Queue (packet, hdr);
279 for (PluginList::const_iterator i =
m_plugins.end () - 1; i !=
m_plugins.begin () - 1; i--)
410 (*i)->UpdateBeacon (beacon);
461 bool drop = !((*i)->Receive (packet, *hdr));
509 recvBeacons (0), sentFrames (0), sentBytes (0), recvFrames (0), recvBytes (0)
517 "rxBeacons=\"" << recvBeacons <<
"\" "
518 "txFrames=\"" << sentFrames <<
"\" "
519 "txBytes=\"" << sentBytes <<
"\" "
520 "rxFrames=\"" << recvFrames <<
"\" "
521 "rxBytes=\"" << recvBytes <<
"\"/>" << std::endl;
529 "Address = \"" <<
GetAddress () <<
"\">" << std::endl;
531 os <<
"</Interface>" << std::endl;
void AddSupportedRate(uint32_t bs)
keep track of time values and allow control of global simulation resolution
MeshWifiInterfaceMac()
C-tor.
#define NS_LOG_FUNCTION(parameters)
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
Time GetBeaconInterval() const
Ptr< UniformRandomVariable > m_coefficient
Add randomness to beacon generation.
bool m_beaconEnable
whether beaconing is enabled
virtual ~MeshWifiInterfaceMac()
D-tor.
virtual uint32_t GetNModes(void) const =0
SupportedRates GetSupportedRates() const
WifiPhyStandard GetPhyStandard() const
void AddPacketTag(const Tag &tag) const
bool CheckSupportedRates(SupportedRates rates) const
virtual void DoDispose()
Real d-tor.
#define NS_ASSERT(condition)
void SetLinkMetricCallback(Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > cb)
uint32_t GetSize(void) const
uint16_t GetChannelNumber() const
Return current channel number, see SetChannelNumber()
static void Cancel(const EventId &id)
void SetChannelNumber(uint16_t id)
Set channel number.
bool IsRunning(void) const
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
void SwitchFrequencyChannel(uint16_t new_id)
Switch channel.
bool IsEqual(const Ssid &o) const
void SendBeacon()
Send beacon.
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
WifiPhyStandard m_standard
Current PHY standard: needed to configure metric.
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
Time GetTbtt() const
Next beacon frame time.
#define NS_FATAL_ERROR(msg)
fatal error handling
void SendManagementFrame(Ptr< Packet > frame, const WifiMacHeader &hdr)
To be used by plugins sending management frames.
NS_LOG_COMPONENT_DEFINE("MeshWifiInterfaceMac")
void NotifyNavResetNow(Time duration)
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
double GetSeconds(void) const
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
void SetTypeOfStation(TypeOfStation type)
int64_t GetMicroSeconds(void) const
hold objects of type ns3::Time
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
AcIndex QosUtilsMapTidToAc(uint8_t tid)
static Mac48Address GetBroadcast(void)
uint16_t GetFrequencyChannel() const
Current channel Id.
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
bool GetBeaconGeneration() const
Get current beaconing status.
uint32_t GetLinkMetric(Mac48Address peerAddress)
PluginList m_plugins
List of all installed plugins.
void SetBasicRate(uint32_t bs)
Mac48Address GetMeshPointAddress() const
bool IsBasicRate(uint32_t bs) const
virtual bool SupportsSendFrom() const
Ptr< Packet > Copy(void) const
uint32_t PeekHeader(Header &header) const
Mac48Address m_mpAddress
Mesh point address.
virtual void SetLinkUpCallback(Callback< void > linkUp)
802.11 PHY layer modelThis PHY implements a model of 802.11a. The model implemented here is based on ...
DcfManager * m_dcfManager
Time m_beaconInterval
Beaconing interval.
virtual WifiMode GetMode(uint32_t mode) const =0
void Receive(Ptr< Packet > packet, WifiMacHeader const *hdr)
Frame receive handler.
Time m_randomStart
Maximum delay before first beacon.
Beacon is beacon header + list of arbitrary information elements.
static TypeId GetTypeId()
Never forget to support typeid.
virtual void SetLinkUpCallback(Callback< void > linkUp)
Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > m_linkMetricCallback
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
void SetRandomStartDelay(Time interval)
Set maximum initial random delay before first beacon.
void InstallPlugin(Ptr< MeshWifiInterfaceMacPlugin > plugin)
bool RemovePacketTag(Tag &tag)
#define NS_LOG_DEBUG(msg)
virtual Mac48Address GetAddress(void) const
void Report(std::ostream &) const
Statistics:
void SetBeaconGeneration(bool enable)
Enable/disable beacons.
bool IsSupportedRate(uint32_t bs) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
EventId m_beaconSendEvent
"Timer" for the next beacon
void SetBeaconInterval(Time interval)
Set interval between two successive beacons.
void Print(std::ostream &os) const
void SetMeshPointAddress(Mac48Address)
Time m_tbtt
Time for the next frame.
void ShiftTbtt(Time shift)
Shift TBTT.
Ptr< WifiRemoteStationManager > m_stationManager
Hold an floating point type.
void SetAttribute(std::string name, const AttributeValue &value)
Ptr< T > GetObject(void) const
a unique identifier for an interface.
uint64_t GetDataRate(void) const
TypeId SetParent(TypeId tid)
uint8_t GetTid(void) const
int64_t AssignStreams(int64_t stream)
virtual void SetParent(Ptr< MeshWifiInterfaceMac > parent)=0
Each plugin must be installed on interface to work.
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)