• No results found

CHAPTER 5. COMPOSITE EVENT DETECTION

5.2. The scheme

5.2.1.The basic idea

Figure 5.1.Event query in a WSN

The basic idea of our proposed scheme is illustrated in Figure 5.1, where an area is monitored by a WSN. There is a gateway node (or several gateway nodes) which is responsible for making a conclusion and reporting it to the users if an event happens. This gateway node is properly selected and every sensor in the network has a chance to serve as a gateway node in order to balance the energy consumptions. The different name (gateway node) is used to distinguish the functionality, not the characteristics. To detect events based on different properties, multiple types of sensors are deployed. For example, in Figure 5.1, type 1, type 2, and type 3 sensors are used for temperature, smoke density, and light monitoring, respectively. An event E is defined with a compound propositional function as following:

E=F (P1(x), P2(x), …, Pn(x)) (5.1)

Gateway sensor Type 1 sensor Type 2 sensor Type 3 sensor

where P1(x) through Pn(x) are predicates, F is a function of Boolean algebra operators

such as ‘∧’, ‘∨’ or ‘¬’. For example, an event fire can be defined as Fire = P1(x) P2(x) P3(x),

where P1(x) denotes the predicate “temperature > 300oC”, P2(x) denotes the predicate “smoke >

100mg/L”, and P3(x) denotes the predicate “light > 500cd”.

The event E and threshold values can be disseminated to gateway and non-gateway nodes by the BS at the initial phase or pre-installed in each sensor. Only the gateway nodes have the information about an event E. Each non-gateway node only knows the threshold values of its monitored properties. During the network operation time, once a sensor detects that the current sensed value is over the threshold of its monitored property, it sends one bit ‘1’ instead of the sensed value to a gateway node. If a gateway node receives a ‘1’, it checks if the compound propositional function which defines an event E derives a TRUE value. If so, it immediately sends a warning to the BS. It is important to emphasize that a sensor need not periodically report its raw sensing-data. Instead, it only reports the predicate ‘1’, that is, it notifies the gateway node only when its sensed value reaches the threshold and refrains from sending data for all other cases.

5.2.2.Communication scheme

Denote r be the number of atomic events comprised to our interested composite event (see Section 5.3.1 for list of notations). For each atomic event, the payload of the packet sent by each sensor has two parts:

log2r

bits (namely event identification bits which depends on the composite event pattern definition) to identify the types of atomic events, and a single bit for the value (which is always ‘1’ showing that the atomic event happens). Thus, if a sensor is able to sense t atomic events, the payload of the packet sent from that sensor occupies

8 1 r log2 + ×t

payload of the packet must be the blocks of 8 bits - bytes). Thus, it is highly practical to employ some sorts of data aggregation mechanism which is extensively employed in database-related applications (the one presented in [UPA03] is an example of such mechanism) in reporting the event to the gateway. The communication overhead would greatly diminish if such a mechanism is utilized. Instead of directly employing that mechanism, we implement a better communication scheme which would be even more efficient when working with our 1-bit scheme. We name this communication scheme of “piggybacking” scheme. To reduce the header overhead of packets, several packets’ payloads are piggybacked to a single packet. “Piggybacking” scheme has two variants, and the choice of which variant to implement is completely up to users:

Variant 1

log2r

: In this variant, only data readings for the same atomic event are piggybacked. More specifically, any intermediate sensor, who forwards packets from its neighbors, will combine those data readings (including its own data readings) belonged to the same type of data reading (each type could detect an atomic event) and create a single packet for each type. It then forwards those packets out. This variant could save the overhead of event identification bits ( bits). However, a sensor has to forward as many packets as the number of types of sensing data that are sensed by itself and are carried by packets it has to forward.

Variant 2

5.2.3. Scheme advantages

: In this variant, a sensor piggyback whatever it has to forward into one packet. That sensor does not care about the types of data readings that it has to forward. This variant could save the processing time, but it has to include the events identification bits since several types of data readings could be piggybacked in the same packet.

 When its reading is over (smaller or greater than) a pre-defined threshold, instead of sending the real, big-sized data reading, the sensor only sends the single bit ‘1’.  Each atomic event requires only a single bit to be sent, thus the packet’s header

overhead will dominate the interested information carried in the payload. By piggybacking packets, the amount of packets sent in the network also significantly reduced while the size of packets is the same or little bit bigger than the normal ones.  Sensors do not send the data reading all the time, it only sends the data when its

reading is over a threshold. This has twofold: the sensors naturally do not waste their energy on unnecessary communication and the network traffic is also moderated. Since no significant amount of data is sent to the BS, thus each sensor can naturally conserve more energy to extend network lifetime. Section 5.2.4 provides a rough numerical estimation on amount of saved energy. Furthermore, reducing network traffic has a good effect on lowering radio interference. Also, the energy consumption among sensors is well balanced.

Also, our scheme has following advantages:

 Decisions are locally made at special sensors, namely gateway nodes, and then only particular conclusions, e.g., the ones that specify the occurrence of an interested event, are reported to the BS, so that the users can obtain valuable information in a timely manner.

 The pattern definition of an event may consist of multiple properties instead of a single one and can be defined by users.

 By sending a warning from a gateway node to the BS, the BS can know where the event happens (with the assumption that the BS knows all the nodes’ positions).

5.2.4. Amount of data and energy can be saved

Figure 5.2.IEEE-802.15.4 general MAC frame format [IEEE4]

In this section, we conduct a rough comparison of amount of exchanging data being saved of our scheme using Variant 1 and the most common scheme in literature. To answer the question of how much is the amount of data can be refrained from being sent by our scheme, we measure the size of packets of traditional method and our novel scheme. To make our comparison practical, we assume the sensors networks using IEEE802.15.4 [IEEE4] (see Figure 5.2) which is used in many commercial sensors products such as those of Crossbow [XBOW09] as MAC+Physical layer protocol. For the sensors’ operating system (OS), TinyOS [TINYOS], which is the most advanced and common OS for sensor networks, is our choice.

For variable-size fields of Figure 5.2, we assume 2 bytes for Destination/Source addresses/identifiers. For distributed algorithm where nodes are only required to be identified locally, 2 bytes are enough. Since TinyOS does not automatically support network and transport protocol for any packets sending out, an application layer’s payload could be encapsulated directly to MAC and physical headers. Also, the header overhead for IEEE802.15.4 physical layer would be 2 bytes. Consequently, the average size of a packet should be 15 bytes + payload. Denote

γ

=

log2r

(where r is number of atomic events comprised composite event) which is amount of bits to identify an atomic event. Assume i data readings are piggybacked in

Octets:2 1 0/2 0/2/8 0/2 0/2/8 variable 2 Destination PAN identifier Destination address Source PAN identifier Source address MAC

payload MAC footer

Frame check sequence MAC header Addressing fields Frame control Sequence number Frame payload

the same packets, we need

(

γ

+i)/8

bytes payload to carry i bits ‘1’ with event identification bits. Assume the real data reading has the size of b bytes. The amount of data saving for a single packet would be b×i+

log2

γ 

− (

γ

+i)/8

bytes out of 15+b×i+

log2

γ

bytes. The saving

would be

(

 

)

log

% 15 100 8 / ) ( log 2 2 γ γ γ + × + × + − + × i b i i b .

However, the data readings are not over the threshold at all times meaning if the sensors are working under our scheme, they do not always have to send the packets. Thus if the frequency of data readings being over threshold is f (f ≤ 1), then we would expect the amount of

data saving approximately is

(

)

log

% 15 100 8 / ) ( 15 100 2       + × + × + + × − γ γ i b i f . For example, if r=4 (meaning γ=2), f=25%, i=3, b=4 (4-byte integer number) then we could expect the amount of saving is about 85.7%. Notice that f=25% means that if sensors sample and sense the data readings (for atomic events) every 2 msec then the composite event occurs every 8 msec which would not be the case in most practical situations . In practice, the value of f must be much smaller than 25% and the value of both b and i might be bigger than the value we used in our example, thus the real amount of saving in practice would be (much) bigger than 85.7%

The energy consumption of a sensor is dominated by the energy burned to transmit the data which is proportional to the size of the packet. Network lifetime will increase if the amount of data being transmitted decreases. Thus, by using our scheme, the sensors could save a significantly amount of energy and network lifetime increases as consequence.

Related documents