• No results found

Time-synchronisation protocol

Related Work

3.1 Medium Access Control Protocol for WSNs

3.1.3 Time-synchronisation protocol

Time synchronisation is crucial in a schedule based protocol as the nodes have to agree upon and follow the predefined schedule. A reference node is required to synchronise the nodes. Time synchronisation in an order of microseconds may be required in WSNs. The Network Time Protocol (NTP) which is used in the Internet does not suit wireless sensor networks due to its resource constraint [EGE02, GKS03]. An external system that behaves like a timing reference such as a Global Positioning System (GPS) may not be available in some areas. Each sensor has an oscillator which generates ticks and they are used to represent the local clock. Different local clocks may run at different speeds and clock drift can occur. The drift can be accumulated into seconds and the synchronization deteriorates. Hence, clock drift should be monitored in a schedule-based protocol design.

Several non-deterministic delays in data communication and processing such as send, access and receive delays are determined in [EGE02]. Some delays are hardware dependent and these non- deterministic delays are discarded. The remaining delays, which are taken into account, are propagation and reception. Physical-layer broadcasts are used to periodically deliver the messages which are not included in explicit timestamps. It assumes that insignificant variability in the propagation delays is observed at such receivers. Receivers use the packet’s arrival time as a reference for comparing their local clocks and they exchange such measurements and the offsets are then computed. More accurate results will be obtained if the message reception is tight and if the receiver is able to measure its local time of reception promptly. However, a sequence of reference messages from the same sender is preferred. Once clock offset and skew are estimated, a table storing parameters which relate to offset and skew with respect to every other clock in the

58

network is maintained by each node. In multi-hop, a third node is required for synchronising two nodes which are located within different neighbourhoods.

In a sender-receiver based scenario, the synchronisation is conducted at the receiver [GKS03]. Two phases are desired. Firstly, each node assigns itself a level to form a spanning tree. A root node is assigned to level 0. It broadcasts a message to its neighbours. Upon reception, other nodes assign level which is one greater than the level included in the message. The message will be discarded if the level is already set. Secondly, pair-wise synchronisation is performed and it is started from the root node. Prior to the synchronisation, the root node broadcasts a packet. The nodes at lower level respond by sending a packet to the root node. Acknowledgement will be transmitted and the exchange of local times is completed. The same processes will be repeated to create a network-wide synchronisation. In [GKS03], the receiver synchronises to the sender. Both clock drift and two-way propagation delay are computed by the receiver. The timestamps are performed at the MAC layer. In order to avoid collisions, several random backoffs are used prior to transmissions.

Instead of forming a spanning tree, an ad hoc structure is formed and the global time maintained by the root node is transferred to the nodes [MKSL04]. The cost of the tree establishment is not therefore required. The protocol provides a network-wide synchronisation by knowing the difference between the estimated global time at the root and the local time at the receiver. The clock offset is computed at the receiver. Only a single broadcasted message is sufficient to establish synchronisation between a sender and some receivers. In addition to timestamping at the MAC layer, several delays required for completing data transmission and reception are considered in order to minimise the source of synchronisation errors. The message broadcast from the root node consists of preamble, SYNC bytes, message descriptor, actual data and CRC bytes. Such information enables message reassembling with correct byte alignment and message verification. The associated durations are used to adjust the timestamps. Interrupt handling and encoding/decoding times are taken into account by normalising the timestamps. Multiple timestamps are thus obtained but only the final error correction will be included in the message. Clock drifts were measured in order to develop an estimate model to predict the drift of the receiver clock with respect to the sender clock. The model was obtained from running the off-line linear regression.

Unlike [EGE02], time synchronisation in the single-hop WSNs can be performed at the sources and the base station is a reference. Comparing to [GKS03], the base station is at level 0 whilst the sources are at level 1. A cluster consists of a base station and several sources which are located within the base station’s communication range. The local clock exchange in [MKSL04] can be used. A broadcast control packet, including scheduling information, is sufficient for the synchronisation. Timestamping at the MAC layer also applies as the non-deterministic delays are

eliminated. The sources do not compute the clock offset. They schedule their communications by considering the included information.

3.1.4 Summary

WSNs are a shared-medium system where medium access control is required in order to avoid data collision. There are two major schemes including contention and schedule based. Both of them have been adopted and enhanced for WSNs which are considered application specific. Environmental monitoring systems normally require a low duty cycle. Sensors should be switched to sleep mode when they have no data to send in order to minimise idle listening. In the case of contention-based, additional control frames, apart from RTS and CTS, are proposed to achieve the application’s energy requirements. A time slot is allocated for each sensor in the schedule-based approach. Collision and idle listening can be thus avoided and minimised. The reviewed schemes are developed for multi-hop WSNs.

PoRAP is categorised as a schedule based approach. It has been developed to support WSNs where direct communication between sensors, or sources, and base station is feasible. Unlike [ROG03], the same channel is required for control and data transmissions. Furthermore, scheduling information is included in the broadcast control message as in [EQ07]. However, PoRAP does not perform carrier sensing prior to transmission and clock drifts were measured. In the context of time synchronisation, the sensors synchronise to their base station via control packet reception. Unlike [EGE02], no exchange of local clock offsets amongst sensors is required. The sensors located within the base station’s communication range are at the same level and they report to the base station. Timestamps are performed at the MAC layer in order to avoid non- deterministic delays as in [MKSL04].