A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
zigbee-nwk.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Tokushima University, Japan
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors:
7 *
8 * Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
9 * Ryo Okuda <c611901200@tokushima-u.ac.jp>
10 */
11
12#ifndef ZIGBEE_NWK_H
13#define ZIGBEE_NWK_H
14
15#include "zigbee-group-table.h"
16#include "zigbee-nwk-fields.h"
17#include "zigbee-nwk-header.h"
19#include "zigbee-nwk-tables.h"
20
21#include "ns3/event-id.h"
22#include "ns3/lr-wpan-mac-base.h"
23#include "ns3/mac16-address.h"
24#include "ns3/mac64-address.h"
25#include "ns3/object.h"
26#include "ns3/random-variable-stream.h"
27#include "ns3/sequence-number.h"
28#include "ns3/traced-callback.h"
29#include "ns3/traced-value.h"
30
31#include <cstdint>
32#include <iomanip>
33#include <iterator>
34
35namespace ns3
36{
37
38namespace zigbee
39{
40
41/**
42 * @defgroup zigbee ZIGBEE models
43 *
44 * This section documents the API of the Zigbee Specification related models. For a generic
45 * functional description, please refer to the ns-3 manual.
46 */
47
48static constexpr uint32_t ALL_CHANNELS = 0x07FFF800; //!< Bitmap representing all channels (11~26)
49 //!< LSB b0-b26, b27-b31 MSB
50 //!< Page 0 in Zigbee (250kbps O-QPSK)
51
52/**
53 * @ingroup Zigbee
54 *
55 * Indicates a pending NWK primitive
56 */
57enum PendingPrimitiveNwk : std::uint8_t
58{
59 NLDE_NLME_NONE = 0, //!< No pending primitive
60 NLME_NETWORK_FORMATION = 1, //!< Pending NLME-NETWORK-FORMATION.request primitive
61 NLME_DIRECT_JOIN = 2, //!< Pending NLME-DIRECT-JOIN.request primitive
62 NLME_JOIN = 3, //!< Pending NLME-JOIN.request primitive
63 NLME_START_ROUTER = 4, //!< Pending NLME-START-ROUTER.request primitive
64 NLME_NET_DISCV = 5, //!< Pending NLME-NETWORK-DISCOVERY.request primitive
65 NLME_JOIN_INDICATION = 6, //!< Pending NLME-JOIN.indication primitive
66 NLME_ROUTE_DISCOVERY = 7, //!< Pending NLME-ROUTE-DISCOVERY.request primitive
67 NLDE_DATA = 8 //!< Pending NLDE-DATA.request primitive
68};
69
70/**
71 * @ingroup Zigbee
72 *
73 * Table 3.2 (Address Mode) NLDE-DATA-Request parameters
74 */
76{
77 NO_ADDRESS = 0x00, //!< No destination address
78 MCST = 0x01, //!< Multicast Address mode
79 UCST_BCST = 0x02 //!< Unicast or Broadcast address mode
80};
81
82/**
83 * Use to describe the method used to assign addresses in the NWK layer.
84 * See Zigbee specification r22.1.0, Table 3-58
85 */
87{
88 DISTRIBUTED_ALLOC = 0x00, //!< Distributed address allocation
89 //!< (Zigbee Specification r22.1.0 Section 3.6.1.6)
90 STOCHASTIC_ALLOC = 0x02 //!< Stochastic address allocation
91 //!< (Zigbee Specification r22.1.0 Section 3.6.1.7)
92};
93
94/**
95 * Use to describe the identifier of the zigbee stack profile.
96 */
98{
99 ZIGBEE = 0x01, //!< Zigbee stack profile 0x01 (a.k.a. Zigbee 2006, Zigbee 2007, Zigbee)
100 ZIGBEE_PRO = 0x02 //!< Zigbee stack profile 0x02 (Zigbee Pro, also known as r22.1.0, 3.0)
101};
102
103/**
104 * Use to describe the parameter that controls the method of joining the network.
105 * See Zigbee specification r22.1.0, Table 3-21
106 */
108{
109 ASSOCIATION = 0x00, //!< The device is requesting to join a network through association.
110 DIRECT_OR_REJOIN = 0x01, //!< The device is joining directly or rejoining using the
111 //!< orphaning procedure.
112 REJOINING = 0x02, //!< The device is joining the network using the rejoining procedure.
113 CHANGE_CHANNEL = 0x03 //!< The device is to change the operational network channel to
114 //!< that identified in the ScanChannel parameter.
115};
116
117/**
118 * The status returned while attempting to find the next hop in route towards a specific
119 * destination or a many-to-one route request attempt.
120 */
121enum RouteDiscoveryStatus : std::uint8_t
122{
123 ROUTE_FOUND = 0x01, //!< The next hop toward the destination was found in our
124 //!< routing table or neighbor table (Mesh route).
125 ROUTE_NOT_FOUND = 0x02, //!< The next hop was not found. A new entry is is registered
126 //!< in the routing table with DISCOVER_UNDERWAY status(Mesh route).
127 TABLE_FULL = 0x03, //!< Either the routing or neighbor table are full.
128 ROUTE_UPDATED = 0x04, //!< A route was found and updated with a better route
129 //!< (Mesh route or Many-To-One route)
130 NO_DISCOVER_ROUTE = 0x05, //!< We are currently not allowed to perform a route discovery
131 //!< for this route (RouteDiscover flag in network header is false).
132 DISCOVER_UNDERWAY = 0x06, //!< The route was found in the tables but currently has no next hop.
133 //!< i.e. A previous attempt was already made is currently awaiting
134 //!< for a response (hence the route discover is underway).
135 MANY_TO_ONE_ROUTE = 0x07, //!< A new Many-To-One route was created
136 NO_ROUTE_CHANGE = 0x08 //!< No route entry was created or updated during
137 //!< a Many-To-One process
138};
139
140/**
141 * @ingroup Zigbee
142 *
143 * Network layer status values
144 * Combines Zigbee Specification r22.1.0 Table 3-73 and
145 * and IEEE 802.15.4-2006 Table 78
146 *
147 * Used to report the resulting status of various NWK operations.
148 *
149 * Note: UNSUPPORTED_ATTRIBUTE, LIMIT_REACHED, SCAN_IN_PROGRESS
150 */
151enum NwkStatus : std::uint8_t
152{
153 // MAC defined status:
154 SUCCESS = 0, //!< The operation was completed successfully.
155 FULL_CAPACITY = 0x01, //!< PAN at capacity. Association Status field (std. 2006, Table 83).
156 ACCESS_DENIED = 0x02, //!< PAN access denied. Association Status field (std. 2006, Table 83).
157 COUNTER_ERROR = 0xdb, //!< The frame counter of the received frame is invalid.
158 IMPROPER_KEY_TYPE = 0xdc, //!< The key is not allowed to be used with that frame type.
159 IMPROPER_SECURITY_LEVEL = 0xdd, //!< Insufficient security level expected by the recipient.
160 UNSUPPORTED_LEGACY = 0xde, //!< Deprecated security used in IEEE 802.15.4-2003
161 UNSUPPORTED_SECURITY = 0xdf, //!< The security applied is not supported.
162 BEACON_LOSS = 0xe0, //!< The beacon was lost following a synchronization request.
163 CHANNEL_ACCESS_FAILURE = 0xe1, //!< A Tx could not take place due to activity in the CH.
164 DENIED = 0xe2, //!< The GTS request has been denied by the PAN coordinator.
165 DISABLE_TRX_FAILURE = 0xe3, //!< The attempt to disable the transceier has failed.
166 SECURITY_ERROR = 0xe4, //!< Cryptographic process of the frame failed(FAILED_SECURITY_CHECK).
167 FRAME_TOO_LONG = 0xe5, //!< Frame more than aMaxPHYPacketSize or too large for CAP or GTS.
168 INVALID_GTS = 0xe6, //!< Missing GTS transmit or undefined direction.
169 INVALID_HANDLE = 0xe7, //!< When purging from TX queue handle was not found.
170 INVALID_PARAMETER_MAC = 0xe8, //!< Invalid parameter in response to a request passed to the MAC.
171 NO_ACK = 0xe9, //!< No acknowledgment was received after macMaxFrameRetries.
172 NO_BEACON = 0xea, //!< A scan operation failed to find any network beacons.
173 NO_DATA = 0xeb, //!< No response data were available following a request.
174 NO_SHORT_ADDRESS = 0xec, //!< Failure due to unallocated 16-bit short address.
175 OUT_OF_CAP = 0xed, //!< (Deprecated) See IEEE 802.15.4-2003
176 PAN_ID_CONFLICT = 0xee, //!< PAN id conflict detected and informed to the coordinator.
177 REALIGMENT = 0xef, //!< A coordinator realigment command has been received.
178 TRANSACTION_EXPIRED = 0xf0, //!< The transaction expired and its information discarded.
179 TRANSACTION_OVERFLOW = 0xf1, //!< There is no capacity to store the transaction.
180 TX_ACTIVE = 0xf2, //!< The transceiver was already enabled.
181 UNAVAILABLE_KEY = 0xf3, //!< Unavailable key, unknown or blacklisted.
182 INVALID_ADDRESS = 0xf5, //!< Invalid source or destination address.
183 ON_TIME_TOO_LONG = 0xf6, //!< RX enable request fail due to syms. longer than Bcn. interval
184 PAST_TIME = 0xf7, //!< Rx enable request fail due to lack of time in superframe.
185 TRACKING_OFF = 0xf8, //!< This device is currently not tracking beacons.
186 INVALID_INDEX = 0xf9, //!< A MAC PIB write failed because specified index is out of range.
187 READ_ONLY = 0xfb, //!< SET/GET request issued for a read only attribute.
188 SUPERFRAME_OVERLAP = 0xfd, //!< Coordinator sperframe and this device superframe tx overlap.
189 // Zigbee Specification defined status:
190 INVALID_PARAMETER = 0xc1, //!< Invalid Parameter (Zigbee specification r22.1.0)
191 INVALID_REQUEST = 0xc2, //!< Invalid request (Zigbee specification r22.1.0)
192 NOT_PERMITED = 0xc3, //!< Not permitted (Zigbee specification r22.1.0)
193 STARTUP_FAILURE = 0xc4, //!< Startup failure (Zigbee specification r22.1.0)
194 ALREADY_PRESENT = 0xc5, //!< Already present (Zigbee specification r22.1.0)
195 SYNC_FAILURE = 0xc6, //!< Sync Failure (Zigbee specification r22.1.0)
196 NEIGHBOR_TABLE_FULL = 0xc7, //!< Neighbor table full (Zigbee specification r22.1.0)
197 UNKNOWN_DEVICE = 0xc8, //!< Unknown device (Zigbee specification r22.1.0)
198 UNSUPPORTED_ATTRIBUTE = 0xc9, //!< Unsupported attribute (Zigbee specification r22.1.0)
199 NO_NETWORKS = 0xca, //!< No network (Zigbee specification r22.1.0)
200 MAX_FRM_COUNTER = 0xcc, //!< Max Frame counter (IEEE 802.15.4, Zigbee specification r22.1.0)
201 NO_KEY = 0xcd, //!< No Key (Zigbee specification r22.1.0)
202 BAD_CCM_OUTPUT = 0xce, //!< Bad ccm output (IEEE 802.15.4, Zigbee specification r22.1.0)
203 ROUTE_DISCOVERY_FAILED = 0xd0, //!< Route discovery failed (Zigbee specification r22.1.0)
204 ROUTE_ERROR = 0xd1, //!< Route error (Zigbee specification r22.1.0)
205 BT_TABLE_FULL = 0xd2, //!< Bt table full (Zigbee specification r22.1.0)
206 FRAME_NOT_BUFFERED = 0xd3, //!< Frame not buffered (Zigbee specification r22.1.0)
207 INVALID_INTERFACE = 0xd5, //!< Invalid interface (Zigbee specification r22.1.0)
208 LIMIT_REACHED = 0xd6, //!< Limit reached during network scan (IEEE 802.15.4-2011)
209 SCAN_IN_PROGRESS = 0xd7 //!< The dev was scanning during this call (IEEE 802.5.4)
210};
211
212/**
213 * Overloaded operator to print the value of a NwkStatus.
214 *
215 * @param os The output stream
216 * @param state The text value of the NWK state
217 * @return The output stream with text value of the NWK state
218 */
219std::ostream& operator<<(std::ostream& os, const NwkStatus& state);
220
221/**
222 * Overloaded operator to print uint8_t vectors
223 *
224 * @param os The output stream
225 * @param vec The uint8_t vector to print
226 * @return The output stream with the text value of the uint8_t vector members
227 */
228std::ostream& operator<<(std::ostream& os, const std::vector<uint8_t>& vec);
229
230/**
231 *
232 * @param os The output stream
233 * @param num The uint8_t number to print
234 * @return The output stream with the text value of the uint8_t number
235 */
236std::ostream& operator<<(std::ostream& os, const uint8_t& num);
237
238/**
239 * @ingroup Zigbee
240 *
241 * Status codes for network status command frame and route discovery failures.
242 *
243 */
244enum NetworkStatusCode : std::uint8_t
245{
246 NO_ROUTE_AVAILABLE = 0x00, //!< No route available
247 TREE_LINK_FAILURE = 0x01, //!< Tree link failure
248 NON_TREE_LINK_FAILURE = 0x02, //!< Non tree link failure
249 LOW_BATTERY = 0x03, //!< Low battery
250 NO_ROUTING_CAPACITY = 0x04, //!< No routing capacity
251 NO_INDIRECT_CAPACITY = 0x05, //!< No indirect capacity
252 INDIRECT_TRANSACTION_EXPIRY = 0x06, //!< Indirect transaction expiry
253 TARGET_DEVICE_UNAVAILABLE = 0x07, //!< Target device unavailable
254 TARGET_ADDRESS_UNALLOCATED = 0x08, //!< Target address unallocated
255 PARENT_LINK_FAILURE = 0x09, //!< Parent link failure
256 VALIDATE_ROUTE = 0x0a, //!< Validate route
257 SOURCE_ROUTE_FAILURE = 0x0b, //!< Source route failure
258 MANY_TO_ONE_ROUTE_FAILURE = 0x0c, //!< Many to one route failure
259 ADDRESS_CONFLICT = 0x0d, //!< Address conflict
260 VERIFY_ADDRESS = 0x0e, //!< Verify address
261 PAN_IDENTIFIER_UPDATE = 0x0f, //!< PAN identifier update
262 NETWORK_ADDRESS_UPDATE = 0x10, //!< Network address update
263 BAD_FRAME_COUNTER = 0x11, //!< Bad frame counter
264 BAD_KEY_SEQUENCE_NUMBER = 0x12, //!< Bad key sequence number
265 UNKNOWN_COMMAND = 0x13 //!< Unknown command
266};
267
268/**
269 * @ingroup Zigbee
270 *
271 * Channel List Structure. See Zigbee Specification 3.2.2.2.1
272 */
274{
275 uint8_t channelPageCount; //!< The number of the channel page structures contained in
276 //!< the channel list structure.
277 std::vector<uint32_t> channelsField; //!< The set of channels for a given page.
278
284};
285
286/**
287 * @ingroup Zigbee
288 *
289 * NLDE-DATA.confirm params. See Zigbee Specification 3.2.1.2
290 */
292{
294 //!< the corresponding request.
295 uint8_t m_nsduHandle{0}; //!< The handle associated with the NSDU being confirmed.
296 Time m_txTime{Seconds(0)}; //!< The time indication for the transmitted packet
297 //!< based on the local clock.
298};
299
300/**
301 * @ingroup Zigbee
302 *
303 * NLDE-DATA.indication params. See Zigbee Specification 3.2.1.3.1
304 */
306{
307 AddressMode m_dstAddrMode{UCST_BCST}; //!< Destination address mode.
308 //!< 0x01=MCST, 0x02=BCST or UCST
309 Mac16Address m_dstAddr; //!< The destination address to which the NSDU was sent
310 Mac16Address m_srcAddr; //!< The individual device address from which the NSDU originated
311 uint32_t m_nsduLength{0}; //!< The number of octets comprising the NSDU being indicated
312 uint8_t m_linkQuality{0}; //!< LQI value delivered by the MAC on receipt of this frame
313 Time m_rxTime{Seconds(0)}; //!< A time indication for the received packet
314 //!< based on the local clock
315 bool m_securityUse{false}; //!< An indication of whether the received data is using security
316};
317
318/**
319 * @ingroup Zigbee
320 *
321 * NLDE-DATA.request params. See Zigbee Specification 3.2.1.1
322 */
324{
325 AddressMode m_dstAddrMode{UCST_BCST}; //!< Destination address mode.
326 //!< 0x01=MCST, 0x02=BCST or UCST
327 Mac16Address m_dstAddr; //!< The destination address.
328 uint32_t m_nsduLength{0}; //!< The number of octets comprising the NSDU to be transferred.
329 uint8_t m_nsduHandle{0}; //!< The NSDU handle
330 bool m_useAlias{false}; //!< Indicates if next higher layer use an alias for the current frame.
331 Mac16Address m_aliasSrcAddr; //!< The source address to be used by this NSDU
332 //!< (ignored ifuseAlias = false).
333 SequenceNumber8 m_aliasSeqNumber; //!< The sequence number used by this NSDU
334 //!< (ignored if useAlias = false).
335 uint8_t m_radius{0}; //!< Distance in hops that the frame is allowed to
336 //!< travel through the network.
337 uint8_t m_nonMemberRadius{0}; //!< Distance in hops that a multicast frame will be relayed by
338 //!< nodes not a member of the group. 0x07 = Infinity.
339 uint8_t m_discoverRoute{0}; //!< 0x01 Enable Route Discovery | 0x00: Suppress Route discovery
340 bool m_securityEnable{false}; //!< Enable NWK layer security for the current frame.
341};
342
343/**
344 * @ingroup Zigbee
345 *
346 * NLME-NETWORK-FORMATION.request params. See Zigbee Specification 3.2.2.5.1
347 */
349{
351 //!< that contain a description on the pages and
352 //!< their channels to be scanned.
353 uint8_t m_scanDuration; //!< The time spent of each channel in symbols:
354 //!< aBaseSuperframeDuriantion * (2n+1). n=0-14
355 uint8_t m_beaconOrder; //!< The beacon order
356 uint8_t m_superFrameOrder; //!< The superframe order
357 bool m_batteryLifeExtension; //!< True: The zigbee coordinator is started supporting
358 //!< battery extension mode.
359 bool m_distributedNetwork; //!< Indicates that distributed security will be used.
360 Mac16Address m_distributedNetworkAddress; //!< The address of the device in a
361 //!< distributed network.
362
373};
374
375/**
376 * @ingroup Zigbee
377 *
378 * A group of pending parameters arranged into a structure during the execution of
379 * a NLME-NETWORK-FORMATION.request primitive.
380 */
381struct NetFormPendingParamsGen : public SimpleRefCount<NetFormPendingParamsGen>
382{
383 uint8_t channel{0}; //!< The channel selected during the initial steps of a network formation
384 uint8_t page{0}; //!< The page selected during the initial steps of a network formation.
385 uint16_t panId{0}; //!< The PAN id selected during the initial steps of a network formation.
386};
387
388/**
389 * @ingroup Zigbee
390 *
391 * NLME-NETWORK-FORMATION.confirm params. See Zigbee Specification 3.2.2.6.1
392 */
394{
395 NwkStatus m_status{NwkStatus::INVALID_PARAMETER}; //!< The status as a result of
396 //!< this request
397};
398
399/**
400 * @ingroup Zigbee
401 *
402 * NLME-ROUTE-DISCOVERY.request params. See Zigbee Specification 3.2.2.33
403 */
405{
406 AddressMode m_dstAddrMode{UCST_BCST}; //!< Specifies the kind of destination address.
407 Mac16Address m_dstAddr; //!< The 16-bit destination address or Group ID (MCST destination)
408 //!< of the route discovery.
409 uint16_t m_radius{0}; //!< Optional parameter that describes the number of hops that the
410 //!< route request will travel through the network.
411 bool m_noRouteCache{true}; //!< This flag determines whether the NWK should establish a
412 //!< route record table.
413};
414
415/**
416 * @ingroup Zigbee
417 *
418 * NLME-ROUTE-DISCOVERY.confirm params. See Zigbee Specification r22.1.0, 3.2.2.34
419 */
421{
422 NwkStatus m_status{NwkStatus::INVALID_PARAMETER}; //!< The status as a result of
423 //!< this request.
425 //!< the status parameter has a value of ROUTE_ERROR, this code gives further information about
426 //!< the error occurred. Otherwise, it should be ignored.
427};
428
429/**
430 * @ingroup Zigbee
431 *
432 * NLME-DIRECT-JOIN.request params.
433 * See Zigbee Specification r22.1.0, 3.2.2.16
434 */
436{
437 Mac64Address m_deviceAddr; //!< The EUI-64 bit address of the device directly joined.
438 uint8_t m_capabilityInfo; //!< The operating capabilities of the device
439 //!< being directly joined
440};
441
442/**
443 * @ingroup Zigbee
444 *
445 * NLME-DIRECT-JOIN.confirm params.
446 * See Zigbee Specification r22.1.0, 3.2.2.17
447 */
449{
451 //!< the corresponding request.
452 Mac64Address m_deviceAddr; //!< The IEEE EUI-64 address in the request to
453 //!< which this is a confirmation.
454};
455
456/**
457 * @ingroup Zigbee
458 *
459 * NLME-NETWORK-DISCOVERY.request params.
460 * See Zigbee Specification r22.1.0, 3.2.2.3
461 */
463{
464 ChannelList m_scanChannelList; //!< The list of all channel pages and the associated
465 //!< channels that shall be scanned.
466 uint8_t m_scanDuration{0}; //!< A value used to calculate the length of time to spend
467};
468
469/**
470 * @ingroup lr-wpan
471 *
472 * Network Descriptor, Zigbee Specification r22.1.0, 3.2.2.4, Table 3-12
473 */
475{
476 uint64_t m_extPanId{0xFFFFFFFFFFFFFFFE}; //!< The 64-bit PAN identifier of the network.
477 uint16_t m_panId{0xFFFF}; //!< The 16-bit PAN identifier of the network.
478 uint8_t m_updateId{0}; //!< The value of the UpdateID from the NIB.
479 uint8_t m_logCh{11}; //!< The current channel number occupied by the network.
480 StackProfile m_stackProfile{ZIGBEE_PRO}; //!< The Zigbee stack profile identifier in use in
481 //!< the discovered network.
482 uint8_t m_zigbeeVersion; //!< The version of the zigbee protocol in use in
483 //!< the discovered network.
484 uint8_t m_beaconOrder{15}; //!< The beacon order value of the underlying MAC
485 //!< (Determinates the beacon frequency, 15 = No beacon)
486 uint8_t m_superframeOrder{15}; //!< The superframe order value of the underlying MAC
487 //!< (Determinates the value of the active period)
488 bool m_permitJoining{true}; //!< TRUE = Indicates that at least one zigbee router on the
489 //!< network currently permits joining.
490 bool m_routerCapacity{true}; //!< TRUE = The device is able to accept join requests from
491 //!< router-capable devices.
492 bool m_endDeviceCapacity{true}; //!< TRUE= The device is able to accept join request from
493 //!< end devices.
494};
495
496/**
497 * @ingroup Zigbee
498 *
499 * NLME-NETWORK-DISCOVERY.confirm params. See Zigbee Specification r22.1.0, 3.2.2.4
500 */
502{
504 //!< the corresponding request.
505 uint8_t m_networkCount{0}; //!< Gives the number of networks discovered by the search
506 std::vector<NetworkDescriptor> m_netDescList; //!< A list of descriptors,
507 //!< one for each of the networks discovered.
508};
509
510/**
511 * @ingroup Zigbee
512 *
513 * NLME-JOIN.request params.
514 * See Zigbee Specification r22.1.0, 3.2.2.13
515 */
517{
518 uint64_t m_extendedPanId{1}; //!< The 64 bit PAN identifier of the
519 //!< the network to join.
520 JoiningMethod m_rejoinNetwork; //!< This parameter controls the method of joining the
521 //!< network.
522 ChannelList m_scanChannelList; //!< The list of all channel pages and the associated
523 //!< channels that shall be scanned.
524 uint8_t m_scanDuration{0}; //!< A value used to calculate the length of time to spend
525 //!< scanning each channel.
526 uint8_t m_capabilityInfo; //!< The operating capabilities of the device
527 //!< being directly joined (Bit map).
528 bool m_securityEnable{false}; //!< If the value of RejoinNetwork is REJOINING and this
529 //!< value is true, the device will rejoin securely.
530};
531
532/**
533 * @ingroup Zigbee
534 *
535 * NLME-JOIN.confirm params.
536 * See Zigbee Specification r22.1.0, 3.2.2.15
537 */
539{
540 NwkStatus m_status; //!< The status of
541 //!< the corresponding request.
542 Mac16Address m_networkAddress; //!< The 16 bit network address that was allocated
543 //!< to this device. Equal to 0xFFFF if association
544 //!< was unsuccessful.
545 uint64_t m_extendedPanId; //!< The extended 64 bit PAN ID for the network of which the
546 //!< device is now a member.
547 ChannelList m_channelList; //!< The structure indicating the current channel of the
548 //!< network that has been joined.
549 bool m_enhancedBeacon; //!< True if using enhanced beacons (placeholder, not supported)
550 uint8_t m_macInterfaceIndex; //!< The value of the MAC index from nwkMacInterfaceTable.
551 //!< (placeholder, not supported)
552
562};
563
564/**
565 * @ingroup Zigbee
566 *
567 * NLME-JOIN.indication params.
568 * See Zigbee Specification r22.1.0, 3.2.2.14
569 */
571{
572 Mac16Address m_networkAddress{0xFFFF}; //!< The 16 bit network address of an entity that
573 //!< has been added to the network.
574 Mac64Address m_extendedAddress; //!< The EUI-64 bit address of an entity that has been added
575 //!< to the network.
576 uint8_t m_capabilityInfo; //!< Specifies the operational capabilities of the
577 //!< joining device.
578 JoiningMethod m_rejoinNetwork; //!< This parameter indicates the method used to
579 //!< join the network.
580 bool m_secureRejoin{false}; //!< True if the rejoin was performed in a secure manner.
581};
582
583/**
584 * @ingroup Zigbee
585 *
586 * NLME-START-ROUTER.request params.
587 * See Zigbee Specification r22.1.0, 3.2.2.13
588 */
590{
591 uint8_t m_beaconOrder{15}; //!< The beacon order of the network
592 uint8_t m_superframeOrder{15}; //!< The superframe order of the network
593 bool m_batteryLifeExt{false}; //!< True if the router supports battery life extension mode.
594};
595
596/**
597 * @ingroup Zigbee
598 *
599 * NLME-START-ROUTER.confirm params.
600 * See Zigbee Specification r22.1.0, 3.2.2.10
601 */
603{
605 //!< the corresponding request.
606};
607
608/**
609 * @ingroup Zigbee
610 *
611 * Class that implements the Zigbee Specification Network Layer
612 */
613class ZigbeeNwk : public Object
614{
615 public:
616 /**
617 * Get the type ID.
618 *
619 * @return the object TypeId
620 */
621 static TypeId GetTypeId();
622
623 /**
624 * Default constructor.
625 */
626 ZigbeeNwk();
627 ~ZigbeeNwk() override;
628
629 /**
630 * This callback is called after a NSDU has successfully received and
631 * NWK push it to deliver it to the next higher layer.
632 */
634
635 /**
636 * This callback is used to notify the next higher layer with a confirmation in response to
637 * a previously issued NLDE-DATA.request.
638 */
640
641 /**
642 * This callback is used to notify the next higher layer with a confirmation in response to
643 * a previously issued NLME-NETWORK-FORMATION.request.
644 */
646
647 /**
648 * This callback is used to notify the next higher layer with a confirmation in response to
649 * a previously issued NLME-NETWORK-DISCOVERY.request.
650 */
652
653 /**
654 * This callback is used to notify the next higher layer with a confirmation in response to
655 * a previously issued NLME-ROUTE-DISCOVERY.request.
656 */
658
659 /**
660 * This callback is used to notify the next higher layer with a confirmation in response to
661 * a previously issued NLME-DIRECT-JOIN.request.
662 */
664
665 /**
666 * This callback is used to notify the next higher layer with a confirmation in response to
667 * a previously issued NLME-JOIN.request.
668 */
670
671 /**
672 * This callback is used to notify the next higher layer with an indication that a new
673 * device has successfully joined its network by association or rejoining.
674 */
676
677 /**
678 * This callback is used to notify the next higher layer with a confirmation in response to
679 * a previously issued NLME-START-ROUTER.request.
680 */
682
683 /**
684 * Set the underlying MAC to use in this Zigbee NWK
685 *
686 * @param mac The pointer to the underlying LrWpan MAC to set to this Zigbee NWK
687 */
689
690 /**
691 * Get the group table used by this Zigbee NWK.
692 *
693 * @param groupTable The pointer to the group table to set.
694 */
695 void SetGroupTable(Ptr<ZigbeeGroupTable> groupTable);
696
697 /**
698 * Get the underlying MAC used by the current Zigbee NWK.
699 *
700 * @return The pointer to the underlying MAC object currently connected to the Zigbee NWK.
701 */
703
704 /**
705 * Print the entries in the routing table.
706 *
707 * @param stream The stream object used to print.
708 */
710
711 /**
712 * Print the entries in the route discovery table.
713 *
714 * @param stream The stream object used to print.
715 */
717
718 /**
719 * Print the entries in the neighbor table.
720 *
721 * @param stream The stream object used to print.
722 */
724
725 /**
726 * Print the entries in the RREQ retry table.
727 *
728 * @param stream The stream object used to print.
729 */
731
732 /**
733 * Search for a specific destination in this device
734 * neighbor and routing tables.
735 * This function is only a quick reference used for debugging
736 * purposes.
737 *
738 * @param dst The destination to search in our tables
739 * @param neighbor A flag indicating whether or not the returned
740 * next hop was found in our neighbor table.
741 * @return The nexthop address to the destination.
742 */
743 Mac16Address FindRoute(Mac16Address dst, bool& neighbor);
744
745 /**
746 * Obtain this device 16 bit network address (A.K.A. short address).
747 *
748 * This function should only be used for debugging purposes and it
749 * should not be use by higher layers. Higher layers should use
750 * NLME-GET.request instead to obtain this attribute.
751 *
752 * @return Returns this device's 16 bit network address.
753 */
755
756 /**
757 * Obtain this device 64 bit IEEE address (A.K.A. extended address).
758 *
759 * This function should only be used for debugging purposes and it
760 * should not be use by higher layers. Higher layers should use
761 * NLME-GET.request instead to obtain this attribute.
762 *
763 * @return Returns this device's 16 bit network address.
764 */
766
767 /**
768 * IEEE 802.15.4-2011 section 6.3.3
769 * MCPS-DATA.indication
770 * Indicates the reception of an MSDU from MAC to NWK (receiving)
771 *
772 * @param params The MCPS-DATA.indication parameters.
773 * @param msdu The set of octets forming the MSDU.
774 */
776
777 /**
778 * IEEE 802.15.4-2011 section 6.3.2
779 * MCPS-DATA.confirm
780 * Reports the results of a request to a transfer data to another device.
781 *
782 * @param params The MCPS-DATA.confirm parameters.
783 */
785
786 /**
787 * IEEE 802.15.4-2011 section 6.2.10.2
788 * MLME-SCAN.confirm
789 * Reports the results of a scan request.
790 *
791 * @param params The MLME-SCAN.confirm parameters.
792 */
794
795 /**
796 * IEEE 802.15.4-2011 section
797 * MlME-ASSOCIATE.confirm
798 * Report the results of an associate request attempt.
799 *
800 * @param params The MLME-ASSOCIATE.confirm parameters.
801 */
803
804 /**
805 * IEEE 802.15.4-2011 section 7.1.14.2
806 * MLME-START.confirm
807 * Reports the results of a network start request.
808 *
809 * @param params The MLME-START.confirm parameters.
810 */
812
813 /**
814 * IEEE 802.15.4-2011 section 6.2.11.2
815 * MLME-SET.confirm
816 * Reports the result of an attempt to change a MAC PIB attribute.
817 *
818 * @param params The MLME-SET.confirm params
819 */
821
822 /**
823 * IEEE 802.15.4-2011 section 6.2.5.1
824 * MLME-GET.confirm
825 * Reports the result of an attempt to obtain a MAC PIB attribute.
826 *
827 * @param status The status as a result of a MLME-GET.request operation
828 * @param id The identififier of the attribute requested
829 * @param attribute The value of of the attribute requested
830 */
834
835 /**
836 * IEEE 802.15.4-2011 sections 6.2.7.1,
837 * Zigbee Specification r22.1.0 Section 3.6.1.4.3 (parent procedure)
838 * MLME-ORPHAN.indication
839 * Generated by the coordinator and issued to its next higher
840 * layer on receipt of an orphan notification command, as defined
841 * in 5.3.6.
842 *
843 * @param params The MLME-ORPHAN.indication parameters
844 */
846
847 /**
848 * IEEE 802.15.4-2011 section 6.2.4.2
849 * MLME-COMM-STATUS.indication
850 * Allows the MAC MLME to indicate a communication status.
851 *
852 * @param params The MLME-COMM-STATUS.indication parameters
853 */
855
856 /**
857 * IEEE 802.15.4-2011, Section 6.2.4.1
858 * MLME-BEACON-NOTIFY.indication
859 * Allows the MAC MLME to indicate the reception of a beacon with payload.
860 *
861 * @param params The MLME-BEACON-NOTIFY.indication parameters
862 */
864
865 /**
866 * IEEE 802.15.4-2011, Section 6.2.2.2.
867 * MLME-ASSOCIATE.indication
868 * Allows the MAC MLME to indicate the reception of an associate request
869 * on a PAN coordinator or router. In the Zigbee specification this implements
870 * the parent procedure when a device join a network through association
871 * (See Zigbee specification r22.1.0, Section 3.6.1.4.1)
872 *
873 * @param params The MLME-ASSOCIATE.indication parameters
874 */
876
877 /**
878 * Zigbee Specification r22.1.0, Section 3.2.1.1
879 * NLDE-DATA.request
880 * Request to transfer a NSDU.
881 *
882 * @param params the request parameters
883 * @param packet the NSDU to be transmitted
884 */
886
887 /**
888 * Zigbee Specification r22.1.0, Section 3.2.2.5 and 3.6.1.1
889 * NLME-NETWORK-FORMATION.request
890 * Request the formation of a network in a capable device.
891 *
892 * @param params the network formation request params
893 */
895
896 /**
897 * Zigbee Specification r22.1.0, section 3.2.2.33.3 and 3.6.3.5
898 * NLME-ROUTE-DISCOVERY.request
899 * Allows the next higher layer to initiate route discovery.
900 *
901 * @param params the route discovery request params
902 */
904
905 /**
906 * Zigbee Specification r22.1.0, section 3.2.2.3
907 * NLME-NETWORK-DISCOVERY.request
908 * Allows the next higher layer to request that the NWK layer discover
909 * networks currently operating within the personal operating space (POS).
910 *
911 * @param params the network discovery request params
912 */
914
915 /**
916 * Zigbee Specification r22.1.0, section 3.2.2.16 and 3.6.1.4.3
917 * NLME-DIRECT-JOIN.request
918 * Allows the next layer of a Zigbee coordinator or router to request to
919 * directly join another device to its network
920 *
921 * @param params the direct join request params
922 */
924
925 /**
926 * Zigbee Specification r22.1.0, section 3.2.2.13
927 * NLME-JOIN.request
928 * This primitive allows the next higher layer to request to join or rejoin a
929 * network, or to change the operating channel for the device while within an
930 * operating network.
931 *
932 * @param params the join request params
933 */
935
936 /**
937 * Zigbee Specification r22.1.0, section 3.2.2.9
938 * NLME-START-ROUTER.request
939 * This primitive allows the next higher layer of a Zigbee router to initiate
940 * the activities expected of a Zigbee router including the routing of data
941 * framaes, route discovery, and the accepting of request to join the network
942 * from other devices.
943 *
944 * @param params the join request params
945 */
947
948 /**
949 * Set the callback for the end of a RX, as part of the
950 * interconnections between the NWK and the APS sublayer. The callback
951 * implements the callback used in a NLDE-DATA.indication.
952 * @param c the NldeDataIndication callback
953 */
955
956 /**
957 * Set the callback as part of the interconnections between the NWK and
958 * the APS sublayer (or any other higher layer). The callback
959 * implements the callback used in a NLDE-DATA.confirm
960 *
961 * @param c the NldeDataConfirm callback
962 */
964
965 /**
966 * Set the callback as part of the interconnections between the NWK and the
967 * APS sublayer (or any other higher layer). The callback implements the callback
968 * used in a NLME-NETWORK-FORMATION.confirm
969 * @param c the NlmeNetworkFormationConfirm callback
970 */
972
973 /**
974 * Set the callback as part of the interconnections between the NWK and the
975 * APS sublayer (or any other higher layer). The callback implements the callback
976 * used in a NLME-NETWORK-DISCOVERY.confirm
977 * @param c the NlmeNetworkDiscoveryConfirm callback
978 */
980
981 /**
982 * Set the callback as part of the interconnections between the NWK and the
983 * APS sublayer (or any other higher layer). The callback implements the callback
984 * used in a NLME-ROUTE-DISCOVERY.confirm
985 *
986 * @param c the NlmeRouteDiscoveryConfirm callback
987 */
989
990 /**
991 * Set the callback as part of the interconnections between the NWK and the
992 * APS sublayer (or any other higher layer). The callback implements the callback
993 * used in a NLME-DIRECT-JOIN.confirm
994 *
995 * @param c the NlmeDirectJoinConfirm callback
996 */
998
999 /**
1000 * Set the callback as part of the interconnections between the NWK and the
1001 * APS sublayer (or any other higher layer). The callback implements the callback
1002 * used in a NLME-JOIN.confirm
1003 *
1004 * @param c the NlmeJoinConfirm callback
1005 */
1007
1008 /**
1009 * Set the callback as part of the interconnections between the NWK and the
1010 * APS sublayer (or any other higher layer). The callback implements the callback
1011 * used in a NLME-JOIN.indication
1012 *
1013 * @param c the NlmeJoinIndication callback
1014 */
1016
1017 /**
1018 * Set the callback as part of the interconnections between the NWK and the
1019 * APS sublayer (or any other higher layer). The callback implements the callback
1020 * used in a NLME-START-ROUTER.confirm
1021 *
1022 * @param c the NlmeStartRouterConfirm callback
1023 */
1025
1026 /**
1027 * Assign a fixed random variable stream number to the random variables
1028 * used by this model. Return the number of streams (possibly zero) that
1029 * have been assigned.
1030 *
1031 * @param stream first stream index to use
1032 * @return the number of stream indices assigned by this model
1033 */
1034 int64_t AssignStreams(int64_t stream);
1035
1036 /**
1037 * TracedCallback signature for RreqRetriesExhaustedTrace events.
1038 *
1039 * @param rreqId The RREQ id used in the retries
1040 * @param dst The destination address of the RREQ retries
1041 * @param rreqRetriesNum The number of rreq retries attempted
1042 *
1043 */
1044 typedef void (*RreqRetriesExhaustedTracedCallback)(uint8_t rreqId,
1045 Mac16Address dst,
1046 uint8_t rreqRetriesNum);
1047
1048 protected:
1049 void DoInitialize() override;
1050 void DoDispose() override;
1051 void NotifyConstructionCompleted() override;
1052
1053 private:
1054 Ptr<lrwpan::LrWpanMacBase> m_mac; //!< Pointer to the underlying MAC
1055 //!< connected to this Zigbee NWK.
1056
1057 /**
1058 * Structure representing an element in the pending transaction queue.
1059 */
1060 struct PendingTxPkt : public SimpleRefCount<PendingTxPkt>
1061 {
1062 uint8_t nsduHandle; //!< The NSDU handle
1063 Mac16Address dstAddr; //!< The destination network Address
1064 Ptr<Packet> txPkt; //!< The pending packet.
1065 Time expireTime; //!< The expiration time of the packet
1066 };
1067
1068 /**
1069 * The pending transaction queue of data packets awaiting to be transmitted
1070 * until a route to the destination becomes available.
1071 */
1072 std::deque<Ptr<PendingTxPkt>> m_pendingTxQueue;
1073
1074 /**
1075 * The maximum size of the pending transaction queue.
1076 */
1078
1079 /**
1080 * Structure representing an element in the Tx Buffer.
1081 */
1082 struct TxPkt : public SimpleRefCount<TxPkt>
1083 {
1084 uint8_t macHandle; //!< The mac handle (msdu handle).
1085 uint8_t nwkHandle; //!< The nwk handle (nsdu handle).
1086 Ptr<Packet> txPkt; //!< The buffered packet.
1087 };
1088
1089 /**
1090 * The transmission buffer. Copies of DATA packets are stored here
1091 * for post transmission handling.
1092 */
1093 std::deque<Ptr<TxPkt>> m_txBuffer;
1094
1095 /**
1096 * The maximum size of the transmission buffer
1097 */
1099
1100 ///////////////
1101 // Callbacks //
1102 ///////////////
1103
1104 /**
1105 * A trace source that fires when a node has reached the maximum number
1106 * of RREQ retries allowed. The trace provides the RREQ Id, the destination
1107 * address of the RREQ and the number of the maximum allowed retries from
1108 * this node.
1109 *
1110 */
1112
1113 /**
1114 * This callback is used to notify incoming packets to the APS sublayer.
1115 * See Zigbee Specification r22.1.0, section 6.2.1.3.
1116 */
1118
1119 /**
1120 * This callback is used to respond to data PDU (NSDU) transfer
1121 * request issued by APS sublayer to the NWK (or a layer higher to NWK).
1122 * See Zigbee specification r22.1.0, section 3.2.1.2.
1123 */
1125
1126 /**
1127 * This callback is used to to notify the results of a network
1128 * formation to the APS sublayer making the request.
1129 * See Zigbee specification r22.1.0, section 3.2.2.5
1130 */
1132
1133 /**
1134 * This callback is used to to notify the results of a network
1135 * formation to the APS sublayer making the request.
1136 * See Zigbee specification r22.1.0, section 3.2.2.4
1137 */
1139
1140 /**
1141 * This callback is used to to notify the results of a network
1142 * formation to the APS sublayer making the request.
1143 * See Zigbee specification r22.1.0, section 3.2.2.34
1144 */
1146
1147 /**
1148 * This callback is used by the next layer of a zigbee coordinator or
1149 * router to be notified of the result of its request to directly join
1150 * another device to its network
1151 * See Zigbee specification r22.1.0, section 3.2.2.17
1152 */
1154
1155 /**
1156 * This callback is used by the next layer of a zigbee router or device
1157 * to be notified of the result of its request to join
1158 * another device network.
1159 * See Zigbee specification r22.1.0, section 3.2.2.15
1160 */
1162
1163 /**
1164 * This callback is used by the next layer of a zigbee coordinator or
1165 * router to be notified when a new device has successfully joined its
1166 * network by association or rejoined procedures.
1167 * See Zigbee specification r22.1.0, section 3.2.2.14
1168 */
1170
1171 /**
1172 * This callback is used by the next layer of a zigbee router or device
1173 * to be notified of the result of its request to initiate activities
1174 * as a zigbee router
1175 * See Zigbee specification r22.1.0, section 3.2.2.10
1176 */
1178
1179 /**
1180 * The parameters used during a NLME-NETWORK-FORMATION.request. These parameters
1181 * are stored here while the scanning operations and network initialization
1182 * procedures take place.
1183 */
1185
1186 /**
1187 * The values temporarily stored as a result of the initial steps of a
1188 * NLME-NETWORK-FORMATION.request (i.e. after the first energy scan)
1189 * Page, Channel, PanId.
1190 */
1192
1193 /**
1194 * The parameters used during a NLME-JOIN.request. These parameters
1195 * are stored here while the scanning operations and network joining
1196 * procedures take place.
1197 */
1199
1200 /**
1201 * Temporarily store the NLME-JOIN.indication parameters while the
1202 * join operations (asocciation) conclude in the coordinator or router.
1203 */
1205
1206 /**
1207 * Temporarily store the NLME-START-ROUTER.request parameters during
1208 * the router initialization process.
1209 */
1211
1212 /**
1213 * Temporarily store MLME-ASSOCIATE.request parameters
1214 * during a NLME-JOIN.request.
1215 */
1217
1218 /**
1219 * The maximum acceptable energy level used in an energy scan taking place
1220 * during a NLME-NETWORK-FORMATION.request.
1221 */
1223
1224 /**
1225 * Contains the list of channels with acceptable energy levels in a bitmap form.
1226 * This is the result of an Energy Detection (ED) scan during
1227 * a NLME-NETWORK-FORMATION.request
1228 */
1230
1231 /**
1232 * Indicates the current primitive in use in the NWK layer.
1233 */
1235
1236 /**
1237 * The network layer neighbor table
1238 * See Zigbee specification r22.1.0, 3.6.1.5
1239 */
1241
1242 /**
1243 * Use to keep track of neighboring 16 bit PAN id.
1244 * This information is used during the Join process (Association).
1245 */
1247
1248 /**
1249 * The network layer routing table
1250 * See Zigbee specification r22.1.0, 3.6.3.2
1251 */
1253
1254 /**
1255 * The network route discovery table
1256 * See Zigbee specification r22.1.0, 3.6.3.2
1257 */
1259
1260 /**
1261 * Keep track of all the route request retries.
1262 */
1264
1265 /**
1266 * The broadcast transaction table.
1267 * See Zigbee specification r22.1.0, 3.6.5
1268 */
1270
1271 /**
1272 * The Group Table used by this Zigbee NWK.
1273 * See Zigbee specification r22.1.0, 3.6.3.2
1274 */
1276
1277 /**
1278 * Enqueue a packet in the pending transmission queue until
1279 * a route is discovered for its destination.
1280 *
1281 * @param p The packet to enqueue.
1282 * @param nsduHandle The handle associated to this packet
1283 */
1284 void EnqueuePendingTx(Ptr<Packet> p, uint8_t nsduHandle);
1285
1286 /**
1287 * Dequeue a packet previously enqueued in the pending transmission queue.
1288 * This is called after a route has successfully be found and the DATA
1289 * packet is ready to be transmitted.
1290 *
1291 * @param dst The destination of the packet
1292 * @param entry The pending packet element
1293 *
1294 * @return True if successfully dequeued
1295 */
1297
1298 /**
1299 * Dispose of all PendingTxPkt accumulated in the pending transmission queue.
1300 */
1301 void DisposePendingTx();
1302
1303 /**
1304 * Buffer a copy of a DATA frame for post transmission handling
1305 * (Transmission failure counts, retransmission of DATA broadcasts,
1306 * push of confirm notifications to the next layer)
1307 *
1308 * @param p The DATA packet to be buffered in the TxPkt buffer.
1309 * @param macHandle The mac layer handle (msdu handle) associated to this frame.
1310 * @param nwkHandle The nwk layer handle (nsdu handle) associated to this frame.
1311 */
1312 void BufferTxPkt(Ptr<Packet> p, uint8_t macHandle, uint8_t nwkHandle);
1313
1314 /**
1315 * Retrieves a previously DATA frame buffered in the TxPkt buffer.
1316 * If the frame is successfully retrieved, the entry is removed from the
1317 * TxPkt buffer.
1318 *
1319 * @param macHandle The mac layer handle (msdu handle) associated to this frame.
1320 * @param txPkt The packet buffered in the TxPkt buffer.
1321 * @return True if the txPkt is successfully retrieved.
1322 */
1323 bool RetrieveTxPkt(uint8_t macHandle, Ptr<TxPkt>& txPkt);
1324
1325 /**
1326 * Dispose of all the entries in the TxPkt Buffer.
1327 */
1328 void DisposeTxPktBuffer();
1329
1330 /**
1331 * Cast a Mac layer status to a NWK layer status.
1332 *
1333 * @param macStatus The Mac layer status to be casted.
1334 * @return The ZigbeeNwkStatus resulting from the cast.
1335 */
1336 NwkStatus GetNwkStatus(lrwpan::MacStatus macStatus) const;
1337
1338 /**
1339 * Used by a Zigbee coordinator or router to allocate a
1340 * 16 bit address (A.K.A short address or network address)
1341 * to its associated device upon request.
1342 *
1343 * @return The allocated 16 bit address by this router or Zigbee coordinator.
1344 */
1346
1347 /**
1348 * Create and store a MAC beacon payload, then updates its registered size in the MAC.
1349 * This is typically followed by updating the content of the beacon payload.
1350 */
1352
1353 /**
1354 * Updates the content of the beacon payload with the most recent information in the NWK.
1355 */
1356 void UpdateBeaconPayload();
1357
1358 /**
1359 * Get a non linear representation of a Link Quality Indicator (LQI).
1360 * This is used to obtain LQI representations used in the link cost/Path cost
1361 * of a route discovery and the Outgoing cost in the neighbors table.
1362 *
1363 * @param lqi The LQI value (1-255) mapped
1364 * @return The LQI value mapped to a non linear representation (1-7)
1365 */
1366 uint8_t GetLQINonLinearValue(uint8_t lqi) const;
1367
1368 /**
1369 * Obtain the link cost based on the value of the nwkReportConstantCost.
1370 * If nwkReportConstantCost is True, the link will use a constant value of 7,
1371 * if false, it will use the LQI to obtain the link cost.
1372 * When the LQI option is used, the link cost is based on a non linear mapping
1373 * of LQI values.
1374 * See Zigbee specification r22.1.0, 3.6.3.1
1375 * See NXP Zigbee 3.0 Stack User Guide (JN-UG-3113, revision 1.5), page 108.
1376 *
1377 * @param lqi The lqi value (1-255) used to calculate the link cost.
1378 * @return The link cost (1-7).
1379 */
1380 uint8_t GetLinkCost(uint8_t lqi) const;
1381
1382 /**
1383 * Send a route request command.
1384 * See Zigbee specification r22.1.0, Section 3.4.1
1385 *
1386 * @param nwkHeader The network header of the RREQ packet to send
1387 * @param payload The payload header of the RREQ packet to send
1388 * @param rreqRetries The maximum number of retries the broadcast transmission of a route
1389 * request command frame is retried. Only valid for non Many-To-One RREQs.
1390 */
1391 void SendRREQ(ZigbeeNwkHeader nwkHeader,
1393 uint8_t rreqRetries);
1394
1395 /**
1396 * Handles the reception of a route request command.
1397 * See Zigbee specification r22.1.0, Section 3.6.3.5.2
1398 *
1399 * @param macSrcAddr The MAC header source address
1400 * @param nwkHeader The received network Header
1401 * @param payload The received route request command payload
1402 * @param linkCost The link cost associated to the received RREQ
1403 */
1404 void ReceiveRREQ(Mac16Address macSrcAddr,
1405 uint8_t linkCost,
1406 ZigbeeNwkHeader nwkHeader,
1408
1409 /**
1410 * Construct and send a route reply command.
1411 * See Zigbee specification r22.1.0, Section 3.4.2
1412 *
1413 * @param nextHop The address of the next hop in the path back to the RREQ originator.
1414 * @param originator The address of the originator device of the first RREQ.
1415 * @param responder The address of the first device responding to the RREQ with a RREP.
1416 * @param rreqId The RREQ identifier of the originator RREQ.
1417 * @param pathcost The sum value of link costs along the way.
1418 */
1419 void SendRREP(Mac16Address nextHop,
1420 Mac16Address originator,
1421 Mac16Address responder,
1422 uint8_t rreqId,
1423 uint8_t pathcost);
1424
1425 /**
1426 * Handles the reception of a route reply command.
1427 * See Zigbee specification r22.1.0, Section 3.6.3.5.3
1428 *
1429 * @param macSrcAddr The MAC source address of this reply (a.k.a. previous hop)
1430 * @param nwkHeader The received network Header
1431 * @param payload The received route reply command payload
1432 * @param linkCost The link cost associated to the received RREP
1433 */
1434 void ReceiveRREP(Mac16Address macSrcAddr,
1435 uint8_t linkCost,
1436 ZigbeeNwkHeader nwkHeader,
1438
1439 /**
1440 * Process a Multicast Frame received as a member of a multicast group.
1441 * See Zigbee specification r22.1.0 Section 3.6.6.3
1442 *
1443 * @param nwkHeader The network header of the received multicast frame.
1444 * @param msdu The MSDU (MSDU = MAC Service Data Unit) received
1445 * @param params The MCPS-DATA.indication parameters associated to the received frame.
1446 */
1448 Ptr<Packet> msdu,
1450
1451 /**
1452 * Process a Multicast Frame received as a non member of a multicast group.
1453 * See Zigbee specification r22.1.0 Section 3.6.6.4
1454 *
1455 * @param nwkHeader The network header of the received multicast frame.
1456 * @param msdu The MSDU (MSDU = MAC Service Data Unit) received
1457 * @param params The MCPS-DATA.indication parameters associated to the received frame.
1458 */
1460 Ptr<Packet> msdu,
1462
1463 /**
1464 * Returns true if the address is a broadcast address according to
1465 * Zigbee specification r22.1.0, Section 3.6.5, Table 3-69
1466 *
1467 * @param address The address to compare to a broadcast address
1468 * @return True if the address in a broadcast address
1469 */
1470 bool IsBroadcastAddress(Mac16Address address);
1471
1472 /**
1473 * Send a data unicast packet, and if necessary look for the next hop route
1474 * and store the pending data transmission until a route is found.
1475 *
1476 * @param packet The NPDU (nwkHeader + data payload) to transmit.
1477 * @param nwkHandle The NWK handle associated to this packet (nsdu handle).
1478 * A handle of 0 implies that the unicast transmission is a
1479 * retransmission and do not requires a handle which is
1480 * used to identify a packet in confirmations to
1481 * requests (NLDE-DATA.confirm).
1482 */
1483 void SendDataUcst(Ptr<Packet> packet, uint8_t nwkHandle);
1484
1485 /**
1486 * Send a data broadcast packet, and add a record to the broadcast transaction
1487 * table (BTT).
1488 *
1489 * @param packet The NPDU (nwkHeader + data payload) to transmit.
1490 * @param nwkHandle The NWK handle associated to this packet (nsdu handle).
1491 * A handle of 0 implies that the unicast transmission is a
1492 * retransmission and do not requires a handle which is
1493 * used to identify a packet in confirmations to
1494 * requests (NLDE-DATA.confirm).
1495 */
1496 void SendDataBcst(Ptr<Packet> packet, uint8_t nwkHandle);
1497
1498 /**
1499 * Send a data multicast packet to all the members of a multicast group.
1500 *
1501 * @param packet The NPDU (nwkHeader + data payload) to transmit.
1502 * @param nwkHandle The NWK handle associated to this packet (nsdu handle).
1503 * A handle of 0 implies that the unicast transmission is a
1504 * retransmission and do not requires a handle which is
1505 * used to identify a packet in confirmations to
1506 * requests (NLDE-DATA.confirm).
1507 */
1508 void SendDataMcst(Ptr<Packet> packet, uint8_t nwkHandle);
1509
1510 /**
1511 * Find the next hop in route to a destination.
1512 *
1513 * See RouteDiscoveryStatus enumeration for full information on the returned status.
1514 *
1515 * @param macSrcAddr The MAC address received from the previous hop.
1516 * @param pathCost The path cost accumulated in the route discovery so far.
1517 * @param nwkHeader The network header created at the initiator or the received RREQ.
1518 * @param payload The payload header of the initiator or the received RREQ.
1519 * @param nextHop If the destination is found in the routing or neighbor tables
1520 * it contains the address of the next hop towards the destination.
1521 *
1522 * @return The RouteDiscoveryStatus of the route search attempt
1523 */
1525 uint8_t pathCost,
1526 ZigbeeNwkHeader nwkHeader,
1528 Mac16Address& nextHop);
1529
1530 /**
1531 * Process Many-To-One routes. In essence, creating new routes or updating
1532 * existing ones from information contained in the received RREQs.
1533 *
1534 * @param macSrcAddr The MAC address received from the previous hop
1535 * @param pathCost The path cost accumulated in the route discovery so far.
1536 * @param nwkHeader The network header created at the initiator or the received RREQ.
1537 * @param payload The payload header created at the initiator or the received RREQ.
1538 *
1539 * @return The resulting RouteDiscoveryStatus of the Many-To-One process request.
1540 */
1542 uint8_t pathCost,
1543 ZigbeeNwkHeader nwkHeader,
1545
1546 /**
1547 * Provides uniform random values
1548 */
1550
1551 /**
1552 * Provides uniform random values for the route request jitter
1553 */
1555
1556 /**
1557 * Provides uniform random values for the broadcast jitter
1558 */
1560
1561 /**
1562 * Temporarily store beacons information from POS routers and PAN coordinators
1563 * during a network-discovery process.
1564 */
1565 std::vector<NetworkDescriptor> m_networkDescriptorList;
1566
1567 /**
1568 * Points to the beacon payload used during the network formation process.
1569 */
1571
1572 /**
1573 * Used to store the value of the PHY current channel.
1574 */
1576
1577 /////////////////////////////
1578 // Network layer constants //
1579 /////////////////////////////
1580
1581 /**
1582 * Indicates whether the device is capable of becoming the ZigBee coordinator
1583 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant in the specification
1584 * but here is defined as variable to be able to change the devices capabilities.
1585 */
1587
1588 /**
1589 * Indicates the version of the ZigBee NWK protocol in the device.
1590 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant in the specification
1591 * but here is defined as variable to be able to change the devices capabilities.
1592 */
1594
1595 /**
1596 * Indicates the duration until a route discovery expires.
1597 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant in the specification
1598 * but here is defined as variable to be able to change the devices capabilities.
1599 */
1601
1602 /**
1603 * The number of times the first broadcast transmission of a route request command
1604 * frame is retried. Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1605 * in the specification but here is defined as variable to allow the selection of values
1606 * per device.
1607 */
1609
1610 /**
1611 * The number of times the broadcast transmission of a route request command frame is
1612 * retried on relay by an intermediate Zigbee router or coordinator.
1613 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1614 * in the specification but here is defined as variable to allow the selection of values
1615 * per device.
1616 */
1618
1619 /**
1620 * Count the number of retries this device has transmitted an RREQ
1621 */
1623
1624 /**
1625 * Duration between retries of a broadcast route request command frame.
1626 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1627 * in the specification but here is defined as variable to allow the selection of values
1628 * per device.
1629 */
1631
1632 /**
1633 * Minimum Route request broadcast jitter time (msec).
1634 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1635 * in the specification but here is defined as variable to allow the selection of values
1636 * per device.
1637 */
1639
1640 /**
1641 * Maximum Route request broadcast jitter time (msec).
1642 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1643 * in the specification but here is defined as variable to allow the selection of values
1644 * per device.
1645 */
1647
1648 /**
1649 * Minimum Broadcast jitter time (msec).
1650 * Zigbee Specification r22.1.0, Table 3-57. Defined as a constant
1651 * in the specification but here is defined as variable to allow the selection of values
1652 * per device.
1653 */
1655
1656 //////////////////////////////
1657 // Network layer attributes //
1658 //////////////////////////////
1659
1660 /**
1661 * A value that determines the method used to assign addresses.
1662 * See Zigbee specification r22.1.0, Table 3-58
1663 */
1665
1666 /**
1667 * The depth a device can have.
1668 * Default value defined in the stack profile.
1669 * See Zigbee specification r22.1.0 Layer protocol implementation conformance statement (PICS)
1670 * and stack profiles (Section 10.4.2.1)
1671 */
1673
1674 /**
1675 * The number of children a device is allowed to have on its current network.
1676 * Default value defined in the stack profile.
1677 * See Zigbee PRO/2007 Layer protocol implementation conformance statement (PICS)
1678 * and stack profiles (Section 10.4.2.1)
1679 */
1681
1682 /**
1683 * The number of routers any one device is allowed to have as children. This is
1684 * determined by the zigbee coordinator for all devices in the network.
1685 * This value is not used if stochastic address allocation is used.
1686 * Default value defined in the stack profile.
1687 * See Zigbee PRO/2007 Layer protocol implementation conformance statement (PICS)
1688 * and stack profiles (Section 10.4.2.1)
1689 */
1691
1692 /**
1693 * Describes the current stack profile used in this NWK layer
1694 */
1696
1697 /**
1698 * Indicates the index of the requested timeout field that contains the timeout
1699 * in minutes for any end device that does not negotiate a different timeout
1700 * value.
1701 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1702 */
1704
1705 /**
1706 * The extended PAN identifier for the PAN of which the device is a member.
1707 * A value of 0 means that the extended PAN identifier is unknown.
1708 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1709 */
1711
1712 /**
1713 * The 16-bit address that the device uses to communicate with the PAN.
1714 * This attribute reflects the value of the MAC PIB attribute macShortAddress
1715 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1716 */
1718
1719 /**
1720 * The EUI 64 bit IEEE address of the local device.
1721 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1722 */
1724
1725 /**
1726 * This NIB attribute should, at all times, have the same value as macPANId .
1727 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1728 */
1729 uint16_t m_nwkPanId;
1730
1731 /**
1732 *
1733 * The behavior depends upon whether the device is a FFD or RFD.
1734 * For RFD, this records the information received in an End device timeout
1735 * response command indicating the parent information (Table 3-55).
1736 * For FFD, this records the device's local capabilities.
1737 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1738 */
1740
1741 /**
1742 * This NIB attribute contains the device capability information established
1743 * at network joining time.
1744 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1745 */
1747
1748 /**
1749 * This NIB attribute is a flag determining if this device is a concentrator
1750 * (Use in Many-To-One routing).
1751 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1752 */
1754
1755 /**
1756 * This NIB attribute indicates the hop count radius for concentrator
1757 * route discoveries (Used by Many-To-One routing).
1758 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1759 */
1761
1762 /**
1763 * The time in seconds between concentrator route discoveries.
1764 * If set to 0x0000, the discoveries are done at the start up
1765 * and by the next higher layer only.
1766 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1767 */
1769
1770 /**
1771 * This NIB attribute indicates whether the NWK layer should assume the ability to
1772 * use hierarchical routing.
1773 * True = Hierarchical routing False = Never use hierarchical routing
1774 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1775 */
1777
1778 /**
1779 * If false, the NWK layer shall calculate the link cost from all neighbor nodes
1780 * using the LQI values reported by the MAC layer, otherwise it shall report a
1781 * constant value (7).
1782 * See Zigbe Specification r22.1.0, Table 3-58 (NIB attributes)
1783 */
1785
1786 /**
1787 * Describes the current route symmetry:
1788 * True: Routes are considered to be symmetric links. Backward and forward routes
1789 * are created during one-route discovery and they are identical.
1790 * False: Routes are not consider to be comprised of symmetric links. Only the forward
1791 * route is stored during route discovery.
1792 * See Zigbe Specification r22.1.0, Table 3-58 (NIB attributes)
1793 */
1795
1796 /**
1797 * The maximum number of retries allowed after a broadcast transmission failure
1798 * See Zigbe Specification r22.1.0, Table 3-58 (NIB attributes)
1799 */
1801
1802 /**
1803 * The maximum time duration in milliseconds allowed for the parent all the child devices to
1804 * retransmit a broadcast message.
1805 * See Zigbe Specification r22.1.0, Table 3-58 (NIB attributes)
1806 * See Zigbee-2007 Layer PICS and Stack Profiles
1807 */
1809
1810 /**
1811 * Time duration that a broadcast message needs to encompass the entire network.
1812 * Its default value is calculated based on other NIB attributes.
1813 * See Zigbe Specification r22.1.0, Table 3-58 (NIB attributes)
1814 */
1816
1817 /**
1818 * The sequence number used to identify outgoing frames
1819 * See Zigbee specification r22.1.0, Table 3-58 (NIB attributes)
1820 */
1822
1823 /**
1824 * The counter used to identify route request commands
1825 */
1827
1828 /**
1829 * The handle assigned when doing a transmission request
1830 * to the MAC layer
1831 */
1833
1834 /**
1835 * The expiration time of routing table entry.
1836 * This value is not standardized and it is implementation dependent.
1837 */
1839};
1840
1841} // namespace zigbee
1842} // namespace ns3
1843
1844#endif /* ZIGBEE_NWK_H */
Callback template class.
Definition callback.h:422
This class can contain 16 bit addresses.
an EUI-64 address
Object()
Constructor.
Definition object.cc:96
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:67
Simulation virtual time values and global simulation resolution.
Definition nstime.h:96
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:49
The Broadcast Transaction Table (BTT) The BTT is used to keep track of data broadcast transactions.
The network layer Network Table See Zigbee specification r22.1.0, 3.6.1.5.
A table that keeps record of neighbors devices NWK extended PAN ids (64 bits) and their related 16 bi...
The network layer Route Discovery Table See Zigbee specification r22.1.0, 3.6.3.2.
The network layer Routing Table.
A table storing information about upcoming route request retries.
Represent the NWK Header with the Frame Control and Routing fields Zigbee Specification r22....
void SendDataUcst(Ptr< Packet > packet, uint8_t nwkHandle)
Send a data unicast packet, and if necessary look for the next hop route and store the pending data t...
NeighborTable m_nwkNeighborTable
The network layer neighbor table See Zigbee specification r22.1.0, 3.6.1.5.
RouteDiscoveryStatus ProcessManyToOneRoute(Mac16Address macSrcAddr, uint8_t pathCost, ZigbeeNwkHeader nwkHeader, ZigbeePayloadRouteRequestCommand payload)
Process Many-To-One routes.
ZigbeeNwk()
Default constructor.
Mac64Address GetIeeeAddress() const
Obtain this device 64 bit IEEE address (A.K.A.
NlmeStartRouterRequestParams m_startRouterParams
Temporarily store the NLME-START-ROUTER.request parameters during the router initialization process.
Ptr< ZigbeeGroupTable > m_nwkGroupIdTable
The Group Table used by this Zigbee NWK.
uint8_t m_nwkConcentratorDiscoveryTime
The time in seconds between concentrator route discoveries.
void DisposePendingTx()
Dispose of all PendingTxPkt accumulated in the pending transmission queue.
uint8_t m_nwkCapabilityInformation
This NIB attribute contains the device capability information established at network joining time.
Callback< void, NlmeDirectJoinConfirmParams > NlmeDirectJoinConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:663
void MlmeOrphanIndication(lrwpan::MlmeOrphanIndicationParams params)
IEEE 802.15.4-2011 sections 6.2.7.1, Zigbee Specification r22.1.0 Section 3.6.1.4....
void UpdateBeaconPayload()
Updates the content of the beacon payload with the most recent information in the NWK.
TracedCallback< uint8_t, Mac16Address, uint8_t > m_rreqRetriesExhaustedTrace
A trace source that fires when a node has reached the maximum number of RREQ retries allowed.
Mac16Address AllocateNetworkAddress()
Used by a Zigbee coordinator or router to allocate a 16 bit address (A.K.A short address or network a...
void NlmeDirectJoinRequest(NlmeDirectJoinRequestParams params)
Zigbee Specification r22.1.0, section 3.2.2.16 and 3.6.1.4.3 NLME-DIRECT-JOIN.request Allows the next...
RoutingTable m_nwkRoutingTable
The network layer routing table See Zigbee specification r22.1.0, 3.6.3.2.
double m_nwkcMinRREQJitter
Minimum Route request broadcast jitter time (msec).
SequenceNumber8 m_nwkSequenceNumber
The sequence number used to identify outgoing frames See Zigbee specification r22....
Callback< void, NlmeRouteDiscoveryConfirmParams > NlmeRouteDiscoveryConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:657
NlmeNetworkFormationRequestParams m_netFormParams
The parameters used during a NLME-NETWORK-FORMATION.request.
void McpsDataConfirm(lrwpan::McpsDataConfirmParams params)
IEEE 802.15.4-2011 section 6.3.2 MCPS-DATA.confirm Reports the results of a request to a transfer dat...
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random values.
NlmeJoinIndicationParams m_joinIndParams
Temporarily store the NLME-JOIN.indication parameters while the join operations (asocciation) conclud...
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream) const
Print the entries in the routing table.
Mac16Address FindRoute(Mac16Address dst, bool &neighbor)
Search for a specific destination in this device neighbor and routing tables.
void SetNlmeJoinConfirmCallback(NlmeJoinConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
void NlmeStartRouterRequest(NlmeStartRouterRequestParams params)
Zigbee Specification r22.1.0, section 3.2.2.9 NLME-START-ROUTER.request This primitive allows the nex...
void SetNlmeRouteDiscoveryConfirmCallback(NlmeRouteDiscoveryConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
uint8_t m_currentChannel
Used to store the value of the PHY current channel.
Time m_routeExpiryTime
The expiration time of routing table entry.
static TypeId GetTypeId()
Get the type ID.
Definition zigbee-nwk.cc:35
void NldeDataRequest(NldeDataRequestParams params, Ptr< Packet > packet)
Zigbee Specification r22.1.0, Section 3.2.1.1 NLDE-DATA.request Request to transfer a NSDU.
void SendRREP(Mac16Address nextHop, Mac16Address originator, Mac16Address responder, uint8_t rreqId, uint8_t pathcost)
Construct and send a route reply command.
void PrintNeighborTable(Ptr< OutputStreamWrapper > stream) const
Print the entries in the neighbor table.
void MlmeSetConfirm(lrwpan::MlmeSetConfirmParams params)
IEEE 802.15.4-2011 section 6.2.11.2 MLME-SET.confirm Reports the result of an attempt to change a MAC...
void UpdateBeaconPayloadLength()
Create and store a MAC beacon payload, then updates its registered size in the MAC.
StackProfile m_nwkStackProfile
Describes the current stack profile used in this NWK layer.
NlmeDirectJoinConfirmCallback m_nlmeDirectJoinConfirmCallback
This callback is used by the next layer of a zigbee coordinator or router to be notified of the resul...
bool m_nwkReportConstantCost
If false, the NWK layer shall calculate the link cost from all neighbor nodes using the LQI values re...
Time m_nwkcRREQRetryInterval
Duration between retries of a broadcast route request command frame.
Ptr< UniformRandomVariable > m_bcstJitter
Provides uniform random values for the broadcast jitter.
void DoInitialize() override
Initialize() implementation.
NlmeNetworkFormationConfirmCallback m_nlmeNetworkFormationConfirmCallback
This callback is used to to notify the results of a network formation to the APS sublayer making the ...
void MlmeCommStatusIndication(lrwpan::MlmeCommStatusIndicationParams params)
IEEE 802.15.4-2011 section 6.2.4.2 MLME-COMM-STATUS.indication Allows the MAC MLME to indicate a comm...
PanIdTable m_panIdTable
Use to keep track of neighboring 16 bit PAN id.
Mac16Address m_nwkNetworkAddress
The 16-bit address that the device uses to communicate with the PAN.
RouteDiscoveryStatus FindNextHop(Mac16Address macSrcAddr, uint8_t pathCost, ZigbeeNwkHeader nwkHeader, ZigbeePayloadRouteRequestCommand payload, Mac16Address &nextHop)
Find the next hop in route to a destination.
void SetMac(Ptr< lrwpan::LrWpanMacBase > mac)
Set the underlying MAC to use in this Zigbee NWK.
uint8_t m_nwkParentInformation
The behavior depends upon whether the device is a FFD or RFD.
void ReceiveMulticastNonMemberFrame(ZigbeeNwkHeader nwkHeader, Ptr< Packet > msdu, lrwpan::McpsDataIndicationParams params)
Process a Multicast Frame received as a non member of a multicast group.
SequenceNumber8 m_macHandle
The handle assigned when doing a transmission request to the MAC layer.
Callback< void, NldeDataIndicationParams, Ptr< Packet > > NldeDataIndicationCallback
This callback is called after a NSDU has successfully received and NWK push it to deliver it to the n...
Definition zigbee-nwk.h:633
NlmeJoinRequestParams m_joinParams
The parameters used during a NLME-JOIN.request.
void MlmeBeaconNotifyIndication(lrwpan::MlmeBeaconNotifyIndicationParams params)
IEEE 802.15.4-2011, Section 6.2.4.1 MLME-BEACON-NOTIFY.indication Allows the MAC MLME to indicate the...
void SetNlmeJoinIndicationCallback(NlmeJoinIndicationCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
uint8_t m_nwkcInitialRREQRetries
The number of times the first broadcast transmission of a route request command frame is retried.
void SetNlmeNetworkDiscoveryConfirmCallback(NlmeNetworkDiscoveryConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
void MlmeAssociateConfirm(lrwpan::MlmeAssociateConfirmParams params)
IEEE 802.15.4-2011 section MlME-ASSOCIATE.confirm Report the results of an associate request attempt.
void EnqueuePendingTx(Ptr< Packet > p, uint8_t nsduHandle)
Enqueue a packet in the pending transmission queue until a route is discovered for its destination.
void NlmeNetworkDiscoveryRequest(NlmeNetworkDiscoveryRequestParams params)
Zigbee Specification r22.1.0, section 3.2.2.3 NLME-NETWORK-DISCOVERY.request Allows the next higher l...
Ptr< NetFormPendingParamsGen > m_netFormParamsGen
The values temporarily stored as a result of the initial steps of a NLME-NETWORK-FORMATION....
NlmeStartRouterConfirmCallback m_nlmeStartRouterConfirmCallback
This callback is used by the next layer of a zigbee router or device to be notified of the result of ...
NlmeJoinConfirmCallback m_nlmeJoinConfirmCallback
This callback is used by the next layer of a zigbee router or device to be notified of the result of ...
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void ReceiveMulticastMemberFrame(ZigbeeNwkHeader nwkHeader, Ptr< Packet > msdu, lrwpan::McpsDataIndicationParams params)
Process a Multicast Frame received as a member of a multicast group.
void NlmeJoinRequest(NlmeJoinRequestParams params)
Zigbee Specification r22.1.0, section 3.2.2.13 NLME-JOIN.request This primitive allows the next highe...
Callback< void, NlmeJoinIndicationParams > NlmeJoinIndicationCallback
This callback is used to notify the next higher layer with an indication that a new device has succes...
Definition zigbee-nwk.h:675
uint8_t m_nwkConcentratorRadius
This NIB attribute indicates the hop count radius for concentrator route discoveries (Used by Many-To...
double m_nwkcMaxRREQJitter
Maximum Route request broadcast jitter time (msec).
Mac64Address m_nwkIeeeAddress
The EUI 64 bit IEEE address of the local device.
void SetGroupTable(Ptr< ZigbeeGroupTable > groupTable)
Get the group table used by this Zigbee NWK.
void SetNlmeStartRouterConfirmCallback(NlmeStartRouterConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
Time m_nwkPassiveAckTimeout
The maximum time duration in milliseconds allowed for the parent all the child devices to retransmit ...
Callback< void, NlmeJoinConfirmParams > NlmeJoinConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:669
void ReceiveRREP(Mac16Address macSrcAddr, uint8_t linkCost, ZigbeeNwkHeader nwkHeader, ZigbeePayloadRouteReplyCommand payload)
Handles the reception of a route reply command.
uint16_t m_nwkPanId
This NIB attribute should, at all times, have the same value as macPANId .
void SetNldeDataConfirmCallback(NldeDataConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
Ptr< Packet > m_beaconPayload
Points to the beacon payload used during the network formation process.
uint8_t m_countRREQRetries
Count the number of retries this device has transmitted an RREQ.
PendingPrimitiveNwk m_pendPrimitiveNwk
Indicates the current primitive in use in the NWK layer.
bool IsBroadcastAddress(Mac16Address address)
Returns true if the address is a broadcast address according to Zigbee specification r22....
double m_nwkcMaxBroadcastJitter
Minimum Broadcast jitter time (msec).
void SendDataMcst(Ptr< Packet > packet, uint8_t nwkHandle)
Send a data multicast packet to all the members of a multicast group.
BroadcastTransactionTable m_btt
The broadcast transaction table.
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
uint8_t m_nwkMaxBroadcastRetries
The maximum number of retries allowed after a broadcast transmission failure See Zigbe Specification ...
uint32_t m_maxPendingTxQueueSize
The maximum size of the pending transaction queue.
uint8_t m_nwkMaxDepth
The depth a device can have.
AddrAllocMethod m_nwkAddrAlloc
A value that determines the method used to assign addresses.
std::vector< NetworkDescriptor > m_networkDescriptorList
Temporarily store beacons information from POS routers and PAN coordinators during a network-discover...
NldeDataConfirmCallback m_nldeDataConfirmCallback
This callback is used to respond to data PDU (NSDU) transfer request issued by APS sublayer to the NW...
Callback< void, NldeDataConfirmParams > NldeDataConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:639
Ptr< lrwpan::LrWpanMacBase > m_mac
Pointer to the underlying MAC connected to this Zigbee NWK.
void MlmeStartConfirm(lrwpan::MlmeStartConfirmParams params)
IEEE 802.15.4-2011 section 7.1.14.2 MLME-START.confirm Reports the results of a network start request...
uint8_t GetLinkCost(uint8_t lqi) const
Obtain the link cost based on the value of the nwkReportConstantCost.
void MlmeAssociateIndication(lrwpan::MlmeAssociateIndicationParams params)
IEEE 802.15.4-2011, Section 6.2.2.2.
void ReceiveRREQ(Mac16Address macSrcAddr, uint8_t linkCost, ZigbeeNwkHeader nwkHeader, ZigbeePayloadRouteRequestCommand payload)
Handles the reception of a route request command.
void PrintRREQRetryTable(Ptr< OutputStreamWrapper > stream) const
Print the entries in the RREQ retry table.
void PrintRouteDiscoveryTable(Ptr< OutputStreamWrapper > stream)
Print the entries in the route discovery table.
Ptr< UniformRandomVariable > m_rreqJitter
Provides uniform random values for the route request jitter.
NwkStatus GetNwkStatus(lrwpan::MacStatus macStatus) const
Cast a Mac layer status to a NWK layer status.
uint16_t m_nwkMaxChildren
The number of children a device is allowed to have on its current network.
uint8_t m_scanEnergyThreshold
The maximum acceptable energy level used in an energy scan taking place during a NLME-NETWORK-FORMATI...
void MlmeScanConfirm(lrwpan::MlmeScanConfirmParams params)
IEEE 802.15.4-2011 section 6.2.10.2 MLME-SCAN.confirm Reports the results of a scan request.
void NlmeNetworkFormationRequest(NlmeNetworkFormationRequestParams params)
Zigbee Specification r22.1.0, Section 3.2.2.5 and 3.6.1.1 NLME-NETWORK-FORMATION.request Request the ...
SequenceNumber8 m_routeRequestId
The counter used to identify route request commands.
NlmeNetworkDiscoveryConfirmCallback m_nlmeNetworkDiscoveryConfirmCallback
This callback is used to to notify the results of a network formation to the APS sublayer making the ...
uint16_t m_nwkEndDeviceTimeoutDefault
Indicates the index of the requested timeout field that contains the timeout in minutes for any end d...
void DisposeTxPktBuffer()
Dispose of all the entries in the TxPkt Buffer.
bool m_nwkIsConcentrator
This NIB attribute is a flag determining if this device is a concentrator (Use in Many-To-One routing...
Time m_nwkcRouteDiscoveryTime
Indicates the duration until a route discovery expires.
uint8_t m_txBufferMaxSize
The maximum size of the transmission buffer.
lrwpan::MlmeAssociateRequestParams m_associateParams
Temporarily store MLME-ASSOCIATE.request parameters during a NLME-JOIN.request.
void(* RreqRetriesExhaustedTracedCallback)(uint8_t rreqId, Mac16Address dst, uint8_t rreqRetriesNum)
TracedCallback signature for RreqRetriesExhaustedTrace events.
void SendRREQ(ZigbeeNwkHeader nwkHeader, ZigbeePayloadRouteRequestCommand payload, uint8_t rreqRetries)
Send a route request command.
Callback< void, NlmeStartRouterConfirmParams > NlmeStartRouterConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:681
RreqRetryTable m_rreqRetryTable
Keep track of all the route request retries.
bool m_nwkUseTreeRouting
This NIB attribute indicates whether the NWK layer should assume the ability to use hierarchical rout...
void SetNlmeNetworkFormationConfirmCallback(NlmeNetworkFormationConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
Time m_nwkNetworkBroadcastDeliveryTime
Time duration that a broadcast message needs to encompass the entire network.
NlmeRouteDiscoveryConfirmCallback m_nlmeRouteDiscoveryConfirmCallback
This callback is used to to notify the results of a network formation to the APS sublayer making the ...
void SetNlmeDirectJoinConfirmCallback(NlmeDirectJoinConfirmCallback c)
Set the callback as part of the interconnections between the NWK and the APS sublayer (or any other h...
bool m_nwkSymLink
Describes the current route symmetry: True: Routes are considered to be symmetric links.
uint32_t m_filteredChannelMask
Contains the list of channels with acceptable energy levels in a bitmap form.
std::deque< Ptr< PendingTxPkt > > m_pendingTxQueue
The pending transaction queue of data packets awaiting to be transmitted until a route to the destina...
uint16_t m_nwkMaxRouters
The number of routers any one device is allowed to have as children.
bool m_nwkcCoordinatorCapable
Indicates whether the device is capable of becoming the ZigBee coordinator Zigbee Specification r22....
void McpsDataIndication(lrwpan::McpsDataIndicationParams params, Ptr< Packet > msdu)
IEEE 802.15.4-2011 section 6.3.3 MCPS-DATA.indication Indicates the reception of an MSDU from MAC to ...
Callback< void, NlmeNetworkFormationConfirmParams > NlmeNetworkFormationConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:645
void BufferTxPkt(Ptr< Packet > p, uint8_t macHandle, uint8_t nwkHandle)
Buffer a copy of a DATA frame for post transmission handling (Transmission failure counts,...
bool RetrieveTxPkt(uint8_t macHandle, Ptr< TxPkt > &txPkt)
Retrieves a previously DATA frame buffered in the TxPkt buffer.
void NlmeRouteDiscoveryRequest(NlmeRouteDiscoveryRequestParams params)
Zigbee Specification r22.1.0, section 3.2.2.33.3 and 3.6.3.5 NLME-ROUTE-DISCOVERY....
std::deque< Ptr< TxPkt > > m_txBuffer
The transmission buffer.
Callback< void, NlmeNetworkDiscoveryConfirmParams > NlmeNetworkDiscoveryConfirmCallback
This callback is used to notify the next higher layer with a confirmation in response to a previously...
Definition zigbee-nwk.h:651
Ptr< lrwpan::LrWpanMacBase > GetMac() const
Get the underlying MAC used by the current Zigbee NWK.
uint8_t GetLQINonLinearValue(uint8_t lqi) const
Get a non linear representation of a Link Quality Indicator (LQI).
void SetNldeDataIndicationCallback(NldeDataIndicationCallback c)
Set the callback for the end of a RX, as part of the interconnections between the NWK and the APS sub...
void DoDispose() override
Destructor implementation.
uint8_t m_nwkcRREQRetries
The number of times the broadcast transmission of a route request command frame is retried on relay b...
bool DequeuePendingTx(Mac16Address dst, Ptr< PendingTxPkt > entry)
Dequeue a packet previously enqueued in the pending transmission queue.
uint8_t m_nwkcProtocolVersion
Indicates the version of the ZigBee NWK protocol in the device.
void SendDataBcst(Ptr< Packet > packet, uint8_t nwkHandle)
Send a data broadcast packet, and add a record to the broadcast transaction table (BTT).
Mac16Address GetNetworkAddress() const
Obtain this device 16 bit network address (A.K.A.
void MlmeGetConfirm(lrwpan::MacStatus status, lrwpan::MacPibAttributeIdentifier id, Ptr< lrwpan::MacPibAttributes > attribute)
IEEE 802.15.4-2011 section 6.2.5.1 MLME-GET.confirm Reports the result of an attempt to obtain a MAC ...
NldeDataIndicationCallback m_nldeDataIndicationCallback
This callback is used to notify incoming packets to the APS sublayer.
RouteDiscoveryTable m_nwkRouteDiscoveryTable
The network route discovery table See Zigbee specification r22.1.0, 3.6.3.2.
uint64_t m_nwkExtendedPanId
The extended PAN identifier for the PAN of which the device is a member.
NlmeJoinIndicationCallback m_nlmeJoinIndicationCallback
This callback is used by the next layer of a zigbee coordinator or router to be notified when a new d...
Represent a variable portion of the zigbee payload header that includes the route reply command.
Represent a variable portion of the zigbee payload header that includes the route request command.
MacPibAttributeIdentifier
IEEE 802.15.4-2006 PHY and MAC PIB Attribute Identifiers Table 23 and Table 86.
MacStatus
The status of a confirm or an indication primitive as a result of a previous request.
SequenceNumber< uint8_t, int8_t > SequenceNumber8
8 bit Sequence number.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1369
AddrAllocMethod
Use to describe the method used to assign addresses in the NWK layer.
Definition zigbee-nwk.h:87
@ STOCHASTIC_ALLOC
Stochastic address allocation (Zigbee Specification r22.1.0 Section 3.6.1.7)
Definition zigbee-nwk.h:90
@ DISTRIBUTED_ALLOC
Distributed address allocation (Zigbee Specification r22.1.0 Section 3.6.1.6)
Definition zigbee-nwk.h:88
JoiningMethod
Use to describe the parameter that controls the method of joining the network.
Definition zigbee-nwk.h:108
@ CHANGE_CHANNEL
The device is to change the operational network channel to that identified in the ScanChannel paramet...
Definition zigbee-nwk.h:113
@ REJOINING
The device is joining the network using the rejoining procedure.
Definition zigbee-nwk.h:112
@ ASSOCIATION
The device is requesting to join a network through association.
Definition zigbee-nwk.h:109
@ DIRECT_OR_REJOIN
The device is joining directly or rejoining using the orphaning procedure.
Definition zigbee-nwk.h:110
NetworkStatusCode
Status codes for network status command frame and route discovery failures.
Definition zigbee-nwk.h:245
@ MANY_TO_ONE_ROUTE_FAILURE
Many to one route failure.
Definition zigbee-nwk.h:258
@ NO_ROUTING_CAPACITY
No routing capacity.
Definition zigbee-nwk.h:250
@ VERIFY_ADDRESS
Verify address.
Definition zigbee-nwk.h:260
@ PAN_IDENTIFIER_UPDATE
PAN identifier update.
Definition zigbee-nwk.h:261
@ VALIDATE_ROUTE
Validate route.
Definition zigbee-nwk.h:256
@ TREE_LINK_FAILURE
Tree link failure.
Definition zigbee-nwk.h:247
@ INDIRECT_TRANSACTION_EXPIRY
Indirect transaction expiry.
Definition zigbee-nwk.h:252
@ BAD_KEY_SEQUENCE_NUMBER
Bad key sequence number.
Definition zigbee-nwk.h:264
@ TARGET_DEVICE_UNAVAILABLE
Target device unavailable.
Definition zigbee-nwk.h:253
@ NO_ROUTE_AVAILABLE
No route available.
Definition zigbee-nwk.h:246
@ LOW_BATTERY
Low battery.
Definition zigbee-nwk.h:249
@ TARGET_ADDRESS_UNALLOCATED
Target address unallocated.
Definition zigbee-nwk.h:254
@ SOURCE_ROUTE_FAILURE
Source route failure.
Definition zigbee-nwk.h:257
@ NO_INDIRECT_CAPACITY
No indirect capacity.
Definition zigbee-nwk.h:251
@ ADDRESS_CONFLICT
Address conflict.
Definition zigbee-nwk.h:259
@ UNKNOWN_COMMAND
Unknown command.
Definition zigbee-nwk.h:265
@ NON_TREE_LINK_FAILURE
Non tree link failure.
Definition zigbee-nwk.h:248
@ PARENT_LINK_FAILURE
Parent link failure.
Definition zigbee-nwk.h:255
@ NETWORK_ADDRESS_UPDATE
Network address update.
Definition zigbee-nwk.h:262
@ BAD_FRAME_COUNTER
Bad frame counter.
Definition zigbee-nwk.h:263
AddressMode
Table 3.2 (Address Mode) NLDE-DATA-Request parameters.
Definition zigbee-nwk.h:76
@ MCST
Multicast Address mode.
Definition zigbee-nwk.h:78
@ NO_ADDRESS
No destination address.
Definition zigbee-nwk.h:77
@ UCST_BCST
Unicast or Broadcast address mode.
Definition zigbee-nwk.h:79
StackProfile
Use to describe the identifier of the zigbee stack profile.
Definition zigbee-nwk.h:98
@ ZIGBEE
Zigbee stack profile 0x01 (a.k.a.
Definition zigbee-nwk.h:99
@ ZIGBEE_PRO
Zigbee stack profile 0x02 (Zigbee Pro, also known as r22.1.0, 3.0)
Definition zigbee-nwk.h:100
std::ostream & operator<<(std::ostream &os, const NwkStatus &state)
Overloaded operator to print the value of a NwkStatus.
RouteDiscoveryStatus
The status returned while attempting to find the next hop in route towards a specific destination or ...
Definition zigbee-nwk.h:122
@ NO_DISCOVER_ROUTE
We are currently not allowed to perform a route discovery for this route (RouteDiscover flag in netwo...
Definition zigbee-nwk.h:130
@ ROUTE_NOT_FOUND
The next hop was not found.
Definition zigbee-nwk.h:125
@ MANY_TO_ONE_ROUTE
A new Many-To-One route was created.
Definition zigbee-nwk.h:135
@ ROUTE_FOUND
The next hop toward the destination was found in our routing table or neighbor table (Mesh route).
Definition zigbee-nwk.h:123
@ NO_ROUTE_CHANGE
No route entry was created or updated during a Many-To-One process.
Definition zigbee-nwk.h:136
@ DISCOVER_UNDERWAY
The route was found in the tables but currently has no next hop.
Definition zigbee-nwk.h:132
@ ROUTE_UPDATED
A route was found and updated with a better route (Mesh route or Many-To-One route)
Definition zigbee-nwk.h:128
@ TABLE_FULL
Either the routing or neighbor table are full.
Definition zigbee-nwk.h:127
static constexpr uint32_t ALL_CHANNELS
Bitmap representing all channels (11~26) LSB b0-b26, b27-b31 MSB Page 0 in Zigbee (250kbps O-QPSK)
Definition zigbee-nwk.h:48
PendingPrimitiveNwk
Indicates a pending NWK primitive.
Definition zigbee-nwk.h:58
@ NLME_NET_DISCV
Pending NLME-NETWORK-DISCOVERY.request primitive.
Definition zigbee-nwk.h:64
@ NLME_DIRECT_JOIN
Pending NLME-DIRECT-JOIN.request primitive.
Definition zigbee-nwk.h:61
@ NLME_NETWORK_FORMATION
Pending NLME-NETWORK-FORMATION.request primitive.
Definition zigbee-nwk.h:60
@ NLME_JOIN
Pending NLME-JOIN.request primitive.
Definition zigbee-nwk.h:62
@ NLDE_NLME_NONE
No pending primitive.
Definition zigbee-nwk.h:59
@ NLME_START_ROUTER
Pending NLME-START-ROUTER.request primitive.
Definition zigbee-nwk.h:63
@ NLME_JOIN_INDICATION
Pending NLME-JOIN.indication primitive.
Definition zigbee-nwk.h:65
@ NLME_ROUTE_DISCOVERY
Pending NLME-ROUTE-DISCOVERY.request primitive.
Definition zigbee-nwk.h:66
@ NLDE_DATA
Pending NLDE-DATA.request primitive.
Definition zigbee-nwk.h:67
NwkStatus
Network layer status values Combines Zigbee Specification r22.1.0 Table 3-73 and and IEEE 802....
Definition zigbee-nwk.h:152
@ BEACON_LOSS
The beacon was lost following a synchronization request.
Definition zigbee-nwk.h:162
@ UNSUPPORTED_LEGACY
Deprecated security used in IEEE 802.15.4-2003.
Definition zigbee-nwk.h:160
@ ALREADY_PRESENT
Already present (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:194
@ READ_ONLY
SET/GET request issued for a read only attribute.
Definition zigbee-nwk.h:187
@ MAX_FRM_COUNTER
Max Frame counter (IEEE 802.15.4, Zigbee specification r22.1.0)
Definition zigbee-nwk.h:200
@ UNSUPPORTED_SECURITY
The security applied is not supported.
Definition zigbee-nwk.h:161
@ DISABLE_TRX_FAILURE
The attempt to disable the transceier has failed.
Definition zigbee-nwk.h:165
@ FULL_CAPACITY
PAN at capacity.
Definition zigbee-nwk.h:155
@ NO_DATA
No response data were available following a request.
Definition zigbee-nwk.h:173
@ IMPROPER_KEY_TYPE
The key is not allowed to be used with that frame type.
Definition zigbee-nwk.h:158
@ INVALID_PARAMETER_MAC
Invalid parameter in response to a request passed to the MAC.
Definition zigbee-nwk.h:170
@ TRANSACTION_OVERFLOW
There is no capacity to store the transaction.
Definition zigbee-nwk.h:179
@ SUPERFRAME_OVERLAP
Coordinator sperframe and this device superframe tx overlap.
Definition zigbee-nwk.h:188
@ NOT_PERMITED
Not permitted (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:192
@ INVALID_REQUEST
Invalid request (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:191
@ OUT_OF_CAP
(Deprecated) See IEEE 802.15.4-2003
Definition zigbee-nwk.h:175
@ NO_NETWORKS
No network (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:199
@ SECURITY_ERROR
Cryptographic process of the frame failed(FAILED_SECURITY_CHECK).
Definition zigbee-nwk.h:166
@ UNSUPPORTED_ATTRIBUTE
Unsupported attribute (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:198
@ TRANSACTION_EXPIRED
The transaction expired and its information discarded.
Definition zigbee-nwk.h:178
@ REALIGMENT
A coordinator realigment command has been received.
Definition zigbee-nwk.h:177
@ SUCCESS
The operation was completed successfully.
Definition zigbee-nwk.h:154
@ LIMIT_REACHED
Limit reached during network scan (IEEE 802.15.4-2011)
Definition zigbee-nwk.h:208
@ NO_SHORT_ADDRESS
Failure due to unallocated 16-bit short address.
Definition zigbee-nwk.h:174
@ INVALID_INTERFACE
Invalid interface (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:207
@ INVALID_INDEX
A MAC PIB write failed because specified index is out of range.
Definition zigbee-nwk.h:186
@ UNAVAILABLE_KEY
Unavailable key, unknown or blacklisted.
Definition zigbee-nwk.h:181
@ INVALID_PARAMETER
Invalid Parameter (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:190
@ INVALID_ADDRESS
Invalid source or destination address.
Definition zigbee-nwk.h:182
@ FRAME_NOT_BUFFERED
Frame not buffered (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:206
@ IMPROPER_SECURITY_LEVEL
Insufficient security level expected by the recipient.
Definition zigbee-nwk.h:159
@ INVALID_HANDLE
When purging from TX queue handle was not found.
Definition zigbee-nwk.h:169
@ CHANNEL_ACCESS_FAILURE
A Tx could not take place due to activity in the CH.
Definition zigbee-nwk.h:163
@ TX_ACTIVE
The transceiver was already enabled.
Definition zigbee-nwk.h:180
@ BAD_CCM_OUTPUT
Bad ccm output (IEEE 802.15.4, Zigbee specification r22.1.0)
Definition zigbee-nwk.h:202
@ UNKNOWN_DEVICE
Unknown device (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:197
@ ACCESS_DENIED
PAN access denied.
Definition zigbee-nwk.h:156
@ NEIGHBOR_TABLE_FULL
Neighbor table full (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:196
@ FRAME_TOO_LONG
Frame more than aMaxPHYPacketSize or too large for CAP or GTS.
Definition zigbee-nwk.h:167
@ BT_TABLE_FULL
Bt table full (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:205
@ DENIED
The GTS request has been denied by the PAN coordinator.
Definition zigbee-nwk.h:164
@ ROUTE_DISCOVERY_FAILED
Route discovery failed (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:203
@ SYNC_FAILURE
Sync Failure (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:195
@ TRACKING_OFF
This device is currently not tracking beacons.
Definition zigbee-nwk.h:185
@ COUNTER_ERROR
The frame counter of the received frame is invalid.
Definition zigbee-nwk.h:157
@ NO_ACK
No acknowledgment was received after macMaxFrameRetries.
Definition zigbee-nwk.h:171
@ STARTUP_FAILURE
Startup failure (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:193
@ ON_TIME_TOO_LONG
RX enable request fail due to syms.
Definition zigbee-nwk.h:183
@ NO_BEACON
A scan operation failed to find any network beacons.
Definition zigbee-nwk.h:172
@ SCAN_IN_PROGRESS
The dev was scanning during this call (IEEE 802.5.4)
Definition zigbee-nwk.h:209
@ PAST_TIME
Rx enable request fail due to lack of time in superframe.
Definition zigbee-nwk.h:184
@ PAN_ID_CONFLICT
PAN id conflict detected and informed to the coordinator.
Definition zigbee-nwk.h:176
@ ROUTE_ERROR
Route error (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:204
@ NO_KEY
No Key (Zigbee specification r22.1.0)
Definition zigbee-nwk.h:201
@ INVALID_GTS
Missing GTS transmit or undefined direction.
Definition zigbee-nwk.h:168
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MLME-ASSOCIATE.confirm params.
MLME-ASSOCIATE.indication params.
MLME-ASSOCIATE.request params.
MLME-BEACON-NOTIFY.indication params.
MLME-COMM-STATUS.indication params.
MLME-ORPHAN.indication params.
Channel List Structure.
Definition zigbee-nwk.h:274
uint8_t channelPageCount
The number of the channel page structures contained in the channel list structure.
Definition zigbee-nwk.h:275
std::vector< uint32_t > channelsField
The set of channels for a given page.
Definition zigbee-nwk.h:277
A group of pending parameters arranged into a structure during the execution of a NLME-NETWORK-FORMAT...
Definition zigbee-nwk.h:382
uint8_t channel
The channel selected during the initial steps of a network formation.
Definition zigbee-nwk.h:383
uint16_t panId
The PAN id selected during the initial steps of a network formation.
Definition zigbee-nwk.h:385
uint8_t page
The page selected during the initial steps of a network formation.
Definition zigbee-nwk.h:384
Network Descriptor, Zigbee Specification r22.1.0, 3.2.2.4, Table 3-12.
Definition zigbee-nwk.h:475
uint16_t m_panId
The 16-bit PAN identifier of the network.
Definition zigbee-nwk.h:477
uint8_t m_updateId
The value of the UpdateID from the NIB.
Definition zigbee-nwk.h:478
uint8_t m_superframeOrder
The superframe order value of the underlying MAC (Determinates the value of the active period)
Definition zigbee-nwk.h:486
bool m_routerCapacity
TRUE = The device is able to accept join requests from router-capable devices.
Definition zigbee-nwk.h:490
bool m_endDeviceCapacity
TRUE= The device is able to accept join request from end devices.
Definition zigbee-nwk.h:492
StackProfile m_stackProfile
The Zigbee stack profile identifier in use in the discovered network.
Definition zigbee-nwk.h:480
uint8_t m_logCh
The current channel number occupied by the network.
Definition zigbee-nwk.h:479
uint8_t m_beaconOrder
The beacon order value of the underlying MAC.
Definition zigbee-nwk.h:484
uint8_t m_zigbeeVersion
The version of the zigbee protocol in use in the discovered network.
Definition zigbee-nwk.h:482
uint64_t m_extPanId
The 64-bit PAN identifier of the network.
Definition zigbee-nwk.h:476
bool m_permitJoining
TRUE = Indicates that at least one zigbee router on the network currently permits joining.
Definition zigbee-nwk.h:488
NLDE-DATA.confirm params.
Definition zigbee-nwk.h:292
uint8_t m_nsduHandle
The handle associated with the NSDU being confirmed.
Definition zigbee-nwk.h:295
NwkStatus m_status
The status of the corresponding request.
Definition zigbee-nwk.h:293
Time m_txTime
The time indication for the transmitted packet based on the local clock.
Definition zigbee-nwk.h:296
NLDE-DATA.indication params.
Definition zigbee-nwk.h:306
AddressMode m_dstAddrMode
Destination address mode.
Definition zigbee-nwk.h:307
Time m_rxTime
A time indication for the received packet based on the local clock.
Definition zigbee-nwk.h:313
uint32_t m_nsduLength
The number of octets comprising the NSDU being indicated.
Definition zigbee-nwk.h:311
uint8_t m_linkQuality
LQI value delivered by the MAC on receipt of this frame.
Definition zigbee-nwk.h:312
bool m_securityUse
An indication of whether the received data is using security.
Definition zigbee-nwk.h:315
Mac16Address m_srcAddr
The individual device address from which the NSDU originated.
Definition zigbee-nwk.h:310
Mac16Address m_dstAddr
The destination address to which the NSDU was sent.
Definition zigbee-nwk.h:309
NLDE-DATA.request params.
Definition zigbee-nwk.h:324
uint8_t m_nonMemberRadius
Distance in hops that a multicast frame will be relayed by nodes not a member of the group.
Definition zigbee-nwk.h:337
uint32_t m_nsduLength
The number of octets comprising the NSDU to be transferred.
Definition zigbee-nwk.h:328
SequenceNumber8 m_aliasSeqNumber
The sequence number used by this NSDU (ignored if useAlias = false).
Definition zigbee-nwk.h:333
Mac16Address m_dstAddr
The destination address.
Definition zigbee-nwk.h:327
bool m_securityEnable
Enable NWK layer security for the current frame.
Definition zigbee-nwk.h:340
bool m_useAlias
Indicates if next higher layer use an alias for the current frame.
Definition zigbee-nwk.h:330
Mac16Address m_aliasSrcAddr
The source address to be used by this NSDU (ignored ifuseAlias = false).
Definition zigbee-nwk.h:331
uint8_t m_nsduHandle
The NSDU handle.
Definition zigbee-nwk.h:329
uint8_t m_radius
Distance in hops that the frame is allowed to travel through the network.
Definition zigbee-nwk.h:335
AddressMode m_dstAddrMode
Destination address mode.
Definition zigbee-nwk.h:325
uint8_t m_discoverRoute
0x01 Enable Route Discovery | 0x00: Suppress Route discovery
Definition zigbee-nwk.h:339
NLME-DIRECT-JOIN.confirm params.
Definition zigbee-nwk.h:449
NwkStatus m_status
The status the corresponding request.
Definition zigbee-nwk.h:450
Mac64Address m_deviceAddr
The IEEE EUI-64 address in the request to which this is a confirmation.
Definition zigbee-nwk.h:452
NLME-DIRECT-JOIN.request params.
Definition zigbee-nwk.h:436
Mac64Address m_deviceAddr
The EUI-64 bit address of the device directly joined.
Definition zigbee-nwk.h:437
uint8_t m_capabilityInfo
The operating capabilities of the device being directly joined.
Definition zigbee-nwk.h:438
Mac16Address m_networkAddress
The 16 bit network address that was allocated to this device.
Definition zigbee-nwk.h:542
NwkStatus m_status
The status of the corresponding request.
Definition zigbee-nwk.h:540
uint8_t m_macInterfaceIndex
The value of the MAC index from nwkMacInterfaceTable.
Definition zigbee-nwk.h:550
uint64_t m_extendedPanId
The extended 64 bit PAN ID for the network of which the device is now a member.
Definition zigbee-nwk.h:545
ChannelList m_channelList
The structure indicating the current channel of the network that has been joined.
Definition zigbee-nwk.h:547
bool m_enhancedBeacon
True if using enhanced beacons (placeholder, not supported)
Definition zigbee-nwk.h:549
NLME-JOIN.indication params.
Definition zigbee-nwk.h:571
Mac64Address m_extendedAddress
The EUI-64 bit address of an entity that has been added to the network.
Definition zigbee-nwk.h:574
uint8_t m_capabilityInfo
Specifies the operational capabilities of the joining device.
Definition zigbee-nwk.h:576
JoiningMethod m_rejoinNetwork
This parameter indicates the method used to join the network.
Definition zigbee-nwk.h:578
Mac16Address m_networkAddress
The 16 bit network address of an entity that has been added to the network.
Definition zigbee-nwk.h:572
bool m_secureRejoin
True if the rejoin was performed in a secure manner.
Definition zigbee-nwk.h:580
NLME-JOIN.request params.
Definition zigbee-nwk.h:517
JoiningMethod m_rejoinNetwork
This parameter controls the method of joining the network.
Definition zigbee-nwk.h:520
ChannelList m_scanChannelList
The list of all channel pages and the associated channels that shall be scanned.
Definition zigbee-nwk.h:522
uint8_t m_scanDuration
A value used to calculate the length of time to spend scanning each channel.
Definition zigbee-nwk.h:524
uint8_t m_capabilityInfo
The operating capabilities of the device being directly joined (Bit map).
Definition zigbee-nwk.h:526
uint64_t m_extendedPanId
The 64 bit PAN identifier of the the network to join.
Definition zigbee-nwk.h:518
bool m_securityEnable
If the value of RejoinNetwork is REJOINING and this value is true, the device will rejoin securely.
Definition zigbee-nwk.h:528
NLME-NETWORK-DISCOVERY.confirm params.
Definition zigbee-nwk.h:502
uint8_t m_networkCount
Gives the number of networks discovered by the search.
Definition zigbee-nwk.h:505
std::vector< NetworkDescriptor > m_netDescList
A list of descriptors, one for each of the networks discovered.
Definition zigbee-nwk.h:506
NwkStatus m_status
The status of the corresponding request.
Definition zigbee-nwk.h:503
NLME-NETWORK-DISCOVERY.request params.
Definition zigbee-nwk.h:463
uint8_t m_scanDuration
A value used to calculate the length of time to spend.
Definition zigbee-nwk.h:466
ChannelList m_scanChannelList
The list of all channel pages and the associated channels that shall be scanned.
Definition zigbee-nwk.h:464
NLME-NETWORK-FORMATION.confirm params.
Definition zigbee-nwk.h:394
NwkStatus m_status
The status as a result of this request.
Definition zigbee-nwk.h:395
NLME-NETWORK-FORMATION.request params.
Definition zigbee-nwk.h:349
Mac16Address m_distributedNetworkAddress
The address of the device in a distributed network.
Definition zigbee-nwk.h:360
uint8_t m_superFrameOrder
The superframe order.
Definition zigbee-nwk.h:356
bool m_batteryLifeExtension
True: The zigbee coordinator is started supporting battery extension mode.
Definition zigbee-nwk.h:357
bool m_distributedNetwork
Indicates that distributed security will be used.
Definition zigbee-nwk.h:359
ChannelList m_scanChannelList
A structure that contain a description on the pages and their channels to be scanned.
Definition zigbee-nwk.h:350
uint8_t m_scanDuration
The time spent of each channel in symbols: aBaseSuperframeDuriantion * (2n+1).
Definition zigbee-nwk.h:353
NLME-ROUTE-DISCOVERY.confirm params.
Definition zigbee-nwk.h:421
NwkStatus m_status
The status as a result of this request.
Definition zigbee-nwk.h:422
NetworkStatusCode m_networkStatusCode
In case where.
Definition zigbee-nwk.h:424
NLME-ROUTE-DISCOVERY.request params.
Definition zigbee-nwk.h:405
bool m_noRouteCache
This flag determines whether the NWK should establish a route record table.
Definition zigbee-nwk.h:411
AddressMode m_dstAddrMode
Specifies the kind of destination address.
Definition zigbee-nwk.h:406
uint16_t m_radius
Optional parameter that describes the number of hops that the route request will travel through the n...
Definition zigbee-nwk.h:409
Mac16Address m_dstAddr
The 16-bit destination address or Group ID (MCST destination) of the route discovery.
Definition zigbee-nwk.h:407
NLME-START-ROUTER.confirm params.
Definition zigbee-nwk.h:603
NwkStatus m_status
The status of the corresponding request.
Definition zigbee-nwk.h:604
NLME-START-ROUTER.request params.
Definition zigbee-nwk.h:590
uint8_t m_beaconOrder
The beacon order of the network.
Definition zigbee-nwk.h:591
bool m_batteryLifeExt
True if the router supports battery life extension mode.
Definition zigbee-nwk.h:593
uint8_t m_superframeOrder
The superframe order of the network.
Definition zigbee-nwk.h:592
Structure representing an element in the pending transaction queue.
Time expireTime
The expiration time of the packet.
Mac16Address dstAddr
The destination network Address.
uint8_t nsduHandle
The NSDU handle.
Ptr< Packet > txPkt
The pending packet.
Structure representing an element in the Tx Buffer.
Ptr< Packet > txPkt
The buffered packet.
uint8_t nwkHandle
The nwk handle (nsdu handle).
uint8_t macHandle
The mac handle (msdu handle).