From Electron Cloud
- good explanation of problems with UDP on interfaces that have multiple IP addresses and consequently why it's a good idea to bind separately to each interface's IP address
- trivial UDP server example which binds to a port, receives packets and prints them out
See what ports are bound:
netstat -lun
Watch UDP traffic:
tcpdump -A -u port 9877 -i iface
Modified version of the UDP server linked above, which sends replies: