Link Search Menu Expand Document

Hornet Developer Guides

Hornet (Hub Orchestrated Routing Network) is an Open Source Mesh Network stack.

Hornet is very similar to Zigbee and Thread protocol. It is more like a Zigbee protocol with all design flaws fixed.

Hornet offers a robust routing mesh network implementation in the NWK and APS layers (about 10,000 lines of code). Although initially implemented with IEEE 802.15.4 MAC, the MAC layer can be radio agnostic.

Why Another Mesh Protocol?

Hornet was started in 2015. At that time, there was no open-source Zigbee protocol. Many flaws in Zigbee would stay forever.

We need a mesh network that supports binding and end-to-end encryption (APS link key). That is how Hornet was started.

Terminologies

  1. Like Zigbee and Thread, there are three types of devices defined a. Coordinator/Hub b. REED, Router Enabled End-Device. A mains-powered device can act as either a router or an end device. The role can be switched on-the-fly. c. RFD, Reduced Function Device. A battery-powered, low-power sleepy device.
  2. Network and Address
    Like Zigbee, when a Hornet Hub forms a network, it creates a random PAN ID. Each device shall have a built-in unique 64-bit IEEE address. When a device joins the network, it is assigned a uniquely immutable 16-bit network address. The 16-bit address within the network can uniquely identify a device until it is removed.
  3. Hornet adopts Zigbee Cluster Library (ZCL) as the application layer protocol.

Difference from Zigbee and Thread

The design of Hornet is very much like Zigbee. Nevertheless, Hornet is not Zigbee in that there are differences; some differences are quite fundamental.

Device Join

During device join, Hornet uses X25519 key exchange to establish a “trust center link key” between the coordinator and the device. The unique link key is then used to send NWK key from the coordinator to the device.

NWK Layer

  1. Unique immutable device short address
    Like Zigbee, every device is assigned a 16-bit short address. Unlike Zigbee, the short address is assigned by Hub in the join process, and it will never change until the device is removed from the network. Both Zigbee and Thread have constantly changing routable device IDs.
  2. Dynamic router/end-device switching
    A mains-powered device can switch between the role of router and end-device to maintain the optimal density of routers.
  3. Improved routing algorithms
    1. Try to avoid unstable links
      An unstable link is a link with a cost of 7. Hornet route discovery algorithm will choose a stable route, a route without any unstable link, whenever possible.
    2. Table routing
      Each router maintains a routing table, which only contains routes to other routers. The routing table does not contain end-device routes because we use “parent routing.”
    3. Parent routing
      Every device caches the parent of each bound peer. If the peer is a router, it doesn’t have a parent. The sender device specifies the parent of the sender and the destination in the NWK header if a parent exists (as the source routing field). If both devices are routers, there is no source routing field. If the source and destination are both end devices, two entries will be in the source routing field. Parent routing significantly reduced the size of the routing table.

APS Layer

Thread protocol is network only. It does not define things like binding and application level security such as link key.

  1. Mandatory end-to-end encryption through binding
    Every pair of bound devices share a secret unique encryption key called the “application link key.” It was defined in the Zigbee protocol but has never been widely adopted.
  2. ZDO mangement
    Hornet adopts the basic concept of ZDO management from Zigbee. However, Hornet has its own management message set quite different from the Zigbee standard.

Design Philosophy

  1. Hornet Mesh is designed to be an end-user-centric ad-hoc mesh network. It is the best practice of decentralization.
  2. We need a Hub for the following reasons.
    1. Security and privacy. The Hub is a trust center and is the only IoT node the end-user needs to trust. From there, we can implement security such as end-to-end encryption, trust-no-one, and data access on a need-to-know basis.
    2. Ease of management.
      • As a trust center, the Hub is the only node users and other devices need to trust. So, it has information on the whole picture of the entire network;
      • A lot of IoT nodes, such as devices and sensors, need more resources in terms of memory and storage. Hub has the resources to make optimal management decisions.

Note that the Hub is the center of trust and management. However, we make the system independent of the Hub as much as possible.

  1. Occasionally, we need to perform management through the Hub. But when the management task is done, the IoT nodes within the network can operate independently of the Hub.
  2. The system shall operate on a best-effort basis independently of the Hub. If there is a Hub failure, the system shall continue to work while waiting for hub replacement.
  3. Our patented Thing-App technology is designed for direct interconnection and interaction among things, with or without the Hub.

Open Source

Our primary focus is on building our Libertas IoT platform. We should be okay with any communication technology, wired or wireless, as long as it is good enough. We open-source Hornet to empower people with more choices. Choice is power!

More Comparison With Zigbee and Thread

  1. Like Zigbee, Hornet is table routing and AODV route discovery. Thread uses DV routing (distance vector). Thread limits the maximum number of routers in a network to 32. Hornet doesn’t have that limitation.
  2. Hornet uses parent routing. As a result, the routing table only maintains routes to routers. As a result, the size of the routing table is significantly reduced by order of magnitude.
  3. Hornet’s route discovery algorithm is more robust than Zigbee’s. It requires a REED to explicitly respond to route requests as a confirmation of existence and reachability.
  4. A REED as an end device needs no keep-alive messages. It constantly listens to the neighbor’s broadcasts and sends packets when any neighbor requires its existence. In contrast, Thread requires a keep-alive from child devices.

Efficiency

The Hornet stack is built on top of FreeRTOS. The stack consumes about 10KB of REED and 6KB for RFD, including memory used by FreeRTOS and 4.5KB of stack memory.

Data Model

We also open-sourced Hornet CLuster Library, an underlying protocol-independent Zigbee/Matter data model for application development.

Working With Libertas Hub and Libertas Thing-App

Libertas Hub is our Hub implementation. Libertas Hub features Libertas IoT App design with a complete development tool (IDE), Libertas Studio

We are working on building a Lua virtual machine into every MCU as a Thing-App engine (Libertas OS). Anybody can use TypeScript to write IoT Apps that interact with the internet of anything. It will be “write-once, run-everywhere” with unprecedented reliability, security, and privacy protection, versatility, and end-user friendliness.


Table of contents