• 沒有找到結果。

Chapter 2 Related Work

2.3 Summary

Because both structured and unstructured PID assignment mechanisms have their own problems, we want to propose a mechanism to eliminate or reduce these problems, called Hybrid Path-aware Identity (HPID) mechanism. HPID mechanism not only inte-grates structured and unstructured mechanisms but also uses identity space efficiently.

In the following section we will introduce our mechanism.

Chapter 3

HPID Mechanism

Whereas the drawbacks of the conventional PID assignment mechanisms, we propose a Hybrid Path-aware Identity (HPID) mechanism to eliminate or reduce effects of those problems. HPID mechanism integrates different PID mechanisms to combine their fea-tures and provides a hybrid assignment and routing mechanism. According to network characteristics, we could hybridize more than two mechanisms and draw on the strength of each to offset the weakness of the others. Namely, because a structured mechanism has problem about less flexibility of network topology, we could hybridize it with an unstructured mechanism to enhance flexibility. On the other hand, an unstructured mechanism which makes tree structure skew and causes inefficient use of identity space, could be hybridized with a structured one to make the tree structure more balance.

Therefore, hybridizing mechanisms could reduce the problems induced by each mecha-nism and make the use of identity more efficient. Moreover, simulation results indicate that our mechanism provides quite high identity utilization which is better than the other mechanisms.

Next, we will introduce the configuration of HPID format, assignment and routing mechanisms in the following sections.

3.1 HPID Format

PID1 PID2

a bits b bits

Figure 3-1. An illustration of the HPID format.

To perform HPID mechanism, we have to configure an HPID format in the beginning.

First of all, we partition the HPID format into several segments and choose some PID mechanisms for each segment based on network characteristics. Figure 3-1 is an illus-tration of HPID format, and it represents that there are two or more segments partitioned.

Segment 1 is a-bit and uses mechanism PID1, segment 2 is b-bit and uses mechanism PID2, etc. In order to explain our mechanism more clearly, we will take a scenario as an example in the following introduction.

K

Figure 3-2 Part of the distribution of the sensors.

Consider a scenario that we want to averagely distribute hundreds of sensors in a narrow area to control temperature of soil. Furthermore, each sensor should have a unique identity to recognize each other for sending data. Figure 3-2 illustrates the part of sensor distribution, and node A is a coordinator in the sensor network. Sensor devices have limited capabilities, such as memory and power. Therefore, the conventional ta-ble-driven mechanisms which need extensive routing table are not useful in this condi-tion. Conversely, we perform HPID mechanism to allocate identity for a sensor and configure an HPID format as follows.

0 1 2 3 4 5 6 7 8 9

Prime-based ZigBee

Figure 3-3. Configuration of the HPID format.

As the scenario described, we would configure the HPID format as Figure 3-3, and identity length is 10-bit for hundreds of sensors. Due to the network characteristics we partition the format into two segments. The first segment is 4-bit using the Prime DHCP scheme with sub-identity range from 0 to 15. The second segment is 6-bit using the Zig-Bee mechanism with sub-identity range from 0 to 63. Because sensors are distributed in a narrow area, the tree structure should be flexible enough to extend the control range.

Therefore, the Prime DHCP scheme is chosen for the first segment. Besides, the sub-tree structure should be balance for the average sensor distribution, and therefore we choose the ZigBee mechanism in the second segment. The parameters and Cskip values of the ZigBee mechanism are shown as Table 1.

Table 1. Parameters and Cskip values at each depth for ZigBee mechanism.

Parameters nwkMaxRouter 4

nwkMaxChild 4 nwkMaxDepth 3

Depth, d Cskip(d)

0 21 1 5 2 1 3 0

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.

3.3 HPID Routing Mechanism

The HPID routing procedure is performed through computing the HPIDs directly, so it is not necessary to lookup the extensive routing table and fasts the routing latency. Next, we will continue the scenario and introduce the routing mechanism via the backward HPID approach with modification. The routing procedure for the forward HPID ap-proach is trivial and similar to the backward HPID apap-proach, thus we take the backward HPID approach as an example to describe the routing mechanism.

If (RN_BN = D_BN) { if (RN_ID = D_ID)

RN is D;

else if (RN_Former_ID = D_Former_ID) { if (RN_BN = a)

run the routing mechanism of PID_1;

else

run the routing mechanism of PID_2;

} else { run the routing mechanism of PID_2;

else

run the routing mechanism of PID_1;

} else { send to P;

} • RN – the receiving node

• D – the destination node

• P – the parent node of RN

(1)

(2)

(3)

To perform the routing procedure, the receiving node must to compute the HPIDs of the destination and itself when a node receives packets. The receiving node compares the BNs and conforms the following rules.

(1) If the BN of the receiving node is equal to the destination’s, then compare the former code of the HPIDs.

(i) If the former codes are different, then the receiving node sends the packets to its parent directly.

(ii) Otherwise, compare the latter codes of both.

a. If the latter codes are different, then the receiving node performs the routing mechanism corresponding to the latter code. (Namely, if both nodes’ HPIDs are the 1st type, then perform the mechanism PID1. Otherwise, perform the mechanism PID2.)

b. Otherwise, the receiving node is the destination.

(2) If the BN of the receiving node is less than the destination’s, then shift the HPID of the destination right k bits to get the shifted HPID, where k is equal to

receiving node’s BN minus destination’s BN. Compare the latter code of the receiving node and the shifted HPID.

(i) If the latter codes are the same, then the receiving node performs the next routing mechanism corresponding to its latter code (the mechanism PID2).

(ii) Otherwise, the receiving node performs the routing mechanism corre-sponding to its latter code (the mechanism PID1).

(3) If the BN of the receiving node is larger than the destination’s, then the receiv-ing node sends the packets to its parent directly.

K

Figure 3-9 The routing procedure via the backward-HPID.

Figure 3-9 illustrates the routing procedure from node K (source) to node L (desti-nation). In (a), node K compares the HPIDs of itself and node L, and sends the packet to its parent (node I) directly because the former codes are different. Node I sends the packet to node D in (b) similar to (a). When node D receives the packet, it shifts the HPID of node L right 6 bits as L’ because D’s BN is less than L’s SN. Node D forwards the packet via the routing mechanism of the Prime DHCP scheme for the different latter codes of itself and L’, as well as (d), (e) and (f). Finally node F receives the packet and

sends to node L which is the destination via the routing mechanism of the ZigBee mechanism for the dual role as node (15. 0). Finally, the routing procedure is finished.

Chapter 4

Discussions of the HPID Mechanism

We have proposed the HPID assignment mechanism with two approaches, one is for-ward and the other is backfor-ward. Now, we would take the problems induced by each into consideration and process the quantitative analysis.

4.1 Forward Assignment 4.1.1 Leak of Identities

2a +

Figure 4-1 Identities leaking of forward assignment on three segments.

The forward HPID assignment is intuitive and simple, but it has a problem about “leak of identities” while there are more than two partitions. Figure 4-1 illustrates the

situa-tion when the format is partisitua-tioned into three segments with a, b and c bits respectively.

Here, there are three types of identities, (A. 0. 0), (A. B. 0) and (A. B. C). The 2nd type’s identities, (A. B. 0), inherit the former code of the 1st type’s identities, (A. 0. 0). In order not to produce the duplicate identities, the middle code B should not be zero. Similarly, the latter code C of the 3rd type’s identities, (A. B. C), would not be zero either. There-fore, the identities as form (A. 0. C) will never be generated and the amount of those leaking identities is 2a.(2c-1). However, this problem would be more and more serious

as the number of segments increasing.

4.1.2 Quantitative Analysis

ID-length = 16 bits

Figure 4-2 Identities leaking of forward assignment.

The following equation calculates the number of leaking identities when there are k par-titions, where ni represents the length of segment i.

(

2 1

) (

2 1

)

, 2

Figure 4-2 shows the effect of identities leaking on the different number of seg-ments for a 16-bit long identity. This figure indicates the worst, average and best cases of identity leaking among the entire HPID formats and assumes that the length of each segment is at least 2-bit long. We observe that no leaking identities there are while the format is partitioned into only two segments, but the number of leaking identities rises obviously as the number of segments increasing. When there are 8 segments, the num-ber of leaking identities is up to 52416 which is almost 80% of the whole identity space.

This result also tells us that the forward assignment is not impracticable as the HPID format would be partitioned into many segments.

4.2 Backward Assignment 4.2.1 Leak of Identities

In order to reduce the effect of identities leaking, we propose the HPID assignment with the other direction, called backward HPID assignment. However, the backward assign-ment can not avoid the leak of identity for all HPID formats. In other words, the back-ward assignment can prevent the leak of identity just while the length of each segment is the same. But if the length of the first segment is shorter than the others’, the problem of identities leaking still occurs. The issue about the longer length of the first segment will be discussed later in the next section. Unlike the forward assignment, the backward assignment would have leaking identities for the format with two segments while the length of the first segment is less than the second one’s.

b – a

Figure 4-3 Identities leaking of backward assignment on two segments.

An example of identities leaking for two segments is shown as Figure 4-3. In this example, there are two types of identities, (0. A) and (A. B). Since the 1st type’s latter code, A, cannot be zero, the identity “0” will never be used and cause one leaking iden-tity. Besides, the identities with the first a-bit zero code and next (b-a)-bit non-zero code will never be generated either and the number is 2b - 2a. Thus, the total amount of those leaking identities is 1 + 2b - 2a.

4.2.2 Duplication of Identities

A 0

B A

a-bit b-bit

B A

0 ≠ 0

a – b

2a– 1 +

(2a– 1) ∙2b ID space (2a-b – 1) ∙2b 2a– 2b

Duplication of ID a > b,A0 Leak of ID: 1

2nd 1st

Figure 4-4 Identities duplication of backward assignment on two segments.

However, if the length of the first segment is longer than any other’s, the identities du-plication will occurs, which is not allowed. An example of identities dudu-plication for two segments is shown as Figure 4-4. Similar to the example of Figure 4-3, there are two types of identities, (0. A) and (A. B). Since the length of the first segment is longer then the second one’s, the identities with the first a-bit zero code and next (b-a)-bit non-zero code will be generated twice. But such duplication would not be permitted for the most network environment, so the first segment’s length must not exceed the others’.

In order to avoid duplication of identities, we would configure the length of the first segment shortest while executing the backward assignment. Furthermore, we ob-serve that the backward assignment indeed decreases the effect of identities leaking sig-nificantly while the number of partitioned segments increases from the mathematical derivation and simulation results.

4.2.3 Quantitative Analysis

Figure 4-5 Identities leaking of backward assignment.

The following equation calculates the number of leaking identities when there are k par-titions, where ni represents the length of segment i.

(

2 1

)

2 , 2

Figure 4-5 shows the effect of identities leaking on the different number of seg-ments for a 16-bit long identity. This figure indicates the worst, average and best cases of identity leaking among the entire HPID formats and assumes the length of each ment is at least 2-bit long. We observe that in the best cases for each number of seg-ments there will be some HPID formats that make the number of leaking identities pretty low. In other aspect, the worst case happens when there are two segments and the

Figure 4-5 shows the effect of identities leaking on the different number of seg-ments for a 16-bit long identity. This figure indicates the worst, average and best cases of identity leaking among the entire HPID formats and assumes the length of each ment is at least 2-bit long. We observe that in the best cases for each number of seg-ments there will be some HPID formats that make the number of leaking identities pretty low. In other aspect, the worst case happens when there are two segments and the

相關文件