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.

TL;DR

A gateway sits on the boundary of a mesh and translates between it and an outside network, as Thread Border Routers, Bluetooth Mesh proxies and LoRaWAN gateways do. With end-to-end encryption it carries ciphertext, but it still sees volume and timing and can drop or delay messages. Plan for several gateways, queue data locally, and wait for end-to-end receipts.

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

Mesh network gateway function

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

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.

Thread, Bluetooth Mesh and LoRaWAN gateways

Thread, Bluetooth Mesh and LoRaWAN each have a gateway that bridges their network to another: the Thread Border Router, the Bluetooth Mesh proxy and the LoRaWAN gateway. 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 node

A relay forwards traffic between devices within one mesh, while a gateway connects the mesh to another network and translates between them. 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.

Mesh gateway trust and acknowledgments

A gateway should carry content it cannot read, and its acknowledgment should not be taken as proof that the destination accepted a message. 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.

Gateway redundancy in mesh design

A few design habits keep a mesh gateway from becoming a weak point: plan for more than one, expect the gateway to disappear, choose gateways deliberately, and confirm end to end.

  • 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.

What is a Thread Border Router?

A Thread Border Router connects a Thread network to other IP networks such as Wi-Fi or Ethernet. At minimum it provides two-way IP connectivity, two-way service discovery and external commissioning, and any Thread device may act as one.

How does a phone connect to a Bluetooth Mesh network?

Through a proxy node. The phone connects to the proxy node like any Bluetooth LE peripheral, and the proxy relays mesh messages between the advertising bearer and that GATT connection using the proxy protocol.

Does a gateway acknowledgment mean the message reached its destination?

No. When a gateway accepts a message it has received it, but 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.

Can a mesh gateway read the messages it carries?

Not if content is encrypted end to end, because the gateway then carries ciphertext it cannot read. It can still see traffic volume and timing, and it can drop or delay messages.

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