A Discrete-Event Network Simulator
API
lr-wpan-csmaca.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 The Boeing Company
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author:
19 * kwong yin <kwong-sang.yin@boeing.com>
20 * Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
21 * Alberto Gallegos Ramonet <ramonet@fc.ritsumei.ac.jp>
22 */
23
24#include "lr-wpan-csmaca.h"
25#include <ns3/random-variable-stream.h>
26#include <ns3/simulator.h>
27#include <ns3/log.h>
28#include <algorithm>
29
30#undef NS_LOG_APPEND_CONTEXT
31#define NS_LOG_APPEND_CONTEXT \
32 std::clog << "[address " << m_mac->GetShortAddress () << "] ";
33
34namespace ns3 {
35
36NS_LOG_COMPONENT_DEFINE ("LrWpanCsmaCa");
37
38NS_OBJECT_ENSURE_REGISTERED (LrWpanCsmaCa);
39
40TypeId
42{
43 static TypeId tid = TypeId ("ns3::LrWpanCsmaCa")
44 .SetParent<Object> ()
45 .SetGroupName ("LrWpan")
46 .AddConstructor<LrWpanCsmaCa> ()
47 ;
48 return tid;
49}
50
52{
53 // TODO-- make these into ns-3 attributes
54
55 m_isSlotted = false;
56 m_NB = 0;
57 m_CW = 2;
58 m_macBattLifeExt = false;
59 m_macMinBE = 3;
60 m_macMaxBE = 5;
62 m_aUnitBackoffPeriod = 20; // symbols
63 m_random = CreateObject<UniformRandomVariable> ();
65 m_ccaRequestRunning = false;
67 m_coorDest = false;
68}
69
71{
72 m_mac = 0;
73}
74
75void
77{
78 m_lrWpanMacStateCallback = MakeNullCallback <void, LrWpanMacState> ();
79 m_lrWpanMacTransCostCallback = MakeNullCallback <void, uint32_t> ();
80
81 Cancel ();
82 m_mac = 0;
83}
84
85void
87{
88 m_mac = mac;
89}
90
93{
94 return m_mac;
95}
96
97void
99{
100 NS_LOG_FUNCTION (this);
101 m_isSlotted = true;
102}
103
104void
106{
107 NS_LOG_FUNCTION (this);
108 m_isSlotted = false;
109}
110
111bool
113{
114 NS_LOG_FUNCTION (this);
115 return (m_isSlotted);
116}
117
118bool
120{
121 NS_LOG_FUNCTION (this);
122 return (!m_isSlotted);
123}
124
125void
127{
128 NS_LOG_FUNCTION (this << macMinBE);
129 NS_ASSERT_MSG (macMinBE <= m_macMaxBE,"MacMinBE (" << macMinBE << ") should be <= MacMaxBE (" << m_macMaxBE << ")");
130 m_macMinBE = macMinBE;
131}
132
133uint8_t
135{
136 NS_LOG_FUNCTION (this);
137 return m_macMinBE;
138}
139
140void
142{
143 NS_LOG_FUNCTION (this << macMaxBE);
144 NS_ASSERT_MSG (macMaxBE >= 3 && macMaxBE <= 8, "MacMaxBE (" << macMaxBE << ") should be >= 3 and <= 8");
145 m_macMaxBE = macMaxBE;
146}
147
148uint8_t
150{
151 NS_LOG_FUNCTION (this);
152 return m_macMaxBE;
153}
154
155void
156LrWpanCsmaCa::SetMacMaxCSMABackoffs (uint8_t macMaxCSMABackoffs)
157{
158 NS_LOG_FUNCTION (this << macMaxCSMABackoffs);
159 NS_ASSERT_MSG (macMaxCSMABackoffs <= 5, "MacMaxCSMABackoffs should be <= 5");
160 m_macMaxCSMABackoffs = macMaxCSMABackoffs;
161}
162
163uint8_t
165{
166 NS_LOG_FUNCTION (this);
168}
169
170void
171LrWpanCsmaCa::SetUnitBackoffPeriod (uint64_t unitBackoffPeriod)
172{
173 NS_LOG_FUNCTION (this << unitBackoffPeriod);
174 m_aUnitBackoffPeriod = unitBackoffPeriod;
175}
176
177uint64_t
179{
180 NS_LOG_FUNCTION (this);
182}
183
184Time
186{
187 NS_LOG_FUNCTION (this);
188
189 // The reference for the beginning of the SUPERFRAME (the active period) changes depending
190 // on the data packet being sent from the Coordinator/outgoing frame (Tx beacon time reference)
191 // or other device/incoming frame (Rx beacon time reference ).
192
193 Time elapsedSuperframe; // (i.e The beacon + the elapsed CAP)
194 Time currentTime;
195 double symbolsToBoundary;
196 Time nextBoundary;
197 uint64_t elapsedSuperframeSymbols;
198 uint64_t symbolRate;
199 Time timeAtBoundary;
200 [[maybe_unused]] Time elapsedCap;
201 [[maybe_unused]] Time beaconTime;
202
203
204 currentTime = Simulator::Now ();
205 symbolRate = (uint64_t) m_mac->GetPhy ()->GetDataOrSymbolRate (false); //symbols per second
206
207 if (m_coorDest)
208 {
209 // Take the Incoming Frame Reference
210 elapsedSuperframe = currentTime - m_mac->m_macBeaconRxTime;
211
212 beaconTime = Seconds ((double) m_mac->m_rxBeaconSymbols / symbolRate);
213 elapsedCap = elapsedSuperframe - beaconTime;
214 NS_LOG_DEBUG ("Elapsed incoming CAP symbols: " << (elapsedCap.GetSeconds () * symbolRate) << " (" << elapsedCap.As (Time::S) << ")");
215 }
216 else
217 {
218 // Take the Outgoing Frame Reference
219 elapsedSuperframe = currentTime - m_mac->m_macBeaconTxTime;
220 }
221
222 // get a close value to the the boundary in symbols
223 elapsedSuperframeSymbols = elapsedSuperframe.GetSeconds () * symbolRate;
224 symbolsToBoundary = m_aUnitBackoffPeriod - std::fmod ((double) elapsedSuperframeSymbols,m_aUnitBackoffPeriod);
225
226 timeAtBoundary = Seconds ((double)(elapsedSuperframeSymbols + symbolsToBoundary) / symbolRate);
227
228 // get the exact time boundary
229 nextBoundary = timeAtBoundary - elapsedSuperframe;
230
231 NS_LOG_DEBUG ("Elapsed Superframe symbols: " << elapsedSuperframeSymbols << " ("
232 << elapsedSuperframe.As (Time::S) << ")");
233
234 NS_LOG_DEBUG ("Next backoff period boundary in approx. " << nextBoundary.GetSeconds () * symbolRate << " symbols ("
235 << nextBoundary.As (Time::S) << ")");
236
237 return nextBoundary;
238
239}
240
241void
243{
244 NS_LOG_FUNCTION (this);
245 m_NB = 0;
246 if (IsSlottedCsmaCa ())
247 {
248 // TODO: Check if the current PHY is using the Japanese band 950 Mhz:
249 // (IEEE_802_15_4_950MHZ_BPSK and IEEE_802_15_4_950MHZ_2GFSK)
250 // if in use, m_CW = 1.
251 // Currently 950 Mhz band PHYs are not supported in ns-3.
252 // To know the current used PHY, making the method for GetPhy()->GetMyPhyOption()
253 // public is necessary. Alternatively, the current PHY used
254 // can be known using phyCurrentPage variable.
255
256 m_CW = 2;
257
259 {
260 m_BE = std::min (static_cast<uint8_t> (2), m_macMinBE);
261 }
262 else
263 {
265 }
266
267 // m_coorDest to decide between incoming and outgoing superframes times
268 m_coorDest = m_mac->isCoordDest ();
269
270 // Locate backoff period boundary. (i.e. a time delay to align with the next backoff period boundary)
271 Time backoffBoundary = GetTimeToNextSlot ();
273
274 }
275 else
276 {
279 }
280}
281
282void
284{
288 m_mac->GetPhy ()->CcaCancel ();
289}
290
291void
293{
294 NS_LOG_FUNCTION (this);
295
296 uint64_t upperBound = (uint64_t) pow (2, m_BE) - 1;
297 Time randomBackoff;
298 uint64_t symbolRate;
299 Time timeLeftInCap;
300
301 symbolRate = (uint64_t) m_mac->GetPhy ()->GetDataOrSymbolRate (false); //symbols per second
302
303 // We should not recalculate the random backoffPeriods if we are in a slotted CSMA-CA and the
304 // transmission was previously deferred (m_randomBackoffPeriods != 0)
306 {
307 m_randomBackoffPeriodsLeft = (uint64_t)m_random->GetValue (0, upperBound + 1);
308 }
309
310 randomBackoff = Seconds ((double) (m_randomBackoffPeriodsLeft * GetUnitBackoffPeriod ()) / symbolRate);
311
312 if (IsUnSlottedCsmaCa ())
313 {
314 NS_LOG_DEBUG ("Unslotted CSMA-CA: requesting CCA after backoff of " << m_randomBackoffPeriodsLeft <<
315 " periods (" << randomBackoff.As (Time::S) << ")");
317 }
318 else
319 {
320 // We must make sure there is enough time left in the CAP, otherwise we continue in
321 // the CAP of the next superframe after the transmission/reception of the beacon (and the IFS)
322 timeLeftInCap = GetTimeLeftInCap ();
323
324 NS_LOG_DEBUG ("Slotted CSMA-CA: proceeding after random backoff of " << m_randomBackoffPeriodsLeft <<
325 " periods (" << (randomBackoff.GetSeconds () * symbolRate) << " symbols or " << randomBackoff.As (Time::S) << ")");
326
327
328
329
330 NS_LOG_DEBUG ("Backoff periods left in CAP: " << ((timeLeftInCap.GetSeconds () * symbolRate) / m_aUnitBackoffPeriod) << " ("
331 << (timeLeftInCap.GetSeconds () * symbolRate) << " symbols or "
332 << timeLeftInCap.As (Time::S) << ")");
333
334
335 if (randomBackoff >= timeLeftInCap)
336 {
337 uint64_t usedBackoffs = (double)(timeLeftInCap.GetSeconds () * symbolRate) / m_aUnitBackoffPeriod;
338 m_randomBackoffPeriodsLeft -= usedBackoffs;
339 NS_LOG_DEBUG ("No time in CAP to complete backoff delay, deferring to the next CAP");
341 }
342 else
343 {
345 }
346
347 }
348}
349
350Time
352{
353 Time currentTime;
354 uint64_t capSymbols;
355 Time endCapTime;
356 uint64_t activeSlot;
357 uint64_t symbolRate;
358 Time rxBeaconTime;
359
360
361 // At this point, the currentTime should be aligned on a backoff period boundary
362 currentTime = Simulator::Now ();
363 symbolRate = (uint64_t) m_mac->GetPhy ()->GetDataOrSymbolRate (false); //symbols per second
364
365
366 if (m_coorDest)
367 { // Take Incoming frame reference
368 activeSlot = m_mac->m_incomingSuperframeDuration / 16;
369 capSymbols = activeSlot * (m_mac->m_incomingFnlCapSlot + 1);
370 endCapTime = m_mac->m_macBeaconRxTime +
371 Seconds ((double) capSymbols / symbolRate);
372 }
373 else
374 { // Take Outgoing frame reference
375 activeSlot = m_mac->m_superframeDuration / 16;
376 capSymbols = activeSlot * (m_mac->m_fnlCapSlot + 1);
377 endCapTime = m_mac->m_macBeaconTxTime +
378 Seconds ((double) capSymbols / symbolRate);
379 }
380
381 return (endCapTime - currentTime);
382}
383
384void
386{
387 NS_LOG_FUNCTION (this);
388
389 Time timeLeftInCap;
390 uint16_t ccaSymbols;
391 uint32_t transactionSymbols;
392 Time transactionTime;
393 uint64_t symbolRate;
394
395 ccaSymbols = 0;
397 symbolRate = (uint64_t) m_mac->GetPhy ()->GetDataOrSymbolRate (false);
398 timeLeftInCap = GetTimeLeftInCap ();
399
400
401 // TODO: On the 950 Mhz Band (Japanese Band)
402 // only a single CCA check is performed;
403 // the CCA check duration time is:
404 //
405 // CCA symbols = phyCCADuration * m_CW (1)
406 // other PHYs:
407 // CCA symbols = 8 * m_CW(2)
408 //
409 // note: phyCCADuration & 950Mhz band PHYs are
410 // not currently implemented in ns-3.
411 ccaSymbols += 8 * m_CW;
412
413 // The MAC sublayer shall proceed if the remaining CSMA-CA algorithm steps
414 // can be completed before the end of the CAP.
415 // See IEEE 802.15.4-2011 (Sections 5.1.1.1 and 5.1.1.4)
416 // Transaction = 2 CCA + frame transmission (SHR+PHR+PPDU) + turnaroudtime*2 (Rx->Tx & Tx->Rx) + IFS (LIFS or SIFS) and Ack time (if ack flag true)
417
418 transactionSymbols = ccaSymbols + m_mac->GetTxPacketSymbols ();
419
420 if (m_mac->isTxAckReq ())
421 {
422 NS_LOG_DEBUG ("ACK duration symbols: " << m_mac->GetMacAckWaitDuration ());
423 transactionSymbols += m_mac->GetMacAckWaitDuration ();
424 }
425 else
426 {
427 //time the PHY takes to switch from Rx to Tx and Tx to Rx
428 transactionSymbols += (m_mac->GetPhy ()->aTurnaroundTime * 2);
429 }
430 transactionSymbols += m_mac->GetIfsSize ();
431
432 // Report the transaction cost
434 {
435 m_lrWpanMacTransCostCallback (transactionSymbols);
436 }
437
438 transactionTime = Seconds ((double) transactionSymbols / symbolRate);
439 NS_LOG_DEBUG ("Total required transaction: " << transactionSymbols << " symbols (" << transactionTime.As (Time::S) << ")");
440
441 if (transactionTime > timeLeftInCap)
442 {
443 NS_LOG_DEBUG ("Transaction of " << transactionSymbols << " symbols " <<
444 "cannot be completed in CAP, deferring transmission to the next CAP");
445
446
447
448 NS_LOG_DEBUG ("Symbols left in CAP: " << (timeLeftInCap.GetSeconds () * symbolRate) <<
449 " (" << timeLeftInCap.As (Time::S) << ")");
450
452 }
453 else
454 {
456 }
457
458}
459
460void
462{
463 NS_LOG_FUNCTION (this);
464 m_ccaRequestRunning = true;
465 m_mac->GetPhy ()->PlmeCcaRequest ();
466}
467
468void
470{
471 NS_LOG_FUNCTION (this);
473}
474
475void
477{
478 NS_LOG_FUNCTION (this << status);
479
480 // Only react on this event, if we are actually waiting for a CCA.
481 // If the CSMA algorithm was canceled, we could still receive this event from
482 // the PHY. In this case we ignore the event.
484 {
485 m_ccaRequestRunning = false;
486 if (status == IEEE_802_15_4_PHY_IDLE)
487 {
488 if (IsSlottedCsmaCa ())
489 {
490 m_CW--;
491 if (m_CW == 0)
492 {
493 // inform MAC channel is idle
495 {
496 NS_LOG_LOGIC ("Notifying MAC of idle channel");
498 }
499 }
500 else
501 {
502 NS_LOG_LOGIC ("Perform CCA again, m_CW = " << m_CW);
504 }
505 }
506 else
507 {
508 // inform MAC, channel is idle
510 {
511 NS_LOG_LOGIC ("Notifying MAC of idle channel");
513 }
514 }
515 }
516 else
517 {
518 if (IsSlottedCsmaCa ())
519 {
520 m_CW = 2;
521 }
522 m_BE = std::min (static_cast<uint16_t> (m_BE + 1), static_cast<uint16_t> (m_macMaxBE));
523 m_NB++;
525 {
526 // no channel found so cannot send pkt
527 NS_LOG_DEBUG ("Channel access failure");
529 {
530 NS_LOG_LOGIC ("Notifying MAC of Channel access failure");
532 }
533 return;
534 }
535 else
536 {
537 NS_LOG_DEBUG ("Perform another backoff; m_NB = " << static_cast<uint16_t> (m_NB));
538 m_randomBackoffEvent = Simulator::ScheduleNow (&LrWpanCsmaCa::RandomBackoffDelay, this); //Perform another backoff (step 2)
539 }
540 }
541 }
542}
543
544void
546{
547 NS_LOG_FUNCTION (this);
549}
550
551void
553{
554 NS_LOG_FUNCTION (this);
556}
557
558void
559LrWpanCsmaCa::SetBatteryLifeExtension (bool batteryLifeExtension)
560{
561 m_macBattLifeExt = batteryLifeExtension;
562}
563
564int64_t
566{
567 NS_LOG_FUNCTION (this);
568 m_random->SetStream (stream);
569 return 1;
570}
571
572uint8_t
574{
575 return m_NB;
576}
577
578bool
580{
581 return m_macBattLifeExt;
582}
583
584} //namespace ns3
#define min(a, b)
Definition: 80211b.c:42
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:532
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
This class is a helper for the LrWpanMac to manage the Csma/CA state machine according to IEEE 802....
static TypeId GetTypeId(void)
Get the type ID.
bool GetBatteryLifeExtension(void)
Get the value of the Battery Life Extension.
uint64_t m_aUnitBackoffPeriod
Number of symbols per CSMA/CA time unit, default 20 symbols.
Ptr< LrWpanMac > m_mac
The MAC instance for which this CSMA/CA implemenation is configured.
void SetBatteryLifeExtension(bool batteryLifeExtension)
Set the value of the Battery Life Extension.
void PlmeCcaConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.
void RandomBackoffDelay(void)
In step 2 of the CSMA-CA, perform a random backoff in the range of 0 to 2^BE -1.
uint8_t GetMacMinBE(void) const
Get the minimum backoff exponent value.
bool m_isSlotted
Beacon-enabled slotted or nonbeacon-enabled unslotted CSMA-CA.
uint8_t m_BE
Backoff exponent.
EventId m_canProceedEvent
Scheduler event for checking if we can complete the transmission before the end of the CAP.
EventId m_randomBackoffEvent
Scheduler event for the start of the next random backoff/slot.
LrWpanCsmaCa(void)
Default constructor.
void SetMac(Ptr< LrWpanMac > mac)
Set the MAC to which this CSMA/CA implementation is attached to.
LrWpanMacStateCallback m_lrWpanMacStateCallback
The callback to inform the configured MAC of the CSMA/CA result.
void SetUnSlottedCsmaCa(void)
Configure for the use of the unslotted CSMA/CA version.
uint64_t GetUnitBackoffPeriod(void) const
Get the number of symbols forming the basic time period used by the CSMA-CA algorithm.
void Start(void)
Start CSMA-CA algorithm (step 1), initialize NB, BE for both slotted and unslotted CSMA-CA.
LrWpanMacTransCostCallback m_lrWpanMacTransCostCallback
The callback to inform the cost of a transaction in slotted CSMA-CA.
uint8_t GetMacMaxCSMABackoffs(void) const
Get the maximum number of backoffs.
EventId m_requestCcaEvent
Scheduler event when to start the CCA after a random backoff.
bool m_coorDest
Indicates whether the CSMA procedure is targeted for a message to be sent to the coordinator.
void SetLrWpanMacTransCostCallback(LrWpanMacTransCostCallback trans)
Set the callback function to report a transaction cost in slotted CSMA-CA.
bool IsUnSlottedCsmaCa(void) const
Check if the unslotted CSMA/CA version is being used.
void Cancel(void)
Cancel CSMA-CA algorithm.
void SetMacMaxBE(uint8_t macMaxBE)
Set the maximum backoff exponent value.
uint8_t m_macMaxBE
Maximum backoff exponent.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC to which this CSMA/CA implementation is attached to.
void SetMacMinBE(uint8_t macMinBE)
Set the minimum backoff exponent value.
uint8_t m_CW
Contention window length (used in slotted ver only).
uint8_t m_macMinBE
Minimum backoff exponent.
bool IsSlottedCsmaCa(void) const
Check if the slotted CSMA/CA version is being used.
uint8_t GetNB(void)
Get the number of CSMA retries.
void SetUnitBackoffPeriod(uint64_t unitBackoffPeriod)
Set the number of symbols forming the basic time period used by the CSMA-CA algorithm.
bool m_macBattLifeExt
Battery Life Extension.
void CanProceed(void)
In the slotted CSMA-CA, after random backoff, determine if the remaining CSMA-CA operation can procee...
void DeferCsmaTimeout(void)
The CSMA algorithm call this function at the end of the CAP to return the MAC state back to to IDLE a...
EventId m_endCapEvent
Scheduler event for the end of the current CAP.
virtual ~LrWpanCsmaCa(void)
uint64_t m_randomBackoffPeriodsLeft
Count the number of remaining random backoff periods left to delay.
Time GetTimeLeftInCap()
Get the time left in the CAP portion of the Outgoing or Incoming superframe.
virtual void DoDispose(void)
Destructor implementation.
bool m_ccaRequestRunning
Flag indicating that the PHY is currently running a CCA.
void RequestCCA(void)
Request the Phy to perform CCA (Step 3)
void SetLrWpanMacStateCallback(LrWpanMacStateCallback macState)
Set the callback function to the MAC.
uint8_t GetMacMaxBE(void) const
Get the maximum backoff exponent value.
void SetSlottedCsmaCa(void)
Configure for the use of the slotted CSMA/CA version.
uint8_t m_NB
Number of backoffs for the current transmission.
Ptr< UniformRandomVariable > m_random
Uniform random variable stream.
void SetMacMaxCSMABackoffs(uint8_t macMaxCSMABackoffs)
Set the maximum number of backoffs.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Time GetTimeToNextSlot(void) const
Locates the time to the next backoff period boundary in the SUPERFRAME and returns the amount of time...
uint8_t m_macMaxCSMABackoffs
Maximum number of backoffs.
A base class which provides memory management and object aggregation.
Definition: object.h:88
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:555
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:586
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:380
@ S
second
Definition: nstime.h:115
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:418
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
#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:88
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:206
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:274
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:290
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
Definition: lr-wpan-phy.h:108
@ CHANNEL_ACCESS_FAILURE
CHANNEL_ACCESS_FAILURE.
Definition: lr-wpan-mac.h:77
@ MAC_CSMA_DEFERRED
MAC_CSMA_DEFERRED.
Definition: lr-wpan-mac.h:82
@ CHANNEL_IDLE
CHANNEL_IDLE.
Definition: lr-wpan-mac.h:78
@ IEEE_802_15_4_PHY_IDLE
Definition: lr-wpan-phy.h:113
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1245
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mac
Definition: third.py:87