• 沒有找到結果。

The Proposed Schedule-based Approach

Imprecision-tolerant Location Management Model

Theorem 8. If G is connected, the tree constructed by algorithm IQT is a con- con-nected deviation-avoidance tree rooted at the sink

6.2 The Proposed Schedule-based Approach

6.2.1 Overview

We assume that a CSMA-based MAC protocol is adopted as the underlying MAC protocol. In order to solve the contention problem and the hidden terminal prob-lem in the event area, a schedule-based (or a TDMA-like) approach is proposed.

Figure 6.3: The redundancy problem.

However, for those sensors not in the event area, because not all sensors need to help forward packets, assigning slots to those sensors that do not intend to transmit any packet is unnecessary and could increase delay. This means that the TDMA-like approach may not be suitable for sensors not in the event area. Instead, they will take a CSMA-based MAC approach. Therefore, our scheme can be regarded as a hybrid TDMA/CSMA protocol.

Each node has two modes: event-source (ES) mode and non-event-source (NES) mode. Sensors in the ES mode will adopt a schedule-based approach to transmit packets. Issues involved in the ES mode include: (i) when to enter the ES mode, (ii) how to design a good slot assignment strategy, (iii) how to determine proper slot size, (iv) what will lead to synchronization error and how to conduct time synchronization, (v) how to exploit the spatial correlation of sensor data, and (vi) when to leave the ES mode.

On the other hand, sensors in the NES mode will adopt the original CSMA-based protocol to reduce report latency. An issue involved in this mode is how to alleviate congestion when multiple events occur simultaneously.

6.2.2 Operations in the ES Mode

Entering the ES Mode

As we mentioned above, a CSMA-based MAC protocol is adopted as the underly-ing MAC protocol, but sensors in the ES mode will adopt a TDMA-like protocol.

To implement this TDMA-like protocol, we divide the time into slots at the link layer. When the network was deployed, a slot assignment algorithm will be run so that each sensor will be assigned a slot. Slots are numbered from 1 to MAXSLOT, and the first slot (i.e., slot 1) will be started on-the-fly in an event-driven manner.

Initially, each sensor is in the NES mode. When a sensor detects an event, it will enter the ES mode by starting slot 1. Then, it will count slots until its slot arrives. If its slot arrives and it intends to transmit a packet, it will perform the access mechanisms defined in the underlying CSMA-based MAC protocol (such as the backoff and CCA mechanisms) as usual to access the channel. If a sensor cannot send its packet in its current slot, it will wait for its slot in the next cycle (note that it is also possible that the sensor will suspend its packet and not retry again).

Slot Assignment Strategy

Conventional TDMA-based protocols will assign each node a slot different from those of its one-hop and two-hop neighbors. We argue that when the spatial cor-relation of sensor data is taken into consideration, such a strategy may not be efficient, because not every sensor needs to report. It is easy to see that if a node finally decides not to report, then its assigned slot is wasted. In addition, our TDMA-like protocol is built on top of a CSMA-based protocol. Thus, with proper backoff, assigning the same slot to neighboring nodes does not necessarily lead to collision. Even, in case neighboring nodes share the same slot, the backoff mechanism can be used to determine who should report and the losers may sus-pend their reports due to the spatial correlation of sensor data when they overhear the packet sent by the winner. Therefore, we even intentionally assign a slot used

by a node’s one-hop neighbors to that node, but the node still should be assigned a slot different from those used by its two-hop neighbors to avoid the hidden ter-minal problem without the aid of RTS/CTS. Another advantage of our proposed slot assignment strategy is that the value of MAXSLOT required can be reduced significantly.

We develop a simple distributed slot assignment algorithm to complement this slot assignment strategy. Note that the algorithm is run only once when sensors are first deployed. We make some assumptions. First, the network topology is static (otherwise, the slot assignment algorithm has to be run after topology change).

Second, each sensor has a unique ID. Third, each sensor can correctly discover all its one-hop and two-hop neighbors. Finally, the number of two-hop neighbors of a node is finite.

Each sensor will maintain a slot usage table to record the slots used by its one-hop and two-hop neighbors. Each sensor that does not own a slot will select its slot in a distributed way. Thus, we only describe the behavior of a sensor x.

First, x will send a request to all of its two-hop neighbors. Any two-hop neighbor y of x receiving the request will act as follows.

• If y does not own a slot yet and y.ID < x.ID, then y will reply a grant to x. Because y does not own a slot yet, null slot information will be carried on the grant.

• Otherwise, y will do nothing.

Once x receives grants from all of its two-hop neighbors, x will select a slot by the following rule. To begin with, x will check whether there exists a slot such that this slot has been assigned to x’s one-hop neighbors but has not been assigned to x’s two-hop neighbors. If such slots exist, x will pick up the most-used one among those slots. (Recall that we will intentionally assign a slot used by a node’s one-hop neighbors to that node.) Otherwise, x will select the smallest slot that has not been used by its two-hop neighbors. (The reason is to minimize MAXSLOT.)

After selecting its own slot, x will send a grant with its selected slot to each of its two-hop neighbors. Then, when another node z receives such a grant on which a selected slot is carried from one of its two-hop neighbors, z will modify its slot usage table accordingly and check whether it has received all grants from all of its two-hop neighbors.

Finally, when a sensor determines its slot, it will notify the sink so that the sink can determine the value of MAXSLOT. Then the sink will announce MAXS-LOT to all sensors. Note that when no packet loss occurs, the proposed slot as-signment algorithm guarantees that each node will receives grants from all of its two-hop neighbors. However, when packet loss cannot be avoided, a sensor may loss grants and this will result in deadlock. In order to overcome the packet loss problem, a sensor can actively ask its two-hop neighbors to resend their grants (if allowed) when it waits passively for a long period.