In the deployment of LoRaWAN networks, gateways with built-in NS (Network Server) were once a simplified architectural choice, but they are gradually losing their core value. As the demand for the Internet of Things (IoT) evolves, their limitations are becoming increasingly apparent.
1. The Three-Layer Architecture is the Standard LoRaWAN Architecture
1.1 Function Distribution of the Three-Layer Architecture
The standard LoRaWAN architecture is a three-layer architecture, where the device layer, also known as the sensor or collection layer, is responsible for collecting sensor data and transmitting it to the gateway using LoRa modulation technology.
The gateway acts as a transparent device, demodulating the LoRa data and packaging the payload along with the LoRa-related signal data to be sent to the NS in JSON format.
The NS is the core brain of the LoRaWAN network, responsible for managing terminal devices, processing data, allocating network resources, and ensuring communication security.
1.2 Advantages of the Three-Layer Architecture
The LoRaWAN protocol includes authentication (network access authentication and data integrity authentication), encryption and decryption, frame number management, Adaptive Data Rate (ADR), time synchronization, mode switching, and other MAC layer instructions. The LoRaWAN protocol is primarily implemented and interacted with by the device layer and the NS layer.
The advantage of the three-layer architecture is that each layer performs its duties and collaborates according to standard protocols. For demand-side users, it allows for separate procurement of devices across the three layers, as long as they comply with the LoRaWAN protocol standards. Any LoRaWAN device can connect to any NS server through any gateway, thus establishing a robust LoRaWAN ecosystem and avoiding vendor lock-in with proprietary protocols, which helps to expand the LoRaWAN ecosystem.
1.3 Built-in NS is a Privatized Solution
If the NS is built into the gateway, it effectively turns the gateway and NS into a privatized system, thereby binding the gateway and NS in customer choices.
2. Applicable Scenarios for Built-in NS Gateways
The original intention of designing gateways with built-in NS is to provide a quick and low-cost solution for small IoT projects. Here are some typical applicable scenarios:
- Rapid Validation for Small Projects: When developers or enterprises are initially exploring LoRaWAN technology, gateways with built-in NS can quickly set up a small test network without the need for additional cloud NS deployment, reducing initial development and testing costs.
- Resource-Constrained Environments: In some remote areas or scenarios with weak network infrastructure, gateways with built-in NS can operate as independent network nodes, reducing dependence on the cloud. For example, the UG65 gateway from Starry Intelligence has a built-in NS, supports MQTT/HTTP API, and can connect up to 100 terminal nodes, making it suitable for IoT applications in small buildings or localized areas.
- Local Data Processing: In certain scenarios, data needs to be processed locally to avoid delays and privacy risks associated with uploading to the cloud. For instance, intelligent gateways based on cloud-edge collaboration can leverage edge computing and cloud computing technologies to process data locally at the gateway, reducing data upload volume and minimizing latency from the terminal to the gateway.
3. Disadvantages of Built-in NS Gateways
Although built-in NS gateways have certain value in specific scenarios, their limitations make it difficult to meet the demands of modern IoT in most practical applications, especially when there is more than one gateway in a system/project, leading to the following issues.
- Inability to Achieve Multi-Gateway Cross-Coverage: The network architecture of built-in NS gateways is centralized, where each gateway can only manage devices within its coverage area, making it impossible to achieve cross-coverage between multiple gateways. This limits the scalability and flexibility of the network. As the number of devices increases or the coverage area expands, network islands are likely to occur.
- Limited System Capacity: Gateways with built-in NS typically support only a limited number of devices. For example, some gateways can connect a maximum of 20 or 100 terminal nodes, which clearly cannot meet the needs of large-scale IoT projects.
- Functionality Limitations: Compared to cloud NS, built-in NS usually has simpler functionality and lacks support for advanced features. For instance, it may not support complex device management, data security mechanisms (such as end-to-end encryption), or spectrum management. In contrast, cloud NS (such as ThinkLink, ChirpStack, TTN, etc.) offers more powerful features, such as device authentication, key management, data forwarding, and rule engines.
- Poor Scalability: Once deployed, the capacity and functionality of built-in NS gateways are essentially fixed, making it difficult to dynamically scale according to demand. In contrast, cloud NS can easily scale by adding server resources or adopting a distributed architecture to accommodate the growing number of devices and complex application scenarios.
- Data Island Issues: Each gateway’s built-in NS operates independently, leading to data being scattered across multiple gateways, making unified management and analysis difficult. Cloud NS can centrally manage all devices and data, facilitating global optimization and decision-making.
4. How to Migrate from Two-Layer Architecture to Three-Layer Architecture
If the devices connected to the system are standard LoRaWAN devices, migrating from a two-layer architecture to a three-layer architecture is quite straightforward. The actual work can be divided into four steps.
4.1 Set Up an NS Server
Mainstream server providers such as TTN, ThinkLink, and ChirpStack primarily use the MQTT protocol and generally support UDP-based GWMP or Semtech’s Basic Station protocol. They also offer proprietary MQTT-based protocol interfaces. Among them, ChirpStack is an open-source protocol stack with a high market share, and most manufacturers’ gateways support ChirpStack integration. For instance, the GDI51 and GDO51 series from Mensi Technology, MileSight, and RAK gateways support GWMP and ChirpStack interfaces.
4.2 Export Existing Node Archive Information
Typically, project deployments have multiple tuple information, including devEui, devAddr, appKey, nwkSessionKey, appSessionKey, and standard, etc. If these details are not backed up, they need to be exported from the original gateway NS.
This information is crucial, and it is recommended to back up these archive details after project implementation.
4.3 Import into the Established NS System
Mainstream NS manufacturers support importing archive information via Excel spreadsheets, which is a very simple process.
4.4 Modify the NS Pointing of Existing Gateways
Point the existing gateways to the newly established NS server. This completes the migration of the entire project.
Mensi Technology focuses on the field of LoRaWAN technology, with a product family based on its self-developed low-power operating system (MPOS) and edge computing virtualizer (Edge-bus), supporting global frequency bands of the LoRaWAN standard, featuring thirteen functional points to adapt to complex application scenarios. Modules, terminal devices, gateways, and NS have been widely used in various countries and regions, including South America, Europe, and Japan, with the earliest large-scale applications having been in stable operation for over ten years since 2014.
Modules and DTUs aim to provide users with an interface (UART/RS-485) and its protocol, enabling the realization of thirteen functional points, including LoRaWAN functionality, without any software development, and providing a complete LoRaWAN system.
Gateways are enterprise-level gateways based on Ubuntu, capable of adapting to complex enterprise intranet systems and supporting interfaces such as ChirpStack, Basic Station, TTN, ThinkLink, and GWMP, allowing integration with any system that supports the aforementioned protocols.
NS (ThinkLink) Cloud version supports the global LoRaWAN standard, allows users to register for free, and supports the connection of 1000 LoRaWAN devices for free, accommodating any brand that supports GWMP and ThinkLink protocol.
ThinkLink-Edge version supports the global LoRaWAN standard, featuring an 8-core processor, 8GB DDR, and 64GB eMMC, embedded with Home Assistant and Thingsboard, supporting seamless integration with Home Assistant, Thingsboard, and BACnet.
- Mensi Technology Official Website:https://www.manthink.cn
- ThinkLink LoRaWAN Network Server:https://thinklink.manthink.cn