A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
peer-management-protocol.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008,2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 * Aleksey Kovalenko <kovalenko@iitp.ru>
8 */
9
11
13#include "ie-dot11s-id.h"
15
16#include "ns3/assert.h"
17#include "ns3/log.h"
18#include "ns3/mesh-point-device.h"
19#include "ns3/mesh-wifi-interface-mac-plugin.h"
20#include "ns3/mesh-wifi-interface-mac.h"
21#include "ns3/random-variable-stream.h"
22#include "ns3/simulator.h"
23#include "ns3/trace-source-accessor.h"
24#include "ns3/wifi-net-device.h"
25
26namespace ns3
27{
28
29NS_LOG_COMPONENT_DEFINE("PeerManagementProtocol");
30
31namespace dot11s
32{
33
34/***************************************************
35 * PeerManager
36 ***************************************************/
37NS_OBJECT_ENSURE_REGISTERED(PeerManagementProtocol);
38
39TypeId
41{
42 static TypeId tid =
43 TypeId("ns3::dot11s::PeerManagementProtocol")
45 .SetGroupName("Mesh")
46 .AddConstructor<PeerManagementProtocol>()
47 // maximum number of peer links. Now we calculate the total
48 // number of peer links on all interfaces
49 .AddAttribute("MaxNumberOfPeerLinks",
50 "Maximum number of peer links",
51 UintegerValue(32),
54 .AddAttribute("MaxBeaconShiftValue",
55 "Maximum number of TUs for beacon shifting",
56 UintegerValue(15),
59 .AddAttribute("EnableBeaconCollisionAvoidance",
60 "Enable/Disable Beacon collision avoidance.",
61 BooleanValue(true),
65 .AddTraceSource("LinkOpen",
66 "New peer link opened",
68 "ns3::PeerManagementProtocol::LinkOpenCloseTracedCallback")
69 .AddTraceSource("LinkClose",
70 "New peer link closed",
72 "ns3::PeerManagementProtocol::LinkOpenCloseTracedCallback")
73
74 ;
75 return tid;
76}
77
79 : m_lastAssocId(0),
80 m_lastLocalLinkId(1),
81 m_enableBca(true),
82 m_maxBeaconShift(15)
83{
85}
86
91
92void
94{
95 // cancel cleanup event and go through the map of peer links,
96 // deleting each
97 for (auto j = m_peerLinks.begin(); j != m_peerLinks.end(); j++)
98 {
99 for (auto i = j->second.begin(); i != j->second.end(); i++)
100 {
101 (*i) = nullptr;
102 }
103 j->second.clear();
104 }
105 m_peerLinks.clear();
106 m_plugins.clear();
107}
108
109bool
111{
112 std::vector<Ptr<NetDevice>> interfaces = mp->GetInterfaces();
113 for (auto i = interfaces.begin(); i != interfaces.end(); i++)
114 {
115 Ptr<WifiNetDevice> wifiNetDev = (*i)->GetObject<WifiNetDevice>();
116 if (!wifiNetDev)
117 {
118 return false;
119 }
120 Ptr<MeshWifiInterfaceMac> mac = wifiNetDev->GetMac()->GetObject<MeshWifiInterfaceMac>();
121 if (!mac)
122 {
123 return false;
124 }
126 Create<PeerManagementProtocolMac>((*i)->GetIfIndex(), this);
127 mac->InstallPlugin(plugin);
128 m_plugins[(*i)->GetIfIndex()] = plugin;
130 m_peerLinks[(*i)->GetIfIndex()] = newmap;
131 }
132 // Mesh point aggregates all installed protocols
133 m_address = Mac48Address::ConvertFrom(mp->GetAddress());
134 mp->AggregateObject(this);
135 return true;
136}
137
140{
142 {
143 return nullptr;
144 }
146 auto iface = m_peerLinks.find(interface);
147 NS_ASSERT(iface != m_peerLinks.end());
148 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
149 {
150 // If we do not know peer Assoc Id, we shall not add any info
151 // to a beacon timing element
152 if ((*i)->GetBeaconInterval() == Seconds(0))
153 {
154 // No beacon was received, do not include to the beacon timing element
155 continue;
156 }
157 retval->AddNeighboursTimingElementUnit((*i)->GetLocalAid(),
158 (*i)->GetLastBeacon(),
159 (*i)->GetBeaconInterval());
160 }
161 return retval;
162}
163
164void
166 Mac48Address peerAddress,
167 Time beaconInterval,
168 Ptr<IeBeaconTiming> timingElement)
169{
170 // PM STATE Machine
171 // Check that a given beacon is not from our interface
172 for (auto i = m_plugins.begin(); i != m_plugins.end(); i++)
173 {
174 if (i->second->GetAddress() == peerAddress)
175 {
176 return;
177 }
178 }
179 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
180 if (!peerLink)
181 {
182 if (ShouldSendOpen(interface, peerAddress))
183 {
184 peerLink = InitiateLink(interface, peerAddress, Mac48Address::GetBroadcast());
185 peerLink->MLMEActivePeerLinkOpen();
186 }
187 else
188 {
189 return;
190 }
191 }
192 peerLink->SetBeaconInformation(Simulator::Now(), beaconInterval);
194 {
195 peerLink->SetBeaconTimingElement(*PeekPointer(timingElement));
196 }
197}
198
199void
201 Mac48Address peerAddress,
202 Mac48Address peerMeshPointAddress,
203 uint16_t aid,
204 IePeerManagement peerManagementElement,
205 IeConfiguration meshConfig)
206{
207 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
208 if (peerManagementElement.SubtypeIsOpen())
209 {
211 bool reject = !(ShouldAcceptOpen(interface, peerAddress, reasonCode));
212 if (!peerLink)
213 {
214 peerLink = InitiateLink(interface, peerAddress, peerMeshPointAddress);
215 }
216 if (!reject)
217 {
218 peerLink->OpenAccept(peerManagementElement.GetLocalLinkId(),
219 meshConfig,
220 peerMeshPointAddress);
221 }
222 else
223 {
224 peerLink->OpenReject(peerManagementElement.GetLocalLinkId(),
225 meshConfig,
226 peerMeshPointAddress,
227 reasonCode);
228 }
229 }
230 if (!peerLink)
231 {
232 return;
233 }
234 if (peerManagementElement.SubtypeIsConfirm())
235 {
236 peerLink->ConfirmAccept(peerManagementElement.GetLocalLinkId(),
237 peerManagementElement.GetPeerLinkId(),
238 aid,
239 meshConfig,
240 peerMeshPointAddress);
241 }
242 if (peerManagementElement.SubtypeIsClose())
243 {
244 peerLink->Close(peerManagementElement.GetLocalLinkId(),
245 peerManagementElement.GetPeerLinkId(),
246 peerManagementElement.GetReasonCode());
247 }
248}
249
250void
252{
253 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
254 if (peerLink)
255 {
256 peerLink->MLMECancelPeerLink(REASON11S_MESH_CAPABILITY_POLICY_VIOLATION);
257 }
258}
259
260void
262{
263 NS_LOG_DEBUG("transmission failed between " << GetAddress() << " and " << peerAddress
264 << " failed, link will be closed");
265 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
266 if (peerLink)
267 {
268 peerLink->TransmissionFailure();
269 }
270}
271
272void
274{
275 NS_LOG_DEBUG("transmission success " << GetAddress() << " and " << peerAddress);
276 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
277 if (peerLink)
278 {
279 peerLink->TransmissionSuccess();
280 }
281}
282
285 Mac48Address peerAddress,
286 Mac48Address peerMeshPointAddress)
287{
289 // find a peer link - it must not exist
290 if (FindPeerLink(interface, peerAddress))
291 {
292 NS_FATAL_ERROR("Peer link must not exist.");
293 }
294 // Plugin must exist
295 auto plugin = m_plugins.find(interface);
296 NS_ASSERT(plugin != m_plugins.end());
297 auto iface = m_peerLinks.find(interface);
298 NS_ASSERT(iface != m_peerLinks.end());
299 new_link->SetLocalAid(m_lastAssocId++);
300 new_link->SetInterface(interface);
301 new_link->SetLocalLinkId(m_lastLocalLinkId++);
302 new_link->SetPeerAddress(peerAddress);
303 new_link->SetPeerMeshPointAddress(peerMeshPointAddress);
304 new_link->SetMacPlugin(plugin->second);
305 new_link->MLMESetSignalStatusCallback(
307 iface->second.push_back(new_link);
308 return new_link;
309}
310
313{
314 auto iface = m_peerLinks.find(interface);
315 NS_ASSERT(iface != m_peerLinks.end());
316 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
317 {
318 if ((*i)->GetPeerAddress() == peerAddress)
319 {
320 if ((*i)->LinkIsIdle())
321 {
322 (*i) = nullptr;
323 (iface->second).erase(i);
324 return nullptr;
325 }
326 else
327 {
328 return *i;
329 }
330 }
331 }
332 return nullptr;
333}
334
335void
341
342std::vector<Mac48Address>
344{
345 std::vector<Mac48Address> retval;
346 auto iface = m_peerLinks.find(interface);
347 NS_ASSERT(iface != m_peerLinks.end());
348 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
349 {
350 if ((*i)->LinkIsEstab())
351 {
352 retval.push_back((*i)->GetPeerAddress());
353 }
354 }
355 return retval;
356}
357
358std::vector<Ptr<PeerLink>>
360{
361 std::vector<Ptr<PeerLink>> links;
362
363 for (auto iface = m_peerLinks.begin(); iface != m_peerLinks.end(); ++iface)
364 {
365 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
366 {
367 if ((*i)->LinkIsEstab())
368 {
369 links.push_back(*i);
370 }
371 }
372 }
373 return links;
374}
375
376bool
378{
379 Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
380 if (peerLink)
381 {
382 return peerLink->LinkIsEstab();
383 }
384 return false;
385}
386
387bool
392
393bool
395 Mac48Address peerAddress,
396 PmpReasonCode& reasonCode) const
397{
399 {
400 reasonCode = REASON11S_MESH_MAX_PEERS;
401 return false;
402 }
403 return true;
404}
405
406void
408{
410 {
411 return;
412 }
413 auto iface = m_peerLinks.find(interface);
414 NS_ASSERT(iface != m_peerLinks.end());
415 NS_ASSERT(m_plugins.find(interface) != m_plugins.end());
416
417 auto lastBeacon = m_lastBeacon.find(interface);
418 auto beaconInterval = m_beaconInterval.find(interface);
419 if ((lastBeacon == m_lastBeacon.end()) || (beaconInterval == m_beaconInterval.end()))
420 {
421 return;
422 }
423 // my last beacon in 256 us units
424 auto lastBeaconInTimeElement = (uint16_t)((lastBeacon->second.GetMicroSeconds() >> 8) & 0xffff);
425
427 "Wrong beacon shift parameters");
428
429 if (iface->second.empty())
430 {
431 // I have no peers - may be our beacons are in collision
432 ShiftOwnBeacon(interface);
433 return;
434 }
435 // check whether all my peers receive my beacon and I'am not in collision with other beacons
436
437 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
438 {
439 bool myBeaconExists = false;
441 (*i)->GetBeaconTimingElement().GetNeighboursTimingElementsList();
442 for (auto j = neighbors.begin(); j != neighbors.end(); j++)
443 {
444 if ((*i)->GetPeerAid() == (*j)->GetAid())
445 {
446 // I am presented at neighbour's list of neighbors
447 myBeaconExists = true;
448 continue;
449 }
450 if (((int16_t)((*j)->GetLastBeacon() - lastBeaconInTimeElement) >= 0) &&
451 (((*j)->GetLastBeacon() - lastBeaconInTimeElement) %
452 (4 * TimeToTu(beaconInterval->second)) ==
453 0))
454 {
455 ShiftOwnBeacon(interface);
456 return;
457 }
458 }
459 if (!myBeaconExists)
460 {
461 // If I am not present in neighbor's beacon timing element, this may be caused by
462 // collisions with
463 ShiftOwnBeacon(interface);
464 return;
465 }
466 }
467}
468
469void
471{
472 int shift = 0;
473 do
474 {
475 shift = (int)m_beaconShift->GetValue();
476 } while (shift == 0);
477 // Apply beacon shift parameters:
478 auto plugin = m_plugins.find(interface);
479 NS_ASSERT(plugin != m_plugins.end());
480 plugin->second->SetBeaconShift(TuToTime(shift));
481}
482
483Time
485{
486 return MicroSeconds(x * 1024);
487}
488
489int
491{
492 return (int)(x.GetMicroSeconds() / 1024);
493}
494
495void
497 Mac48Address peerIface,
498 Mac48Address myIface,
499 uint32_t interface)
500{
501 NS_LOG_LOGIC("link_open " << myIface << " " << peerIface);
504 if (!m_peerStatusCallback.IsNull())
505 {
506 m_peerStatusCallback(peerMp, peerIface, interface, true);
507 }
508 m_linkOpenTraceSrc(myIface, peerIface);
509}
510
511void
513 Mac48Address peerIface,
514 Mac48Address myIface,
515 uint32_t interface)
516{
517 NS_LOG_LOGIC("link_close " << myIface << " " << peerIface);
520 if (!m_peerStatusCallback.IsNull())
521 {
522 m_peerStatusCallback(peerMp, peerIface, interface, false);
523 }
524 m_linkCloseTraceSrc(myIface, peerIface);
525}
526
527void
529 Mac48Address peerAddress,
530 Mac48Address peerMeshPointAddress,
531 PeerLink::PeerState ostate,
532 PeerLink::PeerState nstate)
533{
534 auto plugin = m_plugins.find(interface);
535 NS_ASSERT(plugin != m_plugins.end());
536 NS_LOG_DEBUG("Link between me:" << m_address << " my interface:" << plugin->second->GetAddress()
537 << " and peer mesh point:" << peerMeshPointAddress
538 << " and its interface:" << peerAddress
539 << ", at my interface ID:" << interface << ". State movement:"
540 << PeerLink::PeerStateNames[ostate] << " -> "
541 << PeerLink::PeerStateNames[nstate]);
542 if ((nstate == PeerLink::ESTAB) && (ostate != PeerLink::ESTAB))
543 {
544 NotifyLinkOpen(peerMeshPointAddress, peerAddress, plugin->second->GetAddress(), interface);
545 }
546 if ((ostate == PeerLink::ESTAB) && (nstate != PeerLink::ESTAB))
547 {
548 NotifyLinkClose(peerMeshPointAddress, peerAddress, plugin->second->GetAddress(), interface);
549 }
550 if (nstate == PeerLink::IDLE)
551 {
552 Ptr<PeerLink> link = FindPeerLink(interface, peerAddress);
553 NS_ASSERT(!link);
554 }
555}
556
557uint8_t
562
569
570void
575
581
582void
584{
585 m_lastBeacon[interface] = Simulator::Now();
586 Simulator::Schedule(beaconInterval - TuToTime(m_maxBeaconShift + 1),
588 this,
589 interface);
590 m_beaconInterval[interface] = beaconInterval;
591}
592
594 : linksTotal(t),
595 linksOpened(0),
596 linksClosed(0)
597{
598}
599
600void
602{
603 os << "<Statistics "
604 "linksTotal=\""
605 << linksTotal
606 << "\" "
607 "linksOpened=\""
608 << linksOpened
609 << "\" "
610 "linksClosed=\""
611 << linksClosed << "\"/>" << std::endl;
612}
613
614void
615PeerManagementProtocol::Report(std::ostream& os) const
616{
617 os << "<PeerManagementProtocol>" << std::endl;
618 m_stats.Print(os);
619 for (auto plugins = m_plugins.begin(); plugins != m_plugins.end(); plugins++)
620 {
621 // Take statistics from plugin:
622 plugins->second->Report(os);
623 // Print all active peer links:
624 auto iface = m_peerLinks.find(plugins->second->m_ifIndex);
625 NS_ASSERT(iface != m_peerLinks.end());
626 for (auto i = iface->second.begin(); i != iface->second.end(); i++)
627 {
628 (*i)->Report(os);
629 }
630 }
631 os << "</PeerManagementProtocol>" << std::endl;
632}
633
634void
636{
637 m_stats = Statistics(m_stats.linksTotal); // don't reset number of links
638 for (auto plugins = m_plugins.begin(); plugins != m_plugins.end(); plugins++)
639 {
640 plugins->second->ResetStats();
641 }
642}
643
644int64_t
646{
647 NS_LOG_FUNCTION(this << stream);
648 m_beaconShift->SetStream(stream);
649 return 1;
650}
651
652void
654{
655 // If beacon interval is equal to the neighbor's one and one o more beacons received
656 // by my neighbor coincide with my beacon - apply random uniformly distributed shift from
657 // [-m_maxBeaconShift, m_maxBeaconShift] except 0.
658 m_beaconShift->SetAttribute("Min", DoubleValue(-m_maxBeaconShift));
659 m_beaconShift->SetAttribute("Max", DoubleValue(m_maxBeaconShift));
660}
661
662void
667
668bool
673} // namespace dot11s
674} // namespace ns3
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
an EUI-48 address
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address GetBroadcast()
Basic MAC of mesh point Wi-Fi interface.
A base class which provides memory management and object aggregation.
Definition object.h:78
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 Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
Hold together all Wifi-related objects.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
according to IEEE 802.11 - 2012
bool SubtypeIsOpen() const
Subtype is open function.
bool SubtypeIsClose() const
Subtype is close function.
PmpReasonCode GetReasonCode() const
Get reason code function.
bool SubtypeIsConfirm() const
Subtype is confirm function.
uint16_t GetPeerLinkId() const
Get peer link ID function.
uint16_t GetLocalLinkId() const
Get local link ID function.
802.11s Peer Management Protocol model
void ReceivePeerLinkFrame(uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, uint16_t aid, IePeerManagement peerManagementElement, IeConfiguration meshConfig)
Deliver Peer link management information to the protocol-part.
void DoDispose() override
Destructor implementation.
bool GetBeaconCollisionAvoidance() const
Get beacon collision avoidance.
bool ShouldSendOpen(uint32_t interface, Mac48Address peerAddress) const
External peer-chooser.
Callback< void, Mac48Address, Mac48Address, uint32_t, bool > m_peerStatusCallback
Callback to notify about peer link changes: Mac48Address is peer address of mesh point,...
void SetMeshId(std::string s)
Set mesh ID to a string value.
uint8_t m_maxNumberOfPeerLinks
maimum number of peer links
int TimeToTu(Time x)
Time<-->TU converters:
void Report(std::ostream &os) const
Report statistics.
void TransmissionFailure(uint32_t interface, const Mac48Address peerAddress)
Cancels peer link due to successive transmission failures.
uint16_t m_maxBeaconShift
Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs.
LinkEventCallback m_linkOpenTraceSrc
LinkOpen trace source.
void TransmissionSuccess(uint32_t interface, const Mac48Address peerAddress)
resets transmission failure statistics
bool ShouldAcceptOpen(uint32_t interface, Mac48Address peerAddress, PmpReasonCode &reasonCode) const
External peer-chooser.
std::vector< Ptr< PeerLink > > GetPeerLinks() const
Get list of all active peer links.
void ReceiveBeacon(uint32_t interface, Mac48Address peerAddress, Time beaconInterval, Ptr< IeBeaconTiming > beaconTiming)
To initiate peer link we must notify about received beacon.
void NotifyLinkClose(Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface)
Aux.
Ptr< PeerLink > InitiateLink(uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress)
Initiate link function.
void DoInitialize() override
Initialize() implementation.
Ptr< IeMeshId > GetMeshId() const
Get mesh ID information element.
void SetPeerLinkStatusCallback(Callback< void, Mac48Address, Mac48Address, uint32_t, bool > cb)
Set peer link status change callback.
uint8_t GetNumberOfLinks() const
Get number of links.
static TypeId GetTypeId()
Get the type ID.
std::map< uint32_t, Time > m_lastBeacon
Last beacon at each interface.
bool Install(Ptr< MeshPointDevice > mp)
Install PMP on given mesh point.
PeerManagementProtocolMacMap m_plugins
plugins
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
std::map< uint32_t, Time > m_beaconInterval
Beacon interval at each interface.
void NotifyBeaconSent(uint32_t interface, Time beaconInterval)
Notify about beacon send event, needed to schedule BCA.
void ShiftOwnBeacon(uint32_t interface)
Shift own beacon function.
std::vector< Ptr< PeerLink > > PeerLinksOnInterface
We keep a vector of pointers to PeerLink class.
void ConfigurationMismatch(uint32_t interface, Mac48Address peerAddress)
Cancels peer link due to broken configuration (Mesh ID or Supported rates)
PeerLinksMap m_peerLinks
Simple link open/close trace source type. Addresses are: src interface, dst interface.
Ptr< UniformRandomVariable > m_beaconShift
Add randomness to beacon shift.
void PeerLinkStatus(uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, PeerLink::PeerState ostate, PeerLink::PeerState nstate)
Indicates changes in peer links.
bool IsActiveLink(uint32_t interface, Mac48Address peerAddress)
Checks if there is established link.
std::vector< Mac48Address > GetPeers(uint32_t interface) const
Get list of active peers of my given interface.
LinkEventCallback m_linkCloseTraceSrc
LinkClose trace source.
void CheckBeaconCollisions(uint32_t interface)
BCA.
Ptr< IeBeaconTiming > GetBeaconTimingElement(uint32_t interface)
When we are sending a beacon - we fill beacon timing element.
Mac48Address GetAddress()
Get mesh point address.
Ptr< PeerLink > FindPeerLink(uint32_t interface, Mac48Address peerAddress)
Find active peer link by my interface and peer interface MAC.
Time TuToTime(int x)
Time<-->TU converters:
void NotifyLinkOpen(Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface)
Aux.
void ResetStats()
Reset statistics function.
void SetBeaconCollisionAvoidance(bool enable)
Enable or disable beacon collision avoidance.
#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
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
std::vector< Ptr< IeBeaconTimingUnit > > NeighboursTimingUnitsList
This type is a list of timing elements obtained from neighbours with their beacons:
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#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_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#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
#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 MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1332
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
U * PeekPointer(const Ptr< U > &p)
Definition ptr.h:443
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition boolean.h:70
void Print(std::ostream &os) const
Print function.