Abstract
New applications based on wireless sensor networks (WSN), such as person-locator services, harvest a large amount of data streams that are simultaneously generated by multiple distributed sources. Specifically, in a WSN this paradigm of data generation/transmission is known as event-streaming. In order to be useful, all the collected data must be aligned so that it can be fused at a later phase. To perform such alignment, the sensors need to agree on common temporal references. Unfortunately, this agreement is difficult to achieve mainly due to the lack of perfectly synchronized physical clocks and the asynchronous nature of the execution. Some solutions tackle the issue of the temporal alignment; however, they demand extra resources to the network deployment since they try to impose global references by using a centralized scheme. In this paper, we propose a temporal alignment model for data streams that identifies temporal relationships and which does not require the use of synchronized clocks, global references, centralized schemes, or additional synchronization signals. The identification of temporal relationships without the use of synchronized clocks is achieved by translating temporal dependencies based on a time-line to causal dependencies among streams. Finally, we show the viability and the effectiveness of the model by simulating it over a sensor network with multihop communication.
1. Introduction
Emerging applications based on wireless sensor networks (WSN) such as remote monitoring of biosignals, multimedia surveillance systems, and person locator services [1] ubiquitously (in this context, the term ubiquitous refers to the capacity to collect information from several places at the same time.) harvest a large amount of continuous time-based data, as audio or video, that is generated from several sensor nodes in a distributed and concurrent way [2–4]. Specifically, the adopted transmission paradigm in such environments is called event-streaming, which represents the generation and the transmission of data as a continuous stream of events reported by multiple sources [5]. In order to be useful to the application, all the collected data require a certain degree of postprocessing (e.g., data fusion (Data fusion refers to the alignment, association, correlation, filtration, and aggregation of the collected data [6, 7])).
For example, suppose that there is a network of fixed cameras along an area, which aims to monitor a person (see Figure 1). As each camera has a limited vision field, the resultant single video must be formed from multiple possible video sequences, collected by different cameras. Thus, all the collected video sequences will be processed/fused to produce useful information (see Figure 1).

Scenario of a person monitoring system.
To perform some kind of analysis or processing, all the data originated through the event-streaming must be temporally aligned in some way to make them functional and coherent. To achieve this, the sensors in the network may need to agree on some common temporal references to the whole system [2, 8–10]. Unfortunately, the characteristics and restrictions of a WSN make it difficult to establish such references. This is mainly due to (1) the resources’ constraints, (2) the channel variability, (3) the dynamicity in the topology, (4) the lack of perfectly synchronized physical clocks, (5) the absence of shared memory, and (6) the asynchronous nature of the event-streaming [3].
In order to avoid the use of synchronized clocks, a clock-free alignment approach for data streams was proposed in [10]. This solution is based on the fact that in most sensor networks, some sensor nodes act as intermediate nodes to aggregate or to collect the data streams which are later sent to another sensor or sink. Assuming the previous communication scheme, the approach has shown that aligning the data streams on the intermediate nodes without synchronizing the clocks of all sensors is sufficient. Nevertheless, this solution requires a synchronization server that broadcasts synchronization signals to the sensors to establish a global reference, and it also needs dedicated devices (data servers) to align the streams according to the broadcasted signals. These two additional requirements imply extra network resources.
In this paper, we propose a new model called Event-Streaming Logical Mapping (ES-LM), for the temporal data alignment in WSNs. The ES-LM model is based on the event-streaming paradigm, the logical mapping model [11], and the data alignment approach described in [12]. The ES-LM uses pairwise interactions between nodes based on the happened-before relation [13]. The ES-LM performs the data alignment by translating temporal dependencies among streams, based on a time-line, to causal dependencies. Such translation allows us to construct a virtual time-line. By using the resulting virtual time-line we can avoid (1) the use of synchronized clocks, (2) the use of global references, (3) the use of centralized schemes, and (4) the use of additional synchronization signals. Finally, we show the viability and the effectiveness of the model by simulating it over a sensor network with multihop communication.
This paper is structured as follows. Section 2 presents the system model and the background, including our definition of the event-streaming as an abstract data type. Section 3 presents a description of the proposed temporal data alignment model for event-streaming. In Section 4 we present the analysis of the model and the simulation results. Finally, Section 5 presents the conclusions.
2. Preliminaries
2.1. System Model
We specify a WSN as a distributed system, which consists of the following three main components.
Processes. Each entity associated with the WSN (sensors or sink) is represented as an individual process. Hence, a WSN is a set of processes Messages. We consider a finite set of messages M sent by a process Events. An event represents an instant execution performed by a process. For our problem of data alignment, we only consider the send and delivery events.
The send event refers to the emission of a message executed by a process. The delivery event refers to the execution performed by a process to present the received information to an application or another process. Let m be a message. We denote by
Furthermore, for the transmissions in a WSN we consider the following two main characteristics.
Transmission Delay. For a message Synchronization Error of Two Samples. This refers to the difference between the local time reference assigned at the reception, which can be used to estimate the sample time and the sample time of the source.
2.2. Background and Definitions
A suitable way to order events in an asynchronous distributed system is the happened-before relation (HBR) defined by Leslie Lamport [13]. This relation establishes the rules to determine whether an event is the cause or the effect of another event, without using global references.
The HBR is a strict partial order on events, defined as follows.
Definition 1.
The happened-before relation, “ If a and b are events belonging to the same process, and a was originated before b, then If a is the sending of a message by one process, and b is the reception of the same message in another process, then If
Based on Definition 1, Lamport defines that a pair of events is concurrently related “
Definition 2.
Two events, a and b, are said to be concurrent if
Immediate Dependency Relation (IDR). The IDR is the transitive reduction of the HBR [14]. The IDR is defined as follows.
Definition 3.
Two events
Note that an event a causally and immediately precedes an event b, if and only if, there is no other event
Intervals. An interval is a set of events which occur during a period of time. If the events that compose an interval satisfy a certain order, then such interval is called ordered interval. The works of Shimamura et al. [15] and Pomares et al. [11] define the following ordered interval composition.
Definition 4.
Let X be an interval of sequentially ordered events at a process
When
Happened-Before Relation for Intervals. Lamport establishes in [16] that an interval A happens before another interval B if all the elements that compose an interval A causally precede all the elements of interval B.
Definition 5.
The causal relation “
According to Definition 4 and Pomares et al. [11], the happened-before relation in regard to ordered intervals can be expressed only in terms of the endpoints as follows.
Property 1.
Let A, B, and C be sets of sequentially ordered events. The set of events A occurs before the set of events B if any of the following conditions are satisfied:
Definition 6.
Let A and B be two ordered intervals. A and B are said to be simultaneous (denoted by
The definition above means that one interval A can take place at the “same time” as another interval B.
2.2.1. The Logical Mapping Model
The logical mapping model introduced in [11] is useful to represent pairwise interactions between processes. Such model expresses temporal relations between sets of events in terms of the happened-before relation for intervals.
The logical mapping translation involves every pair X, Y of intervals of a temporal relation. Each pair is segmented into four subintervals:
Logical mappings expressed by endpoints.
The logical mapping model identifies five logical mappings, which are sufficient to represent all possible temporal relations between continuous media (interval-interval relations [17]), discrete media (point-to-point relations), and discrete-continuous media relations [18].
2.2.2. Event-Streaming Abstract Data Type
We propose a definition of the event-streaming oriented to the data alignment problem. Assuming that an event-streaming is composed of several events, we begin by defining the concept of an atomic event.
Atomic Event. An atomic event indicates that an entity has sent or delivered a message containing a sample. In other words, an atomic event indicates that a portion of data has been collected from the environment.
Definition 7.
An atomic event is a tuple
As we stated above, we consider only two types of events: send and delivery. We denote the atomic delivery event by
Based on the concept of atomic event, for our solution we distinguish two kinds of data streams generated by the nodes in a WSN: the local-streams and the event-streamings.
Local-Streams. In a WSN, each process generates a certain number of atomic events throughout the communication process. When some of these events are generated sequentially by a process
Definition 8.
A local-stream is a poset
A local-stream can be expressed by its endpoints, similarly to the intervals (see Definition 4). For a local-stream
Event-Streamings. An event-streaming is a collection of subsets of local-streams generated by different processes. Such subsets of local-streams are grouped and arranged according to their causal dependencies into sets denoted as
We formally define an event-streaming as follows:
Definition 9.
An event-streaming is a poset
Within an event-streaming each set

Representation of the subsets of an event-streaming.
We note that in a similar way to the local-streams and the intervals, each subset
3. Temporal Data Alignment for Event-Streaming
3.1. The Problem of Data Alignment for Event-Streaming
Based on the definition of the data stream alignment problem given in [10], we define the problem of data alignment for event-streaming as follows.
Definition 10 (data alignment problem for event-streaming).
Given a set of local-streams:
For our solution, the messages of interest are the causal messages sent within an event-streaming. Explicitly, they are the endpoints of the subsets
3.2. Event-Streaming Logical Mapping Model (ES-LM)
The native logical mapping identifies five logical mappings: precedes, simultaneous, ends, starts, and overlaps to determine how two intervals (local-streams) are related. However, for our problem this covers only the base case, which is the alignment of streams whose events have all been generated by a single process. In the following sections, we present an extension to the native logical mapping called event-streaming logical mapping model (ES-LM). The ES-LM establishes how an event-streaming
Event-streaming logical mapping.
From this causal structure, five new logical mappings are identified. These logical mappings represent all the ways that an event-streaming can be related to a local-stream. These new logical mappings are s-precedes, s-simultaneous, s-ends, s-overlaps, and s-starts (see right column of Table 2).
The ES-LM is the core of the data alignment scheme that we propose, which is presented in the following section.
3.3. Data Alignment Description
The data alignment process is described through four stages as follows.
(A.1) Initial Stage: Alignment of Two Local-Streams. Initially, we have two local-streams
We construct a first subset
A.1 Alignment of two local-streams.

Aligning the first subset of the first event-streaming.
Then, according to Table 3, we proceed to construct a second subset

Aligning the second subset of the first event-streaming.
The last subset

Aligning the last subset of the first event-streaming. (a)
Therefore, the first event-streaming has the general causal structure
Once the first stage has finished, we proceed to align two streams: an event-streaming and a local-stream. The event-streaming is labeled as the set
Using
Assuming that the initial stage was accomplished, the logical mapping proceeds according to the three stages that are detailed below.
(B.1) Aligning the First Subsets of Events without Concurrences between an Event-Streaming and a Local-Stream. In the first step, we determine if there are some subsets
Alignment process between an event-streaming and a local-stream.

Aligning the first subsets of events of an event-streaming.
If a subset
(B.2) Aligning the Subsets of Events with Concurrences between an Event-Streaming and a Local-Stream. If during stage B.1 a subset
Once the beginning of the concurrent parts of both streams are detected, according to stage B.2 of Table 4 (lines 2.2 and 2.3), all the subsequent subsets

Aligning the subsets of events with concurrences.
The final subsets of the resulting event-streaming will be constructed depending upon which stream finishes first.
If the local-stream

Aligning the last subsets of events without concurrences when
(B.3) Aligning the Last Subsets of Events without Concurrences. This stage is explained through two cases.
Case A (
The fact that the local-stream
Case B (

Aligning the last subsets of events without concurrences when
The event-streaming logical mapping will continue until there are no more concurrent local-streams to be merged.
In terms of data alignment, we note that by the way in which the subsets of events are constructed and causally ordered, each resultant event-streaming
4. Analysis and Results
4.1. Proof of the Temporal Data Alignment
In this section we prove that by following the ES-LM model, the sequential arrangement of subsets of events that compose an event-streaming establishes a virtual time-line, where each subset represents a unique time-slot and each event is aligned with respect to only one of them.
Theorem 11.
The arrangement of subsets
Proof. We divide this proof into two parts. In the first part we prove that an event-streaming is a causal arrangement of subsets of events that establishes a time-line. In the second part we prove that each subset
Part I. To demonstrate that an event-streaming is a causal arrangement of subsets of events that establishes a time-line, we formulate and prove the following Lemma.
Lemma 12.
An event-streaming is a causal arrangement of subsets of events that establishes a time-line.
Before proving Lemma 12, we need to consider the following. Definition 8 states that a local-stream is a poset
Proof of Lemma 12.
We demonstrate Lemma 12 by a direct proof. According to the ES-LM (Tables 2, 3and 4) during the data alignment, the subsets of events that compose a new event-streaming if if if
In each of these three cases, happened-before relationships are established among the left endpoints of
Corollary 13.
Each subset
Part II. To demonstrate that each subset
Lemma 14.
Each subset
Consider the following:
Proof of Lemma 14.
We prove Lemma 14 by contradiction. Therefore, we suppose that
According to the ES-LM model, the subsets
4.2. Simulation Results
We have simulated the temporal data alignment model for event-streaming using the Castalia simulator [19]. The simulation scenario is within a set of 50 nodes that were arranged into multihop paths, where the nodes are separated by distances between 5 and 10 meters in a field of
For the simulation, we implemented the model using the well-known vector clock structure [20, 21] to identify and preserve the causal relations among events. Therefore, we obtain a computational cost as well as communication and storage overheads of
To transmit a local-stream we use two types of causal messages:
The simulation was configured with the TMAC protocol for the MAC sublayer and the CC2420 radio protocol for wireless transmissions. The data payload for the Application layer packets was fixed to 2000 bytes.
In the simulation scenario, each node generated a random number of local-streams throughout the simulation. Each generated local-stream was composed by a random number of messages between 9 and 100 that were generated using sampling rates between 25 and 1000 milliseconds.
In order to measure and to show that the synchronization error is bounded, we took the simulation time as a global clock. We note that the simulation time was not used in the ES-LM. The ES-LM use only the causal dependencies between the event-streamings to perform the data alignment and do not use any kind of physical time.
At each hop we took the causal messages
Let
For example, in the scenario depicted in Figure 10, process

Example of the alignment of causal messages.
Thus, by considering the simulation time as a global clock, the synchronization error is estimated by using the following formula:
By using sampling rates between 25 and 1000 milliseconds, we show that the synchronization error can be bounded according to the transmission delay as shown in Figure 11.

Difference between the synchronization error and the transmission delay.
4.2.1. Analysis of the Results
Based on the ES-LM, the data alignment is performed in the intermediate nodes while the streams are propagated through the network. In our case the data alignment is achieved by ensuring that at each intermediate node the synchronization error
With respect to why the average synchronization error is bounded between sampling rates of 75 ms to 830 ms we present the following analysis (see Figure 11). The synchronization error cannot be bounded lower than 75 ms because a faster sampling rate causes a greater saturation in communication channels and indeterminism of the transmission delay. The latter is mainly due to the signal-to-noise ratio (SNR) as well as to the medium access contention. On the other hand, the synchronization error cannot be bounded when the sampling rates are greater than 830 ms by our solution since the temporal distance between two consecutive local samples at a process
5. Conclusions
A temporal alignment model for data streams in WSNs called event-streaming logical mapping (ES-LM) has been presented. One original aspect of our model is that the data alignment is performed without using synchronized clocks, global references, centralized schemes, or additional synchronization signals. This was achieved by translating temporal dependencies based on a time-line to causal dependencies among streams. The ES-LM model constructs a virtual time-line by arranging the transmitted data into causally ordered sets of events. In terms of the problem of temporal data alignment, it was proven that each ordered set of events determines a specific and unique time slot. An instantiation of the model was simulated over a sensor network with multihop communication. The simulation results show that the synchronization error is bounded according to the transmission delay.
Footnotes
Conflict of Interests
The only funding source for this work is mentioned in the acknowledgment section of the paper. The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
Jose Roberto Perez Cruz would like to thank to the Council of Science and Technology (CONACYT) of Mexico for the doctoral scholarship with which his studies were supported.
