Guide to SNT – Simple Network Tool

In networking, benchmark the performance of a connection is a common tool to determine both throughput and latency, round trip and etc. But how does one benchmark a network? The source code can be found on GitHub. The installation instruction can be found on GitHub as well.

SNT – Simple Network Tool

SNT (simple network tool) is a server/client benchmark tool, it has some similarities to the iperf that we all have come to know, which are used to benchmark network performance. However, SNT has a couple of different benchmarks modes, as well as support for using compression and encryption. Additionally, it can be tested on a predetermined data set such as a file. Including both TCP and UDP connections.

The following are the supported Benchmark modes.

  • Performance – Send as much data as possible by specified payload size.
  • Integrity – Sends a number sequence or time stamp to compare the arrival order to check if they arrived in a consecutive order or out of order.
  • File-Transfer – Send a file, used for repeatable benchmark testing, for instance with using encryption and compression.

Client

File Benchmark

In the file benchmark mode, a file can be specified by the server that it will be using in the file benchmark mode if the client selects that mode. This way, it is possible to benchmark how a particular data sequence will perform. Now, by default, it will have no effect on the performance. However, by using encryption and compression the performance result.

server -h 127.0.0.1 -b file --file='valid path' --verbose

Performance Benchmark

The performance benchmark mode will attempt to send as many packages as possible between the client and server. The client captures the amount of data that has been received.

snt -h 127.0.0.1 -b performance --verbose

Integrity Benchmark

The integrity is a benchmark mode that is very useful with UDP, since it can show if the packages are received in order, or if there are packages that have been lost. A very good analysis tool for congested connections, or very unreliable connections. Furthermore, it can handle both number increments or timestamps.

snt -h 127.0.0.1 -b integrity --verbose

Server

Creating a server can be done with the SNT program itself as well. Its argument is about the same as the client. However, the major difference is that the server argument must be provided. However, the simplest to a created server, similar to iperf -s, will allow for clients to connect, where the server-supported features are set to default values. By providing the -s flag argument it will be set to server mode.

server -s

Though, it is possible to adjust the support feature and verbosity, similar to the client mode. For instance, the compression and cipher will specify which are supported.

snt --server --secure --compression=all --verbose

WireShark

Wireshark is a network package analysis for capturing network packages as well other package protocols such as USB and many more. But commonly used for network capturing. This is an important toolset for checking the network activities and understanding the network as a whole. Furthermore, it can be used to determine the behavior of network-related applications, such as everything using the internet.

In the git repository, there is a script for adding both TCP and UDP dissecting of SNT protocol with comprehensive information of each of its packages and its content. This is just a simple Lua script that will extract each element and pass it to Wireshark to present it.

Protocol

The protocol for SNT is rather a simple negotiation protocol when looking at the sequences of exchange packages, followed by simple benchmark modes. After having established a TCP connection between the server and the client, the server will exchange what kind of features it supports, like compression, encryption, benchmark modes and etc. Followed by that the client will send a return package telling what features it wants to use. If the server accepts the request, it will continue with the negotiation. However, if it is not valid, it will return an error package, followed by an error code, like how HTTP works with 404 and etc.

Before the benchmark starts, if the client requested encryption, additional negotiation will be required in order to exchange the keys. For instance, if using Diffie Hellman, an asymmetric cipher for exchange the symmetric keys which recommend to check out, pretty cool.

/**       
                
 * Protocol sequence diagram.       
                
 *       
                
 * Client          Server       
                
 *   | -> connec -> |       
                
 *   |               |       
                
 *   | <- init   <- |       
                
 *   |               |       
                
 *   | -> cliopt -> |       
                
 *   |               |       
                
 *  [[ <- certi  <- ]]       
                
 *  [[               ]] Optional.       
                
 *  [[ -> symm  ->  ]]       
                
 *   |               |       
                
 *   | <- ready  <- |       
                
 *   |               |       
                
 *   | -> start  -> |       
                
 *   |               |       
                
 *  [.               .]       
                
 *  [.   benchmark   .] Execution based       
                
 *  [.               .] on benchmark mode.       
                
 *   |      end      |       
                
 *   ^^^^^^^^^^^^^^^^^       
                
 *       
                
 * The error code message command can be       
                
 * sent at any point of the sequence of       
                
 * the diagram.       
                
 */