<<

Wireless : Wi-Fi, , IEEE 802.15.4, DASH7

Helen Fornazier, Aurélien Martin, Scott Messner 16 march 2012

Abstract This article has for objective to introduce the basic concepts of and to compare dierent technologies applied to embedded systems. It focuses on Wi-Fi, Bluetooth, IEEE 802.15.4 and Dash7. For each technology, this article covers , topology, range, energy consumption, data rate, application, security and peculiarities. At the end of the article, the developer should be able to choose the best wireless technology for their own embedded application and have a basic notion as to how to integrate the technology into their system.

Contents

1 Introduction 3

2 Wi-Fi 3 2.1 Origins ...... 3 2.2 Frequency Channels ...... 4 2.3 Multiplexing ...... 4 2.4 ...... 4 2.4.1 Infrastructure Topology (Point-to-Point or Point- to-Multipoint) ...... 4 2.4.2 Ad-Hoc Topology ...... 5 2.5 Layers Denitions ...... 5 2.6 Range, Power Consumption, Data Rate ...... 8 2.7 Security ...... 8 2.8 Particularities and Embedded Applications ...... 8 2.8.1 Wi-Fi Conguration Interface ...... 10 2.8.2 Embedded integration ...... 10 2.8.3 Other Considerations ...... 10 2.8.4 Applications of Ad Hoc: Wi-Fi Direct ...... 12

3 Bluetooth 12 3.1 Origins ...... 12 3.2 Frequency Channels ...... 12 3.3 Multiplexing ...... 13

1 3.4 Network Topology ...... 13 3.4.1 Piconet Topology ...... 13 3.4.2 Scatternet Topology ...... 13 3.5 Layers Denitions ...... 13 3.5.1 The Bluetooth Controller ...... 15 3.5.2 The Bluetooth Host ...... 15 3.5.3 Host Controller Interface (HCI) ...... 15 3.5.4 Generic Access Prole (GAP) ...... 15 3.6 Range, Power Consumption, Data Rate ...... 15 3.6.1 Bluetooth versions ...... 16 3.7 Security ...... 16 3.8 Particularities and Embedded Applications ...... 16 3.8.1 Sni, Hold and Park mode ...... 17

4 IEEE 805.15.4 17 4.1 Origins ...... 17 4.2 Frequency Channels ...... 17 4.3 Multiplexing ...... 18 4.4 Network Topology ...... 18 4.4.1 Star Topology ...... 18 4.4.2 Mesh Topology ...... 18 4.4.3 Enabled Mode ...... 18 4.4.4 Non-beacon Enabled Mode ...... 19 4.5 ZigBee ...... 19 4.5.1 Origins ...... 19 4.5.2 Network Organisation ...... 19 4.6 Layers Denitions ...... 19 4.6.1 Network Layer ...... 19 4.6.2 Aplication Layer ...... 20 4.7 Range, Power Consumption, Data Rate ...... 20 4.8 Security ...... 20 4.9 Particularities and Embedded Applications ...... 20

5 Dash7 20 5.1 Origins ...... 21 5.2 Frequency Channels ...... 21 5.3 Multiplexing ...... 21 5.4 Network Topology ...... 22 5.5 Layers Denitions ...... 22 5.6 Range, Power Consumption, Data Rate ...... 22 5.7 Security ...... 22

6 CSMA/CA 23

7 Comparison table 23

8 Conclusion 23

2 9 References 23 9.1 Wi-Fi ...... 23 9.2 Bluetooth ...... 24 9.3 IEEE 802.15.4 ...... 25 9.4 Dash7 ...... 25

1 Introduction

Wireless communication in embedded systems is a growing eld. It can be used in a wide range of situations where mobility is essential and wires are not practical. The key complications to choosing a wireless technology revolve around the following requirements [ADA10]: ˆ Range ˆ Reliability ˆ Compliancy (Standards)

ˆ Security ˆ Cost ˆ Power Consumption ˆ Transmission rate

ˆ Envisioned This article aims at helping in selecting the best available embedded wireless technology for your devices amongst some of the most popular choices used in the market today. The choices evaluated are Wi-Fi (802.11 a/b/g/n), Blue- Tooth, ZigBee (and 802.15.4), and Dash7.

2 Wi-Fi

Wi-Fi is the common name used for the dierent versions of the IEEE 802.11 standard (a/b/g/n/i, etc.), which describes the technologies and protocols for achieving a Wireless (WLAN), a wireless bridge, or an adhoc network [WFD12][80207].

2.1 Origins The standard IEEE 802.11 for WLAN networks was created in 1985. Wi-Fi suggests Wireless Fidelity, the term is used commercially since 1999 with the creation of Wi-Fi Alliance. Wi-Fi Alliance is responsible for the logo Wi-Fi which gives certications between the devices sporting the logo.

3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Channel 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472 2.484 Center Frequency (GHz)

22 MHz

Figure 1: Wi-Fi channels in the 2.4 GHz band. Source : http://en.wikipedia.org/wiki/IEEE_802.11

2.2 Frequency Channels In embedded systems, there are four main versions of the 802.11 standard that are often used [GAI12]. 802.11a is one that operates in the 5GHz frequency ISM band. In terms of Compliancy and Reliability, this is useful when it is important to avoid interference with other RF devices which commonly operate in the 2.4 GHz ISM band (unlicensed RF band for industrial, scienti, and medical devices). 802.11b/g operate in the 2.4 GHz band, but have faster data transmission rates (11 Mbps and 54 Mbps respectively). 802.11n is the newest and most popular version, and can be congured to operate in either the 2.4 GHz or 5 GHz frequency bands. The 2.4 GHz band used by 802.11b/g is divided into channels separated from 5 MHz each. Of the 13 (14) channels, there is an only set of 3 channels (4 in certain countries) which do not overlap.

2.3 Multiplexing Wi-Fi uses OFDM (Orthogonal Frequency-Division Multiplexing) to perform a full-duplex communication in a single channel. CSMA/CA (see section 6) is used as a mechanism to avoid collision between the overlapping channels and other technologies that use the same ISM band frequency such as ZigBee and BlueTooth.

2.4 Network Topology Depending on the desired application, Wi-Fi is commonly used in two dierent network architecture congurations (Note: dierent network topologies can be implemented at the level) [80207].

2.4.1 Infrastructure Topology (Point-to-Point or Point-to-Multipoint) A standard network architecture in Wi-Fi uses an access point (AP) and multiple clients which communicate on network through the latter.

4 Figure 2: The Infrastructure topologies Basic Service Set (BSS) declares one dedicated AP and multiple clients in any particular WLAN. Source : http://en.kioskea.net/contents/wi/wimodes.php3

2.4.2 Ad-Hoc Topology The 802.11 standard allows also ad-hoc mode with Indepedant Basic Service Sets (IBSS). This conguration permits a to operate as both an AP and a . Ad-hoc infrastructures are widely used in embedded wireless implementa- tions because they permit communication between two devices without a ded- icated access point. Implementing ad-hoc requires careful considerations de- pending on the power consumption requirements of the system.

2.5 Layers Denitions IEEE 802.11 denes Physical (PHY) and (LLC + MAC) layers for generic wireless connexions using electromagnetic waves. There are 3 distinct physical layers, respectively based on DSSS, FHSS and infrared light. The LLC is based on IEE 802.2, which allows a Wi-Fi network to join any network implementing an IEEE standard. The MAC layer, though specic, is deliberately close to 802.3's one (terrestrial ). It uses CSMA/CA (see section 6). There are two access methods : DCS (Distributed Coordina- tion Functions), based on best eort, egalitarian (equal access of each actor to the medium) for asynchronous data transport, and PCF (Point Coordination Function), based on polling, used for sensitive data and real time applications.

5 Figure 3: An Extended Service Set denes the ability of two BSSs to be con- nected via their APs. Source : http://en.kioskea.net/contents/wi/wimodes.php3

6 Figure 4: IBSS provides the capability for devices to interconnect by functioning dually as an AP and a client. Source : http://en.kioskea.net/contents/wi/wimodes.php3

7 Protocol Release Frequency data rate Inner range 802.11a 1999 5 GHz OFDM 54 Mbps 35 m 802.11b 1999 2.4 GHz DSSS 11 Mbps 35 m 802.11g 2003 2.4 GHz OFDM/DSSS 54 Mbps 38 m 802.11n 2009 2.4/5 GHz OFDM 150 Mbps 70 m

Table 1: Wi-Fi protocols overview. Source : http://en.wikipedia.org/wiki/IEEE_802.11

Wi-Fi is widely used under IP protocol.

2.6 Range, Power Consumption, Data Rate Some important considerations - If data-transfer reliability and speed are impor- tant, 802.11n supports Spaced-time block coding (STBC) and Maximal Ratio Combining (MRC). STBC provides redundancy by using multiple receivers to receive messages on multiple channels. This reduces error-rate but consumes more power. MRC similarly transmits messages on multiple channels. source: http://en.wikipedia.org/wiki/IEEE_802.11

2.7 Security Many commercially available embedded Wi-Fi modules come with the added option for conguration in dierent forms of security at the physical and trans- port levels. TKIP (or WPA) is considered to be sucient protection for most low-security applications. WPA2 is considered to be the most secure. Other se- curity protocols for encryption of data can be added in the dierent OSI layers, but WPA and WPA2 are available for basic encryption. WPS - Wi-Fi protected setup is a Wi-Fi conguration and authentication technique using push buttons for input entry. This has been proven susceptible to brute-force attacks.

2.8 Particularities and Embedded Applications Because embedded systems often have very specic constraints to meet, there are some particularities which are generally followed. This section provides some common examples for implementing embedded Wi-Fi at dierent levels of complexity. A WLAN Module is a full-featured Wi-Fi module provided for wireless com- munication abstraction. It most commonly requires a 3.3V power connection and an external interface (SDIO, SPI, UART, USB, etc). This type of WLAN Module is used more often with legacy, or existing em- bedded devices with an available . These plug-in-play modules are cheap, but they require the UART connection (which it can sometimes be im- portant to leave available for debugging purposes and wired software updates).

8 Figure 5: Wi-Fi module. Source : http://www.ept.ca/news/designing-embedded-systems-with-wi-- connectivity/1000633756/

Figure 6: Easy serial-to-Wi-Fi package by GainSpan. Source : http://www.gainspan.com/products/GS1011_serial-to-wi- _eval_kit.

9 Some other interesting Wi-Fi modules to consider at a reasonable price. The cost can vary dramatically depending on features of reliability, range, power consumption, and Wi-Fi standard used. LM006 NanoAdapter (uses USB) cost 25 euros GS1011M GainSpan 802.11b Low Power Wi-Fi cost 30 euros. Provides im- plemented TCP/IP Stack and security. Connection via UART/SPI/I2C/JTAG

2.8.1 Wi-Fi Conguration Interface Out-of-the-box Wi-Fi needs to be hardware calibrated and software congured depending on the system and the desired operating parameters. Most self- containing Wi-Fi modules come pre-congured to avoid complexity in cost of calibration. Wi-Fi conguration can also be done via external connection to the embedded device (USB or Serial). The diagram shows below a Wi-Fi cong module as part of the application layer. The Wi-Fi host must be capable of running a Wi-Fi host driver (example installed with a special conguration software sends commands which are received and interpreted by the Wi-Fi conguration driver). With RF tags and devices which cannot be congured via a connection in- terface, an external conguration application would be used to congure the device via Wi-Fi (device would originally have a factory-reset ). Cong- urable parameters may include the SSID, or the password. Simple Network Management Protocol (SNMP) is a commonly used con- guration protocol used for Wi-Fi devices that require an external, wireless conguration interface.

2.8.2 Embedded Software integration One may also choose to implement Wi-Fi with just the RF receiver. This allows more freedom, and a greater capacity to handle multi-socket communication, but it can be much more complex. Unlike a fully-integrated WLAN Module, the TCP/IP stack must be separately added for handling the underlying com- munication protocol layers comprising the Wi-Fi standard.

Choosing a TCP/IP stack Iwip seems to be the stack of choice by most implementers. It can be found here : http://savannah.nongnu.org/projects/lwip/ There are other open-source and non free versions.

2.8.3 Other Considerations Power Consumption: Wi-Fi Power-save polling (PS-polling) A Wi- Fi module is said to be `active' when it is actively sending or receiving data. Though it varies depending on Wi-Fi modules and driving software, Wi-Fi can consume anywhere between 30% and 60% of the total power consumed during active state in comparison to standby state.

10 Figure 7: Software architecture of an embedded device with all networking and WLAN functionality resident in the WLAN module. Source : http://www.ept.ca/news/designing-embedded-systems-with-wi-- connectivity/1000633756/

11 Many Wi-Fi devices can be congured for variable power-save polling (PS- polling). This concept allows the Access Point to hold onto a queue of packets until the client wakes up and polls for the pending data.

2.8.4 Applications of Ad Hoc: Wi-Fi Direct Wi-Fi Direct allows connection between devices without a dedicated access point. It has been implemented on recent versions of such as the Samsung Galaxy S. This is done by including software which use the de- vice's Wi-Fi as if it were an access point (SoftAP). This makes tethering possible among other things.

3 Bluetooth

Bluetooth technology is used in many devices such as mobile phones and per- sonal . It is designed to be low cost, low range and low power supply.

3.1 Origins Bluetooth was created by Ericsson in 1994 as a wireless alternative for RS232 data cables. Nowadays, Bluetooth is managed by Bluetooth Special Interest Group (SIG) and its specication can be found on their site: www.bluetooth.org. To be able to use Bluetooth for commercial use, you need to be a member of SIG. Adopter members don't need to pay. Bluetooth v1.2 was ratied as IEEE 802.15.1.

3.2 Frequency Channels Bluetooth uses the unlicensed 2.4 GHz ISM Band (2400 - 2483.5 MHz), which it shares with Wi-Fi and IEEE 802.15.4 as well. Bluetooth denes 79 non-overlapping frequency channels, each spaced by 1MHz from the previous one, starting at 2402 MHz, with a lower guard band of 2 MHz and a upper guard band of 3.5 MHz in the 2.4 GHz ISM Band [BSIGF]. The frequency channel can be calculated: f=2402+k MHz, k=0,. . . ,78. 3.2.1. Frequency-Hopping (FHSS) As a mechanism to avoid collision between Wi-Fi, ZigBee, other Bluetooth networks, or other wireless using the same 2.4 GHz ISM Band, Bluetooth uses FHSS, which implements jumping from one channel to another from time to time. Bluetooth implements an AFH mode (Adaptive Frequency-Hopping). In this mode, Bluetooth's devices listen to the channel and if it is occupied, then a new channel is chosen.

12 3.3 Multiplexing Bluetooth uses TDD (Time Division Duplex) to perform full-duplex communica- tion. The master (see section 3.4. Network Topology for master-slave structure) denes slots of time and allocates one slot per slave. The devices don't transmit at the same time, just in their respective allocated slot. Therefore, two parallel Bluetooth networks at the same frequency channel (see 3.3. Frequency Channels) could potentially disturb each other. To avoid this kind of interference, the protocol implements FHSS (frequency-hopping spread spectrum, see 3.3.1. Frequency-Hopping Spread Spectrum for more de- tails). Bluetooth uses CSMA/CA (see section 6 for CSMA/CA) to avoid collision when using a shared channel with another .

3.4 Network Topology Bluetooth is organized in master-slave mode. The topology supports 1 master, 7 slaves and up to 255 slaves in parked mode (waiting to be awakened by the master). The master denes the clock and time slots for all nodes. A master can request to change his role with a slave, at which point the slave becomes the master and the master becomes the slave. For example: a head phone starts the communication as a master, but it prefers to be the slave. Two basic topologies are possible in Bluetooth : Piconet and Scatternet Topology.

3.4.1 Piconet Topology In the piconet topology, the master connects to several slaves, but the slaves don't communicate between them, even passing through the master. Communication between the slaves can be performed in a higher software layer, but the master is not naturaly like a router.

3.4.2 Scatternet Topology A slave from one piconet can be master of another piconet. This is called scatternet topology.

3.5 Layers Denitions The Bluetooth layers can be divided in three sub-categories : ˆ The Bluetooth controller ˆ The Bluetooth host

ˆ The Generic Access Prole (GAP).

13 Figure 8: Piconet topology.

Figure 9: Scatternet topology.

14 3.5.1 The Bluetooth Controller The Bluetooth controller is divided into three main parts : Radio: responsible of sending in the physical channel. LC (Link Control): Responsible for the , it encodes and de- codes Bluetooth packets, manages the time schedule and takes care of AFH services. LM (Link Manager): Responsible for creating a logical link with an other Bluetooth device. It manages the discovery service. The Bluetooth controller exposes to the host three basic types of services: Device control services: Allows modications in the behaviour of the Blue- tooth device. Transport control service: Controls channels and links. Data service: Carries data between devices.

3.5.2 The Bluetooth Host SDP (Service Discovery Protocol): Responsible for managing the discovery ser- vice on the host's side. L2CAP ( and Adaptive Protocol): responsible for man- aging the resource, the controller is assumed to have a limited buer and the applications can be aware of this.

3.5.3 Host Controller Interface (HCI) The HCI describes the interface protocol between host and controller.

3.5.4 Generic Access Prole (GAP) The Bluetooth stack layer aims at providing full interoperability between layers, including layers at the top of the stack. The Generic Access Proles are a list of many other dened layers for a special kind of application. For a headset device (for example) it may support the Headset Prole (HSE).

3.6 Range, Power Consumption, Data Rate The Bluetooth are dened in 3 classes [BSIGT]:

Class 3: ˆ Range: 1 meters (max). ˆ Maximum Output Power: 1 mW.

Class 2: (most common) ˆ Range: 10 meters (max). ˆ Maximum Output Power: 2.5 mW.

15 Class 1: (for industrial uses). ˆ Range: 100 meters (max). ˆ Maximum Output Power: 100mW.

3.6.1 Bluetooth versions The Bluetooth wireless technology is basically divided in two dierent systems: Basic Rate (BR) and Low Energy (LE). The BR systems can include the Enhanced Data Rate (EDR) mode and a High Speed (HS) mode. Pure BR systems (v1.2) are up to 721 Kbps [BSIGG]. BR/EDR (v2.0 and v2.1) oers the 2 Mbps (referred as π -DQPSK) and 3 Mbps (referred as 8DPSK) 4 modes and HS (v3.0) can reach 24 Kbps [BSIGS]. LE systems (v4.0) have lower consumption and lower data rates. Versions 2.1 and 2.0 are backward compatible. The Bluetooth LE has an entirely new compared to the stan- dard protocols dened in v1.0 v2.0 and v3.0, previously named WiBree and Bluetooth ULP (Ultra Low Power) [BVW12]. The wake up latency usually is of about 3 seconds [TWB10].

3.7 Security In Bluetooth v2.0 and earlier, security is based on PIN code authentication : each device must enter the same PIN code. Limited input devices like headsets usually have a default PIN code dened inside (0000 or 1234) [PMW12]. Bluetooth v2.1 is backward compatible and it implements the Secure Simple Pairing (SSP), using public key . The goal is to simplify the pairing procedure for the user and improve security mainly against Eavesdropping and Man-In-The-Middle attacks. SSP has 4 pairing procedures [BSIGB]: Numeric Comparison: The user must conrm that the number displayed on one device is the same as on the other device Just Works: The user must conrm the connection. Used in scenarios where one of the devices is really limited like headsets with no display or keyboard. This pairing method oers no protection against Man-In-The-Middle attack. Out of Band: Higher security method, dierent types of exist. NFC system is an example. Passkey Entry: The user must enter the PIN number displayed on one device into the other.

3.8 Particularities and Embedded Applications In embedded systems applications the radio class 2 is most used, it is usually found in mobile phones.

16 One can nd Bluetooth transceivers in the market starting at $7, the con- nection is usually made by UART interface.

3.8.1 Sni, Hold and Park mode Bluetooth devices have 3 modes to save power energy in transmission inactive state : sni mode, hold mode and parked mode [BSIGM].

ˆ Sni mode: the slave must listen during every master-to-slave time slot, it can be inactive in the others slots. ˆ Hold mode: In this mode, slave and master should agree on the duration the slave remains in hold mode. When in hold mode, the slave is free to do other things like attending another its own piconet or entering power save mode. ˆ Park state: The slave gives up his logical transport address and receives a new address to be used in park state. The slave wakes up from time to time to synchronize with the master who sends a dened message (called beacon train) with a constant time period. The slave can be swapped to an active state by the master's beacon train.

4 IEEE 805.15.4

While Wi-Fi and Bluetooth are very power-greedy, and with the rise of em- bedded systems, the need has been heavily felt for more and more autonomous ones, and thus for a more convenient . This protocol has been described by the IEEE 802.15.4 group. It is intended for wireless networks with small dimensions, small consumption and small cost (WPANs for Wireless Personnal Area Networks). It's thus perfectly adapted to the embedded world. Only a physical (PHY) and a (MAC) layer are dened, upper layers being left to the discretion of implementations.

4.1 Origins IEEE 802.15.4 was released 12 May 2003, and has then been revised 7 June 2006, 28 August 2007 and twice in 2009. [WIK02]

4.2 Frequency Channels The original standard denes 3 frequency bands to use : 2400-2483.5 MHz, 16 channels, available worldwide 902-928 MHz : 10 channels until 2006, then 30, available in the USA 868.0-868.6 MHz : 1 single channel, available in Europe

17 The rst one has to be shared with both Wi-Fi and Bluetooth, which causes collisions between networks making use of those protocols. common in envi- ronements where they cohabit. [I3E03] [I3E06]

4.3 Multiplexing Multiplexing in IEEE 802.15.4 is managed using CSMA/CA, which is detailed in section 6 of the present document. Coordination can be provided through the use of beacon frames, see 4.4.3. [I3E03]

4.4 Network Topology IEEE 802.25.4 networks are organized according to two types of topologies : star or mesh. Both involve a mandatory coordinator node, and any number of FFD (Full Function Devices) and/or RFD (Reduced Function Devices), the latter unable to connect to more than one other node (a FFD), but far less power-greedy thaxn the former. The coordinator must thus be a FFD. It can be useful to note that modules usually implement only one of those solutions. [I3E03]

4.4.1 Star Topology In star topology, each node is exclusively bounded to the coordinator of the net- work. Higher layers (for instance ZigBee network layer or Application layer) can allow routing so that any node could communicate with any other through the coordinator. It is an unsafe method, since a failure of the coordinator endangers the whole network, and only one link anchors each node in the network. This mode is quite similar to a Bluetooth piconet, except in Bluetooth there cannot be any communication between slaves.

4.4.2 Mesh Topology It's a far more general topology, where each FFD is directly connected to each other node at range. Here again, higher layers can allow each FFD to route communications. There are subcategories of meshes, such as tree networks where each node can only converse with its parent and children.

4.4.3 Beacon Enabled Mode In beacon mode, time is divided in superframes delimited with (special MAC frames) and of predened length. The superframe is itself partitioned in 16 slots, which can either be contention-free or contention-access. A succession of contention-free slots at the end of the superframe constitutes the Guaranted Time Slots, to which a given node can subscribe to ensure reliability and low latency in its communications.

18 4.4.4 Non-beacon Enabled Mode In this mode, communications are asynchronous, though beacons can still be requested for some purposes. The general idea is that beacons keep your devices awake, which is a waste of power if the eective communication load is light. Only the coordinator keeps constantly awake here. It stores pending messages, so that other nodes only have to poll it whenever they have to emit something or want to know whether they have mail. The coordinator can be plugged and dispose of unlimited power, while other nodes need to stay autonomous. (For example, in home automation, you can have your light bulb pumping power and any number of switches sending sparse signals to the former.)

4.5 ZigBee Since IEEE 803.15.4 does only dene PHY and MAC layers, implementations must dene the higher ones That's what does ZigBee, a standard for WPAN specifying a Network and an Application Layer to complete the IEEE.

4.5.1 Origins In 2002, seeing that neither Wi-Fi nor Bluetooth could t some of their needs for embedded systems (namely, autonomy), a number of industrial companies formed the consortium called ZigBee Alliance, aimed at providing standards for low cost / low consumption wireless communications. Then, with the birth of IEEE 802.15.4 group, both teams have worked closely to specify the entire protocol stack, so that, with the IEEE being released in May 2003, a rst ZigBee specication could be ratied 14 December 2004 and go out 13 June 2005. A rst revision saw the light in 2006, then ZigBee PRO, an enhanced stack oering advanced features such as multicasting and many-to-one routing but more RAM-greedy than its humbler counterpart, in 2007. [WIK03]

4.5.2 Network Organisation The topology of a ZigBee network can be any one of those oered by IEEE 802.25.4, namely star, tree or mesh. Devices are similarly typed, but bear dierent names : a FFD becomes a ZR (ZigBee Router), a RFD a ZED (ZigBee End Device), and the coordinator is called a ZC (ZigBee Coordinator). [ZIG08]

4.6 Layers Denitions 4.6.1 Network Layer ZigBee Routers and the ZigBee Coordinator are given routing capacities, and can discover neighbours and routes to those neighbours. This is performed through the AODV (Ad-hoc On Demand Vector) protocol, as follows : a route request is broadcasted to all neighbours, which froward it to all their neighbours, and so on until the searched for device receives the request, and unicasts its route answer to the source via the lowest cost path. [ZIG08]

19 4.6.2 Aplication Layer The application Layer is the one which the end user is faced with. It denes ZDOs (ZigBee Device Objects), whose roles comprise keeping the role played by the device in the network (namely ZC, ZR or ZED) and managing device discovery, requests to join a network, security and more. The Application Sup- port Sublayer stores and maintains binding tables as a . ZigBee also denes device proles, so that any application could ideally dispose of a protocol perfectly adapted to its needs and constraints. [ZIG08]

4.7 Range, Power Consumption, Data Rate ZigBee communications can reach up to 500m, with a data rate of up to 250 kbs, for a typical power consumption of 125 to 400 µW. As ZigBee is based on IEEE 802.15.4, there is no wake-up , but slots for sleep or activity, or in asynchronous mode, devices sleeping anytime they have nothing to say, with an ever-vigilant coordinator. [WIK03]

4.8 Security Based on facilities provided by IEEE 802.15.4, ZigBee oers means of securing communications, such as use of cryptographic cyphering frames with symmetric keys, frame integrity control, sequential freshness control and ACLs (Access Control Lists). Unsecured mode allows none, ACL mode allows ACLs only and Secured mode allows all. [MAS07]

4.9 Particularities and Embedded Applications ZigBee therefore seems a good technology to put to use when you want your devices to communicate sparsely (no video streaming !) while consuming few power for a low cost. To use a ZigBee module with a , you need to connect it to a UART. There are other, optional pins to use, including a number of analog inputs / digital IOs and a PWM output indicating the strength of the signal which you can directly connect to a LED pin for observation purposes. While the ocial ZigBee stack's access is exclusive to sub- scribing members of the ZigBee Alliance (who pay the annual fee and must use it in their devices), you can make your own implementation of the whole stack, but it has to be approved by the Alliance before being used in a commercial purpose.

5 Dash7

Dash7 is a wireless technology created to have low power consumption and low latency response. It is known as a (WSN) Dash7 applies BLAST concept [JPN09] :

20 B: Bursty, abrupt data transfer, no support for stream data (i.e. video or audio). L: Light-data, limited packet size, small amount of exchanged data. AS: ASynchronous, no hand-shaking between devices. Command-response oriented. T: Transitive, network can be changing, not a xed structure.

5.1 Origins The standard ISO 18000-7 (Dash7) was ratied in 2004 as a Wireless Sensor Network (WSN) and modied in 2008. In 2009 the U.S. Department of Defense signed a $429 million contract for DASH7 devices. And in March of the same year the Dash7 Alliance was created [D7W12][DAW12]. Dash7 Alliance is an association which gives interoperability certications for devices. Dash7 Alliance is similar to Wi-Fi Alliance. Dash7 has a mode 1 (ratied as ISO 18000-7) and mode 2 [D7212] which is compatible with mode 1. Mode 2 is not an ocial ISO standard yet. This document will focus on Dash7 mode 1 ISO 18000-7:2004.

5.2 Frequency Channels Dash7 mode 1 uses just one frequency channel centered on the 433,92 MHz ISM Band and of 500 kHz [ISO4P]. There is thus no conict with Wi-Fi, Bluetooth and ZigBee signals. Dash7 takes advantage of his low frequency band to save device power and penetrate water, concrete and walls [WDB12]. Dash7 mode 2 has 8 frequency channels and bandwidth of 216kHz per chan- nel [D7AM2].

5.3 Multiplexing Multiplexing is performed by collision arbitration [ISO4T] in a broadcast mes- sage, point-to-point messages are synchronous (collision may happen with an- other network only) and collisions are seen as a damaged package. The interrogator (or master) asks the tags (slaves) to collect their Tag's IDs by broadcast and it sets a window size (WS, in number of slots). Each slot of the window lasts a predetermined period of time and tags must transmit just during these slots, the slot during which to transmit is chosen randomly by the tag. In case of collision between tags, they choose another random slot to transmit (Slotted Aloha method). After WS slots the interrogator sends a sleep signal to the tags who answered the rst collection round, and then it starts again another collection round until there is no more answer.

21 5.4 Network Topology The network is based on master-slave mode, also called interrogator and tag. Dash7 mode 2 is event-driven and an event can trigger a tag-initiated com- munication or a tag-to-tag communication which is not possible in Dash7 mode 1. Event-drivenness brings a better battery use compared to mode 1 where the network polls in the background. The interrogator can set the Owner ID for each tag to separate network groups.

5.5 Layers Denitions The ISO 18000-7:2004 denes physical and data link layers [ISO4D]. The physical layer denes the modulation used in air communications and band frequencies. The data denes the communications protocol, data , com- mands, data, collision treatment, broadcast communication and point-to-point communication. Between commands, the interrogator can ask by broadcast for each tag's IDs (at once) in its RF communication range, set a tag's owner ID by point-to-point communication, verify a tag's battery status (if it is less than 20%) and set a connection password. Dash7 Alliance supports the development of Open Tag, an open-source project that implements the Mode 2's communication stack [ODA12][OWS12].

5.6 Range, Power Consumption, Data Rate The ISO 1800-7:2004 sets transmission rate to 27.7 kbps. Dash7 mode 2 has a max throughput of 250 kbps [WDT12]. Wake up time is about 2,5 seconds. The range can vary from 10 meters to 10 kilometers. The power consumption is less than 1 mW.

5.7 Security The interrogator can encrypt the connection between the tag by setting a pass- word [ISO4S]. To allow a new password, the tag must be unlocked rst with the old password. Tags are unlocked by default. Locked tags answer a point-to-point communication only if the message is encrypted with this password, but broadcast messages are not aected by locked or unlocked status. Dash7 mode 2 can use 128-bit AES, public key.

22 Wi-Fi BlueTooth ZigBee Dash7 mode 1 Operating frequency 2.4, 5 GHz ISM Band 2.4 (worldwide), 902(USA), 868 (Europe) GHz ISM Band 868 MHz (Europe), 900-928MHz (USA), 2.4GHz (worldwide) 433 MHzISM Band Channels 14 79 16 (worldwide),10 (USA),1 (Europe) 1 Data rate 11, 54, 540 Mbps 3 Mbps 250 Kbps 28 kbps Power supply ~4,7mW /324,71mW ~2,5mW ~300 / 600 µW < 1 µW Range ~75m / 125m ~10m ~10m / 75~ ~10m / ~10km Multiplexing OFDM - CSMA TDD - CSMA CSMA Slotted ALOHA Network topology Star, ad-hoc Piconet, sScatternet Star, mesh Master-slave Security WPA, WEP, TKIP PIN Code, Public key Security WPA, WEP, TKIP PIN Code, Public key Symmetric cryptography + ACLs 128-bit AES, public key Signal susceptibility Reference More sensitive Less sensitive Far less sensitive Specication IEEE 802.11 IEEE 802.15.1 (v1.2) IEEE 802.15.4 ISO 18000-7

6 CSMA/CA

CSMA (Carrier Sense Multiple Access) is a multiplexing method based, as its name implies, on listening to signals by sensing carriers. In CSMA, the device regularly samples the medium, and waits for it to be clear before beginning to emit. That's just the you're implementing whenever you are in a regular conversation. CSMA/CA (with Collision Avoidance) introduces a random Delay between each test, as a way to decrease medium utilization and over all to narrow chances of collision when several devices are waiting simultaneously.

7 Comparison table 8 Conclusion

We expect this article has been sucient to give you the keys to choose wisely between those wireless communication protocols for use in your own embed- ded applications. In a nutshell : Wi-Fi for heavy communications, BlueTooth for short distances, point-to-point such communications consuming less power, ZigBee for light and power-savvy applications, Dash7 for even lighter and even thriftier ones.

9 References 9.1 Wi-Fi [ADA10] Adams, Lew. Easy Provisioning with GainSpan Embedded Wi-Fi Technology. GainSpan Corporation. 21 Oct 2010. accessed 15 Mar 2012. http://www.slideshare.net/gainspan/easy-provisioning-with-gainspan-embedded- Wi-Fi-technology

23 [ERG12] Ergen, Mustafa. IEEE 802.11 Overview. UC Berkeley. http://wow.eecs.berkeley.edu/ergen/docs/IEEE- 802.11overview.ppt accessed 16 Mar 2012. [LWO12] http://www.lesswatts.org/tips/wireless.php. LessWatts.org. ac- cessed 15 Mar 2012. [WFD12] Wi-Fi Direct. Wikipedia. http://en.wikipedia.org/wiki/Wi-Fi_Direct. accessed 14 Mar 2012. [WAK12] Wake On LAN. Wikipedia. http://en.wikipedia.org/wiki/Wake- on-LAN. accessed 15 Mar 2012. [80207] IEEE 802.11. Wikipedia. http://en.wikipedia.org/wiki/IEEE_802.11. accessed 15 Mar 2012. [MAG09] Magee, Owen. Digi International. EE Times. 28 Mars 2009. http://www.eetimes.com/design/embedded/4026972/Sorting-through-the-embedded- Wi-Fi-confusion-item-1?pageNumber=1. accessed 15 Mar 2012. [I3E07] IEEE Standard for  and information exchange between systems  Local and metropolitan area net- works  Specic requirements; Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specications. IEEE Computer Society. 3 Park Avenue, New York, NY. 12 June 2007. [GAI12] GainSpan Resource . GainSpan Corporation. ://www.gainspan.com/products/resource_library.php. accessed 15 Mar 2012. [COM] Les modes de fonctionnement du Wi-Fi (802.11 ou Wi-Fi). comment- camarch.net. http://www.commentcamarche.net/contents/wi/wimodes.php3#gonext. accessed 15 Mar 2012.

9.2 Bluetooth Channel division information: [BSIGF] Bluetooth Special Interest Group, Core Version 4.0, Vol 2, Part A - FREQUENCY BANDS AND CHANNEL ARRANGEMENT. Range and power supply information: [BSIGT] Bluetooth Special Interest Group, Core Version 4.0, Vol 2, Part A - CHARACTERISTICS. Data rate information: [BSIGG] Bluetooth Special Interest Group, Core Version 4.0, Vol 1, Part A - GENERAL DESCRIPTION. Data rate information for Enhanced Data Rate mode: [BSIGS] Bluetooth Special Interest Group, Core Version 4.0, Vol 2, Part A - SCOPE. Bluetooth Low Power: [BVW12] Bluetooth v4.0. Wikipedia. http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v4.0 accessed 13 Mar 2012. Bluetooth wake-up delay: [TWB10] The comparison of Wi-Fi, Bluetooth and ZigBee. Sena Blog. http://www.sena.com/blog/?p=359 25 Feb 2010. Bluetooth Security: [BSIGB] Bluetooth Special Interest Group, Core Version 4.0, Vol 1, Part A - BR/EDR SECURE SIMPLE PAIRING. [PMW12] Paring Mechanisms.

24 Wikipedia. http://en.wikipedia.org/wiki/Bluetooth#Pairing_mechanisms ac- cessed 13 Mar 2012. Bluetooth Sni, Hold and Park mode: [BSIGM] Bluetooth Special Interest Group, Core Version 4.0, Vol 2, Part B - SNIFF MODE, HOLD MODE, PARK STATE.

9.3 IEEE 802.15.4 [DUS07] Stevanovic Dusan, http://www.cse.yorku.ca/~dusan/Zigbee-Standard- Talk.pdf, 20 June 2007 [I3E03] The Institute of Electrical and Electronics Engineers, Inc., IEEE Std 802.15.4TM-2003, Part 5 - General Description, 1 October 2003 [I3E06] The Institute of Electrical and Electronics Engineers, Inc., IEEE Std 802.15.4TM-2006 (Revision of IEEE Std 802.15.4-2003), Part 5 - General Description, 8 Septemeber 2006 [JEN06] Jennic, IEEE 802.15.4 Wireless Networks - User Guide Revision 1.1, 6 October 2006 [MAS07] Masica Ken, Recommended Practices Guide For Securing ZigBee Wireless Networks in Control System Environments Draft, April 2007 [SIN04] Sinem Coleri Ergen, ZigBee/IEEE 802.15.4 Summary, September 10, 2004 [WIK02] http://en.wikipedia.org/wiki/IEEE_802.15.4, 23 February 2012 [WIK03] http://en.wikipedia.org/wiki/ZigBee, 5 March 2012 [ZIG08] ZigBee Alliance, ZiggBee Specication, Section 1.1 - Protocol De- scription, January 17, 2008

9.4 Dash7 BLAST Reference : [JPN09] JP Norair, Introduction to DASH7 Technologies, 1st Edition. 16 Mar 2009. Dash7 Origins: [D7W12] Dash7. Wikipedia. http://en.wikipedia.org/wiki/DASH7 accessed 15 march 2012. [DAW12] Dash7 Alliance. Wikipedia. http://en.wikipedia.org/wiki/DASH7_Alliance accessed 15 march 2012. Dash7 Mode 2: [D7212] Dash7 Alliance. DASH7 Mode 2 FAQ. http://www.dash7.org/index.php?option=com_content&view=article&id=162&Itemid=209 accessed 15 Mar 2012. Frequency channel information and wake up information: [ISO4P] ISO/IEC, Internation Standard ISO/IEC 18000-7:2004 - Physical Layer. Signal penetration in walls, water and concrete: [WDB12] Dash7 Alliance. Why is DASH7 Technology Better?. http://www.dash7.org/index.php?option=com_content&view=article&id=11&Itemid=13 accessed 15 Mar 2012. Frequency channel information in Dash7 mode 2 [D7AM2] Dash7 Alliance, DASH7 Mode 2 Webinar presentation.

25 Collision information [ISO4T] ISO/IEC, Internation Standard ISO/IEC 18000-7:2004 - Tag Col- lection and Collision Arbitration. Data link layer information: [ISO4D] ISO/IEC, Internation Standard ISO/IEC 18000-7:2004 - Data Link Layer. Range, power supply and security information: [WDT12] Dash7 Alliance. What is DASH7 Technology?. http://www.dash7.org/index.php?option=com_content&view=article&id=9&Itemid=11 accessed 15 Mar 2012. Security Information: [ISO4S] ISO/IEC, Internation Standard ISO/IEC 18000-7:2004 - Security - Set Password. CC430 Dash7 module: [D7M12] SAN RAMON, Calif. DASH7 Alliance and Texas Instruments Join Forces to Bring Wireless Networking to the Mass Mar- ket. http://dash7.org/index.php?option=com_content&view=article&id=126%3Adash7- alliance-and-texas-instruments-join-forces-to-bring-wireless-networking-to-the-mass- market&catid=14%3Apress-releases&Itemid=190 accessed 15 Mar 2012. [CC412] Texas Instruments. CC430F5133 Description. http://www.ti.com/product/cc430f5133 accessed 15 Mar 2012. OpenTag library: [ODA12] Dash7 Alliance. Opentag. http://www.dash7.org/index.php?option=com_content&view=article&id=130&Itemid=193 accessed 15 Mar 2012. [OWS12] OpenTag Web Site. http://sourceforge.net/projects/opentag/ accessed 15 Mar 2012.

26