Latency monitoring: we already have last night
"It was slow last night." Anyone who has said that to an internet provider knows what comes next. Can you run a ping and a traceroute and send us the output? Can you install MTR? Were you on wifi? Can you run it again next time it happens?
By then it's the next morning, and the connection is fine. The test shows nothing, the ticket waits for the fault to come back, and the customer has become the one collecting evidence. The provider had the other end of the connection the whole time. It just wasn't measuring it, or wasn't showing anyone what it measured.
Since 19 November, both our edges have pinged every Layer 3 service we give an address to, 20 times a minute, all day and all night. We keep five years of it. The customer sees the same graph our staff and our support assistant read.
This is why we do it, what it shows, how it's built, and what it costs.
Why asking for an MTR is the wrong way round
There's nothing wrong with MTR. It's the wrong thing to ask a customer for after the fact:
- Wrong time. The fault was last night. The MTR runs now.
- Wrong path. It starts at a laptop and crosses wifi and the customer's router before it reaches the provider. The provider can't see that part, and the customer can't see the rest.
- Invented loss. Routers answer traceroute probes from their own CPU, at low priority, and ration how many they answer. A hop that shows loss while the hops after it show none is a router saving its CPU, not a fault.
- Wrong person. The one who can see the least has to prove the fault.
When the test shows nothing, "no data" quietly becomes "no fault".
The provider doesn't need the customer for any of this. It holds one end of every connection. From inside its own network it can reach the other end at any hour, with nobody's wifi in the way. Doing that costs under half a kilobit a second per connection.
Not measuring is a choice, and so is keeping the results to yourself. Both leave the proof with the customer, who has the least to prove it with.
We measure every Layer 3 service from the day it's on, and show the customer what we see. A report of a slow night starts from last night's data, not a request to reboot the router. The proof is ours to collect.
What we measure
Our edges are the two Linux routers in Sydney that run our VPNs and customer domains. Each one pings your router's WAN address, and nothing past it:
our edge ---> our BNG ---> upstream ---> nbn ---> NTD ---> your router
(pinger) (WAN address)
|<----------------------------- measured ----------------------------->|
not measured: your wifi and LAN, our CGNAT, our transit, the far endA raised median or a lost echo is somewhere on that path, your router included. Slowness that doesn't show here is inside the house or further along.
It's free and on by default, with a switch on the service's overview to turn it off. You see it in our business portal, or in your provider's white-label portal. Resellers can read it from the business API at GET /api/v1/business/services/{id}/latency.
We ping the address on record for the service, not the RADIUS session. An outage shows as loss over a hatched offline stretch, and the pinging carries on through it. A router that stops answering while its session stays up shows as loss within minutes. After ten minutes without a reply, the panel says the router isn't answering ping.
The graph never goes quiet just because the connection did.
A day on my service at home
This is my 750/50 fibre service at home, the one nbn's policer report caught in Shaping for nbn. Its first day ran from 6:08 pm on Thursday 19 November to 6:20 pm on Friday, Sydney time.

| First day | Both edges |
|---|---|
| Echoes sent | 58,068 |
| Lost | 4 (3 on edge-1, 1 on edge-2) |
| Median | 3.8 ms on each edge |
| Eight echoes in ten | 3.3 to 4.2 ms |
| Over 10 ms | about 1 echo in 60 |
| Fastest, slowest | 3.05 ms, 52.7 ms |
Four lost is about one in 14,500, and no echo was lost on both edges at once. By 6 am on Saturday the count had reached 86,022 sent and 5 lost.
Nine echoes in ten took 4.2 ms or less. The panel's 90th percentile, 7.4 ms, is a different figure: the 90th percentile of the 5-minute steps' 90th percentiles. That day each step's figure averaged five per-minute ones, so a minute with a few slow echoes in its twenty raised the whole step.
The graph is SmokePing's idea: each step's spread of round trips in greys, and the median over it in ink. Here is the same day for each edge on its own:

The grey spikes are scattered slow replies, through the day and the night, on both edges. A router answers ping from its own CPU, after its real work, so it sometimes answers late. A full or faulty path moves the median, and the median barely moved. Every minute's median sat between 3.4 and 4.2 ms.
This is what normal looks like for this service, on record. A bad night now has something to compare against.
How the edges ping
The pinger is part of the edge agent, the program that already runs each edge's WireGuard, FRR and nftables (more on the edges). The services to ping arrive in the same desired state Underlay sends it, with every order, address change and network move.
We didn't run SmokePing on a monitoring host. A router behind our CGNAT can't be reached from one, because its 100.64 address only exists inside our routing instances. The edges already have a VRF into each of them.
The schedule, from the agent's source:
latencyRound = 60 * time.Second // a round is a wall-clock minute
latencyEchoes = 20 // echoes per target per round
latencySpacing = 3 * time.Second // between a target's echoes
latencyTimeout = 2 * time.Second // a reply later than this is late, not received
latencyLateKeep = 30 * time.Second // a timed-out echo's late reply is still recognised this long
latencyJitter = 150 * time.Millisecond // each send moves by up to ± this
latencyRate = 40000 // sends per second, all targets togetherThat's an echo every 3 s from each edge, and a reply slower than 2 s counts as lost.
- Phase. Each service starts at its own point in the 3 s gap, from a hash of its ID, so a thousand services don't send in the same millisecond. The second edge runs 1.5 s behind the first, so your router hears from one or the other every 1.5 s.
- One socket per VRF. Each VRF in use gets one raw ICMP socket. A private network's router is pinged inside its VRF, one behind our CGNAT inside our CGNAT pool's VRF, and one with a public IP from the default VRF.
- Kernel timestamps. The send time goes in the echo's 56-byte payload, and the kernel stamps each reply as it arrives (
SO_TIMESTAMPNS). An agent slow to read its replies adds no time. - Never blocks. Sends are non-blocking. If a socket's buffer is full, that echo fails rather than hold up every other service's.
Neither path passes through our CGNAT. The two edges do all of this independently, so a fault on one of ours can't pass for a fault on yours.
Every echo, in one histogram
The first version kept seven statistics per service per minute on each edge: the fastest, five percentiles and the slowest. With sent, answered, late and the reply TTL, that was 11 series per service per edge.
It had two problems. Seven numbers don't merge, so an hour's median was an average of sixty minutes' medians. And at 100,000 services on two edges, 11 series each is 2.2 million, before any rollups.
On 21 November we replaced it. Every reply's round trip now goes into one Prometheus native histogram per service per edge. It has 16 buckets to each doubling of round-trip time (schema 4), so each bucket is 4.4% wide. Histograms add exactly. The difference between two scrapes holds every reply in between, so for windows up to 7 days each step's percentiles come from every echo in it. The only rounding is one bucket: 0.17 ms at 3.8 ms.
This is what edge-1 exported for my service at 6 am on Saturday, with labels trimmed and bucket bounds in milliseconds. Under it is the query behind one 5-minute step's median:
underlay_latency_sent_total{node="edge-1"} 4580
underlay_latency_received_total{node="edge-1"} 4579
underlay_latency_rtt_seconds{node="edge-1"} count 4579, sum 18.79 s, 47 buckets
...
(3.58, 3.74] 728
(3.74, 3.91] 874
(3.91, 4.08] 819
(4.08, 4.26] 690
(4.26, 4.45] 94
...
(50.3, 52.6] 1
histogram_quantile(0.5,
underlay_latency_rtt_seconds{service_id="…", family="v4"}
- underlay_latency_rtt_seconds{service_id="…", family="v4"} offset 5m)That's 4,580 sent since the switch at 2:10 am, and 4,579 answered. The one missing was lost at about 3:09 am. The median, 3.8 ms, sits in the busiest bucket.
Each service now has at most four series per edge. Sent and answered are always there, the histogram arrives with the first reply, and an error counter with the first error. Overnight, from 2:10 to 6 am, the two edges' histograms held 9,175 replies. The median was 3.8 ms, as on the first day, and 112 took over 10 ms, about one in 82.
The same release raised the pinger's cap from 5,000 sends a second to 40,000. That's 108,000 services an edge, with a tenth spare. One VRF's socket takes at most 86,315, because each echo holds one of its 16-bit sequence numbers until it's answered or times out. Past either limit, the pinger pings the first services in full, refuses the rest and raises an alert, rather than leave gaps in everyone's graph. Each edge's scrape can now carry a million samples, and a full edge sends under half that.
Pings that must never leave
Pinging all the time means pinging routers that are switched off. Without a guard, an echo to one goes out to the internet from our internal addresses.
Each VRF on an edge has a default route out the edge's public face. That's how VPN devices in the network reach the internet. While a router behind our CGNAT is online, its /32 is in the VRF, learned over EVPN. When it goes offline, the /32 goes too.
An echo to it then takes the default. It leaves the public face from the edge's own address in the VRF, and reaches the BNG, whose PUBLIC table carries it to transit. We tested it, and that's where it went.
Our first fix was a route, unreachable 100.64.0.0/10, in every VRF. Our own review caught the problem the same afternoon, before the pinger went out. The edges run loose reverse-path filtering (rp_filter = 2), which accepts a packet if its source is reachable at all. Some 100.64/10 sources are reachable only by that default, such as the BNG's own address inside a business network's CGNAT routing instance. The unreachable route would have cut them off, and the edge would have dropped everything they sent.
So the guard went in the edge's firewall, where a packet's way out and its source are both known:
chain vrf_leak {
type filter hook postrouting priority filter; policy accept;
oifname "net1.100" ip saddr 100.127.255.0/28 counter name vrf_leak_drop drop
}Nothing leaves the public face with an edge's internal source. The chain runs before source NAT, where VPN traffic still carries its inner source, so nothing legitimate matches. The pinger counts the dropped echo as lost, which it is. The agent's integration test sends one inside a network namespace, and checks that the stand-in for the BNG sees nothing from that range.
An offline router's echoes now stop at our own edge.
From the edges to every screen
Prometheus scrapes each edge every 30 s. Underlay's API reads windows of up to 7 days straight from it, in steps of a minute to half an hour.
Longer windows come from Postgres. Every 5 minutes, the API's leader rolls each finished hour into latency_hourly, one row per service, edge and day, kept 90 days. An hour is an 18-byte slot: echoes sent, echoes answered and seven statistics, each a 16-bit logarithm. The seven come from the hour's histogram, exact to a bucket. A 30-day graph is drawn in 2-hour steps, each merging two hours the way the first version merged minutes: the fastest of the fastest, the slowest of the slowest, the mean of the rest. It's the same compromise, at an hour's grain rather than a minute's. Each finished day is then merged into latency_daily, one row per service, edge and month, kept five years. Steps of a day or more, and any window reaching back past 90 days, read those.
Results are kept by service, never by IP address: addresses get reused, and one customer must never see another's history.
Echoes from both edges cross the same path from our BNG to your router, so a fault there shows on both. The customer's graph takes the better edge each step: the one with data, then the one with less loss, then the lower median. Staff see that, and each edge on its own:

That's why my panel showed no loss for the first day. Each lost echo fell in a step where the other edge lost none. Loss reaches your graph when both edges lose echoes in the same step.
The support assistant reads the same results with a tool, get_latency, over anything from the last 5 minutes to the last year. When someone writes at lunchtime that it was slow last night, it can ask for the last 18 hours, which come back in 20-minute steps.
Its handbook says what the patterns mean. A median that rises in the evening with some loss, while the service carries close to its plan's speed, is the connection full. A raised median or loss for hours on a quiet connection points at us or nbn, and goes to a person. How we fixed our support desk covers the rest.
The customer, our staff and the assistant all start from the same numbers.
What it costs
| What | Cost |
|---|---|
| Echoes reaching your router | 40 a minute from two edges, under half a kilobit a second |
| One edge, 1,000 services | 333 echoes a second, about 225 kbit/s each way |
| One edge at its cap, 108,000 services | 36,000 echoes a second, about 24 Mbit/s each way |
| Prometheus series | 3 per service per edge, 4 after an error |
| Prometheus, a day of one service | about 120 KiB, both edges |
| Prometheus, a day of 100,000 services | about 11 GiB; graphs read the last 7 days |
| Postgres, 90 days hourly and 5 years daily, one service | about 200 KiB, both edges |
| Postgres, the same for 100,000 services | about 20 GiB |
Each echo is an 84-byte packet. In our scale test, with 70,401 of 100,000 services monitored, the history writer's longest pass took 49 seconds of the 5 minutes it has.
This costs so little that not doing it is a choice.
What it means for you
Every Layer 3 nbn service we give an address to has it, at no charge and on by default. That's Business nbn and wholesale alike.
Your router must answer ping (ICMP echo) on its WAN address. If it doesn't, the panel says so.
Layer 2 services, and Layer 3 services on your own addressing, aren't covered, because our network can't ping those addresses.
If a slow night shows on the graph, it happened between our edge and your router, and we start there. If the graph is flat, we say so with numbers and look further along the path.
When you tell us it was slow last night, we already have last night, and so do you.