Internet speeds are a key performance indicator for any network. Yet accurately benchmarking and troubleshooting speed issues can be deceptively complex. This guide aims to demystify speed tests on the popular pfSense firewall platform.

We will cover different methods for executing, scheduling, and parsing speed tests using both pfSense‘s built-in tools as well as third party software. You‘ll learn expert techniques for analyzing results over both long and short time scales. We‘ll also tackle topics like eliminating bufferbloat and inconsistencies between download vs upload speeds.

Follow these techniques and you‘ll gain invaluable visibility into your firewall‘s internet performance – facilitating capacity planning and rapid problem resolution.

Speed Test Tools Overview

There are a variety of speed test tools available for pfSense, each with their own pros and cons:

Tool Description Pros Cons
pfSense Speed Test Package Official speed test package
Runs speedtest.net tests
Easy to use
Web interface
Only provides snapshot data
speedtest-cli Command line interface
for speedtest.net tests
Automatable via scripts
Flexible server selection
Need to parse output
No graphing built-in
Smokeping Open-source latency
and packet loss monitor
Long-term trending
loss % and latency data
Computed speeds
No upload/download split

For ad-hoc bandwidth tests, the Speed Test Package provides a quick and easy web interface using speedtest.net‘s global server backend. For more flexibility in scripting and data collection, speedtest-cli gives direct access on the command line.

However, for long-term trending spanning months or years – Smokeping is invaluable. The graphs provide intuitive visualization for detecting even subtle changes in latency and packet loss that can indicate congestion or capacity issues before they become severe.

In this guide, we will utilize all three tools, leveraging their respective strengths for monitoring internet speeds on pfSense.

Installing and Configuring Speed Test Tools

First, let‘s install the packages we‘ll be using:

  1. Navigate to System > Package Manager
  2. Search for the "Speed Test" package and click + to install
  3. Repeat to install "Smokeping"

Once installed, the packages will be available under Diagnostics in the sidebar menu.

Configuring the Speed Test Package

The Speed Test package provides a simple web interface for executing bandwidth tests using speedtest.net‘s global server infrastructure.

No special configuration is necessary out of the box. However, we can pick a designated test server geographically close to our location for more consistent results:

  1. Go to Diagnostics > Speed Test
  2. Click the Server drop down and browse servers sorted by distance
  3. Choose the server with lowest latency to your location

Alternatively, you may explicitly want to choose a remote server to benchmark available bandwidth across your entire route. It depends if you‘re looking to diagnose speeds to local infrastructure vs transcontinental links.

Configuring Smokeping

Smokeping uses active latency probes to track network characteristics over long periods. For wide-area networks, latency and packet loss are often leading indicators of congestion and capacity issues before bandwidth is impacted significantly.

To configure Smokeping:

  1. Go to Diagnostics > Smokeping
  2. Navigate to the Targets tab
  3. Delete any existing sample targets
  4. Click Add to create a new target
  5. Give target a name like "WAN Link"
  6. Set host to 8.8.8.8 or similar public IP
  7. Click Save

Repeat these steps to add multiple targets across different public IPs and geographic regions. This will allow comparing regional vs transcontinental latency and loss.

The General tab also contains options for customizing the time scale displayed.

Now that our tools are configured, let‘s look at collecting bandwidth data.

Executing and Scheduling Speed Tests

Both the Speed Test package and speedtest-cli allow on-demand and scheduled speed tests. Each method has advantages depending on your use case.

On-Demand Speed Tests

Impromptu speed tests are useful for one-off troubleshooting. Both tools provide flexibility here:

  • Speed Test Package – Navigate to Diagnostics > Speed Test and click the Run Speedtest button
  • speedtest-cli – Via SSH run speedtest-cli or speedtest-cli --server ####

However, keep in mind that single tests only provide a snapshot in time. Use on-demand testing judiciously when attempting to characterize performance.

Automated Recurring Tests

Monitoring bandwidth over time requires recurring automated tests. Here are two options:

Cron Script Method

This approach executes speedtest-cli from a cron script and saves output to log file.

  1. Create a test script – /root/speedtest.sh:

    #!/bin/sh  
    /usr/local/bin/speedtest-cli --simple > /tmp/speed.log
  2. Cron entry to run hourly:

    0 * * * * /root/speedtest.sh

RRD Method

For long-term storage and graphing, record to Round Robin Database (RRD) instead of text file.

  1. Exec script parses speeds and updates RRD – /root/speedtest-rrd.php:

    <?php
    
    // grab speedtest-cli output
    $results = file_get_contents(‘/tmp/speed.log‘);  
    
    // parse values 
    // save to PHP vars  
    
    // update RRD 
    $rrd = rrd_update($rrd_filename, Array($download, $upload));
    ?>
  2. Enable graphing under Services > RRD Graphs

The RRD method provides built-in visualization and data retention. But requires some programming to extract readings.

Comparing Different Speed Test Tools

While conceptually simple, different internet speed tests utilize varied methodologies which impact results:

Tool Approach Duration Advantages Disadvantages
speedtest-cli Downloads random
data from multiple
speedtest.net servers
~30 seconds Good coverage globally
Easy CLI access
No packet loss info
Very brief snapshot
Smokeping Active probing using
ICMP towards multiple
public IPs
Continuous –
months or years
Long term trends
Packet loss %
Seperate latency
No upload vs
download split

speedtest-cli provides a quick, globally available bandwidth benchmark but lacks long-term history. Whereas Smokeping excels at extended monitoring for more subtle performance shifts – at the cost testing download vs upload separately.

Combining both methods gives a comprehensive view combining real-time bandwidth stats and and long-term connectivity trends.

Monitoring Speeds and Loss Over Time

For identifying progressively developing issues, analyzing performance longitudinally is invaluable. Smokeping provides this visibility.

Here is an example multi-year graph:

Smokeping Long Term Graph

We can pinpoint two events potentially impacting connectivity:

  1. Latency increase starting March 2021 – Gradually rising latency indicates possible capacity upgrade requirements. Supported by loss % increase.
  2. Packet loss spike on 05/02/2022 – Brief packet loss suggesting network equipment fault or misconfiguration. Worth further investigation.

Having this long-term baseline makes it easy to highlight anomalies like the May 2022 loss spike that could indicate significant events impacting performance. Smokeping trending provides crucial context.

Now let‘s look at optimizing the speed test collection itself.

Controlling Test Conditions with Traffic Shaping

One challenge with relying on internet speed tests is their inherent variability – results tend to spike up and down. This makes it hard to establish a baseline.

We can mitigate uncontrolled fluctuations using traffic shaping to lock down test conditions – ensuring consisteny between runs.

Here is an example speed test graph without and with shapers applied:

Speed Test Spikyness Before and After Traffic Shaping

As you can see, controlling the test environment allows much more stable measurements, establishing a solid baseline. Now we know observed dips are real, rather than normal variations.

Here is how to configure temporary shapers in pfSense to constrain a speed test:

  1. Create two floating rules on the LAN interface matched to the firewall‘s IP

  2. Apply minimum bandwidth limit shapers to lock speedtest traffic speed

    • Queue: AeUo
    • Bandwidth: 50Mbps
  3. Run speed test to establish baseline

  4. Remove or adjust shapers afterwards

This technique eliminates noise allowing accurate analysis – especially useful for documentation or scripting purposes.

Diagnosing Bufferbloat with Dual-Direction Tests

Another key metric that impacts speed testing is bufferbloat – broadband routers frequently include bloated queues causing latency spikes under load.

We can diagnose the presence of bufferbloat using a special dual-test method:

  1. Run speed test to saturation throughput + 25%
  2. Run second simultaneous test upstream
  3. Compare results looking for increased latency

If the downstream test shows significantly lower latency once upstream test starts, indicates bufferbloat in the router. The additional two-way traffic triggers the onset of queuing delays.

Repeating with 50%, 75%, and 100% simultaneous upstream load quantifies the extent of buffering issues for ISP troubleshooting.

Comparing Upload and Download Consistency

In some environments, bandwidth capacity for downloading vs uploading differs drastically due to asymmetric links. This frequently occurs on cable connections.

When dealing with asymmetrical capacity, it‘s important to analyze upload and download performance independently:

  1. Perform multiple speed tests at different times of day
  2. Log results over a longer period to identify trends

Once sufficient data is collected, upload vs download consistency can be compared:

Date Hour Download Speed Upload Speed % Diff
June 1 6 AM 112.6 Mbps 11.7 Mbps
June 1 12 PM 105.3 Mbps 10.9 Mbps \<5% of 6AM
June 1 6 PM 107.2 Mbps 11.4 Mbps \<5% Since Morning

Here we see that while absolute speeds vary drastically, download rates remain quite consistent throughout the day – fluctuation <5%. However upload at 6 PM drops nearly 2% vs the morning.

This analysis highlights that upload performance is less stable and may need to be addressed as traffic patterns shift during business hours.

Having this data informs decisions when targeting improvements where they are needed most.

Troubleshooting Common Internet Speed Issues

Many factors can negatively impact internet speeds. Here are techniques for diagnosing common culprits:

Problem Detection Method Remediation
Network congestion Meteor-burst tests show
blip of full speed
Contact ISP to upgrade
chronic capacity shortage
Bufferbloat Dual speed tests show
super-high ping
Enable Smart Queue
to cap buffering latency
WiFi interference Station iperf tests checking
multiple endpoints
Reconfigure WiFi channels
to cleaner spectrum
Modem channel overload Compare modem power
levels across channels
Shift MTU to optimal
less saturated channel
Poor copper line Smokeping shows frequent
minor packet loss
Phone provider check
line quality and joints

The above are just some examples of diagnostic steps to isolate various types of throughput issues.

In each case, targeted monitoring provides the data to identify the root cause. Without rigorous measurements, it becomes guessing. Analyzing this data donciously vastly simplifies the troubleshooting process.

Sustained Speed vs Temporary Peaks

One final consideration when evaluating speed tests is the diffference between temporary peak throughput levels vs sustainable speeds over longer intervals.

Many speed tests emphasize peak bandwidth achieved which may only be maintained for a few seconds before settling to normal levels. However what typically matters most is sustained performance capacity during regular usage.

Comparing the baseline speed to sporatic spikes provides insight into both:

Sustained vs Peak Internet Speed Samples

As shown in the chart, peak throughput reaches up to 940 Mbps down on this 500/50Mbps cable connection. However the link only sustains on average 650 Mbps downloads when measured over 10+ minutes.

Pay attention to this nuance when interpreting speed test data – a brief spike can suggest latent capacity while stable numbers indicate realistic expectations.

Conclusion

While running simple speed tests is trivial, properly analyzing results to accurately characterize capacity and isolate issues requires employing more advanced troubleshooting techniques.

This guide provided an expert-level tour of tips for installing, scheduling, comparing, and troubleshooting internet speed measurements on the pfSense platform specifically.

By leveraging different tools for short and long-term data sets, intelligently controlling test conditions, diagnosing infrastructure bottlenecks, and understanding the difference between burst and sustained speeds, you can gain invaluable visibility into your network’s real-world performance, key dependencies, and optimization opportunities.

Rigorously monitoring bandwidth and infrastructure metrics provides the foundation for making data-driven decisions about growth planning and rapidly resolving defects. I encourage applying the methods here to your pfSense environment – the insight gained will provide a major edge as needs scale up.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *