Measuring network jitter with Python on Australian connections
Australia's broadband landscape is unlike anywhere else on Earth. The National Broadband Network rolls out a patchwork of fibre-to-the-premises, fibre-to-the-curb, hybrid fibre-coaxial, and Sky Muster satellite services, while vast distances separate regional towns from the data centres in Sydney and Melbourne. For remote workers streaming a stand-up from Perth, gamers chasing low latency in Adelaide, or households running multiple Zoom calls in Brisbane, jitter is often the silent saboteur behind choppy audio and frozen screens. A short Python script can turn a laptop or a Raspberry Pi sitting next to the modem into a private jitter monitor, helping you tell whether your provider is delivering the stability the ACCC's Measuring Broadband Australia program says you should expect.
The script you build will lean on Python's standard library, so it can run quietly on a home server without extra dependencies. It will send a stream of probes to a known target, record the round-trip time for each one, and apply the RFC 3550 definition of jitter to the resulting samples. Once the numbers are being collected, they can be written to a log file, plotted, or piped into a dashboard so you can spot the moments when your link wobbles.
Why jitter matters on Australian links
Latency is the headline number most people quote when their connection feels slow, but jitter, the variation between successive round-trip times, is what actually breaks real-time traffic. A voice over IP call needs packets to arrive within a few milliseconds of each other, otherwise the codec has to conceal gaps. The same is true for video conferencing, remote desktop sessions, and online games where a 200-millisecond swing between two consecutive packets is enough to produce a noticeable stutter.
In Australia, the picture is shaped by geography and policy. Even a fast NBN 250/100 plan in Sydney typically routes through a handful of international gateways, and customers on Sky Muster satellite in the outback live with hundreds of milliseconds of base latency before jitter is even measured. The Telecommunications Industry Ombudsman regularly fields issues that turn out to be jitter-related once the underlying speed test looks fine, and the ACCC publishes quarterly reports that break down performance by technology and provider, making it easier to know what is reasonable to expect from your own link.
Setting up the Python environment
Everything required ships with CPython, which is convenient for a small utility you might want to leave running on a low-power box. The subprocess module wraps the system ping binary, statistics handles the maths, json and csv take care of persistence, and logging keeps the output tidy when the script runs unattended. If you want graphs, matplotlib is the usual companion, but the core tool works fine without it.
On a Linux host in a Brisbane garage or a Mac mini in a Melbourne study, the script can live in a virtual environment created with python -m venv. Pinning the Python version in a requirements.txt is unnecessary because no third-party packages are mandatory, which also makes it easier to deploy to a Synology NAS or an NUC running Ubuntu Server. Adding a tiny pyproject.toml later is straightforward if you decide to publish the tool.
Building the connectivity probe
The simplest probe uses subprocess.run to call the platform's ping binary with a single packet and a short timeout, then parses the round-trip time out of the output. On Linux and macOS the -c 1 flag limits the count, while Windows accepts -n 1. The script should normalise the result into a floating-point number of milliseconds regardless of the local format, because Windows reports times with a comma in some locales.
A more portable approach uses the socket module to open a TCP connection to a well-known port on a stable target. Connecting to port 443 on 1.1.1.1 or 8.8.8.8 exercises the routing table without needing raw ICMP privileges, and the time between connect() returning and a small read tells you the round-trip. Many Australian network engineers prefer targeting a local endpoint such as the Sydney AWS region's load balancer or a Melbourne-hosted CDN edge so the measurement reflects the leg from the home router to the nearest peering point.
Calculating round-trip times and jitter
Once each probe returns a number, jitter can be computed using the smoothed absolute difference formula from RFC 3550. The script keeps a running variable that absorbs most of the variation, then for each new sample subtracts the previous round-trip, takes the absolute value, and updates the smoother with a small fraction of the result. After twenty or thirty probes the smoother settles into a value that represents typical jitter in milliseconds.
It is worth also storing the raw samples so you can later compute a mean, a standard deviation, and the 95th percentile. The statistics module handles mean and stdev directly, and a short helper using a sorted list gives the percentile. These extra numbers are useful when comparing a typical weekday evening in Perth, when international links peak, against a quiet Sunday morning.
Continuous monitoring and data logging
A loop around the probe turns the one-shot tool into a monitor. Sleeping for a fixed interval between samples, perhaps five seconds, balances resolution against noise, and writing each result as a JSON line to a log file makes the output easy to ingest later. Rotating the log with logging.handlers.RotatingFileHandler keeps the disk tidy when the script runs for weeks on a small SSD.
On a Linux system the script can be launched by systemd or run from a user crontab, and it survives reboots without intervention. Adding a small retry loop around the probe ensures that a transient failure, such as a Wi-Fi blip or a brief NBN outage, is logged as missing data rather than crashing the monitor. A simple status file updated after every batch can also feed into a Grafana panel or a Home Assistant sensor so the rest of the household sees when the network is misbehaving.
Interpreting the results and acting on them
Once a few hours of samples are available, the script can flag excursions. Anything above about 30 milliseconds of jitter tends to affect video calls, while under 10 milliseconds feels transparent for most purposes. Persistently high readings at peak hours suggest congestion inside the access technology, which in Australia often means the CVC capacity on the NBN segment serving your POI. Lower jitter late at night, or after a call to your provider, points to a capacity problem rather than a wiring fault.
If the numbers stay stubbornly high, the next steps are familiar to anyone who has dealt with Aussie ISPs: log into the modem to check whether QoS can prioritise real-time traffic, contact the provider with timestamps from the log, and, if the issue remains, raise a complaint with the Telecommunications Industry Ombudsman.
