Send and receive UDP datagrams. Supports listen mode (receive packets on a port) and send mode (transmit packets to a host). Ideal for high-frequency, low-latency data where occasional packet loss is acceptable.
Overview
The udp node handles UDP (User Datagram Protocol) communication. UDP is ideal for:
- High-frequency sensor data - Fast updates where occasional packet loss is acceptable
- Broadcasting - Send data to all devices on a network segment
- Device discovery - Find devices on the local network
- Syslog / SNMP - Standard network management protocols
- Low-latency telemetry - Real-time data with minimal overhead
UDP is connectionless and unreliable. Packets may arrive out of order, be duplicated, or lost entirely. Use TCP Client if you need guaranteed delivery.
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
mode | select | listen | Operation mode: "listen" to receive datagrams, "send" to transmit datagrams. | |
host | string | - | - | Target host address (required in send mode). |
port | number | 9999 | UDP port number to listen on or send to. | |
bufferSize | number | - | 4096 | Receive buffer size in bytes (listen mode). |
Listen vs Send Mode
Binds to the specified port and emits a message on the output port for every UDP packet received. host is not required. The output message includes the sender's IP and port.
Sends msg.payload as a UDP datagram to the
configured host and port. Input triggers the send;
no output is produced.
Message Format
In listen mode, received packets produce:
{
"payload": "received data (string or Buffer)",
"ip": "192.168.1.50",
"port": 54321,
"_msgid": "<unique message id>"
} | Property | Type | Description |
|---|---|---|
| payload | string / Buffer | Datagram content |
| ip | string | Sender's IP address |
| port | number | Sender's port number |
Examples
Syslog Receiver
Receive syslog messages from network devices on port 514.
Syslog Server
Receives syslog messages and routes by severity.
View Flow JSON
[
{
"id": "udp1",
"type": "udp",
"name": "Syslog",
"mode": "listen",
"port": 514,
"wires": [["function1"]]
},
{
"id": "function1",
"type": "function",
"name": "Parse Syslog",
"func": "const match = msg.payload.match(/^<(\\d+)>(.+)/);\nif (match) {\n const pri = parseInt(match[1]);\n const severity = pri % 8;\n const names = ['Emergency','Alert','Critical','Error','Warning','Notice','Info','Debug'];\n msg.payload = { severity: names[severity], level: severity, message: match[2].trim(), source: msg.ip };\n return msg;\n}\nreturn null;",
"wires": [["debug1"]]
},
{
"id": "debug1",
"type": "debug",
"name": "Log"
}
] UDP Sender
Send commands or data to a UDP endpoint on a schedule.
UDP Command Sender
Sends a UDP datagram to a device every 10 seconds.
View Flow JSON
[
{
"id": "inject1",
"type": "inject",
"name": "Every 10s",
"repeat": "10",
"payload": "PING",
"wires": [["udp2"]]
},
{
"id": "udp2",
"type": "udp",
"name": "Send to Device",
"mode": "send",
"host": "192.168.1.200",
"port": 5000,
"wires": []
}
] Troubleshooting
Not receiving any packets
- Verify the flow is deployed and the node is in listen mode
- Check firewall allows UDP on the specified port
- Test with netcat:
echo "test" | nc -u host port - Verify sender and receiver are on the same network (for broadcast)
Packets arriving out of order
This is normal UDP behavior. If ordering matters:
- Include sequence numbers in your packets
- Buffer and reorder in a function node
- Consider using TCP Client instead if ordering is critical