---
title: "Testing Latency with the Flexible Network Tester"
url: "/articles/testing-latency-with-the-flexible-network-tester"
type: article
date: 2017-08-30
updated: 2017-08-30
---

# Testing Latency with the Flexible Network Tester

#  Testing Latency with the Flexible Network Tester 

 Evaluate your home internet connection with tools the pros use.

 By

 [  Andrew Berry   ](/about/andrew-berry) 

 August 30, 2017

  

I recently [rebuilt my home network with a new router](https://www.lullabot.com/articles/eliminating-robots-and-voip-glitches-with-active-queue-management). As we all work from home, we use Slack, Hangouts, and other VoIP services all the time. Itâ&#128;&#153;s really important that voice and video calls are reliable and glitch-free. As I was researching the right configuration for my router, I noticed that there were lots of really nice graphs in various blog posts.

It turned out that they were all being generated by [Flent, the â&#128;&#156;Flexible Network Tester.â&#128;&#157;](https://flent.org/) With Flent, you can easily see how your internet connection behaves under load. When we think of testing a home internet connection, we usually just use a speed test like those from [speedtest.net](https://www.speedtest.net/) that measures download and upload speeds. While these are great for initial testing, they donâ&#128;&#153;t accurately represent what really matters for most people: **latency**, how long it takes to send a small bit of data and get a response back. If youâ&#128;&#153;ve ever had to drop a Skype or Hangouts call because of glitches, odds are youâ&#128;&#153;re running into latency spikes, and not low bandwidth. Using Flent requires a bit of setup locally, and a remote server to test against. Hereâ&#128;&#153;s how I got Flent up and running on my Mac laptop, testing against an Ubuntu server hosted at Linode.

## Netperf and fping setup

Flent is a wrapper around other, lower-level network testing tools. On the server side, it requires the `netserver` daemon to be running, which is included in [Netperf](https://netperf.org:443/netperf/). When I was first testing, I was using an Ubuntu 12.04 server where Netperf was quite out of date and didnâ&#128;&#153;t meet the minimum version required by Flent. Since then, Iâ&#128;&#153;ve upgraded to Ubuntu 16.04, and in basic testing Flent works as expected. However, the package runs the daemon by default as root, and is still one point release out of date. Hereâ&#128;&#153;s how I compiled the latest version and ran it as a regular user. Note that there is also a public test server at `netperf.bufferbloat.net`, though I havenâ&#128;&#153;t used it myself.

When compiling software, I like to check out code from source control instead of using tarballs, as it makes it easy to track any changes or new files. Netperf is using Subversion, so I installed that along with the basic compiler tools:

```
$ sudo apt install build-essential subversion
$ svn checkout http://www.netperf.org/svn/netperf2/tags/netperf-2.7.0
$ cd netperf-2.7.0
$ ./configure && make
$ src/netserver -D # Run netserver without actually installing it

```

On the client, both Netperf and a compatible ping tool are required. On macOS, Netperf is available in [Homebrew](https://brew.sh/), which makes it *almost* easy to install. Unfortunately, Flent requires that Netperf is compiled with â&#128;&#156;demo modeâ&#128;&#157; enabled, so we have to edit the formula for it. [This gist](https://gist.github.com/Arie/25b260cc02d04a67d282) got me pointed in the right direction. It turns out that Flentâ&#128;&#153;s 2.7.0 [demo mode has been broken on macOS](https://www.netperf.org:443/pipermail/netperf-talk/2013-December/001162.html) for some time. Run `brew edit netperf`, and add support for HEAD and the `--enable-demo` flag:

```
diff --git a/Formula/netperf.rb b/Formula/netperf.rb
index 3ba24764a..daaa27e2a 100644
--- a/Formula/netperf.rb
+++ b/Formula/netperf.rb
@@ -3,6 +3,7 @@ class Netperf < Formula
   homepage "http://netperf.org"
   url "ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.bz2"
   sha256 "842af17655835c8be7203808c3393e6cb327a8067f3ed1f1053eb78b4e40375a"
+  head "http://www.netperf.org/svn/netperf2/trunk", :using => :svn

   bottle do
     cellar :any_skip_relocation
@@ -15,7 +16,8 @@ class Netperf < Formula

   def install
     system "./configure", "--disable-dependency-tracking",
-                          "--prefix=#{prefix}"
+                          "--prefix=#{prefix}",
+                          "--enable-demo"
     system "make", "install"
   end

```

Finally, install with `brew install` `--HEAD netperf`.

As I was using macOS, I needed to install fping with `brew install fping`.

Flent itself is written in Python, and is available in `pip`. Since weâ&#128;&#153;re already using Homebrew, we may as well avoid the macOS python and itâ&#128;&#153;s sudo requirements by installing python with `brew install python`. Now, we can install Flent with `pip install flent`. Verify itâ&#128;&#153;s working by running `flent` `--help`.

## Running Tests

Lets run some tests and generate graphs! The most common test is the â&#128;&#152;realtime response under loadâ&#128;&#153;, or â&#128;&#152;rrulâ&#128;&#153; test. This test runs 4 downloads, 4 uploads, and pings at the same time.

   

   

 ![Example showing Flent default graphs](/sites/default/files/styles/wide_xs/public/assets/2017-08/s_6f6d5a8c2ef3ac9902a85e47ea0b057061149a9ffb66188f436f6aa0dc52fafd_1495055217262_temp5.png.webp?itok=BTTScc4Y "s_6f6d5a8c2ef3ac9902a85e47ea0b057061149a9ffb66188f436f6aa0dc52fafd_1495055217262_temp5.png")

`$ flent rrul -p all_scaled -l 60 -H myserver.example.com -o graph.png && open graph.png`

On my network with the [Flow Queuing CoDel](https://www.bufferbloat.net/projects/codel/wiki/) traffic shaper enabled, we can see Iâ&#128;&#153;m getting around 27Mbit/s (6.7 MBit/s times 4 download streams), and around 3.4Mbit/s upload, with latency no worse than 80ms. In this case, my network was in no way â&#128;&#156;quiet,â&#128;&#157; with several other applications and computers using bandwidth at the same time. If I had truly limited bandwidth to Flent, the graphs would have much less deviation.

To see all of the available tests, look at the configuration files in `/usr/local/lib/python2.7/site-packages/flent/tests`. They are well documented and offer some really interesting scenarios for this sort of performance testing.

Flent has been an invaluable tool in testing my home network. While itâ&#128;&#153;s great for running active tests, it isnâ&#128;&#153;t a replacement for network monitoring. Next, I hope to build a dashboard to capture historical bandwidth and latency on my network connection.

 Published in:

- [  System Administration   ](/topics/system-administration)

 

   You must have JavaScript enabled to use this form.

## Get in touch with us

### Tell us about your project. We'd love to hear from you!

 First Name  

 Last Name  

 Your email address  

 Your organization  

 How you heard about us  

 Tell us more 

     Leave this field blank