NWEN 439 Special Topic: Protocols and Architecture for the

Alvin C. Valera [email protected] ZigBee and Z-Wave Sources: • Hanes et al., IoT Fundamentals: Networking Technologies, Protocols, and Use Cases for the Internet of Things • Hersent et al., The Internet of Things: Key Applications and Protocols

NWEN 439 Protocols and Architectures for IoT 2 Recap

• IEEE 802.15.4 standard only

Upper Layers specifies Physical Layer and Link Layer • Network layer and higher layers IEEE 802.15.4 Logical Link IEEE 802.2 LLC “left as exercise to the reader”  Control (LLC) Type 1 Data Link Layer IEEE 802.15.4 Medium Access Control (MAC)

IEEE 802.15.4 868/900 IEEE 802.15.4 2.4 GHz MHz PHY PHY Physical Layer

NWEN 439 Protocols and Architectures for IoT 3 IEEE 802.15.4-Based IoT Stacks

Application

ZigBee

MiWi

ISA 100.11a ISA Wireless Hart Wireless

Network 6LoWPAN

Data Link IEEE IEEE IEEE IEEE IEEE 802.15.4 802.15.4 802.15.4 802.15.4 802.15.4 Physical

NWEN 439 Protocols and Architectures for IoT 4 ZigBee Overview

• First ZigBee specification was ratified in 2004 shortly after the release of the IEEE 802.15.4 specification the previous year • While not released as an Internet standard, ZigBee still had industry support from more than 100 companies upon its initial release • Industry support has grown to more than 400 companies that are members of the ZigBee Alliance • Zigbee Alliance is an industry group formed to certify interoperability between vendors and it is committed to driving and evolving ZigBee as an IoT solution for interconnecting smart objects

NWEN 439 Protocols and Architectures for IoT 5 ZigBee Alliance Key Members

NWEN 439 Protocols and Architectures for IoT 6 ZigBee Certification

• ZigBee is aimed at smart objects and sensors that have low bandwidth and low power needs • Products that are ZigBee compliant and certified by the ZigBee Alliance should interoperate even though different vendors may manufacture them

NWEN 439 Protocols and Architectures for IoT 7 How To Get ZigBee Certified?

From this link: • New companies that are not yet Alliance members can join the program by: • joining the Alliance as an Adopter (or higher level) member; or • getting started as an Associate member

• Associate members are subject to a separate certification fee structure: • USD 500 per application • USD 500 for public listing of the certification at www.zigbeealliance.org (due upon submission of the application) • USD 500 annual fee for maintenance of the public listing (due annually on the anniversary date of the grant of certification)

NWEN 439 Protocols and Architectures for IoT 8 Clusters and Application Profiles

• Cluster: a set of commands and message types to achieve related functions for a device • Clusters from different functional domains or libraries form the building blocks of Zigbee Application Profiles

Source: Gislason, Drew. Zigbee wireless networking. Newnes, 2008.

NWEN 439 Protocols and Architectures for IoT 9 Application Areas

• The main areas where ZigBee is the most well-known include automation and smart energy • Automation: • In industrial and commercial, ZigBee-based devices can handle various functions, from measuring temperature and humidity to tracking assets • In home, ZigBee can control lighting, thermostats, and security functions • Smart Energy: • Brings together a variety of interoperable products, such as smart meters, that can monitor and control the use and delivery of utilities, such as electricity and water

NWEN 439 Protocols and Architectures for IoT 10 NWEN 439 Protocols and Architectures for IoT 11 ZigBee Stack

• As mentioned, ZigBee utilizes the IEEE 802.15.4 standard at the lower PHY and MAC layers • ZigBee specifies the network and security layer and application support layer that sit on top of the lower layers Source: Gislason, Drew. Zigbee wireless networking. Newnes, 2008.

NWEN 439 Protocols and Architectures for IoT 12 Network Layer

• Provides mechanisms for network startup, configuration, routing, and securing communications

• Includes discovering neighbours, calculating routing paths, and managing the routing tables as devices join and leave the network

• Also responsible for forming the appropriate topology, which is often a mesh but could be a star or tree as well

NWEN 439 Protocols and Architectures for IoT 13 Mesh Routing

• ZigBee uses Ad hoc On-Demand Distance Vector (AODV) routing across a mesh network • AODV is an on-demand protocol: does not send a message until a route is needed • If a route is not in its routing table, node broadcasts a request for a route • This causes a burst of routing-related traffic, but after a comparison of various responses, the path with the lowest number of hops is determined for the connection • This process is quite different from standard enterprise routing protocols, which usually learn the entire network topology in some manner and then store a consolidated but complete routing table

NWEN 439 Protocols and Architectures for IoT 14 AODV Route Discovery

Source: Iqbal, et al. “Design and Analysis of a Novel Hybrid Wireless Mesh Network Routing Protocol,” International Journal of Adaptive, Resilient and Autonomic Systems, 2014.

NWEN 439 Protocols and Architectures for IoT 15 Application Support and Profiles

• Application Support layer interfaces the lower portion of the stack dealing with the networking of ZigBee devices with the higher-layer applications

• ZigBee predefines many Application Profiles for certain industries, and vendors can optionally create their own custom ones at this layer • Home Automation and Smart Energy are two examples of popular application profiles

NWEN 439 Protocols and Architectures for IoT 16 ZigBee IP

• With the introduction of ZigBee IP, the support of IEEE 802.15.4 continues, but the IP and TCP/UDP protocols and various other open standards are now supported at the network and transport layers • ZigBee-specific layers are now found only at the top of the protocol stack for the applications.

• ZigBee IP was created to embrace the open standards coming from the IETF’s work on LLNs, such as IPv6, 6LoWPAN, and RPL

NWEN 439 Protocols and Architectures for IoT 17 Smart Energy Profile 2.0

• ZigBee IP is a critical part of the Smart Energy (SE) Profile 2.0 specification from the ZigBee Alliance

• SE 2.0 is aimed at smart metering and residential energy management systems

• In fact, ZigBee IP was designed specifically for SE 2.0 but it is not limited to this use case. Any other applications that need a standards-based IoT stack can utilize Zigbee IP

NWEN 439 Protocols and Architectures for IoT 18 ZigBee IP Stack

NWEN 439 Protocols and Architectures for IoT 19 Z-Wave History and Overview • Z-Wave is a proprietary protocol designed by Zensys (now part of SIGMA Designs), private company based in the US and Denmark • Zensys started by introducing a light-control system for consumers, and evolved its product to a full-fledged home area network meshed protocol implemented in a proprietary SoC • Z-wave quickly became a very popular home automation protocol, with hundreds of products sold on web sites like www.zwaveproducts.com or www.zwaveworld.com

NWEN 439 Protocols and Architectures for IoT 20 Z-Wave Alliance

• Zensys OEMs using the protocol are grouped in the Z-wave alliance (www.zwavealliance.org ), which promotes awareness of the product, organizes developer’s forums and interoperability testing events (“Unplugfest”) • Z-wave products are certified by Zensys or agreed labs, using tools provided by Zensys, which test various network management functionalities and assess the communication error rate (CER) of the device under test at various distances

NWEN 439 Protocols and Architectures for IoT 21 Z-Wave Alliance Principal Members

NWEN 439 Protocols and Architectures for IoT 22 Z-Wave Protocol Stack

Application Command Classes

Transport Routing

Network Transfer

Data Link Medium Access Control

Physical Physical Layer

NWEN 439 Protocols and Architectures for IoT 23 Physical Layer

• Z-wave uses a B-FSK “spectrum shaping” modulation over a 868.42 MHz in the EU, 908.42 MHz in the USA, 921.42 MHz in Australia/NZ, and 919.82 MHz in Hong Kong

• Output power is programmable from −20 to 0 dBm • Can decode signals as low as −102 dBm for a data rate of 9.6 kbps (about 30 m indoors, and 150 m in line of sight conditions)

• Maximum bitrate attainable is 40 kbps in favorable link conditions • Zensys plans to add support for other frequencies (950 MHz and 2.4 GHz) in Z-wave 6.00, which also targets a higher maximum bitrate over 100 kbit/s

NWEN 439 Protocols and Architectures for IoT 24 Medium Access Control

• Uses CSMA/CA based on ITU G.9959

• Supports up to 232 unique network identifiers

• Collision avoidance mechanism: perform random back-off before retransmitting when collision occurs

• Acknowledgements are used to ensure frame delivery reliability

• Built-in power saving mechanism through duty cycling: nodes sleep and wakeup according to a wake-up schedule pattern

NWEN 439 Protocols and Architectures for IoT 25 Transfer Layer

• Transfer Layer controls the transmitting and receiving of frames

Frame Types: • Singlecast • Multicast • Broadcast

Source: ITU G.9959

NWEN 439 Protocols and Architectures for IoT 26 Routing Layer

• Routing Layer controls the routing of frames in the network • Z-wave uses source-routing mechanism: the initiator of a frame generates a complete route to the end destination through a number of repeaters • Route consists in a sequence of node IDs that is placed in the frame in (routed singlecast) • An always listening node receiving a routed singlecast with its node ID at the top of the repeater’s list will repeat this frame, just removing its node ID from the list of repeaters • If route to device is not known, a search is performed

NWEN 439 Protocols and Architectures for IoT 27 Routing and Node Types Slave • Controller: Routing Slave • Can be primary (only 1) or secondary • Can be portable or static Primary • Has complete topology Controller knowledge and calculate routes • Can act as repeater • Routing Slave: • Has partial topology knowledge • Can act as repeater Secondary Controller • Slave: • Can only respond to requests from controller or routing slave

NWEN 439 Protocols and Architectures for IoT 28 Command Classes

• Z-wave Protocol supports the applications by defining a standard command structure

• Devices declare the supported command classes during the inclusion process

• Most devices support the basic command class • Through primitives such as BASIC_SET or BASIC_GET, it is possible to set or read values for simple devices (like switches and dimmers)

NWEN 439 Protocols and Architectures for IoT 29 Basic Command Class

• Consists of two commands and one response: • SET - set a value between 0 and 255 • GET - ask the device to report a value • REPORT - response to the GET command, reporting a value between 0 and 255 • Every device interprets the Basic commands depending on that device’s specific functionality, e.g: • A binary switch will switch on when receiving a value 255 and switch off when receiving a value of 0 • A temperature sensor will issue a basic report and send an integer temperature value • A door sensor will either send out a value 0 in case the door is closed or a 255 when the door is open

NWEN 439 Protocols and Architectures for IoT 30 Device Classes

• A device class refers to a typical device and defines which command classes that are mandatory for it to support • Device classes are organised into a three-layer hierarchy: • Every device must belong to a basic device class – defines a device as either controller, routing slave or slave • Devices may further be assigned to a generic device class - defines a device as either generic controller, static controller, binary switch, binary sensor, multi-level switch, multi-level sensor, etc. • Devices may further be assigned to a specific device class

NWEN 439 Protocols and Architectures for IoT 31 Next Lecture

• Constrained Application Protocol (CoAP)

NWEN 439 Protocols and Architectures for IoT 32