This article is intended for administrators who need to verify that they have UDP connectivity between two systems. Since there are multiple tools for testing UDP connectivity, a few of them are explained here. This article covers the following utilities for testing UDP connectivity: iperf and netcat.
Option 1: iperf
Iperf is a free client server utility that can be used to validate UDP connectivity and throughput.
- If your Linux distribution does not have a copy of iperf, you can find one here: http://dag.wieers.com/rpm/packages/iperf/.
- For Windows and Mac OS X, you can find the tools here: http://www.noc.ucf.edu/Tools/Iperf/.
Server setup: Run iperf to listen for UDP traffic on port 33001
iperf -s -p 33001 -u
On the client: Send to the server machine that's listening for UDP on port 33001 (in this case, IP 10.0.101.49), at 10 Mbs:
iperf -c 10.0.101.49 -u -p 33001 -b 10M
Option 2: Netcat
Netcat is the Swiss Army knife of networking utilities.
- On Linux and Mac OS X systems netcat is usually already available
- For Windows, you can download it here: http://joncraton.org/files/nc111nt.zip
On the server, run netcat in listen mode (-l), and specify UDP (-u) and the port (33001):
# nc -l -u 33001
On the client, specify UDP (-u) and provide the server IP address and port that the server is listening to:
# nc -u ip_address 33001
Once the connection is established - you need to type something in the client window, and press ENTER. If the connection is working, you will see that text in the server window.