IPerf2 measures TCP and UDP performance with metrics around throughput and latency using network sockets.
Iperf can use both TCP and UDP sockets (or protocols). It supports unidirectional, full-duplex (same socket), bidirectional traffic, and multiple, simultaneous traffic streams. It supports multicast traffic, including source-specific multicast (SSM) joins. Its multi-threaded design allows for peak performance. Metrics displayed help to characterize host-to-host network performance. Note: Setting the enhanced (-e) option provides all available metrics.
The user must establish both a server (to receive traffic) and a client (to generate and send traffic) for a test to occur. The client and server typically are on different hosts or computers but need not be. There is an extensive list of example server/client options available here.