Wirepas mesh Introduction
This document describes on a high level what is the Wirepas mesh network and how it works. The document explains how routing and communication works, what are the node types in the network, and network security. The document also covers a couple of important concepts including over-the-air updating and provisioning. Later on, the document gives a more detailed dive into more technical concepts like the physical layer and routing.
What you’ll learn
- Wirepas mesh network architecture
- Network organization, formation, and maintenance
- Messages direction, types, and routing methods
- Wirepas related terminology
What you’ll need
You will need a cup of coffee to read through this section.
To get started we have prepared a short video which explains the basic concepts
Wirepas network basics
In this section, we will present the basics of the Wirepas mesh network.
Wirepas mesh is a decentralized mesh wireless communication protocol. Mesh networking means that the devices route traffic via multiple hops. Decentralized means that each node in the network selects its role, maintains and optimizes the connections autonomously based on its environment. Thus the network operates without any centralized control mechanisms such as the operator in the network.
This enables very reliably, optimized, scalable, and simple connectivity between devices.
Depending on the use case, each device in the network can be configured to operate as an extremely low power node or as a high-performance low latency node.
Gateways act as bridges between the network and the internet which means they have no specific role in the network management. If the system has multiple gateways, the mesh network organizes automatically around them making Wirepas mesh a truly multi-gateway system.
A Wirepas mesh network is designed to fit for purpose. It has two different modes of operation, which can be configured at the node level:
- Low Energy mode (LE), which can be used to build fully battery-operated networks. Wirepas mesh differs from many other networks because also a battery-operated device can route the traffic.
- Low Latency mode (LL), which can be used for fast data transmission and intended for mains powered devices.
Because the configuration is a node configuration, the network can be also built by mixing these two modes together so that for example battery-powered LE devices use the fast mains connected LL devices as a transmission backbone.
Wirepas mesh network is reliable and resilient because there is no single point of failure. If one node fails, the rest of the nodes re-organize automatically to find an alternate route to a gateway. Even battery-operated devices can start to operate as a router node at any time. Even if a gateway breaks down the nodes are able to find a route to another gateway. Wirepas mesh network is reliable also because each packet can be sent point-to-point to the next hop with acknowledgment and automatic re-transmissions. This assures 99,9% packet reliability in end-to-end transmissions in most of the use cases.
Wirepas mesh network is secure. It uses industry-standard AES128 encryption in all messaging. An unauthorized party cannot join the network, modify messages, or read the message content. Different keys can be set to each separate network.
Scalability and Density
Wirepas mesh network has maximum scalability. The network uses cost-based routing thus each node finds the best route to the gateway. Because the routing is cost-based, no routing tables are needed to store in the device's memory. That means that extremely large networks can be built.
Wirepas mesh is very adaptive so it can be used both in geographically large scale networks or extremely dense networks. The network can use 40 different channels and the nodes select the least crowded ones independently. Communication between nodes is also split into time slots to optimize the channel usage of multiple nodes while minimizing power consumption. Short transmission time on-air minimizes the risk of collision. Wirepas mesh devices adjust transmission power between each connection. Low transmission power minimizes power consumption. It also maximizes the spectrum usage in a high-density network.
Easy to install and to Maintain
Wirepas mesh has built-in provisioning and node update features. Wirepas mesh provides a secure way to add new devices to a network. The nodes will get the network parameters and security keys to become a member of the network. The whole network can be updated later on using Over-The-Air Programming (OTAP) which provides a long lifecycle for the devices. With OTAP, multiple applications in the same network can be updated remotely including the Wirepas mesh stack firmware. Also, the firmware update is possible so that all the devices in the network are compatible with the new releases of the stack.
Wirepas mesh concepts explained
Wirepas mesh network organization
Wirepas mesh network consists essentially of nodes and gateways:
- Nodes: The actual device that can be a router node or a non-router node. By default, nodes are in automatic role selection called Auto Role. In the auto role, the nodes select autonomously if they route traffic or not.
- Gateways: A gateway is a bridge between the Wirepas mesh network and the backend. The gateway can use one or multiple special nodes called a sink to connect to the network. A sink transmits data between the gateway and the mesh network.
The network forms the topology automatically around a sink node. Each node selects individually to which sink’s routing tree they belong. The nodes try to find the best route to the sink using the best router nodes.
Because Wirepas mesh network organization relies on unique point-to-point links it results in a tree organization as described in the figure below.
Network: A network is formed by nodes that share the same network parameters. The network can consist of multiple gateways and therefore multiple trees.
Tree: A tree consists of all the nodes that are attached to a sink node. A node is always connected to a single upper node in the tree at a time. In the mesh tree, there are multiple groups called clusters.
Cluster: A cluster consists of a cluster head and its direct member connections. A cluster head is a sink or a router node. A device can be a member node in one cluster and a next-hop cluster head in another. This way, a message hops from one cluster to another and eventually to the final destination, which is the sink.
Network & Devices parameters
To join a Wirepas mesh network, the device must have at least the following key parameters:
Network parameters: Network parameters are network wide. Only nodes with the same network parameters can connect together.
- Network address (24 bits): the Network identification.
- Network discovery channel: 1 channel among the 40 channels to be used for node discovery and connection.
- Security keys:
When the nodes share these parameters, they form the network automatically without any user interaction.
- Node address (32 bits): Used to identify each device. The device ID must be unique in the network. The device ID can be generated from the chipset ID.
- Application Area ID: Application ID is used to separate different devices' firmware during the firmware update process. The ID is usually the same for a given device hardware/software combination.
- Bootloader keys: Used to secure update images. They can be common to a manufacturer or to a network operator.
Application Area ID and bootloader keys are defined at the build time and they cannot be changed afterwards.
The default parameters can be given in the factory during the manufacture and changed later during the provisioning.
Node mode of operation
Wirepas mesh supports 2 modes of operation: Low Energy mode and Low Latency mode. The mode selection is a per-device configuration. This means that devices with a different mode of operation can be mixed in the same network. It offers the best fit for purpose to the targeted use cases.
Low Energy mode
This mode is designed to achieve the lowest possible power consumption on all devices including routers. The power consumption of a router can be as low as 30uA, 15uA for a Non-Router (chipset dependent, please refer to the Wirepas mesh KPI for detailed performance measurements available from ). It enables the deployment of fully battery-operated networks.
To achieve this, Wirepas mesh uses an accurate local synchronization and communication scheduling allowing devices to always know the exact times when to send and receive data.
Devices are only active during a regular interval called Access Cycle to send and receive data. The rest of the time is spent in low-power sleep mode. Access cycle can be 2/4/8 seconds with the default parameter being an automatically adjusted to minimize power consumption. See Wirepas Messages performance for more details about routing performance and latency details.
Low Latency mode
This mode is intended to achieve low latency and higher throughput on the network. To achieve this, routers are listening during all their idle time allowing nodes to transmit to the next-hop immediately. The tradeoff is higher power consumption in the range of 7mA making this mode of operation more suited for mains powered devices (please refer to the Wirepas mesh KPI for detailed performance measurements available from ).
The network synchronization described in Low Energy mode is maintained in this mode allowing Low Energy devices to seamlessly interact with Low Latency nodes depending on the topology.
Nodes roles detailed
As seen before even if most of the nodes are capable to automatically decide roles and optimize the network there are different nodes' roles in the network, some are dynamic, some are more static. Independently of their roles, each device can individually send and receive data.
The sink is a node on top of the network tree thus it’s the reference point from which a routing tree starts to form. Usually, the sink is connected to the gateway via a serial interface, like UART or SPI, thus it just routes the traffic between the backend and the Wirepas mesh network.
Up to 14 nodes can connect to a sink node. If a new gateway/sink is added to the network, the nearest nodes find that as the “cheapest” path, and a new tree begins to form organically. Hence, the network balances the load automatically to maximize the throughput without any user interaction.
The auto role is the node’s default role. It is recommended to use an automatic role selection so that the node automatically selects the role of either router or non-router node. Hence, the user does not have to take care of the selection process and the network becomes more optimized.
It is also possible to set a node to a fixed role, either as a Router or a Non-Router node.
A router is a node that transmits data between multiple nodes. A node can adapt to become a router node or a non-router node automatically in case the device is configured in the auto role.
One of the nodes in a cluster is the cluster head which the other nodes follow. A sink is always the head of its cluster. A cluster head is responsible for:
- Managing the cluster timing and frequency channel
- Allocating a communication time slot for each of the members
- Receiving and forwarding messages from and to the members
- Receiving and forwarding messages from and to the next-hop router
Like for a sink, up to 14 nodes can connect to a router node. It includes both the nodes that are connected to the router and the possible router nodes to the next hop.
A Non-Router is a device that does not route any data thus it is at the end of a network tree’s branch. This mode can be selected for some use cases, like asset tracking tags.
Special non-router node modes
A node can also operate in one of two special low-energy modes:
- Non-Router Long Sleep (NRLS)
In both of these roles, the nodes don't route traffic but only operate as end nodes. See About Special non-router node modes in  for more details about those nodes.
The table below summarizes the different roles, associated functionality, and usage examples.
Node mode of operation
Decides automatically to be router or non-router
Nodes can also have a set fixed role to Router or Non-Router role.
Non Router Long Sleep
(communicates with LL router)
In special cases, like in lighting control solutions, the network can operate without the gateway. Because the routing is de-centralized, the network can still operate.
Wirepas Messages: Payload, Directions, Routing methods and Addressing
In this section, we will describe the available message types, direction, and routing methods.
In Wirepas mesh the maximum size of a message is up to 102 Bytes for the actual user payload. Even if messages with a lower size can be sent it is recommended to maximize the payload usage rather than sending several small messages.
The available payload data for users are the same whether the node mode of operation is Low Latency or Low Energy.
Messages directions and performances
Wirepas mesh supports the capability to send messages in all directions. Wirepas message has three directions which are defined as below
- Uplink: Message is sent from a node to the sink. The uplink direction is the most optimized direction and has the best performance. Only the sink onto which the node is attached can be addressed, this concept is called AnySink.
- Downlink: Message is sent from the sink to the network.
- Intra network: Message is sent from a node to one or multiple nodes.
Note: Intra network works only between Low Latency nodes.
Although all directions are possible they do not offer the same performance. See section Wirepas Messages performance for a more detailed explanation about the messages' performances.
Message routing methods
Two routings methods are available in Wirepas mesh and are described below:
- Adaptive Routing: Messages are sent using the mesh routing tree on a hop by hop basis with acknowledgment and automatic retransmission. This method is optimized for node-to-sink and can be used for sink-to-node communication too.
- Adaptive Flooding: messages are sent to all devices in the radio range independently of the established mesh routes. This method is mainly used for local node to node communication.
Please note that the available routing method is dependent on the node operating mode. More details on how adaptive routing and adaptive flooding work can be found in section About Adaptive Routing and Adaptive Flooding in .
Wirepas mesh supports three message addressing types as described below.
Unicast message is sent to a single device.
Multicast message is sent to a group of devices. Multicast uses a group address that is set to devices using Wirepas API. Multicast membership is defined in the application layer thus a device can belong to multiple multicast groups depending on the implementation.
Broadcast message is sent to all devices .
The addressing type options depend also on the mode of operation of the node and are described as below:
- For Low Energy nodes only the following addressing are possible:
- Unicast: From a node to the connected sink, or from a Sink to a specific node
- Multicast & Broadcast: Only from a Sink. The message is propagated only inside the routing tree. If the message is wanted to be sent to all of the devices, the broadcast message should be sent from each sink in the network.
- For Low Latency nodes more options are available thanks to Adaptive Flooding.
In addition to the modes supported in Low Energy, the following addressing are possible:
- Unicast: Can be sent from a node to a node independently of its role and can cross the tree boundaries.
- Multicast and Broadcast: can be sent either from a Sink or from a node and can cross the tree boundaries
Note: In Wirepas mesh v5.0, a message initiated by a Sink with Adaptive Flooding only propagate to the routing tree whereas Wirepas mesh v5.1 propagates outside of the tree boundaries.
Endpoints (EP) are used to multiplex transport layer datagrams between different applications/application functionalities. To some extend they can be compared to port concept in TCP/IP communication. They are mainly used to separate data generated by the stack, e.g. diagnostics, from application data.
EPs are 8-bit values (8-bit source and 8-bit destination EP). EPs are allocated (for specific usage) as source and destination EP pairs. The pair of two values gives a total of 65536 possible EP combinations.
When a node receives a request packet that has the correct source and destination endpoints, it processes the requests in the message and forms a response. Response message has the same endpoints that were in the request packets, except in reverse order.
The table below summarizes the different message direction and routing methods available in the various Wirepas mesh operating modes.
Mode of operation
Unicast, Multicast, Broadcast
Unicast, Multicast, Broadcast
Unicast, Multicast, Broadcast
Mixed Low-Energy / Low-Latency Network
Unicast, Multicast, Broadcast
Supported (only for LL devices)
Intra Network - Only between Low-Latency nodes -
Unicast, Multicast, Broadcast
Supported (only for LL devices)
Wirepas Messages performance
As we have seen before, all directions are possible in Wirepas mesh with complete support of the Addressing, Directions, and Routing method. Even if all those modes can be combined the performance of the mesh will differ depending on the message sent.
Note: This section covers the concept, please refer to the Wirepas mesh KPI for detailed performance measurements available from .
The performance is directly linked to the Node mode of operation. As an example, a low-energy device will have lower performance in terms of latency and throughput in exchange for much lower power consumption.
Because of the nature of the decentralized network management which allows essentially any node to connect to any node without a central decision. The network forms around a sink and is optimized using cost-based routing (see Network formation and maintenance in  for more details)
It means that the performances are not the same. Performance depends on the message direction.
Wirepas messages performance can be summarized as below:
- The Unicast Uplink is the most optimized route
- The Downlink route is much less efficient whatever the addressing mode is
- Intra-network communication is performant to achieve milliseconds latency.
The table below summarizes the typical best case routing performance of a node on different roles and modes. Please refer to the KPI for your chipset for final and detailed numbers .
Mode of operation
Low Latency (1)
Routing Throughput Uplink
120 Packet Per Second(pps) (4)
4 - 2 - 1 pps (2)
Routing Throughput Downlink
Per Hop Latency
2, 4 or 8 seconds (3)
(1) Low-Energy also possible but not recommended
(2) Depending on the access cycle respectively (2,4 or 8seconds)
(3) Depending on node access cycle, by default automatic 8sec
(4) As a reminder one Wirepas mesh packet can be up to 102 Bytes
Quality of Service and Time to Live
Messages can have two different Quality of Service levels (QoS): high and normal priority. High priority packets are always served first and in the case of full buffers, dropped last. High priority messages also have a different default Time-To-Live (TTL) parameter value (high priority 5 minutes, normal priority 10 minutes). TTL is calculated hop-by-hop, so when a router gets a packet from the previous hop, TTL calculation starts from zero. The TTL parameters can be adjusted with the software but it should be the same through the network.
In addition, a hop limit can be set in Adaptive Flooding mode so that for example node-to-node messages won’t spread to the whole network.
In Wirepas mesh, both the data transmission and the network signaling are secured on the link layer with AES128 encryption and OMAC1 integrity verification. Wirepas mesh uses the network-wide Message Integrity Code (MIC) and AES128 encryption key. A replay attack is prevented by adding nonce to the message. The messages are encrypted/decrypted and integrity checked hop-by-hop. End-to-end security can be implemented in the application layer, if needed. The encryption key and the MIC can be changed from the application side thus every network should have different credentials.
Wirepas mesh network nodes can be updated using Over the Air Programming (OTAP). OTAP allows a robust way to update each node in the network. In the process, the nodes spread a scratchpad file which includes one or more application images. OTAP can be used to update the firmware or the applications or both of them simultaneously. Each application image has a unique Application Area ID (AppAreaID) which is used to select the right binary from the scratchpad for the node.
The OTAP process is typically coordinated from the backend via the gateway(s). OTAP is wanted to get done as fast and as efficiently as possible. To allow this, nodes are using a special point-to-point communication mode with high data rate to exchange scratchpad images. That’s why normal network operations are disrupted during the update process.
More details on the OTAP can be found from .
Joining a provisioned network
If a node does not have a matching network configuration, it cannot join an existing network with the normal connection . To be able to join a provisioned network, Wirepas mesh offers a Provisioning protocol.
When Joining is enabled, the router nodes are set to send an open joining beacon. The joining beacon itself is transmitted always on the same configurable channel with the same network address. The beacon includes the minimal parameters of the network for the joining node to connect.
The joining node is set to receive these beacons on the joining network channel. If it receives the beacon, it sends a handshake signal that the stack transmits to the gateway and to the backend. The backend can then make the decision if it’s ok that the new node joins the network. The decision can be done manually by the user or based on a whitelist in a provisioning server. If it’s ok that the new node can join the network, it receives an OK response containing the parameters of the network. After that, the node applies the parameters and boots. After that, it can join the network with the new network parameters as any other node.
More information about Joining can be found from the Wirepas mesh Provisioning application note 
BLE advertising and scanning
Wirepas mesh supports BLE advertising and scanning, it can both receive and transmit BLE advertisement signals.
BLE Advertising: Wirepas mesh offers a simple way to send non-connectable BLE advertisement packets on one or multiple BLE advertisement channels at a regular interval (in example Edystone or iBeacons). The BLE Advertising can be used for example for indoor navigation or to interact with a mobile phone to locate the nearest Wirepas nodes. BLE Advertising can be done simultaneously with the normal operation of the Wirepas mesh.
BLE Scanning: Wirepas stack offers the ability to scan for BLE advertisement messages. When a node is set to receive BLE Scanning it can operate normally with the mesh network but the communication is limited to the three BLE advertisement channel. Hence the BLE Scanning has to be used with care in order to maintain the best performance of the mesh network.
The Wirepas BLE advertising and scanning application note  provides more details about the BLE advertising and scanning feature and its interaction with the system.
Wirepas has a built-in diagnostic mode that can be set to get insights about the network, for example, to see if there are bottlenecks or congestion in a tree. When the diagnostics mode is turned on, the nodes start to send the diagnostics packets with a regular configurable interval. The diagnostics packets affect the network performance and power consumption in the nodes because of the extra messaging in the network.
Wirepas offers a Wirepas Network Tool (WNT) as presented in above picture that provides monitoring and analysis of the Wirepas network operation. The tool provides visibility of the network’s key parameters, individual node behavior, and visualization of network topology. More information about the tool can be found from .
Application data configuration
Application data configuration (app config) is a feature of Wirepas which allows the broadcasting of 80 bytes of data to all nodes in the network. App config is a kind of a shared state or persistent data under a sink. When a node joins the network, the app config is immediately and automatically transmitted to the joining device. Also, when the app config changes on the sink it’s spread to the network with the highest priority. Hence app config data is an excellent way to distribute dynamic configuration parameters to the application running on the nodes. Application configuration uses the Type-Length-Value (TLV) format. TLV format ensures that different configurations from different vendors can be used in the same network. App config is also used to communicate with NRLS nodes (see Special non-router node modes).
 Wirepas Massive v5.1 / v5.2 KPI Performance Summary
 Wirepas Network Tool Client User Guide
 Wirepas Massive OTAP Application Note
 Wirepas Massive Provisioning application note
 Wirepas Massive Concepts - Going Further
 Wirepas BLE advertising and scanning application note
Added section Node mode of operation
Moved Going further to another document
Power consumption numbers update
Added video. Minor updates and link updates to new documents (provisioning and BLE Advertisement and scanning)
Renamed to Wirepas mesh concept
Copyright © 2022 Wirepas Oy