scieee AI-readable full text Open interactive document viewer

Wireless HDLC protocol for energy-efficient large-scale linear wireless sensor networks

Toma, Daniel,Río Fernández, Joaquín del,Manuel Lázaro, Antonio

Abstract

Wireless sensor networks (WSNs) have been widely recognized as a promising technology that can enhance various aspects of infrastructure monitoring. Typical applications, such as sensors embedded in the outer surface of a pipeline or mounted along the supporting structure of a bridge, feature a large-scale linear sensor arrangement. In this paper, we propose a new bidirectional wireless communication scheme, based on the high-level data link control (HDLC) standard, for devices with short-range transmission capabilities for linear sensor topology. By applying for the first time a standard data layer along with a time division multiple access (TDMA)-based medium access control (MAC) and time synchronization technique specifically designed for the linear topology, we address the interoperability problem with guaranteed energy efficiency and data link performance in linear sensor topology. The proposed Wireless HDLC supports half-duplex communication, point to point (peer to peer), and multipoint networking.

Full text

Research Article Wireless HDLC Protocol for Energy-Efficient Large-Scale Linear Wireless Sensor Networks Daniel Mihai Toma, Joaquin del Rio, and Antoni Mànuel SARTI Research Group, Electronics Department, Universitat Polit` ecnica de Catalunya (UPC), Rambla Exposici´ o24, Vilanova i la Geltr´ u, 08800 Barcelona, Spain Correspondence should be addressed to Daniel Mihai Toma; daniel.mihai.to[email protected]du Received 31 October 2013; Revised 10 February 2014; Accepted 16 February 2014; Published 17 April 2014 Academic Editor: Zuqing Zhu Copyright © 2014 Daniel Mihai Toma et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Wireless sensor networks (WSNs) have been widely recognized as a promising technology that can enhance various aspects of infrastructure monitoring. Typical applications, such as sensors embedded in the outer surface of a pipeline or mounted along the supporting structure of a bridge, feature a large-scale linear sensor arrangement. In this paper, we propose a new bidirectional wireless communication scheme, based on the high-level data link control (HDLC) standard, for devices with shortrange transmission capabilities for linear sensor topology. By applying for the first time a standard data layer along with a time division multiple access (TDMA)-based medium access control (MAC) and time synchronization technique specifically designed for the linear topology, we address the interoperability problem with guaranteed energy efficiency and data link performance in linear sensor topology. The proposed Wireless HDLC supports half-duplex communication, point to point (peer to peer), and multipoint networking. 1. Introduction The existing applications of WSNs span a very wide range, including remote system monitoring and control, fraud detection, environmental monitoring, and so forth. So far, little focus has been given to low-power WSNs for linear topologies. Some papers present linear wireless networks for bridge [1], pipeline [2], or overhead transmission lines [3– 5] application. For instance, real time monitoring of power cables thermal conditions and ambient conditions such as temperature and humidity could result in higher dynamic rating of transmission lines and will increase the utilization of their power-carrying capabilities [6]. However, the systems described in these works are proprietary solutions, following no particular standard for communication and arising interoperability problems when they are used. Due to their linear geometry, direct transmission from data source to sinksisusuallynotpracticalbecausethesensornodes(SNs) have a limited communication range and data sources are generally far away from the sinks. Therefore, a multihop network is a good choice for data routing, and clustering topology is appropriate to achieve network scalability [7]. Topology design, power usage minimization, and installation cost are very important for successful deployment of linear WSNs while meeting the application requirements. This paper proposes a new WSN technology based on standard HDLC protocol for long-term continuous monitoring of large-scale linear infrastructures so that efficient monitoring and management systems can be established. As shown in Figure 1, wireless multifunctional SNs are installed on the critical components of large-scale infrastructures such as bridges, pipelines, or power cables, using linear topology. However, the power supply constraints of the WSNs deployed in these infrastructures pose great challenges in energy consumption. Hence, there is a need for reliable and low-power WSNs for linear networks capable of being powered through harvesting devices for long-term monitoring. Therefore, WSNs based on IEEE 802.15.4 standard for lowpower wireless transceiver technology need to be used [8]. Generally, the transmission range of the nodes is assumed to be 10–100 m with data rates of 20 to 250 kbps [9]. Hence, large network and multihop communication are required Hindawi Publishing Corporation International Journal of Distributed Sensor Networks Volume 2014, Article ID 916073, 14 pages http://dx.doi.org/10.1155/2014/916073 2 International Journal of Distributed Sensor Networks Table 1: Comparison in terms of devices power consumption, hops limit, and topologies for existing standard protocols and the proposed Wireless HDLC. Protocol ZigBee PRO WirelessHART 6LoWPAN SP100.11a Wireless HDLC Power consumption Very low in end devices Low in all WirelessHART field devices Low in host devices. Low in end devices. Low in all field devices High in router devices High in router devices High in router devices Maximum number of hops 30 4 255 (theoretical) 255 (theoretical) 124 normal (8 bit address) 8190 in extended (16 bit address) Main topologies star, mesh mesh mesh mesh bus, star 12 3 4 Sink N ··· Figure 1: Wireless linear network as a chain of low-power sensor nodes (SNs) deployed in linear topology. so that nodes relay the information to the data collector, thatis,thesink.Moreover,thesenetworkshavetocombine power and routing awareness, communicate power efficiently through the wireless medium, integrate data with networking protocols, and promote cooperative efforts of SNs [10]. Several wireless standards such as ZigBee [11], WirelessHART [12], 6LoWPAN [13], and SP100.11a [14]formedon top of IEEE 802.15.4 standard, which specifically address the typical needs of wireless control and monitoring applications have been actively pushing the application of wireless technologies in industrial measurement and control applications. The ZigBee protocol is the driver for the development of the 802.15.4 standard and uses the IEEE 802.15.4 PHY and MAC layers but it defines the network and application layer. The WirelessHART and ISA100.11a also use the 802.15.4 PHY but define their own MAC and network and application layers [15]. Following the OSI reference model, it specifies thenetworkandtransportlayerandusethe802.15.4PHY and MAC sublayer of the data link layer [16]. Generally, the network topology of these standards is designed as a mesh network and enables application-specific solutions to be developed for WSNs. However, except for the WirelessHART network where each device can act as a source or a router, in the other standard networks, dedicated routers nodes are necessary to provide communication between source nodes and sink. Moreover, the number of network hops allowable within these standards is limited. The maximum distance from a node to the sink that is allowed by the WirelessHART is of 4 hops, by ZigBee and ZigBee PRO is of 10 hops and 30 hops, respectively, and ISA permit up to 20 hops. The theoretical number of hops limit in a 6LoWPAN network is 255 (8 bits hop limit field). However, 6LoWPAN networks with this specification have not been reported in the literature to date [16]. These limitations are very important for WSNs deployed in large-scale infrastructures, where the number of hops is assumedtobeinorderofhundredsandeachnodeisboth source and router. In this framework, we present the implementation and evaluation of a bidirectional wireless communication schema for linear IEEE 802.15.4-compliant WSNsbasedonHDLCstandard[17] (Wireless HDLC). Table 1 illustrates the capabilities of the proposed Wireless HDLC network in comparison to the existing standard WSN solutions. The Wireless HDLC adopts the IEEE 802.15.4 PHY layer but defines a new TDMA-based MAC, network and transport layers based on HDLC standard. The issue regarding synchronization of nodes throughout the network is addressed by applying any of the time synchronization techniques available such as TPSN (timing-sync protocol for sensor networks) [18] or PTP (precision time protocol) [19]. These techniques may exchange timestamp messages to synchronize distributed clocks in a network while meeting the power usage and bandwidth minimization required by WSNs. The chain of shortranged wireless sensors creates a virtual wired link by means of an ad-hoc network. The system does not require complex routing techniques. The proposed Wireless HDLC supports half-duplex communication providing a bidirectional link between the SNs and the sink. The communication is done in rounds, one time from the sink node to the last node in the network (end node) and one time from the end node to the sink. The bidirectional link acting as a virtual conveyor beltcanbeusedtocollectdatafromdifferentsensorsalong thepath or send data from the base station to different sensors in the network. The data from multiple devices is encoded as HDLC frames and is collected in the available space of the IEEE 802.15.4 standard packet up to a maximum size of 125 octets [8]. In this way various nodes can send variable length packages in one communication round of the transmission grid, following a standard form. The paper is organized as follows. In Section 2 we review some existing related works. Section 3 describes the Wireless HDLC protocol stack layered architecture based on HDLC standard. Section 4 validates our design by demonstrating the Wireless HDLC network. Finally, this paper is concluded and the future work is presented in Section 5. 2. Related Work Wireless sensor network has been the focus of extensive study recently [20–24]proposingawidevarietyofalgorithmicand communication protocols solutions. Most studies are focused International Journal of Distributed Sensor Networks 3 on generic WSNs which assume that sensors are deployed randomly and abundantly in the same area and perform the same function. The smart features envision in the roadmap for research and development of the next generation WSNs, as digitalization, flexibility, intelligence, and customization deal with the interoperability problem in order to allow plug- and-play capability to accommodate progressive technology upgrades with hardware and software components. The plug-and-play capability for low-power WSNs can only be achieved by applying standard technologies such as ZigBee, WirelessHART, 6LoWPAN, or ISA SP100. Although, these standard solutions give support for mesh networking and can be used in a wide range of applications such as home automation, smart energy, building automation, industrial automation, and personal health care, they are not optimized to work in large-scale areas. Due to the geometry of largescale infrastructures, WSNs with linear topology have to be used. However, the design of these WSNs pose several challenges due to their linear nature, limited energy source, robustness to dynamic environment, and scalability to numerous number of sensor nodes. What follows describes the WSN design challenges for an efficient communication in this environment. 2.1. Energy Consumption. Awirelessmoduleisequipped with a limited energy source (i.e., battery, harvesting and device) and hence has an energy consumption capacity and lifetime that is dependent on that source. In a WSN, each node plays two separate and complementary roles: it can originate data and also has to route data. Moreover, if a few nodes deplete their energy resources, it can cause significant topological changes and might require rerouting of packets and reorganization of the network. 2.2. Operating Environment and Fault Tolerance. WSNs for large-scale infrastructures have to be designed with extreme environments in mind. The environmental interference but also physical damage or a depleted energy source may cause an SN to fail. However, the failure of a single node should not affect the overall operation of the network. 2.3. Scalability and Network Topology. Depending on the infrastructure’s length and the number of points of interest, the quantity of SNs deployed in these WSNs may be in the order of hundreds. Therefore, WSN protocols have to be designed to work with these large numbers of nodes. Also a major challenge is the deployment of these SNs to minimize the cost of deployment under the constraint of coverage, connectivity, and link outage probability so that the phenomenon of interest can be monitored efficiently. Moreover, additional SNs can be redeployed at any time to replace the malfunctioning nodes or due to changes in task dynamics. Between all these difficulties, the topology is maybe the most important challenge facing the development of WSNs for large-scale infrastructures. Topology is important for any type of network because it has a great impact on the communication performance of the system. In the literature we can find some examples of algorithms and protocols that are specifically aimed for linear topologies. In [25]Zimmerling et al. proposed the Minimum Energy Relay Routing (MERR) algorithm. Its aim is to minimize the routing path from every node to a common control center. In particular that work covers the routing problems of the special case of a linear network where nodes are located close to their neighbors. The Directional Scheduled MAC (DiS-MAC) [26] isanotherprotocolthathasbeendevelopedforWSNsthat shows a linear topology. With DiS-MAC, Karveli et al. a fail tolerant unidirectional routing protocol for linear network is proposed. In [23] the Wireless Wire (WiWi) protocol is described. This work proposes a bidirectional wireless communication schema with deterministic properties in terms of throughput and latency over a strip of pervasive devices with short-range transmission capabilities. The system is synchronous and fault tolerant and can provide support for an end-to-end communication. As shown in Table 2, both MERR and load balanced routing are focused on routing problems without considering the underlying MAC protocol or the transport layer. The DiS- MAC protocol is focused on TDMA-based MAC protocol andalsoonroutingproblemsinthelinearnetworkbut suffers from being unidirectional. The WiWi protocol defines a TDMA-based MAC protocol and it provides bidirectional communication over a single RF channel. However, in this protocol, power consumption is not considered, and the SNs have to be in active mode for long periods of time. Moreover, compared to standard technologies such as ZigBee, WirelessHART, 6LoWPAN, or ISA SP100, these protocols have a significant drawback providing incomplete architecture and no standard is followed. In next generation WSN’s vision, large, integrated, complex systems require different layers of interoperability, from a plug or wireless connection to compatible processes and procedures [27]. Although it bears many similarities with these works, such as routing techniques, the implementation of Wireless HDLC network differentiates itself from them in many other aspects. In particular, different from the protocols proposed in these papers is that HDLC has been widely implemented in cable networks because it supports both half-duplex and full duplex communication lines, point to point (peer to peer) and multipoint networks and switched or nonswitched channels. The HDLC protocol resides with layer 2 of the OSI 7-layer communication model, the data link layer. However, it offers three different modes of operation supporting a reliable and orderly transfer of packets in a distribute network (transport layer) and specifies the types of stations for data link control. The HDLC is essentially a centralized wireless network which uses a central network manager, the primary station, to provide routing and communication schedules to meet the requirements of wireless applications. The design of Wireless HDLC architecture is based on the requirements of WSNs for large-scale infrastructures, meeting the challenges for an efficient communication in these environments and the need for standard solution for next generation WSNs applications. In the proposed Wireless HDLC network, frames of many SNs can be transmitted in 4 International Journal of Distributed Sensor Networks Table 2: Several protocols for linear WSNs. Protocol Communication OSI Layer MERR [25] Unidirectional Network layer DiS-MAC [26] Unidirectional TDMA-based MAC and network layer WiWi [23] Bidirectional TDMA-based MAC and simple network layer Load balanced routing [35] Unidirectional Network layer one IEEE 802.15.4 standard packet traveling in the linear networks from the sink node to the end node and from the endnodetosinknode.Thisallowsdatacollectionandcontrol of individual or groups of low-power field devices deployed with linear topology. 3. Detailed Description This section presents a unique vision for the WSNs with linear topology in which the wireless network provides half-duplex communication and point-to-multipoint connection. Also, following the OSI reference model, the protocol stack layers of the Wireless HDLC networks are described. In Figure 1 the proposed Wireless HDLC network with a central network manager (sink) and SNs with routing functionality capable of building up the linear link is illustrated. 3.1. Data Link Layer. The Wireless HDLC protocol stack is designed as a synchronous multihop communication scheme and uses a TDMA-based MAC protocol that provides collision-free multiple access. The decision to focus on the TDMA approach arises largely from the fact that the energy consumption is significantly lower than the contention-based due to collision-free communication and minimization of idle listening. The operation of TDMA-based MAC is divided into sequences of phases as depicted in Figure 2. The sequences of phases consist of a network set-up phase and a communication phase. The set-up phase is designated forupdatingthesensormodelatthesink.Thesinkinforms each node about slots in which it should listen to other nodes’ transmissionandabouttheslots,whichthenodecanusefor its own transmission. Once the linear network is built, the system enters into the data transfer phase. The data transfer phase is divided into up-session and down-session. Each session consists of a data transmission/reception period and an idle period. The up-session provides time slots for each node, starting with the sink up to the last node in the network. The down-session provides time slots for each node, starting with the last node to the sink. Assuming that there are N nodes within a network then the session’s period consists of exactly Nslots. The slot duration is the time required to transmit two times a maximum sized IEEE 802.15.4 packet (10 ms) and the duration of idle period depends on the network communication rate. Any node that does not have data to send is assumed to be a repeater. During the data transmission/reception period, each node turns on its radio and sends/receives its data to/from his neighbor over its allocated slot-time and keeps its radio off at all other times. Time synchronization is a fundamental issue in TDMA protocol and for this, accurate timing is ensured by applying synchronization techniques such as PTP protocol [19]. By exchanging timing messages, within HDLC frames, the network may achieve high synchronization precision, in order of microseconds or submicroseconds, as an exact measurement of the transmission and reception times. The data traveling in the Wireless HDLC network is a collection of HDLC frames (superframe) transmitted in an IEEE 802.15.4 packet as illustrated in Figure 3. Each HDLC data is organized into frames using a frame delimiter, or flag, which is a unique sequence of bits [01111110].Aframe delimiter at the end of an HDLC frame may also mark the start of the next HDLC frame. Each frame contains an address field, a control field, information data, and optionally, a CRC field. The length of the address field depends on the total number of wireless sensors in the network and is normally 8 or 16 bits in length for networks of maximum 124 nodes, respectively, 8190 nodes. As specified in the ISO/IEC-13239 standard [17], the control field is 8 bit length indicating a command or a response and a numbers sequence where applicable. The standard HDLC frames indicated through the control field are the information transfer format command andresponse(Iformat),usedtotransmituserdatabetween stations; the supervisory format commands and responses (S format), used to perform control functions; and the unnumbered format commands and responses (U format), used for control purposes. The 5th bit position in the control field is called the poll/final bit or 𝑝/𝑓 bit and is used to providedialoguebetweentheprimarystationandsecondary stations. This is a very useful control in linear WSNs, where theprimarystationcanusethepollfunctiontoacquire responses from the SNs (secondary stations) in an end-to-end transmission. The data transfer transactions in the Wireless HDLC network are designed based on HDLC specifications. The HDLC offers three different modes of operation, the Normal Response Mode (NRM), Asynchronous Response Mode (ARM), and Asynchronous Balanced Mode (ABM) [17]. However, because of the linear nature and the requirements of Wireless HDLC only NRM and ABM modes are used. The NRM is a master-slave mode and is used to coordinate the data transfer between the network nodes and the sink. In NRM, the sink (primary station) gives permission for each network node (secondary station) to speak. The secondary station can only transmit a response when, and onlywhen,itisinstructedtodosobytheprimarystation. This transmission from the secondary station to the primary station may be one or more information frame. Once the last frameistransmittedbythesecondarystation,itmustwait once again for explicit permission to transfer anything from the primary station. International Journal of Distributed Sensor Networks 5 GW transmit transmit transmit 1 transmit Up-session Down-session Data transmission/reception period Idle period Data transmission/reception period Idle period Set-up phase Data transfer phase (this part repeats) 1 transmit transmit 1GW 2 Reception offset period GW: gateway node Node Time Node slot slot slot slot slot slot slotslotslotslotslotslot receivereceivereceivereceivereceivereceive N NN−1 N−1 N−1 N−2 1to N: node 1 to N Figure 2: TDMA-based MAC protocol for Wireless HDLC networks. PPDU Preamble sequence Start of frame delimiter Frame length PSDU 114Octets: Octets: PHY layer HDLC MAC sublayer 11112 Addressing fields Control Data FCS Addressing fields Control Data (max 127 octets) n0nk 2+2k−1+k[(a0+··· +a k)+(n 0+··· +n k)] 8+2k−1+k[(a0+··· +a k)+(n 0+··· +n k)] ··· FlagFlag a0(1 ÷ 3) ak(1 ÷ 3) Figure 3: Schematic view of HDLC superframe. In Figure 4, an example of Normal Response Mode (NRM) data transfer is described for the wireless multipoint line using the P(oll)/F(inal) procedure. In this example, a primary station (sink) and 5 secondary stations (SNs) on a multipoint line are illustrated. The sink sends out its data in the TDMA up-session (1) with 𝑃=0to SN 5 (C5) and with 𝑃=1to SN 2 (C2); C2 can transmit data. Next, in downsession (1), C2 sends data to primary station with 𝐹=0 to a signal that has more data to send in the next downsessions. Moreover, the sink can receive data from various secondary stations in the same session. Therefore, in the upsession (2)the sink informs C1 that can transmit data. Hence, in the down-session (2), the sink receives data from C1 and C2. However, the total length of these frames cannot exceed the maximum length of an IEEE 802.15.4 standard packet. In the wireless HDLC architecture the primary station is also the source of time synchronization. Each IEEE 802.15.4 packet transmitted by the primary station contains a frame with its timing information. Using this data, the secondary stations can adjust their clock to the primary station. The ABM mode allows the data transfer between two peer devices (combined stations). The combined station acts as both a primary and a secondary station. The ABM is used as data transfer transaction mode between neighbor nodes in theset-upphaseandalsointhecommunicationphase,when a node transmits rescheduling or energy information to its neighbors. 3.2. Network Layer. In the literature, many routing algorithms and protocols are reported for WSNs. As reported by Singhetal.allmajorroutingprotocolsproposedforWSNsare broken down into seven categories: location-based protocols, data-centric protocols, hierarchical protocols, mobility-based protocols, multipath-based protocols, heterogeneity-based protocols, and Quality of Service (QoS)-based protocols [28]. 6 International Journal of Distributed Sensor Networks Primary C1 C2 C3 C4 C5 Primary C1 C2 C3 C4 C5 Primary C1 C2 C3 C4 C5 Primary C1 C2 C3 C4 C5 Up-session (1) Up-session (2) Down-session Down-session Data |P=0,A=C5 Data |P=1,A=C2 A=C2,F=0|Data Data |P=1,A=C1 A=C1,F=1|Data A =C2,F=1|Data Figure 4: Data transfer in Wireless HDLC multipoint line using poll/final procedure. From the literature review of the routing techniques and basedonthenetworktopologyandchallengesoftheWireless HDLC, the hierarchical protocol Power-Efficient Gathering in Sensor Information Systems (PEGASIS) [29]waschosen. The main reason for adopting this routing protocol was that in Wireless HDLC, where wireless network is constituted by low-power SNs distributed along a strip, the PEGASIS can form a chain from SNs so that each node transmits and receives data from a neighbor. PEGASIS protocol provides the mechanism for sensors to transmit data to their closest neighbor until the end of the network is reached. In the PEGASIS routing protocol, the construction phase assumes that all the sensors have knowledge about their positions and use a greedy approach. In the Wireless HDLC, the positions of the sensors can be determined through the rules such as bestlinkqualityorlowestdelay.Whenasensorfailsordies due to low battery power or when it has run out of energy, thechainisconstructedusingthesamegreedyapproachby bypassing the failed sensor. 3.3. Transport Layer. The transport control protocols for WSNsareimportantforreliabledatadisseminationand energy-conservation. Generally, transport control protocols may include two main functions: congestion control and loss recovery [18]. In order to weaken congestion, the transport layer can use end-to-end mechanism like TCP or hop-by-hop approaches. However, the end-to-end mechanism, which is based on acknowledgments and end-to-end retransmissions, imposes significant overhead for the implementation of these solutions in WSNs. Moreover, hop-by-hop approaches can control congestion with less ongoing packets in networks, while it needs to change the behavior of each node on the way from source to destination. Due to bad quality of wireless channel, sensor failure, and/or congestion, the transport layer should manage the packet loss and data from SNs should be reliably transferred to the sink. Also, the commands and queries from sink should be reliably delivered to the target SNs to assure the proper functioning of the WSNs. This transport layer aims to address both the reliability andcongestionproblemsusingamixedsolutionbetween end-to-end mechanism and hop-by-hop approach through HDLC supervisory frames. Between a pair of nodes, which transmit data accordingly to PEGASIS routing technique, in case of packet errors, each node performs hop-by-hop recovery to fetch the lost packets from neighbor nodes. An SN tries to transmit a package to its neighbor until it receives a Receive Ready (RR) supervisory frame, which acknowledges the reception of this package. Using the TDMA-based protocols explained above, the number of retries is limited by the time slot period and the size of the superframe. To obtain a good compromise between the hop-by-hop reliability, the link delay, and the energy consumption in the proposed WSN, the transmission time slot was set to 10 ms permitting two reties of a maximum sized IEEE 802.15.4 packet. However, end-to-end reliability cannot be maintained in all cases even though hop-by-hop reliability is ensured. Therefore, an end-to-end mechanism is also used for the data transfer between SNs and the sink as illustrated in Figure 5. This method is based on the Selective Reject Automatic Repeat Request (SREJ ARQ) technique provided by HDLC protocol. As shown in Figure 5, the SREJ ARQ technique uses the Send Sequence Number (NS) and the Receive Sequence Number (NR) to control the correct data exchange between the sink and a Sensor Node (SN). International Journal of Distributed Sensor Networks 7 Sink SN NS NR Frame type Message Frame type NR P/F P/F I, 0, P(1), 0 I, 0, F(1), 1 I, 1, P(1), 1 I, 1, F(0), 2 I, 2, F(0), 2 I, 3, F(1), 2 S, RR, P(0), 3 (a) Sink SN I, 0,P(1), 0 I, 0,F(1), 1 I, 1,P(1), 1 I, 1,F(0), 2 I, 3,F(1), 2 I, 2,F(0), 2 S, REJ, P(1), 1 (b) Figure 5: HDLC operation: (a) normal two-way data exchange and (b) selective reject ARQ. 3.4. Application Layer. Generally, the application layer provides necessary interfaces to the user to interact with the physical world through the WSN. Hence, the role of the application layer is to abstract the physical sensors and topology of the WSN for the applications. The large variety of available sensor types complicates the integration of sensors into monitoring systems. Therefore, the use of standard interfaces and data encodings such as IEEE 1451 Smart Transducer Interface Standard [30,31] and time synchronization standards such as IEEE 1588 PTP protocol [17]isrecommended. Hence, we propose the use of standard applications, which can be easily implemented on the Wireless HDLC network, in order to hide the underlying layers, the network communication details, and heterogeneous sensor hardware from the applications built on top of it. Figure 6 illustrates the proposed half-duplex communication model suitable for low-power WSN and the handling of downstream and upstream data flows. The upstream data flow is generated by the sink and flows up to the last node inthenetwork.Thedownstreamdataflowisgeneratedby thelastnodeinthenetworkandstartswhentheupstream flow reaches this node. In this way a two-way communication cycle is generated which repeats itself along the time based on a network communication period. This data flow has a strict staggeredpattern:eachnodewillcalculatethetriggertimefor receiving and transmitting a time slot based on the total numberofhops.Thehop-by-hopapproachinapairofconsecutive nodes is also depicted in Figure 6; a node transmits an IEEE 802.15.4 packet to the next node and waits for a message to acknowledge this. With a transmission rate of the 802.15.4 Standard2.4GHzphysicallayerof250kb/s,amessagewith the maximum size of 127 bytes (125 bytes payload + 2 bytes PHY dependent for IEEE 802.15.4) transmitted between pair nodes in 4000 us and with an acknowledge timeout of 1000 us is allowed for one retransmission. Depending on the synchronization accuracy, the pairs of sensors will use a time offset for the transmit-receive process to avoid loss of messages. The upstream IEEE 802.15.4 packet transmitted by the sink node contains HDLC frames with data, commands, or timing information to SNs. The downstream packet is a collection of HDLC frames with the responses from SNs to the sink commands. If an SN does not receive any command fromthesinknodeitwillworkasarouterandwilltransmit thedownstreampackettothenexthop. 4. Implementation and Performance Evaluation This section starts by introducing the hardware platform weusetoevaluatetheWirelessHDLCandthenoffersa description of its implementation and provides the results of our proposal. 4.1. Hardware Platform. We base our implementation on the XBee and XBee-PRO 802.15.4 OEM RF modules [32]provided by Digi. The modules contain the MC13211 platform which incorporates a low-power 2.4 GHz radio frequency transceiver and an 8 bit Freescale HCS08 microcontroller [33]. The modules are driven by a 16 MHz crystal source and contain an internal event timer block of 24 bit clocked at a rate varying from 15 kHz to 2 MHz used to maintain the SNs time and synchronization. Freescale provides for this platform a simple IEEE 802.15.4 physical layer library in ANSI C used to build our proposed protocol stack and the new firmware for XBee modules. A prototype design, using the XBee module, has been developed for the Wireless HDLC. The prototype is 8 International Journal of Distributed Sensor Networks T T Space (nodes) time (slots) Master node 01234 End node Two way communication cycle (min T) R T Receive data Transmit data Idle state (sleep, measurements) Τ I I I I II T IR TI I I I T I R T III R I R I II R I R ACK Data R T R T T R T I I R T R T T R I I I T T R T I I R I I R I I I I R T R T R TR T R T I R T R T R T R T R Processing and Node2 synchronization Communication Receive time offset Node3 synchronization T 2T 3T . . . . . . . . . . . . (n−3)T (n−2)T (n−1)T nT (n+3)T (n+2)T (n+1)T (n+4)T (2n − 1)T (2n − 2)T 2nT (2n + 1)T +Δ (2n + 2)T +Δ (2n + 3)T +Δ (3n − 1)T +Δ (3n − 2)T +Δ (3n − 3)T +Δ (3n + 1)T +Δ n−3 n−2 n−1 n ··· Δsleep time min 2(𝛼2+𝛼 3) time (𝜏) timeout (T −𝜏−𝛼 3) 3nT+Δ error (𝛼3) error (𝛼2) Figure 6: Bidirectional communication for low-power Wireless HDLC networks. equipped with a harvesting device as power supply [34]. Also, theboardincludes8ADCchannelsof10bit,oneSPIport,and a RS232 interface. Hence this platform can be equipped with various sensors to monitor phenomenon of interest. 4.2. Protocol Stack Design. Figure 7 describes the overall design of the Wireless HDLC data link layer which consists of four major modules: timer, TDMA function, HDLC framer, andthestatemachine.Thetimermoduleprovidesaccurate timing to ensure the system operates correctly. The timer module has been designed as a real time clock capable of providing accurate triggers for wake-up, measure, receive, or transmit states of the SNs and also to keep the 10 ms time slots in synchronization. To keep the synchronization of the timer module, a simplified PTP protocol [34]isusedtoexchange timing messages in the network. This protocol provides methods to implement transparent clocks in multihop networks, to calculate the delay time, and to adjust the offset between the master clock and slave clocks. With this method, each SN can also synchronize their source clock using the trim capability of the 16 MHz crystal, which reduces their drift with the master source clock. Using the 24 bit counter clocked at a rateof2MHz,thenodesareabletoobtainsynchronization accuracy in the order of a microsecond. The TDMA function determines the usage of time slots for communication. This module uses a schedule to calculate thenumberoftimeslotsbetweenthedownstreamand upstream data flows for each sensor according to the number of nodes in the network. It also calculates the time for the next communication cycle based on network communication International Journal of Distributed Sensor Networks 9 Physical layer TDMA MAC layer Packet receive State machine Timer module Packet transmit TDMA function HDLC framer HDLC framer Application Figure 7: HDLC protocol stack architecture. Sync (T1) Sync Sync Sync (T1) Sync Sync (T4) T3 Master clock-0 Transparent clock-2 T4 T1 Slave clock-3 Transparent clock-1 (1) (2) (3) (4) (3) (5) (6) (7) (8) (9) (6) (9) (T1+𝛿 1) (T1+𝛿 1) (T4−Δ 1) (T1+𝛿 1+𝛿 2) (T1+𝛿 1+𝛿 2) (T4−Δ 1−Δ 2) T1+d 1+d 2, T2 T1+d 1+d 2, T2 T1+d 1+d 2, T2, T1+d 1+d 2, T2, T3, T4−Δ 1−Δ 2 Delay req Delay req Delay req Delay resp Delay resp Delay resp . . . Figure 8: Synchronization messages exchange for linear topology. The slave communicates with the master through transparent clocks. period. Every event that can affect the time scheduling will cause the TDMA function to reassess this scheduler. The functionality of the HDLC framer is to decode the received messages in order to get the relevant information fortheSNandtogenerateandaddHDLCframestothe transmitted messages. If an SN receives an HDLC frame from the sink node with his unicast address, it will delete the frame from the IEEE 802.15.4 packet and will retransmit the remaining package. Next, in the downstream data flow, the node will add the response, for the sink query, to the received superframe and it will transmit the new package to the next node in the network. The state machine is responsible for sending and receiving a packet over the transceiver. Based on the TDMA triggers, it executes the transaction in a slot and uses a light implementation of PTP protocol to adjust the timer module. 4.3. PTP Protocol over Wireless HDLC. The PTP standard specifies a clock synchronization protocol applicable to distributed systems consisting of one or more nodes communicating over a network. The protocol provides a mechanism for synchronizing the clocks of participating nodes to a high degree of accuracy and precision. However, a full implementation of this protocol as is specified by the IEEE 1588 standard is not suitable for low-power WSNs. The main challenge is that the IEEE 1588 messages size is more than the maximum size allowed in IEEE 802.15.4. Therefore, a light implementation of this standard is proposed for Wireless HDLC networks. The wireless implementation of PTP protocolisbuiltontopofHDLCprotocolconsistingofPTPdevices including ordinary clocks and transparent clocks. Figure 8 illustrates the basic pattern of synchronization message exchange in the linear topology of Wireless HDLC. The timestamp information obtained with this exchange of PTP messages may be used to compute the offset of the SNs (transparent clocks) with respect to the sink (master clock) and the mean propagation time of messages between the two clocks. Considering that the master-to-slave delay is equal to the slave-to-master delay and by using the time information in the four messages illustrated in Figure 8, these quantities canbecalculatedfromthemeasurementvalues𝑇1,𝑇2,𝑇3 and 𝑇4: delay𝑘=(𝑇2 −𝑇1 + (𝛿1+⋅⋅⋅+𝛿 𝑘−1)) 2 +(𝑇4− (Δ1−⋅⋅⋅−Δ𝑘−1)−𝑇3) 2, offset𝑘=(𝑇2− 𝑇1+ (𝛿1+⋅⋅⋅+𝛿 𝑘−1)) 2 −(𝑇4− (Δ1−⋅⋅⋅−Δ𝑘−1)−𝑇3) 2, (1) where 𝛿1,...,𝛿𝑘−1 is the accumulated residence time in transparent clocks for Sync message and Δ1,...,Δ𝑘−1 is accumulated residence time in transparent clocks for Delay Req message. The synchronization interval is equal to the network