Mesh networking

What is a gateway in a mesh network?

A gateway is a node that connects a mesh network to a different network, usually an IP network or the internet, and translates traffic between the two. Devices inside the mesh reach outside services through it. Unlike a relay, which forwards traffic within the mesh, a gateway sits on the boundary and decides what crosses it.

Learning objectives

After reading this article you will be able to:

  • Distinguish a gateway from a relay node in a mesh network
  • Describe how Thread Border Routers, Bluetooth Mesh proxies and LoRaWAN gateways bridge networks
  • Explain why a gateway acknowledgment does not prove the destination accepted a message

What a gateway does

A mesh network is a local network: devices talk to their neighbours and pass messages along. Many applications also need something outside the mesh, such as a cloud service, a building management system or a phone that cannot speak the mesh’s protocol. A gateway is the device that connects the two.

To do that, a gateway sits on both networks at once. It has a radio or interface on the mesh side and another on the outside, such as Wi-Fi, Ethernet or cellular. Traffic that crosses it usually has to be translated, because the two sides use different radios, packet formats or addressing. A gateway is also a natural point to filter, since everything that enters or leaves the mesh passes through it.

Gateways in common standards

The idea appears under different names in most mesh and low-power standards.

Thread Border Router. Thread is an IPv6 mesh for home and building devices. A Thread Border Router connects a Thread network to other IP networks such as Wi-Fi or Ethernet, and OpenThread states that a Thread network needs one to reach other networks. At minimum it provides two-way IP connectivity, two-way service discovery between the Thread side and the Wi-Fi or Ethernet side, and external commissioning, so that a phone can authenticate a new device and join it to the network. It can also merge Thread partitions, groups of Thread devices that have lost radio contact with each other, over an IP link. Any Thread device may act as a Border Router, and a network can have several.

Bluetooth Mesh proxy. Bluetooth Mesh devices normally exchange messages using Bluetooth LE advertising. Some devices, such as phones whose operating system does not give apps suitable advertising access, cannot use that bearer. The Bluetooth SIG defines a proxy feature for them: a proxy node relays mesh messages between the advertising bearer and a GATT connection, using the proxy protocol. A phone connects to the proxy node like any Bluetooth LE peripheral and reaches the rest of the mesh through it.

LoRaWAN gateways. In LoRaWAN, gateways receive radio messages from end devices, convert them into IP packets, and forward them to a network server. Strictly, LoRaWAN is a star-of-stars network rather than a mesh, but its gateways play the same bridging role. Mesh networking vs LoRaWAN compares the two designs.

Gateway vs relay

A relay and a gateway both forward traffic, which makes them easy to confuse.

Relay nodeGateway
ConnectsDevices within one meshThe mesh to another network
TranslatesUsually nothing; it passes messages on in the same formatBetween radios, protocols or addressing schemes
If it failsTraffic can take another path through the meshThe mesh loses that route to the outside
Typical positionAnywhere in the meshAt its edge, with a second connection

One device can be both. A phone in a mesh might relay messages between neighbours over Bluetooth LE and also carry some of them to a server over its mobile data connection.

What a gateway should be trusted with

Because a gateway sees everything that crosses it, its position carries risk. If content is encrypted end to end, the gateway carries ciphertext it cannot read, but it can still see traffic volume and timing, and it can drop or delay messages.

A more subtle problem is what a gateway’s acknowledgment means. When a gateway accepts a message, it has received it; that does not mean the destination has. The server behind it might reject the message, crash before storing it, or never receive it if the gateway’s own uplink fails. An application that needs certainty should wait for an end-to-end delivery receipt from the destination, and treat delivery and acceptance as separate outcomes.

Offline Protocol’s documentation is explicit about both. A gateway is provisioned against a defined contract covering identity, delivery verdicts and recovery, and a device that happens to have internet access does not automatically become a trusted upload destination. Its security docs record that gateway delivery is not authenticated proof that the destination accepted a message, and tell applications to verify application receipts.

Designing with gateways

A few habits make gateways less of a weak point.

  • Plan for more than one. Thread allows several Border Routers in one network. Where a deployment depends on reaching the outside, more than one gateway avoids a single point of failure.
  • Expect the gateway to disappear. When a mesh loses its only gateway, it is cut off from the wider network, a network partition between the mesh and everything beyond it. Devices should keep working locally and queue outbound data, using store-and-forward delivery until a gateway returns.
  • Choose gateways deliberately. Decide in advance which devices may act as gateways, how they authenticate to the outside service, and what they are allowed to forward.
  • Confirm end to end. Treat a gateway’s acknowledgment as progress, not completion.

Frequently asked questions

Is a gateway the same as a relay node?

No. A relay forwards messages between devices inside the same mesh. A gateway connects the mesh to a different network and translates between them. One device can do both jobs.

Does a mesh stop working if its gateway fails?

Not inside the mesh. Devices can still reach each other over their local links; what they lose is access to the network beyond the gateway, unless another gateway is available.

Sources

Build it with Offline Protocol

The Offline Protocol transport and routing docs explain how gateways fit alongside BLE, relays and other paths, and the security docs record what gateway delivery does and does not prove.

Read the transport and routing docs