UDP Communication in NTN

UDP (User Datagram Protocol) is a lightweight and efficient protocol for sending short messages over IP networks with minimal delay.

This page covers how to use UDP in NTN scenarios, including:

  • Client Mode – sending messages to the device.

  • Server Mode – listening for incoming messages on the device.

UDP is well-suited for real-time data exchange, making it ideal for NTN-based applications.

🛰️ Test the Connection by Sending a UDP Payload

Use the following steps to verify UDP connectivity when the modem has an active satellite data session:

Allocate a UDP Socket (Client Mode)

Create a UDP socket targeting the remote IP 18.199.15.247 on port 1055:

AT%SOCKETCMD="ALLOCATE",1,"UDP","OPEN","18.199.15.247",1055

Expected Response:

%SOCKETCMD: 1  
OK

Set Socket Options and Activate

Enable automatic closure after 10 minutes (36000 seconds) and activate the socket:

AT%SOCKETCMD="SETOPT",1,36000,1
AT%SOCKETCMD="ACTIVATE",1

Expected Response:

OK

Send UDP Payload

Send the message "Hello, world!" encoded in hex (48656C6C6F2C20776F726C6421):

AT%SOCKETDATA="SEND",1,13,"48656C6C6F2C20776F726C6421"

Expected Response:

%SOCKETDATA: 1,13  
OK

Check Socket Info (Optional)

To confirm the connection details:

AT%SOCKETCMD="INFO",1

Expected Response:

%SOCKETCMD:"ACTIVATED","UDP","10.116.194.86","18.199.15.247",49154,1055
OK

Close the Socket

To release resources when done:

AT%SOCKETCMD="DELETE",1

Expected Response:

OK

🛰️ Set Up the EVK to Listen for Incoming UDP Packets

Follow the steps below to configure the EVK in "server mode" (listening on a specific port):

Allocate UDP Socket in Listen Mode (e.g., port 6000)

AT%SOCKETCMD="ALLOCATE",1,"UDP","LISTEN",,,6000,,,1

Expected Response:

%SOCKETCMD: 1  
OK

Activate the Listener

AT%SOCKETCMD="ACTIVATE",1

Expected Response:

OK

Verify Listener Info (Optional)

AT%SOCKETCMD="INFO",1

Expected Response:

%SOCKETCMD: "ACTIVATED","UDP","EVK_IP",,,6000  
OK

Send a UDP Message Now use the UDP Sender application on your PC to send a UDP message to the EVK’s IP address and listening port.

Wait for UDP Event Notification

The modem will notify when a packet is received:

%SOCKETEV: 1,1

Read Incoming UDP Data

AT%SOCKETDATA="RECEIVE",1,1500

Example Response:

%SOCKETDATA: 1,1,1,"48656C6C6F0D0A","<Sender_IP>",54532  
OK

(The hex string "48656C6C6F0D0A" decodes to Hello)

Close the Listener Socket

AT%SOCKETCMD="DELETE",1

Expected Response:

OK

🛠️ Prerequisites for Sending UDP Payloads to the EVK

Public IP Mapping (NAT) or VPN Configuration Ensure the EVK is reachable via a public IP address, either through NAT port forwarding or a VPN tunnel. This is essential for delivering UDP packets to the device.

Static IP Assignment Assign a static IP address to the device within your APN to ensure consistent and reliable routing.

UDP Sender Tool for Windows For testing purposes, you can use a simple tool to send UDP messages from your PC: 👉 Download UDP Sender from the Microsoft Store

Last updated

Was this helpful?