Set up UDP server

When building IoT applications over NTN (satellite) networks, you need a server to send and receive data to and from your devices. Since NTN uses NB-IoT which only supports UDP, your server must be able to handle UDP packets.

Follow this guide to set up your own UDP server in minutes.

1. Create a Server

Spin up a cloud server with a public IP address. For example using Digital Oceanarrow-up-right.

circle-info

When using Digital Ocean:

  • Create a new Droplet (starting at $4-6/month)

  • Choose Ubuntu as the operating system

  • Select the smallest size for testing

  • Note down the IP address of your server

2. Install socat

SSH into your server and install socat, a versatile networking tool:

apt update
apt install socat -y

3. Open the Firewall

Allow UDP traffic on port 9000:

ufw allow 9000/udp

4. Start UDP Listener

Start a UDP listener on port 9000:

circle-info

Explanation of the command:

  • UDP4-RECVFROM:9000 listens for UDP packets on port 9000

  • fork handles multiple connections

  • - outputs received data to the terminal

5. Test from your local machine

Before testing with your NTN device, verify the UDP server is working by sending data from your local machine:

Type a message such as hello world and press Enter.

circle-check

Next steps

Continue building your NTN application and start sending UDP data from your NTN-enabled devices. Have a look at our guides for the Murata Type 1SC or Nordic nRF9151 SiP.

Last updated

Was this helpful?