Once your Digi Wi-SUN network is formed and operational, devices can exchange data both within the mesh and with external systems. Communication may occur between XBee for Wi-SUN nodes; between nodes and the XBee Hive for Wi-SUN Border Router; or between nodes, the Border Router, and remote servers such as a cloud platform or application host.
This topic provides an overview of supported communication methods on both the nodes and the Border Router, and describes how traffic flows within the mesh and beyond it.
Communication methods supported by the XBee for Wi-SUN nodes
XBee for Wi-SUN nodes support the following protocols:
-
UDP (connectionless communication with low overhead)
-
TCP (reliable, connection-oriented communication)
XBee for Wi-SUN nodes can send and receive data using several methods:
-
Socket-like communication through API frames: The XBee for Wi-SUN firmware provides API frames that implement a socket-like interface, allowing applications on a host MCU to open, send, and receive data using TCP or UDP. This provides fine-grained control over connections, ports, and protocols.
-
MicroPython socket library: If the XBee for Wi-SUN module is running MicroPython, you can use its built-in
socketmodule to open TCP or UDP sockets. This method allows embedded applications on the module to perform peer-to-peer communication without an external host. For more information on developing MicroPython applications on the XBee for Wi-SUN, see Interact with the MicroPython REPL. -
Transparent serial mode: For simpler data exchange, nodes can operate in transparent mode, where serial data is automatically sent to a destination IPv6 address configured on the device. This approach requires minimal application logic and is suitable for straightforward data collection or control tasks.
| For more information on how to send data on the XBee for Wi-SUN, see Send and receive data. |
Communication methods supported by the XBee Hive for Wi-SUN Border Router
The XBee Hive for Wi-SUN Border Router can send and receive data using standard socket libraries. The primary supported way to access sockets on the Border Router is through a Python application. Python on the XBee Hive for Wi-SUN Border Router supports IPv6 sockets for TCP and UDP, including client and server use cases.
For more on how to send data on the XBee Hive for Wi-SUN, see Send and receive data.
For more on developing Python applications on the XBee Hive for Wi-SUN, see Interact with the Python Interpreter.
Communication paths
Wi-SUN deployments typically use one or both of the following paths:
-
Direct to server: Nodes send data directly to a server using their IPv6 addresses. The Border Router routes traffic between the mesh and the upstream network.
-
Local communication: Nodes send data to the Border Router, which runs an application that aggregates or forwards the data.
For a conceptual overview of these paths, see See how devices communicate.
Communication within the Wi-SUN network
Within the Wi-SUN mesh, devices communicate using IPv6 over a wireless multi-hop network managed by the XBee Hive for Wi-SUN Border Router. The Border Router assigns IPv6 prefixes to nodes and enables addressable, secure communication between any two devices in the mesh. All data sent and received between the nodes and/or the Border Router are encrypted and secure.
Communication outside the Wi-SUN network
The XBee Hive for Wi-SUN Border Router acts as the gateway between the Wi-SUN mesh and external IP networks such as Ethernet, cellular, or Wi-Fi. This enables Wi-SUN nodes to exchange data with cloud services, servers, or other IP-based applications.
Common external communication scenarios include:
Border router as a gateway to the cloud
The Border Router can host or forward socket connections to remote servers using standard IP protocols such as UDP, TCP, or TLS. Depending on how the Border Router is configured, traffic between the Wi-SUN network and the upstream network may be handled in routed, bridged, or translated mode:
-
Routed mode: the Border Router advertises IPv6 prefixes to the mesh and routes traffic between the Wi-SUN network and the upstream network.
-
Bridged mode: the Border Router forwards traffic on behalf of Wi-SUN nodes so they appear as directly attached to the upstream network.
-
Translated mode: the Border Router performs IPv6/IPv4 translation (NAT64/DNS64) for compatibility with IPv4-only services.
For more information on these operating modes, see Architecture models.
Node-to-cloud communication through the Border Router
Wi-SUN nodes can initiate UDP or TCP connections to destinations beyond the mesh by sending IPv6 packets that the Border Router routes to the external network. This allows sensor or actuator nodes to report data directly to cloud services or application endpoints. However, because TLS is not currently supported on the Wi-SUN nodes, data transmitted over TCP or UDP is not encrypted end-to-end unless the Border Router provides tunneling or proxying to a secure connection. Exercise caution when designing applications that send sensitive data to external systems.
Example communication scenarios
The following simple examples illustrate common communication patterns:
-
Node-to-node (within mesh): A remote sensor node sends UDP packets to a control node to trigger an actuator when a threshold is reached. The sender uses the destination node’s IPv6 address configured through the API or MicroPython socket interface.
-
Node-to-Border Router (data aggregation): Multiple Wi-SUN nodes periodically transmit temperature readings to the Border Router, which forwards the data to a cloud server using a TCP socket.
-
Node-to-server (direct): A leaf node opens a UDP or TCP socket directly to an upstream server using its routable IPv6 address, sending telemetry without Border Router application processing.
-
Border router-to-cloud (gateway): The Border Router maintains a secure TLS connection to a cloud application for telemetry upload and remote command delivery.