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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
18 */
19
20/*
21 * This example demonstrates the use of lr-wpan bootstrap (i.e. IEEE 802.15.4 Scan & Association).
22 * For a full description of this process check IEEE 802.15.4-2011 Section 5.1.3.1 and Figure 18.
23 *
24 * In this example, we create a grid topology of 100 nodes.
25 * Additionally, 2 coordinators are created and set in beacon-enabled mode.
26 * Coordinator 1 = Channel 14, Pan ID 5 , Coordinator 2 = Channel 12, Pan ID 7.
27 * Nodes start scanning channels 11-14 looking for beacons for a defined duration (PASSIVE SCAN).
28 * The scanning start time is slightly different for each node to avoid a storm of association
29 * requests. When a node scan is completed, an association request is send to one coordinator based
30 * on the LQI results of the scan. A node may not find any beacons if the coordinator is outside its
31 * communication range. An association request may not be send if LQI is too low for an association.
32 *
33 * The coordinator in PAN 5 runs in extended addressing mode and do not assign short addresses.
34 * The coordinator in PAN 7 runs in short addressing mode and assign short addresses.
35 *
36 * At the end of the simulation, an animation is generated (lrwpan-bootstrap.xml), showing the
37 * results of the association with each coordinator. This simulation can take a few seconds to
38 * complete.
39 */
40
41#include <ns3/core-module.h>
42#include <ns3/lr-wpan-module.h>
43#include <ns3/mobility-module.h>
44#include <ns3/netanim-module.h>
45#include <ns3/network-module.h>
46#include <ns3/propagation-module.h>
47#include <ns3/spectrum-module.h>
48
49#include <iostream>
50
51using namespace ns3;
52using namespace ns3::lrwpan;
53
57
58static void
60{
61 std::cout << Simulator::Now().As(Time::S) << " | Animation Updated, End of simulation.\n";
62 for (uint32_t i = 0; i < nodes.GetN(); ++i)
63 {
64 anim->UpdateNodeSize(i, 5, 5);
65 Ptr<Node> node = nodes.Get(i);
66 Ptr<NetDevice> netDevice = node->GetDevice(0);
67 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
68 int panId = lrwpanDevice->GetMac()->GetPanId();
69
70 switch (panId)
71 {
72 case 5:
73 anim->UpdateNodeColor(node, 0, 0, 255);
74 break;
75 case 7:
76 anim->UpdateNodeColor(node, 0, 51, 102);
77 break;
78 default:
79 break;
80 }
81 }
82}
83
84static void
86{
87 // The algorithm to select which coordinator to associate is not
88 // covered by the standard. In this case, we use the coordinator
89 // with the highest LQI value obtained from a passive scan and make
90 // sure this coordinator allows association.
91
92 if (params.m_status == MacStatus::SUCCESS)
93 {
94 // Select the coordinator with the highest LQI from the PAN Descriptor List
95 int maxLqi = 0;
96 int panDescIndex = 0;
97 if (!params.m_panDescList.empty())
98 {
99 for (uint32_t i = 0; i < params.m_panDescList.size(); i++)
100 {
101 if (params.m_panDescList[i].m_linkQuality > maxLqi)
102 {
103 maxLqi = params.m_panDescList[i].m_linkQuality;
104 panDescIndex = i;
105 }
106 }
107
108 // Only request association if the coordinator is permitting association at this moment.
109 SuperframeField superframe(params.m_panDescList[panDescIndex].m_superframeSpec);
110 if (superframe.IsAssocPermit())
111 {
112 std::string addressing;
113 if (params.m_panDescList[panDescIndex].m_coorAddrMode == SHORT_ADDR)
114 {
115 addressing = "Short";
116 }
117 else if (params.m_panDescList[panDescIndex].m_coorAddrMode == EXT_ADDR)
118 {
119 addressing = "Ext";
120 }
121
122 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId()
123 << " [" << device->GetMac()->GetShortAddress() << " | "
124 << device->GetMac()->GetExtendedAddress() << "]"
125 << " MLME-scan.confirm: Selected PAN ID "
126 << params.m_panDescList[panDescIndex].m_coorPanId
127 << "| Coord addressing mode: " << addressing << " | LQI "
128 << static_cast<int>(params.m_panDescList[panDescIndex].m_linkQuality)
129 << "\n";
130
131 if (params.m_panDescList[panDescIndex].m_linkQuality >= 127)
132 {
133 MlmeAssociateRequestParams assocParams;
134 assocParams.m_chNum = params.m_panDescList[panDescIndex].m_logCh;
135 assocParams.m_chPage = params.m_panDescList[panDescIndex].m_logChPage;
136 assocParams.m_coordPanId = params.m_panDescList[panDescIndex].m_coorPanId;
137 assocParams.m_coordAddrMode = params.m_panDescList[panDescIndex].m_coorAddrMode;
138 CapabilityField capability;
139
140 if (params.m_panDescList[panDescIndex].m_coorAddrMode ==
141 AddressMode::SHORT_ADDR)
142 {
143 assocParams.m_coordAddrMode = AddressMode::SHORT_ADDR;
144 assocParams.m_coordShortAddr =
145 params.m_panDescList[panDescIndex].m_coorShortAddr;
146 capability.SetShortAddrAllocOn(true);
147 }
148 else if (assocParams.m_coordAddrMode == AddressMode::EXT_ADDR)
149 {
150 assocParams.m_coordAddrMode = AddressMode::EXT_ADDR;
151 assocParams.m_coordExtAddr =
152 params.m_panDescList[panDescIndex].m_coorExtAddr;
153 assocParams.m_coordShortAddr = Mac16Address("ff:fe");
154 capability.SetShortAddrAllocOn(false);
155 }
156 assocParams.m_capabilityInfo = capability.GetCapability();
157
159 device->GetMac(),
160 assocParams);
161 }
162 else
163 {
164 std::cout << Simulator::Now().As(Time::S) << " Node "
165 << device->GetNode()->GetId() << " ["
166 << device->GetMac()->GetShortAddress() << " | "
167 << device->GetMac()->GetExtendedAddress() << "]"
168 << " MLME-scan.confirm: Beacon found but link quality too low for "
169 "association.\n";
170 }
171 }
172 }
173 else
174 {
175 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId()
176 << " [" << device->GetMac()->GetShortAddress() << " | "
177 << device->GetMac()->GetExtendedAddress()
178 << "] MLME-scan.confirm: Beacon not found.\n";
179 }
180 }
181 else
182 {
183 std::cout << Simulator::Now().As(Time::S) << " [" << device->GetMac()->GetShortAddress()
184 << " | " << device->GetMac()->GetExtendedAddress()
185 << "] error occurred, scan failed.\n";
186 }
187}
188
189static void
191{
192 // This is typically implemented by the coordinator next layer (3rd layer or higher).
193 // The steps described below are out of the scope of the standard.
194
195 // Here the 3rd layer should check:
196 // a) Whether or not the device was previously associated with this PAN
197 // (the coordinator keeps a list).
198 // b) The coordinator have sufficient resources available to allow the
199 // association.
200 // If the association fails, status = 1 or 2 and assocShortAddr = FFFF.
201
202 // In this example, the coordinator accepts every association request and have no association
203 // limits. Furthermore, previous associated devices are not checked.
204
205 // When short address allocation is on (set initially in the association request), the
206 // coordinator is supposed to assign a short address. In here, we just do a dummy address
207 // assign. The assigned short address is just a truncated version of the device existing
208 // extended address (i.e the default short address).
209
210 MlmeAssociateResponseParams assocRespParams;
211
212 assocRespParams.m_extDevAddr = params.m_extDevAddr;
213 assocRespParams.m_status = MacStatus::SUCCESS;
214 CapabilityField capability;
215 capability.SetCapability(params.capabilityInfo);
216
217 if (capability.IsShortAddrAllocOn())
218 {
219 // Truncate the extended address and make an assigned
220 // short address based on this. This mechanism is not described by the standard.
221 // It is just implemented here as a quick and dirty way to assign short addresses.
222 uint8_t buffer64MacAddr[8];
223 uint8_t buffer16MacAddr[2];
224
225 params.m_extDevAddr.CopyTo(buffer64MacAddr);
226 buffer16MacAddr[1] = buffer64MacAddr[7];
227 buffer16MacAddr[0] = buffer64MacAddr[6];
228
229 Mac16Address shortAddr;
230 shortAddr.CopyFrom(buffer16MacAddr);
231 assocRespParams.m_assocShortAddr = shortAddr;
232 }
233 else
234 {
235 // If Short Address allocation flag is false, the device will
236 // use its extended address to send data packets and short address will be
237 // equal to ff:fe. See 802.15.4-2011 (Section 5.3.2.2)
238 assocRespParams.m_assocShortAddr = Mac16Address("ff:fe");
239 }
240
241 Simulator::ScheduleNow(&LrWpanMac::MlmeAssociateResponse, device->GetMac(), assocRespParams);
242}
243
244static void
246{
247 // Used by coordinator higher layer to inform results of a
248 // association procedure from its mac layer.This is implemented by other protocol stacks
249 // and is only here for demonstration purposes.
250 switch (params.m_status)
251 {
252 case MacStatus::TRANSACTION_EXPIRED:
253 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
254 << " [" << device->GetMac()->GetShortAddress() << " | "
255 << device->GetMac()->GetExtendedAddress() << "]"
256 << " MLME-comm-status.indication: Transaction for device " << params.m_dstExtAddr
257 << " EXPIRED in pending transaction list\n";
258 break;
259 case MacStatus::NO_ACK:
260 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
261 << " [" << device->GetMac()->GetShortAddress() << " | "
262 << device->GetMac()->GetExtendedAddress() << "]"
263 << " MLME-comm-status.indication: NO ACK from " << params.m_dstExtAddr
264 << " device registered in the pending transaction list\n";
265 break;
266
267 case MacStatus::CHANNEL_ACCESS_FAILURE:
268 std::cout << Simulator::Now().As(Time::S) << " Coordinator " << device->GetNode()->GetId()
269 << " [" << device->GetMac()->GetShortAddress() << " | "
270 << device->GetMac()->GetExtendedAddress() << "]"
271 << " MLME-comm-status.indication: CHANNEL ACCESS problem in transaction for "
272 << params.m_dstExtAddr << " registered in the pending transaction list\n";
273 break;
274
275 default:
276 break;
277 }
278}
279
280static void
282{
283 // Used by device higher layer to inform the results of a
284 // association procedure from its mac layer.This is implemented by other protocol stacks
285 // and is only here for demonstration purposes.
286 if (params.m_status == MacStatus::SUCCESS)
287 {
288 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
289 << device->GetMac()->GetShortAddress() << " | "
290 << device->GetMac()->GetExtendedAddress() << "]"
291 << " MLME-associate.confirm: Association with coordinator successful."
292 << " (PAN: " << device->GetMac()->GetPanId()
293 << " | CoordShort: " << device->GetMac()->GetCoordShortAddress()
294 << " | CoordExt: " << device->GetMac()->GetCoordExtAddress() << ")\n";
295 }
296 else if (params.m_status == MacStatus::NO_ACK)
297 {
298 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
299 << device->GetMac()->GetShortAddress() << " | "
300 << device->GetMac()->GetExtendedAddress() << "]"
301 << " MLME-associate.confirm: Association with coordinator FAILED (NO ACK).\n";
302 }
303 else
304 {
305 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
306 << device->GetMac()->GetShortAddress() << " | "
307 << device->GetMac()->GetExtendedAddress() << "]"
308 << " MLME-associate.confirm: Association with coordinator FAILED.\n";
309 }
310}
311
312static void
314{
315 if (params.m_status == MacStatus::CHANNEL_ACCESS_FAILURE)
316 {
317 std::cout
318 << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
319 << device->GetMac()->GetShortAddress() << " | "
320 << device->GetMac()->GetExtendedAddress() << "]"
321 << " MLME-poll.confirm: CHANNEL ACCESS problem when sending a data request command.\n";
322 }
323 else if (params.m_status == MacStatus::NO_ACK)
324 {
325 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
326 << device->GetMac()->GetShortAddress() << " | "
327 << device->GetMac()->GetExtendedAddress() << "]"
328 << " MLME-poll.confirm: Data Request Command FAILED (NO ACK).\n";
329 }
330 else if (params.m_status != MacStatus::SUCCESS)
331 {
332 std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " ["
333 << device->GetMac()->GetShortAddress() << " | "
334 << device->GetMac()->GetExtendedAddress() << "]"
335 << " MLME-poll.confirm: Data Request command FAILED.\n";
336 }
337}
338
339int
340main(int argc, char* argv[])
341{
343
344 nodes.Create(100);
346
348 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
349 mobility.SetPositionAllocator("ns3::GridPositionAllocator",
350 "MinX",
351 DoubleValue(0.0),
352 "MinY",
353 DoubleValue(0.0),
354 "DeltaX",
355 DoubleValue(30.0),
356 "DeltaY",
357 DoubleValue(30.0),
358 "GridWidth",
359 UintegerValue(20),
360 "LayoutType",
361 StringValue("RowFirst"));
362
363 mobility.Install(nodes);
364
365 Ptr<ListPositionAllocator> listPositionAlloc = CreateObject<ListPositionAllocator>();
366 listPositionAlloc->Add(Vector(210, 50, 0)); // Coordinator 1 mobility (210,50,0)
367 listPositionAlloc->Add(Vector(360, 50, 0)); // Coordinator 2 mobility (360,50,0)
368
369 mobility.SetPositionAllocator(listPositionAlloc);
370 mobility.Install(coordinators);
371
372 Ptr<SingleModelSpectrumChannel> channel = CreateObject<SingleModelSpectrumChannel>();
374 CreateObject<LogDistancePropagationLossModel>();
376 CreateObject<ConstantSpeedPropagationDelayModel>();
377
378 channel->AddPropagationLossModel(propModel);
379 channel->SetPropagationDelayModel(delayModel);
380
381 LrWpanHelper lrWpanHelper;
382 lrWpanHelper.SetChannel(channel);
383
384 NetDeviceContainer lrwpanDevices = lrWpanHelper.Install(nodes);
385 lrwpanDevices.Add(lrWpanHelper.Install(coordinators));
386
387 // Set the extended address to all devices (EUI-64)
388 lrWpanHelper.SetExtendedAddresses(lrwpanDevices);
389
390 // Devices hooks & MAC MLME-scan primitive set
391 for (auto i = nodes.Begin(); i != nodes.End(); i++)
392 {
393 Ptr<Node> node = *i;
394 Ptr<NetDevice> netDevice = node->GetDevice(0);
395 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
396 lrwpanDevice->GetMac()->SetMlmeScanConfirmCallback(
397 MakeBoundCallback(&ScanConfirm, lrwpanDevice));
398 lrwpanDevice->GetMac()->SetMlmeAssociateConfirmCallback(
399 MakeBoundCallback(&AssociateConfirm, lrwpanDevice));
400 lrwpanDevice->GetMac()->SetMlmePollConfirmCallback(
401 MakeBoundCallback(&PollConfirm, lrwpanDevice));
402
403 // Devices initiate channels scan on channels 11, 12, 13, and 14 looking for beacons
404 // Scan Channels represented by bits 0-26 (27 LSB)
405 // ch 14 ch 11
406 // | |
407 // 0x7800 = 0000000000000000111100000000000
408
409 MlmeScanRequestParams scanParams;
410 scanParams.m_chPage = 0;
411 scanParams.m_scanChannels = 0x7800;
412 scanParams.m_scanDuration = 14;
413 scanParams.m_scanType = MLMESCAN_PASSIVE;
414
415 // We start the scanning process 100 milliseconds apart for each device
416 // to avoid a storm of association requests with the coordinators
417 Time jitter = Seconds(2) + MilliSeconds(std::distance(nodes.Begin(), i) * 100);
418 Simulator::ScheduleWithContext(node->GetId(),
419 jitter,
421 lrwpanDevice->GetMac(),
422 scanParams);
423 }
424
425 // Coordinator hooks
426 for (auto i = coordinators.Begin(); i != coordinators.End(); i++)
427 {
428 Ptr<Node> coor = *i;
429 Ptr<NetDevice> netDevice = coor->GetDevice(0);
430 Ptr<LrWpanNetDevice> lrwpanDevice = DynamicCast<LrWpanNetDevice>(netDevice);
431 lrwpanDevice->GetMac()->SetMlmeAssociateIndicationCallback(
432 MakeBoundCallback(&AssociateIndication, lrwpanDevice));
433 lrwpanDevice->GetMac()->SetMlmeCommStatusIndicationCallback(
435 }
436
437 Ptr<Node> coor1 = coordinators.Get(0);
438 Ptr<NetDevice> netDeviceCoor1 = coor1->GetDevice(0);
439 Ptr<LrWpanNetDevice> coor1Device = DynamicCast<LrWpanNetDevice>(netDeviceCoor1);
440
441 Ptr<Node> coor2 = coordinators.Get(1);
442 Ptr<NetDevice> netDeviceCoor2 = coor2->GetDevice(0);
443 Ptr<LrWpanNetDevice> coor2Device = DynamicCast<LrWpanNetDevice>(netDeviceCoor2);
444
445 // Coordinators require that their short address is explicitly set.
446 // Either FF:FE to indicate that only extended addresses will be used in the following
447 // data communications or any other value (except for FF:FF) to indicate that the coordinator
448 // will use the short address in these communications.
449 // The default short address for all devices is FF:FF (unassigned/no associated).
450
451 // coor1 (PAN 5) = extended addressing mode coor2 (PAN 7) = short addressing mode
452 coor1Device->GetMac()->SetShortAddress(Mac16Address("FF:FE"));
453 coor2Device->GetMac()->SetShortAddress(Mac16Address("CA:FE"));
454
455 // PAN coordinator 1 (PAN 5) transmits beacons on channel 12
457 params.m_panCoor = true;
458 params.m_PanId = 5;
459 params.m_bcnOrd = 3;
460 params.m_sfrmOrd = 3;
461 params.m_logCh = 12;
462
463 Simulator::ScheduleWithContext(coor1Device->GetNode()->GetId(),
464 Seconds(2.0),
466 coor1Device->GetMac(),
467 params);
468
469 // PAN coordinator N2 (PAN 7) transmits beacons on channel 14
471 params2.m_panCoor = true;
472 params2.m_PanId = 7;
473 params2.m_bcnOrd = 3;
474 params2.m_sfrmOrd = 3;
475 params2.m_logCh = 14;
476
477 Simulator::ScheduleWithContext(coor2Device->GetNode()->GetId(),
478 Seconds(2.0),
480 coor2Device->GetMac(),
481 params2);
482
483 anim = new AnimationInterface("lrwpan-bootstrap.xml");
485 anim->UpdateNodeDescription(coordinators.Get(0), "Coordinator (PAN 5)");
486 anim->UpdateNodeDescription(coordinators.Get(1), "Coordinator (PAN 7)");
487 anim->UpdateNodeColor(coordinators.Get(0), 0, 0, 255);
488 anim->UpdateNodeColor(coordinators.Get(1), 0, 51, 102);
489 anim->UpdateNodeSize(nodes.GetN(), 9, 9);
490 anim->UpdateNodeSize(nodes.GetN() + 1, 9, 9);
491
495
497 delete anim;
498 return 0;
499}
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:42
helps to manage and create IEEE 802.15.4 NetDevice objects
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel associated to this helper.
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.
This class can contain 16 bit addresses.
Definition: mac16-address.h:44
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.
Definition: ptr.h:77
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:571
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:142
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition: simulator.h:588
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
static void Run()
Run the simulation.
Definition: simulator.cc:178
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:605
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:186
Hold variables of type string.
Definition: string.h:56
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:415
@ S
second
Definition: nstime.h:116
Hold an unsigned integer type.
Definition: uinteger.h:45
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 ...
Definition: lr-wpan-mac.cc:760
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...
Definition: lr-wpan-mac.cc:586
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...
Definition: lr-wpan-mac.cc:685
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...
Definition: lr-wpan-mac.cc:625
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:767
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1319
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1331
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.
LogLevel
Logging severity classes and levels.
Definition: log.h:94
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
Definition: log.h:118
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
Definition: log.h:119
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
Definition: log.h:120
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
Definition: log.cc:320
ns channel
Definition: third.py:88
ns mobility
Definition: third.py:105
FtrParams 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.
MLME-START.confirm 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.
MLME-START.request params.
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.