A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mesh-wifi-interface-mac.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 * Pavel Boyko <boyko@iitp.ru>
8 */
9
11
12#include "mesh-wifi-beacon.h"
13
14#include "ns3/boolean.h"
15#include "ns3/channel-access-manager.h"
16#include "ns3/double.h"
17#include "ns3/log.h"
18#include "ns3/mac-tx-middle.h"
19#include "ns3/pointer.h"
20#include "ns3/qos-txop.h"
21#include "ns3/random-variable-stream.h"
22#include "ns3/simulator.h"
23#include "ns3/socket.h"
24#include "ns3/string.h"
25#include "ns3/trace-source-accessor.h"
26#include "ns3/wifi-mac-queue-scheduler.h"
27#include "ns3/wifi-mac-queue.h"
28#include "ns3/wifi-net-device.h"
29#include "ns3/wifi-utils.h"
30#include "ns3/yans-wifi-phy.h"
31
32namespace ns3
33{
34
35NS_LOG_COMPONENT_DEFINE("MeshWifiInterfaceMac");
36
37NS_OBJECT_ENSURE_REGISTERED(MeshWifiInterfaceMac);
38
39TypeId
41{
42 static TypeId tid =
43 TypeId("ns3::MeshWifiInterfaceMac")
45 .SetGroupName("Mesh")
46 .AddConstructor<MeshWifiInterfaceMac>()
47 .AddAttribute("BeaconInterval",
48 "Beacon Interval",
49 TimeValue(Seconds(0.5)),
50
53 .AddAttribute("RandomStart",
54 "Window when beacon generating starts (uniform random) in seconds",
55 TimeValue(Seconds(0.5)),
58 .AddAttribute("BeaconGeneration",
59 "Enable/Disable Beaconing.",
60 BooleanValue(true),
64 return tid;
65}
66
68{
69 NS_LOG_FUNCTION(this);
70
71 // Let the lower layers know that we are acting as a mesh node
74}
75
80
81//-----------------------------------------------------------------------------
82// WifiMac inherited
83//-----------------------------------------------------------------------------
84bool
89
90bool
92{
93 return true;
94}
95
96void
98{
99 NS_LOG_FUNCTION(this);
101
102 // The approach taken here is that, from the point of view of a mesh
103 // node, the link is always up, so we immediately invoke the
104 // callback if one is set
105 linkUp();
106}
107
108void
117
118void
120{
121 NS_LOG_FUNCTION(this);
122 m_coefficient->SetAttribute("Max", DoubleValue(m_randomStart.GetSeconds()));
123 if (m_beaconEnable)
124 {
125 Time randomStart = Seconds(m_coefficient->GetValue());
126 // Now start sending beacons after some random delay (to avoid collisions)
130 m_tbtt = Simulator::Now() + randomStart;
131 }
132 else
133 {
134 // stop sending beacons
136 }
137}
138
139int64_t
141{
142 NS_LOG_FUNCTION(this << stream);
143 int64_t currentStream = stream + WifiMac::AssignStreams(stream);
144 m_coefficient->SetStream(currentStream++);
145 for (auto i = m_plugins.begin(); i < m_plugins.end(); i++)
146 {
147 currentStream += (*i)->AssignStreams(currentStream);
148 }
149 return (currentStream - stream);
150}
151
152//-----------------------------------------------------------------------------
153// Plugins
154//-----------------------------------------------------------------------------
155void
157{
158 NS_LOG_FUNCTION(this);
159
160 plugin->SetParent(this);
161 m_plugins.push_back(plugin);
162}
163
164//-----------------------------------------------------------------------------
165// Switch channels
166//-----------------------------------------------------------------------------
167uint16_t
169{
170 NS_LOG_FUNCTION(this);
171 NS_ASSERT(GetWifiPhy()); // need PHY to set/get channel
172 return GetWifiPhy()->GetChannelNumber();
173}
174
175void
177{
178 NS_LOG_FUNCTION(this);
179 NS_ASSERT(GetWifiPhy()); // need PHY to set/get channel
180 /**
181 * \todo
182 * Correct channel switching is:
183 *
184 * 1. Interface down, e.g. to stop packets from layer 3
185 * 2. Wait before all output queues will be empty
186 * 3. Switch PHY channel
187 * 4. Interface up
188 *
189 * Now we use dirty channel switch -- just change frequency
190 */
192 WifiPhy::ChannelTuple{new_id, 0, GetWifiPhy()->GetPhyBand(), 0});
193 // Don't know NAV on new channel
195}
196
197//-----------------------------------------------------------------------------
198// Forward frame down
199//-----------------------------------------------------------------------------
200void
202{
203 NS_LOG_FUNCTION(this << *mpdu << to << from);
204
205 auto& hdr = mpdu->GetHeader();
206 auto packet = mpdu->GetPacket()->Copy();
207
208 hdr.SetAddr2(GetAddress());
209 hdr.SetAddr3(to);
210 hdr.SetAddr4(from);
211 hdr.SetDsFrom();
212 hdr.SetDsTo();
213 // Address 1 is unknown here. Routing plugin is responsible to correctly set it.
214 hdr.SetAddr1(Mac48Address());
215 // Filter packet through all installed plugins
216 for (auto i = m_plugins.end() - 1; i != m_plugins.begin() - 1; i--)
217 {
218 bool drop = !((*i)->UpdateOutcomingFrame(packet, hdr, from, to));
219 if (drop)
220 {
221 return; // plugin drops frame
222 }
223 }
224 // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin.
225 NS_ASSERT(hdr.GetAddr1() != Mac48Address());
226 // Queue frame
227 if (GetWifiRemoteStationManager()->IsBrandNew(hdr.GetAddr1()))
228 {
229 // in adhoc mode, we assume that every destination
230 // supports all the rates we support.
231 for (const auto& mode : GetWifiPhy()->GetModeList())
232 {
233 GetWifiRemoteStationManager()->AddSupportedMode(hdr.GetAddr1(), mode);
234 }
235 GetWifiRemoteStationManager()->RecordDisassociated(hdr.GetAddr1());
236 }
237
239 m_stats.sentBytes += packet->GetSize();
240 auto tid = hdr.GetQosTid();
241 NS_ASSERT(GetQosTxop(tid) != nullptr);
242 GetQosTxop(tid)->Queue(Create<WifiMpdu>(packet, hdr));
243}
244
245void
247{
248 // Filter management frames:
249 WifiMacHeader header = hdr;
250 for (auto i = m_plugins.end() - 1; i != m_plugins.begin() - 1; i--)
251 {
252 bool drop = !((*i)->UpdateOutcomingFrame(packet, header, Mac48Address(), Mac48Address()));
253 if (drop)
254 {
255 return; // plugin drops frame
256 }
257 }
259 m_stats.sentBytes += packet->GetSize();
260 if ((GetQosTxop(AC_VO) == nullptr) || (GetQosTxop(AC_BK) == nullptr))
261 {
262 NS_FATAL_ERROR("Voice or Background queue is not set up!");
263 }
264 /*
265 * When we send a management frame - it is better to enqueue it to
266 * priority queue. But when we send a broadcast management frame,
267 * like PREQ, little MinCw value may cause collisions during
268 * retransmissions (two neighbor stations may choose the same window
269 * size, and two packets will be collided). So, broadcast management
270 * frames go to BK queue.
271 */
273 {
274 GetQosTxop(AC_VO)->Queue(Create<WifiMpdu>(packet, header));
275 }
276 else
277 {
278 GetQosTxop(AC_BK)->Queue(Create<WifiMpdu>(packet, header));
279 }
280}
281
284{
285 // set the set of supported rates and make sure that we indicate
286 // the Basic Rate set in this set of supported rates.
287 AllSupportedRates rates;
288 for (const auto& mode : GetWifiPhy()->GetModeList())
289 {
290 const auto gi = GetGuardIntervalForMode(mode, GetWifiPhy()->GetDevice());
291 rates.AddSupportedRate(mode.GetDataRate(GetWifiPhy()->GetChannelWidth(), gi, 1));
292 }
293 // set the basic rates
294 for (uint32_t j = 0; j < GetWifiRemoteStationManager()->GetNBasicModes(); j++)
295 {
296 const auto mode = GetWifiRemoteStationManager()->GetBasicMode(j);
297 const auto gi = GetGuardIntervalForMode(mode, GetWifiPhy()->GetDevice());
298 rates.SetBasicRate(mode.GetDataRate(GetWifiPhy()->GetChannelWidth(), gi, 1));
299 }
300 return rates;
301}
302
303bool
305{
306 for (uint32_t i = 0; i < GetWifiRemoteStationManager()->GetNBasicModes(); i++)
307 {
308 const auto mode = GetWifiRemoteStationManager()->GetBasicMode(i);
309 const auto gi = GetGuardIntervalForMode(mode, GetWifiPhy()->GetDevice());
310 if (!rates.IsSupportedRate(mode.GetDataRate(GetWifiPhy()->GetChannelWidth(), gi, 1)))
311 {
312 return false;
313 }
314 }
315 return true;
316}
317
318//-----------------------------------------------------------------------------
319// Beacons
320//-----------------------------------------------------------------------------
321void
323{
324 NS_LOG_FUNCTION(this << interval);
325 m_randomStart = interval;
326}
327
328void
330{
331 NS_LOG_FUNCTION(this << interval);
332 m_beaconInterval = interval;
333}
334
335Time
340
341void
343{
344 NS_LOG_FUNCTION(this << enable);
345 m_beaconEnable = enable;
346}
347
348bool
353
354Time
356{
357 return m_tbtt;
358}
359
360void
362{
363 // User of ShiftTbtt () must take care don't shift it to the past
364 NS_ASSERT(GetTbtt() + shift > Simulator::Now());
365
366 m_tbtt += shift;
367 // Shift scheduled event
371}
372
373void
380
381void
383{
384 NS_LOG_FUNCTION(this);
385 NS_LOG_DEBUG(GetAddress() << " is sending beacon");
386
388
389 // Form & send beacon
391
392 // Ask all plugins to add their specific information elements to beacon
393 for (auto i = m_plugins.begin(); i != m_plugins.end(); ++i)
394 {
395 (*i)->UpdateBeacon(beacon);
396 }
399
401}
402
403void
405{
406 const WifiMacHeader* hdr = &mpdu->GetHeader();
407 Ptr<Packet> packet = mpdu->GetPacket()->Copy();
408 // Process beacon
409 if ((hdr->GetAddr1() != GetAddress()) && (hdr->GetAddr1() != Mac48Address::GetBroadcast()))
410 {
411 return;
412 }
413 if (hdr->IsBeacon())
414 {
416 MgtBeaconHeader beacon_hdr;
417
418 packet->PeekHeader(beacon_hdr);
419
420 NS_LOG_DEBUG("Beacon received from " << hdr->GetAddr2() << " I am " << GetAddress()
421 << " at " << Simulator::Now().GetMicroSeconds()
422 << " microseconds");
423
424 // update supported rates
425 if (beacon_hdr.Get<Ssid>()->IsEqual(GetSsid()))
426 {
427 NS_ASSERT(beacon_hdr.Get<SupportedRates>());
428 auto rates = AllSupportedRates{*beacon_hdr.Get<SupportedRates>(),
429 beacon_hdr.Get<ExtendedSupportedRatesIE>()};
430
431 for (const auto& mode : GetWifiPhy()->GetModeList())
432 {
433 const auto gi = GetGuardIntervalForMode(mode, GetWifiPhy()->GetDevice());
434 const auto rate = mode.GetDataRate(GetWifiPhy()->GetChannelWidth(), gi, 1);
435 if (rates.IsSupportedRate(rate))
436 {
437 GetWifiRemoteStationManager()->AddSupportedMode(hdr->GetAddr2(), mode);
438 if (rates.IsBasicRate(rate))
439 {
440 GetWifiRemoteStationManager()->AddBasicMode(mode);
441 }
442 }
443 }
444 }
445 }
446 else
447 {
448 m_stats.recvBytes += packet->GetSize();
450 }
451 // Filter frame through all installed plugins
452 for (auto i = m_plugins.begin(); i != m_plugins.end(); ++i)
453 {
454 bool drop = !((*i)->Receive(packet, *hdr));
455 if (drop)
456 {
457 return; // plugin drops frame
458 }
459 }
460 // Check if QoS tag exists and add it:
461 if (hdr->IsQosData())
462 {
463 SocketPriorityTag priorityTag;
464 priorityTag.SetPriority(hdr->GetQosTid());
465 packet->ReplacePacketTag(priorityTag);
466 }
467 // Forward data up
468 if (hdr->IsData())
469 {
470 ForwardUp(packet, hdr->GetAddr4(), hdr->GetAddr3());
471 }
472
473 // We don't bother invoking WifiMac::Receive() here, because
474 // we've explicitly handled all the frames we care about. This is in
475 // contrast to most classes which derive from WifiMac.
476}
477
480{
481 uint32_t metric = 1;
482 if (!m_linkMetricCallback.IsNull())
483 {
484 metric = m_linkMetricCallback(peerAddress, this);
485 }
486 return metric;
487}
488
489void
495
496void
501
507
508// Statistics:
510 : recvBeacons(0),
511 sentFrames(0),
512 sentBytes(0),
513 recvFrames(0),
514 recvBytes(0)
515{
516}
517
518void
520{
521 os << "<Statistics "
522 /// \todo txBeacons
523 "rxBeacons=\""
524 << recvBeacons
525 << "\" "
526 "txFrames=\""
527 << sentFrames
528 << "\" "
529 "txBytes=\""
530 << sentBytes
531 << "\" "
532 "rxFrames=\""
533 << recvFrames
534 << "\" "
535 "rxBytes=\""
536 << recvBytes << "\"/>" << std::endl;
537}
538
539void
540MeshWifiInterfaceMac::Report(std::ostream& os) const
541{
542 os << "<Interface "
543 "BeaconInterval=\""
545 << "\" "
546 "Channel=\""
548 << "\" "
549 "Address = \""
550 << GetAddress() << "\">" << std::endl;
551 m_stats.Print(os);
552 os << "</Interface>" << std::endl;
553}
554
555void
560
561void
566
567void
569{
571 // We use the single DCF provided by WifiMac for the purpose of
572 // Beacon transmission. For this we need to reconfigure the channel
573 // access parameters slightly, and do so here.
574 m_txop = CreateObjectWithAttributes<Txop>("AcIndex", StringValue("AC_BE_NQOS"));
575 m_txop->SetWifiMac(this);
578 m_txop->SetMinCw(0);
579 m_txop->SetMaxCw(0);
580 m_txop->SetAifsn(1);
581 m_scheduler->SetWifiMac(this);
582}
583} // namespace ns3
AttributeValue implementation for Boolean.
Definition boolean.h:26
Callback template class.
Definition callback.h:422
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition event-id.cc:44
bool IsPending() const
This method is syntactic sugar for !IsExpired().
Definition event-id.cc:65
The Extended Supported Rates Information Element.
an EUI-48 address
static Mac48Address GetBroadcast()
Beacon is beacon header + list of arbitrary information elements.
WifiMacHeader CreateHeader(Mac48Address address, Mac48Address mpAddress)
Create Wifi header for beacon frame.
Ptr< Packet > CreatePacket()
Create frame = { beacon header + all information elements sorted by ElementId () }...
Basic MAC of mesh point Wi-Fi interface.
bool SupportsSendFrom() const override
Time m_beaconInterval
Beaconing interval.
void SetLinkMetricCallback(Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > cb)
Set the link metric callback.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Mac48Address m_mpAddress
Mesh point address.
void SetBeaconInterval(Time interval)
Set interval between two successive beacons.
void SwitchFrequencyChannel(uint16_t new_id)
Switch frequency channel.
void ShiftTbtt(Time shift)
Shift TBTT.
Time GetTbtt() const
Next beacon frame time.
void SetRandomStartDelay(Time interval)
Set maximum initial random delay before first beacon.
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
void ResetStats()
Reset statistics function.
void DoCompleteConfig() override
Allow subclasses to complete the configuration of the MAC layer components.
void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax) override
void SendManagementFrame(Ptr< Packet > frame, const WifiMacHeader &hdr)
To be used by plugins sending management frames.
Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > m_linkMetricCallback
linkMetricCallback
EventId m_beaconSendEvent
"Timer" for the next beacon
void InstallPlugin(Ptr< MeshWifiInterfaceMacPlugin > plugin)
Install plugin.
void ScheduleNextBeacon()
Schedule next beacon.
uint32_t GetLinkMetric(Mac48Address peerAddress)
Get the link metric.
uint16_t GetFrequencyChannel() const
Current channel Id.
void SetBeaconGeneration(bool enable)
Enable/disable beacons.
void DoInitialize() override
Initialize() implementation.
bool GetBeaconGeneration() const
Get current beaconing status.
AllSupportedRates GetSupportedRates() const
Get supported rates.
void SetMeshPointAddress(Mac48Address addr)
Set the mesh point address.
Mac48Address GetMeshPointAddress() const
Get the mesh point address.
void Report(std::ostream &os) const
Report statistics.
Time GetBeaconInterval() const
Get beacon interval.
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
Frame receive handler.
void SetLinkUpCallback(Callback< void > linkUp) override
void Enqueue(Ptr< WifiMpdu > mpdu, Mac48Address to, Mac48Address from) override
Time m_randomStart
Maximum delay before first beacon.
static TypeId GetTypeId()
Get the type ID.
PluginList m_plugins
List of all installed plugins.
bool CheckSupportedRates(AllSupportedRates rates) const
Check supported rates.
Ptr< UniformRandomVariable > m_coefficient
Add randomness to beacon generation.
Time m_tbtt
Time for the next frame.
void DoDispose() override
Real d-tor.
Implement the header for management frames of type beacon.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Definition simulator.cc:274
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
indicates whether the socket has a priority set.
Definition socket.h:1307
void SetPriority(uint8_t priority)
Set the tag's priority.
Definition socket.cc:843
The IEEE 802.11 SSID Information Element.
Definition ssid.h:25
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition ssid.cc:50
Hold variables of type string.
Definition string.h:45
The Supported Rates Information Element.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:392
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:402
AttributeValue implementation for Time.
Definition nstime.h:1395
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition txop.cc:313
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
Definition txop.cc:242
virtual void Queue(Ptr< WifiMpdu > mpdu)
Definition txop.cc:612
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition txop.cc:235
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition txop.cc:424
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition txop.cc:270
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Implements the IEEE 802.11 MAC header.
uint8_t GetQosTid() const
Return the Traffic ID of a QoS header.
Mac48Address GetAddr3() const
Return the address in the Address 3 field.
Mac48Address GetAddr4() const
Return the address in the Address 4 field.
bool IsBeacon() const
Return true if the header is a Beacon header.
Mac48Address GetAddr1() const
Return the address in the Address 1 field.
Mac48Address GetAddr2() const
Return the address in the Address 2 field.
bool IsData() const
Return true if the Type is DATA.
bool IsQosData() const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
base class for all MAC-level wifi objects.
Definition wifi-mac.h:89
bool GetQosSupported() const
Return whether the device supports QoS.
Definition wifi-mac.cc:1380
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
Definition wifi-mac.h:938
Ptr< WifiMacQueueScheduler > m_scheduler
wifi MAC queue scheduler
Definition wifi-mac.h:939
Ssid GetSsid() const
Definition wifi-mac.cc:519
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Definition wifi-mac.cc:469
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Definition wifi-mac.cc:1348
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
Definition wifi-mac.h:937
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition wifi-mac.cc:374
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition wifi-mac.cc:493
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition wifi-mac.cc:1449
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Definition wifi-mac.cc:1060
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
Definition wifi-mac.cc:1749
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
Definition wifi-mac.cc:757
Mac48Address GetAddress() const
Definition wifi-mac.cc:506
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition wifi-mac.cc:1078
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Definition wifi-mac.cc:603
void DoDispose() override
Destructor implementation.
Definition wifi-mac.cc:427
std::tuple< uint8_t, MHz_u, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying a segment of an operating channel.
Definition wifi-phy.h:921
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
Definition wifi-phy.cc:1069
uint8_t GetChannelNumber() const
Return current channel number.
Definition wifi-phy.cc:1093
void SetOperatingChannel(const WifiPhyOperatingChannel &channel)
If the standard for this object has not been set yet, store the channel settings corresponding to the...
Definition wifi-phy.cc:1135
std::list< WifiMode > GetModeList() const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition wifi-phy.cc:2064
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1396
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1416
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition abort.h:65
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
@ MESH
Definition wifi-mac.h:61
@ AC_VO
Voice.
Definition qos-utils.h:70
@ AC_BK
Background.
Definition qos-utils.h:66
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetGuardIntervalForMode(WifiMode mode, const Ptr< WifiNetDevice > device)
Get the guard interval for a given WifiMode.
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
Definition wifi-utils.h:183
Struct containing all supported rates.
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
bool IsSupportedRate(uint64_t bs) const
Check if the given rate is supported.
void Print(std::ostream &os) const
Print statistics.