Series note: This is Part 9 of the ManThink LoRaWAN Technical Deep-Dive series. Reading the previous eight parts in order will give you the most complete context.
Why the Last Mile Matters
In any LoRaWAN deployment, the most easily overlooked piece is the "last mile" between the LoRaWAN gateway and the LoRaWAN Network Server (LNS / NS).
The radio side gets all the attention — we've spent several articles on SX1302's 16 parallel channels, TDOA time synchronization, and Class A RX windows. Meanwhile, the part that actually moves the LoRaWAN frame from the gateway to the server is often glossed over with a casual "it uses the packet forwarder." But once your deployment scales to hundreds of devices, crosses a public network, or faces security compliance requirements, this "last mile" turns into the segment that deserves the most scrutiny.
This article lays the three common LoRaWAN gateway-to-server backhaul protocols side by side:
- Semtech UDP Packet Forwarder — first-generation de-facto standard, UDP connectionless, plain JSON
- ThinkLink MQTT Bridge — MQTT-based bridging, message-bus style
- LoRa Basics Station — the modern approach from the LoRa Alliance, WebSocket + TLS + dual-channel (CUPS/LNS)
Then we explain which one a default open-source gateway like the ManThink GD6 supports, why the "protocol menu" looks different across ThinkLink, ChirpStack, and TTN, and how to make the right engineering choice.
1. Where Each Protocol Came From
1.1 Semtech UDP Packet Forwarder (2014 – Present)
This is Semtech's reference implementation from the SX1301 era. It runs a daemon like poly_pkt_fwd / lora_pkt_fwd on a Linux host, pushing uplink JSON frames (rxpk) received by the SX130x chip to the LNS, and writing downlink JSON frames (dnmsg) returned by the LNS into the concentrator queue.
- Transport: UDP, connectionless
- Application layer: Hand-rolled JSON
- Default ports: 1700 (both directions)
- Authentication: None. The Semtech reference implementation includes no TLS and no gateway-identity check.
Its strength is simplicity — tens of KB of RAM is enough; you can port it to a non-standard platform in hours. For an intranet or private test bench, this is still the most direct solution after twenty years.
But the flaws are equally fatal:
- On a public network, the DevAddr and NwkSKey-derived material in the UDP packet can be sniffed, tampered with, and replayed.
- The server cannot tell whether the gateway is "real." A forged JSON packet can impersonate any gateway.
- There is no link-state semantic. Whether the remote gateway is online, or
poly_pkt_fwdis dead, can only be guessed from application-layer timestamps.
Semtech's official lora_gateway repository was the de-facto standard during the SX1301 era, but with SX1302/SX1303 it has been marked NRND (Not Recommended for New Designs), and new-generation gateways generally pivot to Basic Station. ThinkLink's gwTool6 Configuration Guide also marks UDP Packet Forwarder as something "to be used in a controlled network or with additional network protection only."
Key fact: UDP Packet Forwarder is unencrypted, unauthenticated, and has no built-in link-state monitoring.
1.2 ThinkLink MQTT Bridge — Message-Bus Mode
MQTT Bridge is not a standard protocol defined by the LoRa Alliance. Instead, it is a gateway-to-server transport mode that uses MQTT topics to carry LoRaWAN uplink and downlink frames. LoRaWAN messages are mapped to MQTT messages, routed by a Broker.
In ManThink's product line, MQTT Bridge primarily serves the ThinkLink platform. Section 5.2 of the gd6-configuration-guide makes this explicit: ThinkLink MQTT is only available under the ThinkLink vendor combination, and is composed of the following elements:
| Field | Description |
|---|---|
| Broker URI | ssl://... or tcp://..., pointing at the ThinkLink platform |
| Client ID | The gateway's unique identifier on the Broker |
| Username / Password | Broker credentials |
| Topic | MQTT topics for uplink, downlink, status, etc. |
| QoS | QoS 0 / 1 / 2, by message importance |
| TLS Material | One-way / two-way TLS credentials; with mutual TLS, CA, client cert, and client key must be a matching set |
Why does this exist? Because outside of LoRa, MQTT is the de-facto "device protocol gateway" — device → MQTT Broker → business system — the entire chain uses the same message bus. Lifting this pattern onto a LoRaWAN gateway means engineering teams can use a familiar Broker cluster to manage both LoRa end devices and Wi-Fi / 4G devices — the architecture becomes more uniform.
Key MQTT Bridge characteristics:
- Native Pub/Sub: uplink is a message on a topic, downlink is a message on another topic; backhaul and business data share the same pipe.
- TLS optional: encryption depends on the Broker's TLS configuration.
- Authentication configurable: depends on the Broker's username/password mechanism.
- Lifecycle events go to the bus: Device Provisioning, Status / Statistics all become MQTT messages that business-side subscribers simply consume.
A critical note: MQTT Bridge and the "remote configuration" channel are two independent connections. gwTool6 dedicates a separate section to "remote configuration," which requires its own Broker, Client ID, Topic, and TLS credentials, and explicitly warns not to confuse the LoRaWAN channel's MQTT credentials with the remote configuration ones — a common on-site troubleshooting pitfall.
Key fact: MQTT Bridge is a transport mode, not a LoRa Alliance specification. It is driven by the ThinkLink-side platform and primarily serves engineering teams that already speak MQTT.
1.3 LoRa Basics Station (2019 – Present)
LoRa Basics Station was jointly introduced by Semtech and the LoRa Alliance as the official "replacement" for UDP Packet Forwarder. The "Basics" in the name refers to the fact that it specifies both the connection protocol and the reference implementation as an open-source baseline.
Its architecture is two separate WebSocket / HTTPS interfaces:
- LNS (LoRaWAN Network Server) Interface: handles business data transmission. The URI is typically
wss://<server-address>:8887. All uplink LoRaWAN frames and queued downlink frames flow through it. - CUPS (Configuration and Update Server) Interface: handles configuration and firmware upgrade. The URI is typically
https://<server-address>:443. CUPS pushes to the gateway the LNS URI, trust chain, and LNS credentials — meaning which NS to connect to, what certificate to use, and which API key to authenticate with can all be remotely controlled by the server.
Splitting the data channel from the management channel brings three engineering benefits:
- Configuration can be rotated remotely: no on-site visits to change gateway settings;
- Zero-touch deployment: from factory shipping to plugging in power, the gateway auto-connects to CUPS and auto-receives LNS credentials;
- Unified management of large gateway fleets: thousands of gateways share the same credentials and channel plan.
Protocol-stack essentials:
- Transport: WebSocket long connection; protocol-native heartbeat and automatic reconnect;
- Encryption: TLS 1.2 / 1.3 (per server configuration), with support for mutual TLS (mTLS);
- Authentication modes: Server root certificate (trust) + API Key token + optional client certificate;
- Application messages: JSON (similar to UDP PF in some respects, but bidirectional, timestamped, with the ability to push configuration actively).
The two authoritative references:
- LoRa Basics Station LNS (TTN official)
- LoRa Basics Station CUPS (TTN official)
The GW-AN08 practical document summarizes the four core advantages perfectly: Basic Station offers a more efficient WebSocket-based communication, supports dynamic frequency updates (CUPS), has built-in encrypted transport (TLS), and provides superior network management and remote configuration capabilities compared to the traditional UDP Packet Forwarder.
Key fact: Basic Station is the LoRa-Alliance-recommended "modern" backhaul protocol, with WebSocket + TLS + dual channels (LNS for data + CUPS for management) at its core.
2. Engineering Comparison Table
Putting the three protocols side by side, item by item (synthesized from Yibyte, Kerlink, and LoRa Alliance official resources):
| Aspect | Semtech UDP PF | ThinkLink MQTT Bridge | LoRa Basics Station |
|---|---|---|---|
| Transport Layer | UDP connectionless | TCP / MQTT long connection (TLS optional) | WebSocket long connection |
| Encryption | No standard (typically cleartext) | TLS / mTLS optional (depends on Broker) | TLS 1.2 / 1.3, mTLS possible |
| Platform Identity Check | None | Via Broker account / TLS | Server root cert + Token / mTLS |
| Link Monitoring | None native, relies on app heartbeat | MQTT keepalive | Native protocol heartbeat + auto-reconnect |
| Remote Configuration / Upgrade | None native | None native (CUPS-like handled by platform) | CUPS interface natively supported |
| NAT / Firewall Friendliness | Poor (requires port mapping) | Good | Good (WebSocket-based) |
| Gateway Resource Usage | Very low (tens of KB RAM enough) | Medium (depends on Broker config) | Medium (impl + TLS + WebSocket) |
| Implementation Complexity | Low | Medium (need Broker integration) | Medium-High (certs, time sync) |
| Cross-Vendor Interoperability | Best (legacy standard) | Platform-dependent | Good (LoRa Alliance spec) |
| Suitable Scenarios | Intranet testing, small scale, cost-sensitive | Platform-as-Broker, unified device message bus | Public network, large scale commercial, high-security |
Note: GD6 (gwTool6 v1.0.3) defaults to BasicStation CUPS under the TTN vendor; Semtech UDP under the ChirpStack vendor (replaced by BasicStation LNS); and ThinkLink MQTT or a delivery-determined option under the ThinkLink vendor.
3. The Three Platforms' Default Support Matrix: A GD6 Field Guide
The LoRaWAN NS page on GD6 (gwTool6 v1.0.3) presents the "vendor × protocol" combinations directly. This table is the first thing to memorize on the engineering side:
| Platform Vendor | Available Protocols | Default Protocol |
|---|---|---|
| ThinkLink | ThinkLink MQTT, Semtech UDP | Determined by factory delivery |
| ChirpStack | Semtech UDP, BasicStation LNS | Semtech UDP |
| TTN / The Things Stack | BasicStation CUPS, BasicStation LNS, Semtech UDP | BasicStation CUPS |
Some hidden rules in this matrix:
- Drivers are mutually exclusive: Semtech UDP runs on the Packet Forwarder driver; Basic Station LNS / CUPS runs on the Basic Station driver. Both are stored in the same configuration file. Switching drivers on save triggers a cold restart of LoRa forwarding for ~30–60 seconds. So you must avoid OTA, configuration-write, and critical downlink windows.
- ChirpStack does not support CUPS: The MCP documentation explicitly states that ChirpStack's
basicstation gateway bridgeonly supportsbasicstation-lns, notbasicstation-cups. When choosing Basic Station, you can only pick LNS. - CUPS overrides local configuration: The LNS URI and credentials returned by CUPS take precedence over what you filled in locally. When switching back from CUPS to direct LNS, the old CUPS URI must be cleared, or the gateway will silently continue going through CUPS.
- CUPS API Key and LNS API Key have different permissions: They cannot be interchanged on the TTN Console.
- Driver and channel plan interaction: in Basic Station mode, the local channel settings on the "Radio Parameters" page effectively do not apply — the channel plan is pushed by LNS / CUPS. Only when switched back to Packet Forwarder do local channel settings take effect again.
- mTLS only when explicitly required: Most TTN cloud deployments use server TLS + API Key only, with no client certificate needed.
Key fact: The protocol menu and default behavior differ across the three platforms in GD6 — this is the on-site trap that every integration document reiterates.
4. Selection Decision Tree
A "three-step" decision flow you can walk through:
Step 1: Determine deployment scale and exposure
- Public network exposure → exclude UDP PF; prefer Basic Station (TLS); MQTT Broker can also work (depending on TLS setup).
- Fully intranet / few on-site devices → UDP PF still works, lowest cost.
- Thousands of gateways under unified management → strongly prefer Basic Station + CUPS.
Step 2: Check platform support
- TTN / The Things Stack → recommend Basic Station (CUPS preferred, LNS as fallback).
- ChirpStack → recommend Basic Station LNS (CUPS unavailable, applies to all versions).
- ThinkLink platform / private cluster on MQTT → MQTT Bridge is a more "tailored" choice.
- Multi-platform co-existence / heterogeneous NS → mind the driver-mutex: GD6 can only run one driver at a time. Switching needs a 30–60 second cold restart window.
Step 3: Consider operations and compliance
- Compliance audit required → Basic Station or MQTT with mTLS is a must.
- Zero-touch batch provisioning required → Basic Station + CUPS is essentially the only option.
- Ops team familiar with the MQTT ecosystem → MQTT Bridge is natural.
- Want to keep the "old" debugging experience (minimum dependencies, transparent) → UDP PF still works, but never expose it to the public network.
Quick mnemonic:
Testing in intranet? UDP. Production deployment? Basic Station. Platform eats MQTT? Bridge.
5. Engineering Details of Basic Station: 5 Things You Must Know
If you ultimately choose Basic Station, the following five items are pits you will almost certainly encounter.
5.1 wss, Not ws
The LNS URI must start with wss:// (production); the CUPS URI must start with https://. This means:
- Server root certificate (trust) must match the domain name — public certificates like Let's Encrypt can omit self-trust.
- The gateway's system time must be trusted — the TLS handshake validates the certificate's validity period. Off by a few hours and everything fails.
- DNS must be able to resolve the Server Address.
5.2 API Key + CRLF Is Mandatory
The trust field and Token Key field in gwTool6 are stored separately. The Token Key needs to be assembled into a complete HTTP Authorization line, terminated with CRLF (\r\n) — missing one carriage return, TLS passes but 401 persists.
The two keys for CUPS and LNS have different permissions and cannot be interchanged:
- LNS Key: only grants
Link as Gateway to a Gateway Server for traffic exchange. - CUPS Key: requires permissions to view gateway info, edit basic gateway settings, and read the Secret.
5.3 CUPS Will "Override Back" the Local Configuration
Once CUPS connects successfully, the LNS URI + credentials + channel plan it pushes override the values you saved locally. When switching back from CUPS to LNS, the old CUPS URI must be actively cleared — this is the root cause of the "switch to direct LNS but still goes through CUPS" trap explicitly warned about in the gwTool6 documentation.
5.4 mTLS Only When Genuinely Needed
mTLS (mutual TLS) means each gateway needs:
- A client certificate signed for it;
- The client private key imported into the gateway (CN set to gateway EUI in hex);
- The server to trust the same CA and validate the client certificate ID.
Proper usage: in a highly controlled industrial network or on platforms that mandate mTLS (e.g., AWS IoT Core for LoRaWAN). Most public deployments of TTN / ChirpStack use single TLS + Token only. Don't enable mTLS just "for the sake of looking more secure" — it only adds operations cost; it doesn't make the data itself more confidential.
5.5 Driver Switching Is a Cold Restart
After saving the protocol choice, gwTool6 performs a cold restart of LoRa forwarding for ~30–60 seconds. This means:
- Don't switch during OTA / critical downlink windows.
- After switching, re-read the configuration to confirm it took effect (screenshots / logs both work). Don't rely on the page showing "save successful" alone.
- If you see "configuration applied but zero uplinks," wait 60 seconds before troubleshooting further.
6. Field Experience with MQTT Bridge
MQTT Bridge, unlike Basic Station, is not as "standardized," but if you deploy the ThinkLink platform, you can't bypass it. A few principles:
- Topic is the contract. Each gateway / each application has its agreed Topic prefix. Changing Topic paths arbitrarily sends messages into the void.
- TLS material is a set. CA, client cert, and client key — all three must match; missing one and the Broker rejects the connection.
- Remote configuration is a different line. "Remote configuration" and "LoRaWAN data" use two separate Brokers, Client IDs, Topics, and TLS credentials. Do not share credentials for convenience, or a bad remote-configuration push will impact the LoRa business.
- Client ID must be globally unique. Duplicate Client IDs trigger Broker kick-out, causing the occasional "heartbeat-off-reconnect-kicked-out-again" loop.
- QoS choices: Uplink / Downlink use QoS 1 or 2; Status uses QoS 0 — going all QoS 2 significantly raises Broker load.
7. Is UDP Packet Forwarder Still Useful?
Yes, in limited scenarios:
- Controlled network / test bed: lab, production line, R&D environment.
- Existing platforms that only accept UDP: legacy NS / proprietary platform historical baggage.
- Extremely resource-constrained: battery gateways, sensor-side small-scale gateways with Wi-Fi/4G forwarding.
Not recommended for:
- Any deployment that crosses a public network, NAT, or multi-tenant network.
- Any deployment involving real business workloads (especially with billing / compliance / audit requirements).
- Deployments lacking gateway-identity check mechanisms.
GD6 still keeps the UDP PF option, primarily serving: integration with legacy platforms, integration with proprietary self-developed NS, integration with teaching / demo scenarios.
Key fact: UDP PF has now degenerated to an "intranet fallback protocol" — production deployment defaults to Basic Station (public network) or MQTT Bridge (ThinkLink ecosystem).
8. Migration Path: From UDP PF to Basic Station
If your legacy network still uses UDP PF, the recommended migration path is:
- Coexistence phase: first disable all downlink on GD6 and only enable uplink testing. Basic Station and UDP PF are driver-mutex on GD6, so you can only "switch and then switch back."
- Dual-protocol parallel: typical for ChirpStack — UDP PF for legacy links, Basic Station LNS for new links, two Bridges coexisting.
- CUPS takes over bulk configuration: after going on Basic Station, don't let operations staff fill in LNS URI one by one manually — set up CUPS and let the server push everything automatically.
- Credential rotation plan: set validity periods for LNS API Keys / client certificates, and rotate them regularly.
- Fallback plan: keep 1–2 UDP PF fallback gateways, in case Basic Station fails.
The whole migration generally takes 1–2 weeks — provided you've already prepared "maintenance windows" and "credential management."
9. Selection Cheat Sheet
| Scenario | Recommended Protocol | Key Reason |
|---|---|---|
| Intranet testing / teaching | UDP Packet Forwarder | Simplest, fastest, fewest dependencies |
| TTN public network production | Basic Station (CUPS + LNS) | LoRa Alliance modern standard, remote batch management |
| ChirpStack self-built NS | Basic Station LNS | Compatible with legacy deployments, strongly recommend migrating from UDP |
| ThinkLink platform self-deployment | ThinkLink MQTT Bridge | Unifies MQTT message bus with the platform's other devices |
| Large-scale heterogeneous network (≥100 gateways) | Basic Station + CUPS | Zero-touch provisioning, remote credential rotation, scalable operations |
| Extreme resource-constrained devices | UDP PF | Lowest resource usage, can be trimmed |
| Strict audit / compliance requirements | Basic Station + mTLS or MQTT + mTLS | Mutual certificates + platform identity check |
| Multi-protocol coexistence (heterogeneous NS) | Depends on platform; GD6 can only run one driver at a time | Switch requires 30–60 second cold restart window, plan a maintenance window |
10. Common Misconceptions
Finally, here are several "taken-for-granted" claims that reappear on engineering sites:
- "Basic Station is unencrypted" — Wrong. Basic Station defaults to TLS. Whether encrypted depends on whether the URI uses
wss://orws://, and the LNS server side enforces it. - "UDP Packet Forwarder has no users in 2026" — Also wrong. Teaching, R&D, and intranet deployments are still using it at scale.
- "MQTT Bridge is just fiddling with Topics" — That's only the tip of the iceberg. MQTT Bridge in ThinkLink comes with TLS, credentials, and multi-Topic routing — a complete engineering-grade integration mode.
- "CUPS looks complex, so skip it at small scale" — CUPS really isn't necessary for under 5 gateways. But when ops starts complaining "why do I have to manually configure every new gateway," it's time to bring CUPS in.
- "Basic Station equals the free version" — Wrong. Basic Station is a protocol specification introduced by the LoRa Alliance, with Semtech providing an open-source reference implementation. TTN, ChirpStack, AWS IoT Core for LoRaWAN etc. all implement the spec on their server side.
- "Switching protocol is just changing a dropdown" — Wrong. On GD6, switching protocols triggers a cold restart of LoRa forwarding for 30–60 seconds. Don't switch during critical business windows.
Closing Thoughts
Designing the gateway-to-LNS "last mile" protocol correctly determines the operability and scalability of the entire LoRaWAN network. Semtech UDP PF is "lowest cost," MQTT Bridge is "platform-fit," and Basic Station is "long-termism" — all three are reasonable answers in their respective scenarios.
The GD6 open-source gateway supports all three protocols natively, and the gwTool6 protocol menu automatically recommends a combination per platform. New projects should follow the pattern of Basic Station + LNS (production) + UDP PF (experimentation) from day one; legacy projects should migrate steadily using the pattern of "coexist → switch → wind down."
Reference Documentation
- ManThink · gwTool6 Configuration Guide
- ManThink · Connecting gwTool6 Gateways to TTN via Basic Station
- ManThink · Connecting gwTool6 Gateways to ChirpStack via Basic Station
- LoRa Alliance · LoRa Basics Station Specification (referenced via TTN official docs)
- The Things Stack · LNS Reference
- The Things Stack · CUPS Reference
- Kerlink · Basic Station Packet Forwarder Documentation
Series Reading
- LoRaWAN Device Joining: OTAA vs ABP — How to Choose?
- Understanding the LoRaWAN ADR Mechanism: Who Controls the Data Rate
- LoRaWAN Regional Parameters: Why CN470 and EU868 Have Different Channel Counts
- LoRa Physical Layer Parameters: How SF, BW, CR Affect Range and Throughput
- LoRaWAN Device Classes (Class A / B / C) Compared: Trade-offs and Use Cases
- Semtech SX1301 vs SX1302 vs SX1303: The Concentrator Chip Evolution
- ESP32-S3 in IoT Gateways: Why We Chose It Over STM32
- LoRa Geolocation Fundamentals: TDOA vs RSSI Compared
- This article: LoRaWAN Gateway Backhaul Protocols: Semtech UDP / MQTT Bridge / Basic Station Compared
This series is compiled by the ManThink team based on gwTool6 v1.0.3 + LoRa Alliance + Semtech official resources.