• 沒有找到結果。

Chapter 3 HPID Mechanism

3.2 HPID Assignment Mechanism

HPID assignment mechanism is a distributed mechanism, and each entity can assign an HPID by operating independently. Later, we will introduce generation and assignment of HPID in two approaches, “forward HPID” and “backward HPID”.

3.2.1 Forward HPID Approach

Prime-based (4-bit) 0 (6-bit)

Figure 3-4 Forward HPID of the 1st type.

Prime-based (4-bit) ZigBee (6-bit)

Figure 3-5 Forward HPID of the 2nd type.

Generation and assignment of forward HPID are started form the coordinator, node A in Figure 3-2. In the beginning, node A would produce an identity for itself. While other node attaches to the coordinator, it will process mechanism PID1 (the Prime DHCP scheme) to generate a forward HPID of the 1st type as form (a. 0) shown in Figure 3-4.

Among (a. 0), the former code, a, is 4-bit and produced by the mechanism PID1, and the latter code is 6-bit with all zeros. Then node A will assign identities to the attached nodes, such as node B and C. While identities of the 1st type have been assigned, node A would generate an only one forward-HPID of the 2nd type as form (a. b) shown in Figure 3-5. In (a. b), the former code, a, is the same as node A’s former code. The latter code, b, is a 6-bit non-zero number and produced by mechanism PID2 (the ZigBee mechanism) initially. Notice that b of the 2nd type’s identity (a. b) cannot be zero or identity (a. 0) will be duplicated.

While a node has been assigned an identity of the 1st type, it could assign identities to others as node A does. However, if a node is assigned an identity of the 2nd type, it could only generate the 2nd type’s identities. The former code of the generated identity is inherited from the node, and the latter code is produced by the mechanism PID2.

Notice that all of the produced codes should be up bounded by the identity space or within the limited restrictions. Say, the former codes must be within 15 and the latter

codes must be within 63.

Figure 3-6 The forward-HPIDs allocation tree.

Figure 3-6 illustrates the identities allocation tree. Node A (1. 0) is the coordinator and its former code, 1, is the initial number produced by the Prime DHCP scheme. Iden-tities of node B ~ H are the 1st type as well as node A, and the former codes of each are produced via the Prime DHCP scheme by their parents. Take node F (15. 0) for example, the former code, 15, is produced form node C (3. 0). Because the former code 3*3 has been assigned to node E (9. 0), node C produces a sequential code 3*5 for node F. We call that node A ~ H are nodes on a sub-tree yielded by the Prime DHCP scheme, and node A is the root of the sub-tree.

Node I ~ L have identities of the 2nd type with the invariant former codes to their parents, and the latter codes are produced via the ZigBee mechanism by their parents.

Take node I (4. 1) for instance, node D (4. 0) assigns a 2nd type’s identity to it because all of the 1st type’s identities have been assigned. Therefore, the former code of node I, 4, is inherited from its parent, and the latter code, 1, is the initial number produced by the ZigBee mechanism. The latter codes of node I’s children are also produced via the Zig-Bee mechanism. We call that node I, K, and L are nodes on a sub-tree yielded by the

ZigBee mechanism, and node I is the root of the sub-tree. Notice that the latter code of node I and J cannot be zero, otherwise the identity (4. 0) and (15. 0) would be dupli-cated.

However, with this approach, a problem and the related phenomenon must be con-sidered.

Leak of Identities

While HPID format has more than two segments, some identities will never be generated, and we call this problem “leak of identities”. For example, consider that an HPID format is partitioned into three segments and a root node has an identity as form (a. 0. 0) initially. Then the root node will generate identities as form (a. b. 0) to its chil-dren, but b must not be zero to avoid duplicate identities. Similarly, a node with identity as form (a. b. 0) will generate identities as form (a. b. c) with non-zero c. Therefore, identities with form (a, 0, c) will never be generated. This problem appears more sig-nificant while the number of partitioned segments increasing.

Unnatural Assignment

Besides, in Figure 3-6, we also observe that node L gets an identity form node I eventually although it can communicate with both node F and I physically. It is because node F has assigned the only one identity to node J. We call this phenomenon that a node can assign only one identity an “unnatural assignment” phenomenon. Such phe-nomenon always occurs in the leaf nodes of a sub-tree yielded by a certain mechanism.

For example, node A ~ F are nodes on a sub-tree yielded by the Prime DHCP scheme, and node H and F are leaf nodes.

In order to eliminate the problem and the phenomenon, we propose another ap-proach in the next section.

3.2.2 Backward-HPID Approach with Modification

BN = 4

Prime-based (4-bit) 0 (6-bit)

Figure 3-7 Backward-HPID of the 1st type.

The main distinctions of backward and forward HPID approaches are the form of the 1st type’s identities and the identities assignment method of the leaf nodes. In Figure 3-7, the 1st type’s form of the backward-HPID is (0. a) with the all-zero 6-bit former code and the latter code, a, which is 4-bit and produced via the mechanism PID1 (the Prime DHCP scheme). The 2nd type’s form is (a. b) which is the same as the forward HPID.

The former code, a, is inherited from its parent’s code a. In other wards, the former code is the same as the latter code or the former code of its parent’s identity if its parent has the identity with the form (0. a) or (a. b) respectively. While the latter code, b, is 6-bit long and produced via the mechanism PID2 (the ZigBee mechanism) by its parent.

Notice that the coordinator‘s identity cannot be zero, otherwise it will cause the duplicate identities. While the code b in the form (a. b) is zero-allowed, and the problem about leak of identities could be solved here.

(0. 1)

Figure 3-8 The backward-HPIDs allocation tree.

Figure 3-8 illustrates the backward-HPIDs allocation tree which is similar to the forward HPID approach except the 1st type’s identities and the modified behaviors of the leaf nodes, such as node F and H. In order to eliminate the unnatural assignment phenomenon, we let the leaf node takes the role as its only one child in the forward HPID approach. Take node F for example, instead of assigning the identity (15. 0) to its child, it takes the role as the node with identity (15. 0) and can assigns more than one identities via the ZigBee mechanism. In other words, the identity (15. 0) is reserved and never be assigned. Therefore, the modified behaviors of the leaf nodes could eliminate the phenomenon of the unnatural assignment phenomenon.

Besides, BN (Bit Number) used for routing procedure represents the length of the meaningful code, including the inherited and produced code. Learning BN’s value of each HPID costs no additional messages but just through computing the HPID directly.

Say, the 1st type’s identity must be less than 16 and the meaningful code is the last 4-bit produced code, so the BN is equal to 4. Similarly, BN of the 2nd type’s identity is equal to 10 because of the first 4-bit inherited code and the last 6-bit produced code.

相關文件