A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lr-wpan-bootstrap.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Tokushima University, Japan.
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
7 */
8
9/*
10 * This example demonstrates the use of lr-wpan bootstrap (i.e. IEEE 802.15.4 Scan & Association).
11 * For a full description of this process check IEEE 802.15.4-2011 Section 5.1.3.1 and Figure 18.
12 *
13 * In this example, we create a grid topology of 100 nodes.
14 * Additionally, 2 coordinators are created and set in beacon-enabled mode.
15 * Coordinator 1 = Channel 14, Pan ID 5 , Coordinator 2 = Channel 12, Pan ID 7.
16 * Nodes start scanning channels 11-14 looking for beacons for a defined duration (PASSIVE SCAN).
17 * The scanning start time is slightly different for each node to avoid a storm of association
18 * requests. When a node scan is completed, an association request is send to one coordinator based
19 * on the LQI results of the scan. A node may not find any beacons if the coordinator is outside its
20 * communication range. An association request may not be send if LQI is too low for an association.
21 *
22 * The coordinator in PAN 5 runs in extended addressing mode and do not assign short addresses.
23 * The coordinator in PAN 7 runs in short addressing mode and assign short addresses.
24 *
25 * At the end of the simulation, an animation is generated (lrwpan-bootstrap.xml), showing the
26 * results of the association with each coordinator. This simulation can take a few seconds to
27 * complete.
28 */
29
30#include <ns3/core-module.h>
31#include <ns3/lr-wpan-module.h>
32#include <ns3/mobility-module.h>
33#include <ns3/netanim-module.h>
34#include <ns3/network-module.h>
35#include <ns3/propagation-module.h>
36#include <ns3/spectrum-module.h>
37
38#include <iostream>
39
40using namespace ns3;
41using namespace ns3::lrwpan;
42
46
47static void
49{
50 std::cout << Simulator::Now().As(Time::S) << " | Animation Updated, End of simulation.\n";
51 for (uint32_t i = 0; i < nodes.GetN(); ++i)
52 {
53 anim->UpdateNodeSize(i, 5, 5);
54 Ptr<Node> node = nodes.Get(i);
55 Ptr<NetDevice> netDevice = node->GetDevice(0);
56 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
57 int panId = lrwpanDevice->GetMac()->GetPanId();
58
59 switch (panId)
60 {
61 case 5:
62 anim->UpdateNodeColor(node, 0, 0, 255);
63 break;
64 case 7:
65 anim->UpdateNodeColor(node, 0, 51, 102);
66 break;
67 default:
68 break;
69 }
70 }
71}
72
73static void
75{
76 // The algorithm to select which coordinator to associate is not
77 // covered by the standard. In this case, we use the coordinator
78 // with the highest LQI value obtained from a passive scan and make
79 // sure this coordinator allows association.
80
81 if (params.m_status == MacStatus::SUCCESS)
82 {
83 // Select the coordinator with the highest LQI from the PAN Descriptor List
84 int maxLqi = 0;
85 int panDescIndex = 0;
86 if (!params.m_panDescList.empty())
87 {
88 for (uint32_t i = 0; i < params.m_panDescList.size(); i++)
89 {
90 if (params.m_panDescList[i].m_linkQuality > maxLqi)
91 {
92 maxLqi = params.m_panDescList[i].m_linkQuality;
93 panDescIndex = i;
94 }
95 }
96
97 // Only request association if the coordinator is permitting association at this moment.
98 SuperframeField superframe(params.m_panDescList[panDescIndex].m_superframeSpec);
99 if (superframe.IsAssocPermit())
100 {
101 std::string addressing;
102 if (params.m_panDescList[panDescIndex].m_coorAddrMode == SHORT_ADDR)
103 {
104 addressing = "Short";
105 }
106 else if (params.m_panDescList[panDescIndex].m_coorAddrMode == EXT_ADDR)
107 {
108 addressing = "Ext";
109 }
110
111 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId()
112 << " [" << device->GetMac()->GetShortAddress() << " | "
113 << device->GetMac()->GetExtendedAddress() << "]"
114 << " MLME-scan.confirm: Selected PAN ID "
115 << params.m_panDescList[panDescIndex].m_coorPanId
116 << "| Coord addressing mode: " << addressing << " | LQI "
117 << static_cast<int>(params.m_panDescList[panDescIndex].m_linkQuality)
118 << "\n";
119
120 if (params.m_panDescList[panDescIndex].m_linkQuality >= 127)
121 {
122 MlmeAssociateRequestParams assocParams;
123 assocParams.m_chNum = params.m_panDescList[panDescIndex].m_logCh;
124 assocParams.m_chPage = params.m_panDescList[panDescIndex].m_logChPage;
125 assocParams.m_coordPanId = params.m_panDescList[panDescIndex].m_coorPanId;
126 assocParams.m_coordAddrMode = params.m_panDescList[panDescIndex].m_coorAddrMode;
127 CapabilityField capability;
128
129 if (params.m_panDescList[panDescIndex].m_coorAddrMode ==
130 AddressMode::SHORT_ADDR)
131 {
132 assocParams.m_coordAddrMode = AddressMode::SHORT_ADDR;
133 assocParams.m_coordShortAddr =
134 params.m_panDescList[panDescIndex].m_coorShortAddr;
135 capability.SetShortAddrAllocOn(true);
136 }
137 else if (assocParams.m_coordAddrMode == AddressMode::EXT_ADDR)
138 {
139 assocParams.m_coordAddrMode = AddressMode::EXT_ADDR;
140 assocParams.m_coordExtAddr =
141 params.m_panDescList[panDescIndex].m_coorExtAddr;
142 assocParams.m_coordShortAddr = Mac16Address("ff:fe");
143 capability.SetShortAddrAllocOn(false);
144 }
145 assocParams.m_capabilityInfo = capability.GetCapability();
146
148 device->GetMac(),
149 assocParams);
150 }
151 else
152 {
153 std::cout << Simulator::Now().As(Time::S) << " Node "
154 << device->GetNode()->GetId() << " ["
155 << device->GetMac()->GetShortAddress() << " | "
156 << device->GetMac()->GetExtendedAddress() << "]"
157 << " MLME-scan.confirm: Beacon found but link quality too low for "
158 "association.\n";
159 }
160 }
161 }
162 else
163 {
164 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId()
165 << " [" << device->GetMac()->GetShortAddress() << " | "
166 << device->GetMac()->GetExtendedAddress()
167 << "] MLME-scan.confirm: Beacon not found.\n";
168 }
169 }
170 else
171 {
172 std::cout << Simulator::Now().As(Time::S) << " [" << device->GetMac()->GetShortAddress()
173 << " | " << device->GetMac()->GetExtendedAddress()
174 << "] error occurred, scan failed.\n";
175 }
176}
177
178static void
180{
181 // This is typically implemented by the coordinator next layer (3rd layer or higher).
182 // The steps described below are out of the scope of the standard.
183
184 // Here the 3rd layer should check:
185 // a) Whether or not the device was previously associated with this PAN
186 // (the coordinator keeps a list).
187 // b) The coordinator have sufficient resources available to allow the
188 // association.
189 // If the association fails, status = 1 or 2 and assocShortAddr = FFFF.
190
191 // In this example, the coordinator accepts every association request and have no association
192 // limits. Furthermore, previous associated devices are not checked.
193
194 // When short address allocation is on (set initially in the association request), the
195 // coordinator is supposed to assign a short address. In here, we just do a dummy address
196 // assign. The assigned short address is just a truncated version of the device existing
197 // extended address (i.e the default short address).
198
199 MlmeAssociateResponseParams assocRespParams;
200
201 assocRespParams.m_extDevAddr = params.m_extDevAddr;
202 assocRespParams.m_status = MacStatus::SUCCESS;
203 CapabilityField capability;
204 capability.SetCapability(params.capabilityInfo);
205
206 if (capability.IsShortAddrAllocOn())
207 {
208 // Truncate the extended address and make an assigned
209 // short address based on this. This mechanism is not described by the standard.
210 // It is just implemented here as a quick and dirty way to assign short addresses.
211 uint8_t buffer64MacAddr[8];
212 uint8_t buffer16MacAddr[2];
213
214 params.m_extDevAddr.CopyTo(buffer64MacAddr);
215 buffer16MacAddr[1] = buffer64MacAddr[7];
216 buffer16MacAddr[0] = buffer64MacAddr[6];
217
218 Mac16Address shortAddr;
219 shortAddr.CopyFrom(buffer16MacAddr);
220 assocRespParams.m_assocShortAddr = shortAddr;
221 }
222 else
223 {
224 // If Short Address allocation flag is false, the device will
225 // use its extended address to send data packets and short address will be
226 // equal to ff:fe. See 802.15.4-2011 (Section 5.3.2.2)
227 assocRespParams.m_assocShortAddr = Mac16Address("ff:fe");
228 }
229
230 Simulator::ScheduleNow(&LrWpanMac::MlmeAssociateResponse, device->GetMac(), assocRespParams);
231}
232
233static void
235{
236 // Used by coordinator higher layer to inform results of a
237 // association procedure from its mac layer.This is implemented by other protocol stacks
238 // and is only here for demonstration purposes.
239 switch (params.m_status)
240 {
241 case MacStatus::TRANSACTION_EXPIRED:
242 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
243 << " [" << device->GetMac()->GetShortAddress() << " | "
244 << device->GetMac()->GetExtendedAddress() << "]"
245 << " MLME-comm-status.indication: Transaction for device " << params.m_dstExtAddr
246 << " EXPIRED in pending transaction list\n";
247 break;
248 case MacStatus::NO_ACK:
249 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
250 << " [" << device->GetMac()->GetShortAddress() << " | "
251 << device->GetMac()->GetExtendedAddress() << "]"
252 << " MLME-comm-status.indication: NO ACK from " << params.m_dstExtAddr
253 << " device registered in the pending transaction list\n";
254 break;
255
256 case MacStatus::CHANNEL_ACCESS_FAILURE:
257 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
258 << " [" << device->GetMac()->GetShortAddress() << " | "
259 << device->GetMac()->GetExtendedAddress() << "]"
260 << " MLME-comm-status.indication: CHANNEL ACCESS problem in transaction for "
261 << params.m_dstExtAddr << " registered in the pending transaction list\n";
262 break;
263
264 default:
265 break;
266 }
267}
268
269static void
271{
272 // Used by device higher layer to inform the results of a
273 // association procedure from its mac layer.This is implemented by other protocol stacks
274 // and is only here for demonstration purposes.
275 if (params.m_status == MacStatus::SUCCESS)
276 {
277 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
278 << device->GetMac()->GetShortAddress() << " | "
279 << device->GetMac()->GetExtendedAddress() << "]"
280 << " MLME-associate.confirm: Association with coordinator successful."
281 << " (PAN: " << device->GetMac()->GetPanId()
282 << " | CoordShort: " << device->GetMac()->GetCoordShortAddress()
283 << " | CoordExt: " << device->GetMac()->GetCoordExtAddress() << ")\n";
284 }
285 else if (params.m_status == MacStatus::NO_ACK)
286 {
287 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
288 << device->GetMac()->GetShortAddress() << " | "
289 << device->GetMac()->GetExtendedAddress() << "]"
290 << " MLME-associate.confirm: Association with coordinator FAILED (NO ACK).\n";
291 }
292 else
293 {
294 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
295 << device->GetMac()->GetShortAddress() << " | "
296 << device->GetMac()->GetExtendedAddress() << "]"
297 << " MLME-associate.confirm: Association with coordinator FAILED.\n";
298 }
299}
300
301static void
303{
304 if (params.m_status == MacStatus::CHANNEL_ACCESS_FAILURE)
305 {
306 std::cout
307 << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
308 << device->GetMac()->GetShortAddress() << " | "
309 << device->GetMac()->GetExtendedAddress() << "]"
310 << " MLME-poll.confirm: CHANNEL ACCESS problem when sending a data request command.\n";
311 }
312 else if (params.m_status == MacStatus::NO_ACK)
313 {
314 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
315 << device->GetMac()->GetShortAddress() << " | "
316 << device->GetMac()->GetExtendedAddress() << "]"
317 << " MLME-poll.confirm: Data Request Command FAILED (NO ACK).\n";
318 }
319 else if (params.m_status != MacStatus::SUCCESS)
320 {
321 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
322 << device->GetMac()->GetShortAddress() << " | "
323 << device->GetMac()->GetExtendedAddress() << "]"
324 << " MLME-poll.confirm: Data Request command FAILED.\n";
325 }
326}
327
328int
329main(int argc, char* argv[])
330{
332
333 nodes.Create(100);
335
337 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
338 mobility.SetPositionAllocator("ns3::GridPositionAllocator",
339 "MinX",
340 DoubleValue(0.0),
341 "MinY",
342 DoubleValue(0.0),
343 "DeltaX",
344 DoubleValue(30.0),
345 "DeltaY",
346 DoubleValue(30.0),
347 "GridWidth",
348 UintegerValue(20),
349 "LayoutType",
350 StringValue("RowFirst"));
351
352 mobility.Install(nodes);
353
355 listPositionAlloc->Add(Vector(210, 50, 0)); // Coordinator 1 mobility (210,50,0)
356 listPositionAlloc->Add(Vector(360, 50, 0)); // Coordinator 2 mobility (360,50,0)
357
358 mobility.SetPositionAllocator(listPositionAlloc);
359 mobility.Install(coordinators);
360
361 LrWpanHelper lrWpanHelper;
362 lrWpanHelper.SetPropagationDelayModel("ns3::ConstantSpeedPropagationDelayModel");
363 lrWpanHelper.AddPropagationLossModel("ns3::LogDistancePropagationLossModel");
364
365 NetDeviceContainer lrwpanDevices = lrWpanHelper.Install(nodes);
366 lrwpanDevices.Add(lrWpanHelper.Install(coordinators));
367
368 // Set the extended address to all devices (EUI-64)
369 lrWpanHelper.SetExtendedAddresses(lrwpanDevices);
370
371 // Devices hooks & MAC MLME-scan primitive set
372 for (auto i = nodes.Begin(); i != nodes.End(); i++)
373 {
374 Ptr<Node> node = *i;
375 Ptr<NetDevice> netDevice = node->GetDevice(0);
376 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
377 lrwpanDevice->GetMac()->SetMlmeScanConfirmCallback(
378 MakeBoundCallback(&ScanConfirm, lrwpanDevice));
379 lrwpanDevice->GetMac()->SetMlmeAssociateConfirmCallback(
380 MakeBoundCallback(&AssociateConfirm, lrwpanDevice));
381 lrwpanDevice->GetMac()->SetMlmePollConfirmCallback(
382 MakeBoundCallback(&PollConfirm, lrwpanDevice));
383
384 // Devices initiate channels scan on channels 11, 12, 13, and 14 looking for beacons
385 // Scan Channels represented by bits 0-26 (27 LSB)
386 // ch 14 ch 11
387 // | |
388 // 0x7800 = 0000000000000000111100000000000
389
390 MlmeScanRequestParams scanParams;
391 scanParams.m_chPage = 0;
392 scanParams.m_scanChannels = 0x7800;
393 scanParams.m_scanDuration = 14;
394 scanParams.m_scanType = MLMESCAN_PASSIVE;
395
396 // We start the scanning process 100 milliseconds apart for each device
397 // to avoid a storm of association requests with the coordinators
398 Time jitter = Seconds(2) + MilliSeconds(std::distance(nodes.Begin(), i) * 100);
399 Simulator::ScheduleWithContext(node->GetId(),
400 jitter,
402 lrwpanDevice->GetMac(),
403 scanParams);
404 }
405
406 // Coordinator hooks
407 for (auto i = coordinators.Begin(); i != coordinators.End(); i++)
408 {
409 Ptr<Node> coor = *i;
410 Ptr<NetDevice> netDevice = coor->GetDevice(0);
411 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
412 lrwpanDevice->GetMac()->SetMlmeAssociateIndicationCallback(
413 MakeBoundCallback(&AssociateIndication, lrwpanDevice));
414 lrwpanDevice->GetMac()->SetMlmeCommStatusIndicationCallback(
416 }
417
418 Ptr<Node> coor1 = coordinators.Get(0);
419 Ptr<NetDevice> netDeviceCoor1 = coor1->GetDevice(0);
420 Ptr<LrWpanNetDevice> coor1Device = DynamicCast<LrWpanNetDevice>(netDeviceCoor1);
421
422 Ptr<Node> coor2 = coordinators.Get(1);
423 Ptr<NetDevice> netDeviceCoor2 = coor2->GetDevice(0);
424 Ptr<LrWpanNetDevice> coor2Device = DynamicCast<LrWpanNetDevice>(netDeviceCoor2);
425
426 // Coordinators require that their short address is explicitly set.
427 // Either FF:FE to indicate that only extended addresses will be used in the following
428 // data communications or any other value (except for FF:FF) to indicate that the coordinator
429 // will use the short address in these communications.
430 // The default short address for all devices is FF:FF (unassigned/no associated).
431
432 // coor1 (PAN 5) = extended addressing mode coor2 (PAN 7) = short addressing mode
433 coor1Device->GetMac()->SetShortAddress(Mac16Address("FF:FE"));
434 coor2Device->GetMac()->SetShortAddress(Mac16Address("CA:FE"));
435
436 // PAN coordinator 1 (PAN 5) transmits beacons on channel 12
438 params.m_panCoor = true;
439 params.m_PanId = 5;
440 params.m_bcnOrd = 3;
441 params.m_sfrmOrd = 3;
442 params.m_logCh = 12;
443
444 Simulator::ScheduleWithContext(coor1Device->GetNode()->GetId(),
445 Seconds(2.0),
447 coor1Device->GetMac(),
448 params);
449
450 // PAN coordinator N2 (PAN 7) transmits beacons on channel 14
452 params2.m_panCoor = true;
453 params2.m_PanId = 7;
454 params2.m_bcnOrd = 3;
455 params2.m_sfrmOrd = 3;
456 params2.m_logCh = 14;
457
458 Simulator::ScheduleWithContext(coor2Device->GetNode()->GetId(),
459 Seconds(2.0),
461 coor2Device->GetMac(),
462 params2);
463
464 anim = new AnimationInterface("lrwpan-bootstrap.xml");
466 anim->UpdateNodeDescription(coordinators.Get(0), "Coordinator (PAN 5)");
467 anim->UpdateNodeDescription(coordinators.Get(1), "Coordinator (PAN 7)");
468 anim->UpdateNodeColor(coordinators.Get(0), 0, 0, 255);
469 anim->UpdateNodeColor(coordinators.Get(1), 0, 51, 102);
470 anim->UpdateNodeSize(nodes.GetN(), 9, 9);
471 anim->UpdateNodeSize(nodes.GetN() + 1, 9, 9);
472
476
478 delete anim;
479 return 0;
480}
Interface to network animator.
void SkipPacketTracing()
Do not trace packets.
void UpdateNodeSize(Ptr< Node > n, double width, double height)
Helper function to update the size of a node.
void UpdateNodeDescription(Ptr< Node > n, std::string descr)
Helper function to update the description for a given node.
void UpdateNodeColor(Ptr< Node > n, uint8_t r, uint8_t g, uint8_t b)
Helper function to update the node color.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
helps to manage and create IEEE 802.15.4 NetDevice objects
void SetExtendedAddresses(NetDeviceContainer c)
Set the extended 64 bit addresses (EUI-64) for a group of LrWpanNetDevices.
NetDeviceContainer Install(NodeContainer c)
Install a LrWpanNetDevice and the associated structures (e.g., channel) in the nodes.
void SetPropagationDelayModel(std::string name, Ts &&... args)
void AddPropagationLossModel(std::string name, Ts &&... args)
This class can contain 16 bit addresses.
void CopyFrom(const uint8_t buffer[2])
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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 Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition simulator.h:577
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
static void Run()
Run the simulation.
Definition simulator.cc:167
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition simulator.h:594
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Hold variables of type string.
Definition string.h:45
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition time.cc:404
@ S
second
Definition nstime.h:105
Hold an unsigned integer type.
Definition uinteger.h:34
Represent the Capability Information Field.
bool IsShortAddrAllocOn() const
True if the device wishes the coordinator to allocate a short address as result of the association pr...
uint8_t GetCapability() const
Get the bitmap representing the device capability.
void SetCapability(uint8_t bitmap)
Set the bitmap representing the device capability.
void SetShortAddrAllocOn(bool addrAlloc)
Set the Short Address Flag in the Capability Information Field.
void MlmeAssociateResponse(MlmeAssociateResponseParams params) override
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to ...
void MlmeStartRequest(MlmeStartRequestParams params) override
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
void MlmeAssociateRequest(MlmeAssociateRequestParams params) override
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to requ...
void MlmeScanRequest(MlmeScanRequestParams params) override
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel s...
Represent the Superframe Specification information field.
bool IsAssocPermit() const
Check if the Association Permit bit is enabled.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Definition callback.h:745
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1320
static void UpdateAnimation()
static void AssociateIndication(Ptr< LrWpanNetDevice > device, MlmeAssociateIndicationParams params)
NodeContainer coordinators
static void PollConfirm(Ptr< LrWpanNetDevice > device, MlmePollConfirmParams params)
static void AssociateConfirm(Ptr< LrWpanNetDevice > device, MlmeAssociateConfirmParams params)
AnimationInterface * anim
static void ScanConfirm(Ptr< LrWpanNetDevice > device, MlmeScanConfirmParams params)
NodeContainer nodes
static void CommStatusIndication(Ptr< LrWpanNetDevice > device, MlmeCommStatusIndicationParams params)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
LogLevel
Logging severity classes and levels.
Definition log.h:83
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
Definition log.h:107
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
Definition log.h:108
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
Definition log.h:109
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
Definition log.cc:309
mobility
Definition third.py:92
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
MLME-ASSOCIATE.confirm params.
MLME-ASSOCIATE.indication params.
MLME-ASSOCIATE.request params.
Mac64Address m_coordExtAddr
The extended address of the coordinator with which to associate.
uint8_t m_coordAddrMode
The coordinator addressing mode for this primitive and subsequent MPDU.
uint8_t m_capabilityInfo
Specifies the operational capabilities of the associating device (bitmap).
Mac16Address m_coordShortAddr
The short address of the coordinator with which to associate.
uint8_t m_chNum
The channel number on which to attempt association.
uint32_t m_chPage
The channel page on which to attempt association.
uint16_t m_coordPanId
The identifier of the PAN with which to associate.
MLME-ASSOCIATE.response params.
Mac16Address m_assocShortAddr
The short address allocated by the coordinator on successful assoc.
MacStatus m_status
The status of the association attempt (As defined on Table 83 IEEE 802.15.4-2006)
Mac64Address m_extDevAddr
The extended address of the device requesting association.
MLME-COMM-STATUS.indication params.
MlmeScanType m_scanType
Indicates the type of scan performed as described in IEEE 802.15.4-2011 (5.1.2.1).
uint32_t m_scanChannels
The channel numbers to be scanned.
uint8_t m_scanDuration
The factor (0-14) used to calculate the length of time to spend scanning.
uint32_t m_chPage
The channel page on which to perform scan.
uint8_t m_logCh
Logical channel on which to start using the new superframe configuration.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
bool m_panCoor
On true this device will become coordinator.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
uint16_t m_PanId
Pan Identifier used by the device.