UDP Test

udptest.rb is a simple UDP server and client bundled into a single script. It is designed to be used as a network testing tool, and detect packet loss and corruption.

UDP is a lossy network transport in that UDP packets may be dropped if there is not enough capacity to send them. UDP is typically used in real-time scenarios such as voice and video chat. udptest.rb is designed to be as simple as possible. It bounces small packets from the client to the server and back again. If the packet checksum is incorrect at any point, the script exits with an error.

This type of script is designed to detect faulty hardware and errors in configuration, as well as network performance.

Installation

Available from GitHub: https://github.com/oriontransfer/UDPTest.

udptest.rb requires Ruby, therefore it is important to make sure that it is installed.

The source code is also available: AdminToolbox.git (Source Code Browser)

Usage

On one machine we run the following:

$ ./udptest.rb --server
Server starting on port 30000

On another machine we run the following:

$ ./udptest.rb --client localhost
Connection okay...
++++++++++++++++++++++^C
Exiting...

On the first machine, we will get the following output:

$ ./udptest.rb --server
Server starting on port 30000
New connection from ["AF_INET", 54475, "localhost", "127.0.0.1"]
++++++++++++++++++++++

Each + represents a transmission of a packet. Errors will be reported on the server and client. Since the client is the one sending the packets, it is more likely to detect errors. Also, a single udptest.rb –server instance can support multiple clients.