• Nenhum resultado encontrado

Joining a network

No documento ZigBee Specification (páginas 175-181)

APS IB

2.3 Service specification

2.3.6 Joining a network

This set of primitives defines how the next higher layer of a device can:

— request to join a network through association.

— request to join a network directly.

— request to re-join a network if orphaned.

2.3.6.1 NLME-JOIN.request

This primitive allows the next higher layer to request to join a network either through association or directly or to re-join a network if orphaned.

97CCB Comment #193 98CCB Comment #137

NLME-START-ROUTER.confirm ( Status )

Table 110 NLME-START-ROUTER.confirm parameters

Name Type Valid range Description

Status Status

INVALID_REQUEST or any status value returned from the

MLME-START.con-firm primitive.

The result of the attempt to initialize a ZigBee routera.

aCCB Comment #137

99CCB Ibid

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

2.3.6.1.1 Semantics of the service primitive The semantics of this primitive is as follows:

Table 111 specifies the parameters for the NLME-JOIN.request primitive.

NLME-JOIN.request (

PANId, JoinAsRouter, RejoinNetwork, ScanChannels, ScanDuration, PowerSource, RxOnWhenIdle, MACSecurity )

Table 111 NLME-JOIN.request parameters

Name Type Valid range Description

PANId Integer 0x0000—0x3fff

The PAN identifier of the network to attempt to join or re-join. The 2 high-est-order bits of this parameter are reserved and shall be set to 0

JoinAsRouter Boolean TRUE or FALSE

The parameter is TRUE if the device is attempting to join the network in the capacity of a ZigBee router. It is FALSE otherwise.

The parameter is valid in requests to join through association and ignored in requests to join directly or to re-join through orphaning.

RejoinNetwork Boolean TRUE or FALSE

The parameter is TRUE if the device is joining directly or rejoining the network using the orphaning procedure.

The parameter is FALSE if the device is requesting to join a network through association.

ScanChannels Bitmap 32 bit field

The five most significant bits (b27,..., b31) are reserved. The 27 least signifi-cant bits (b0, b1,... b26) indicate which channels are to be scanned (1=scan, 0=do not scan) for each of the 27 valid channels (see [B1]).

This parameter is ignored for requests to join through association.

ScanDuration Integer 0x00-0x0e

A value used to calculate the length of time to spend scanning each channel.

The time spent scanning each channel is (aBaseSuperframeDuration * (2n + 1)) symbols, where n is the value of the ScanDuration parameter [B1].

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 2.3.6.1.2 When generated

The next higher layer of a device generates this primitive to request to join a new network using the MAC sub-layer association procedure, to join a new network directly using the MAC sub-layer orphaning procedure or to locate and re-join a network after being orphaned.

2.3.6.1.3 Effect on receipt

On receipt of this primitive by a device that is currently joined to a network, the NLME issues an NLME-JOIN-confirm primitive with the status parameter set to INVALID_REQUEST.

On receipt of this primitive by a device that is not currently joined to a network, the device attempts to join the network specified by the PANId parameter.

PowerSource Integer 0x00 – 0x01

This parameter becomes a part of the CapabilityInformation parameter passed to the MLME-ASSOCI-ATE.request primitive that is gener-ated as the result of a successful executing of a NWK join. The values are:

0x01 = Mains-powered device.

0x00 = other power source. (see [B1]).

RxOnWhenIdle Integer 0x00 – 0x01

This parameter indicates whether the device can be expected to receive packets over the air during idle por-tions of the CAPa. The values are:

0x01 = The receiver is enabled when the device is idle.

0x00 = The receiver may be disabled when the device is idle.

RxOnWhenIdle shall have a value of 0x01 for ZigBee coordinators and Zig-Bee routers operating in a non-bea-con-oriented network.

MACSecurity Integer 0x00 – 0x01

This parameter becomes a part of the CapabilityInformation parameter passed to the MLME-ASSOCI-ATE.request primitive that is gener-ated as the result of a successful executing of a NWK join. The values are:

0x01 = MAC security enabled.

0x00 = MAC security disabled (see [B1]).

aCCB Comment #138

Table 111 NLME-JOIN.request parameters

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

If the RejoinNetwork parameter is FALSE, the NLME issues an MLME-ASSOCIATE.request with its CoordAddress parameter set to the address of a router in its neighbor table for which following conditions are true:

1) The router belongs to the network identified by the PANId parameter.

2) The router is open to join requests.

3) The link quality for frames received from this device is such that a link cost of at most 3 is pro-duced when calculated as described in sub-clause 2.7.3.1.

If a device exists in the neighbor table for which these conditions are true, the LogicalChannel parameter of the MLME-ASSOCIATE.request primitive is set to that found in the neighbor table entry corresponding to the coordinator address of the potential parent. The bit-fields of the CapabilityInformation parameter shall have the values shown in Table 112 and the capability information assembled here shall be stored as the value of the nwkCapabilityInformation NIB attribute (see Table 132). If more than one device meets the requirements outlined above then the joining device shall select the parent with the smallest tree depth.

Table 112 CapabilityInformation bit-fields

Bit Name Description

0 Alternate PAN coordi-nator

This field will always have a value of 0 in implementations of this specifica-tion.

1 Device type

This field will have a value of 1 if the joining device is a ZigBee router and the JoinAsRouter parametera has a value of TRUE. It will have a value of 0 if the device is a ZigBee end device or else a router-capable device that is joining as an end device.

2 Power source

This field shall be set to the value of lowest-order bit of the PowerSource parameter passed to the NLME-JOIN-request primitive. The values are:

0x01 = Mains-powered device.

0x00 = other power source.

3 Receiver on when idle

This field shall be set to the value of the lowest-order bit of the RxOn-WhenIdle parameter passed to the NLME-JOIN.request primitive.

0x01 = The receiver is enabled when the device is idle.

0x00 = The receiver may be disabled when the device is idle.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 If no device exists in the neighbor table for which the conditions are true, then the NWK layer will issue an

NLME-JOIN.confirm with the Status parameter set to NOT_PERMITTED. Otherwise, the NLME issues the NLME-JOIN.confirm with the Status parameter set to the status parameter value returned from the MLME-ASSOCIATE.confirm primitive.

If the RejoinNetwork parameter is FALSE and the JoinAsRouter parameter is set to TRUE, the device will function as a ZigBee router in the network. If the JoinAsRouter parameter is FALSE, then it will join as an end device and not participate in routing.

If a device that is not joined to a network receives this primitive and the RejoinNetwork parameter is equal to TRUE, then it issues an MLME-SCAN.request with the ScanType parameter set to indicate an orphan scan and the scan duration set to the value provided by the ScanDuration parameter. Upon receipt of the MLME-SCAN.confirm primitive, the NLME issues the NLME-JOIN.confirm with the Status parameter set to NO_NETWORKS, if the device was unable to find a network to join, or else to the status parameter value returned from by scan.100

2.3.6.2 NLME-JOIN.indication

This primitive allows the next higher layer of a ZigBee coordinator or ZigBee router to be notified when a new device has successfully joined its network by association.

2.3.6.2.1 Semantics of the service primitive The semantics of this primitive is as follows:

4 – 5 Reserved

This field will always have a value of 0 in implementations of this specifica-tion.

6 Security capability

This field shall be set to the value of lowest-order bit of the MACSecurity parameter passed to the NLME-JOIN-request primitive. The values are:

0x01 = MAC security enabled.

0x00 = MAC security disabled.

7 Allocate address

This field will always have a value of 1 in implementations of this specifica-tion, indicating that the joining device must be issued a 16-bit short address.

aCCB Comment #118

100CCB Comment #105

NLME-JOIN.indication (

ShortAddress, ExtendedAddress, CapabilityInformation SecureJoina

)

aCCB Comment #203

Table 112 CapabilityInformation bit-fields

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

Table 113 specifies the parameters for the NLME-JOIN.indication primitive.

2.3.6.2.2 When generated

This primitive is generated by the NLME of a ZigBee coordinator or router and issued to its next higher layer on successfully adding a new device to the network using the MAC association procedure. An association attempt initiates this primitive following the reception by the NLME of the MLME-ASSOCIATE.indication primitive, the subsequent acceptance of the new device as a network member and the issuance of the MLME-ASSOCIATION.response primitive.

2.3.6.2.3 Effect on receipt

On receipt of this primitive, the next higher layer of a ZigBee coordinator or ZigBee router is notified that a new device has joined its network.

2.3.6.3 NLME-JOIN.confirm

This primitive allows the next higher layer to be notified of the results of its request to join a network.

2.3.6.3.1 Semantics of the service primitive The semantics of this primitive is as follows:

Table 113 NLME-JOIN.indication parameters

Name Type Valid range Description

ShortAddress Network

address 0x0000 – 0xffff The network address of an entity that has been added to the network.

ExtendedAddress 64-bit IEEE

address Any 64-bit, IEEE address. The 64-bit IEEE address of an entity that has been added to the network.

CapabilityInformation Bitmap See [B1]. Specifies the operational capabilities of the joining device.

SecureJoin Boolean TRUE or FALSE

This parameter will be TRUE if the underlying MAC association was per-formed in a secure manner and FALSE otherwise.a

aCCB Comment #203

NLME-JOIN.confirm (

PANId, Status )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 Table 114 specifies the parameters for the NLME-JOIN.confirm primitive.

2.3.6.3.2 When generated

This primitive is generated by the initiating NLME and issued to its next higher layer in response to an NLME-JOIN.request primitive. If the request was successful, the status parameter indicates a successful join attempt. Otherwise, the status parameter indicates an error code of INVALID_REQUEST, NOT_PERMITTED, NO_NETWORKS101 or any status value returned from either the MLME-ASSOCIATE.confirm primitive or the MLME-SCAN.confirm primitive. The reasons for these status values are fully described in sub-clause 2.3.6.1.3.

2.3.6.3.3 Effect on receipt

On receipt of this primitive, the next higher layer of the initiating device is notified of the results of its request to join a network using the MAC sub-layer association procedure, to join directly using the MAC sub-layer orphaning procedure or to re-join a network once it has been orphaned.

No documento ZigBee Specification (páginas 175-181)