I Built a Network Monitoring Platform Because College Wi-Fi Was Driving Me Insane
I had a fairly simple problem: the college Wi-Fi was being weird. Sometimes everything worked perfectly. Other times, a request that normally took a few milliseconds would suddenly take hundreds of milliseconds. Pages would hang, connections would become sluggish, and everything would feel a little broken.
I wanted to understand what was actually happening instead of repeatedly blaming the Wi-Fi and moving on with my day. So I built PacketLens.
PacketLens is a network observability platform that continuously monitors network targets, collects latency measurements, tracks jitter, detects anomalies and presents everything through a real-time dashboard.
The original motivation was investigating unstable college Wi-Fi. The result was a small network observability platform. Apparently, complaining about the internet can turn into a software engineering project.
01 · Why I Did This
Most people notice network problems when something stops working. A website takes too long to load, a download slows down or a connection randomly drops. Usually, there is not much information available beyond the fact that the internet feels slow.
I wanted something more useful. I wanted to continuously measure network performance and observe how it changes over time.
Some questions I wanted to answer:
- How long does establishing a TCP connection take?
- How long does DNS resolution take?
- How stable are these measurements?
- Are latency spikes isolated or do multiple targets experience them simultaneously?
- How frequently does the network become unstable, and how quickly does it recover?
I also wanted to understand networking better instead of treating it as something that happens somewhere between my application and the server. That meant working with sockets, connection establishment, DNS resolution, concurrency, time-series data and statistical anomaly detection.
02 · What Exactly Is PacketLens?
PacketLens is a network monitoring and observability platform. It continuously probes configured network targets, records measurements and exposes them through an analytics dashboard.
Backend: Go handles probe scheduling, network measurements, statistics, persistence and the API.
Frontend: Next.js and TypeScript power the dashboard, analytics, historical trends and live monitoring interface.
Storage: SQLite stores measurements and anomaly history.
┌──────────────────────┐
│ PacketLens │
│ Dashboard │
└──────────┬───────────┘
│
REST / WebSocket
│
┌──────────▼───────────┐
│ Go Backend │
├──────────────────────┤
│ Probe Scheduler │
│ Network Probes │
│ Statistics │
│ Anomaly Detection │
│ Data Management │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ SQLite │
│ Historical Data │
│ Anomaly Episodes │
└──────────────────────┘
03 · A Quick Look at PacketLens
Here's a short walkthrough of the application. The dashboard brings the measurements together so I can inspect current network behaviour and investigate what happened earlier.
If your video has a different filename, update the src in this video
element to match the file inside assets/videos/.
04 · Collecting Network Measurements
I started with two types of probes: DNS and TCP. They measure different operations, so comparing them helps build a more complete picture of network behaviour.
DNS resolution
DNS translates domain names into IP addresses. The time taken by a lookup is recorded as DNS resolution latency. This is the duration observed by the application; caching and resolver behaviour can affect it.
start := time.Now()
_, err := net.LookupHost("cloudflare.com")
elapsed := time.Since(start)
if err != nil {
// Record a failed probe.
return
}
// Record the successful lookup duration.
latency := elapsed.Milliseconds()
TCP connection latency
For TCP, I measure how long it takes to establish a connection with a remote endpoint. This is connection-establishment time, not the time required to complete an HTTP request.
start := time.Now()
conn, err := net.DialTimeout(
"tcp",
"1.1.1.1:443",
5*time.Second,
)
elapsed := time.Since(start)
if err != nil {
// Record a failed connection attempt.
return
}
defer conn.Close()
latency := elapsed.Milliseconds()
Why Go?
Go was a natural choice for this project. Its networking standard library is excellent, and goroutines make it convenient to perform multiple independent probes concurrently. I didn't want one slow network operation to block the entire monitoring system.
05 · Understanding Latency
Latency is probably the most obvious metric in a network monitoring application. However, looking at a single average doesn't tell us much about the actual behaviour of a network.
12 ms
14 ms
13 ms
15 ms
180 ms
14 ms
13 ms
The network appears reasonably stable most of the time, but there is a sudden spike. An average alone can hide this behaviour. That's why PacketLens tracks historical measurements and percentile-based statistics.
| Metric | Meaning |
|---|---|
| P50 | Median latency |
| P90 | 90% of measurements are at or below this value |
| P95 | 95% of measurements are at or below this value |
| P99 | 99% of measurements are at or below this value |
| Maximum | Highest observed latency |
P95 and P99 are particularly useful because they expose slow measurements that an average might conceal.
06 · Jitter: Latency Is Not the Whole Story
Latency tells us how long an operation takes. Jitter describes how much that latency varies between consecutive measurements.
Consider two sequences:
20 ms
21 ms
19 ms
22 ms
20 ms
21 ms
20 ms
85 ms
24 ms
140 ms
18 ms
95 ms
The second network is much less consistent. A simple way to calculate the difference between consecutive latency measurements is:
Jt = |Lt − Lt−1|
Where Lt is the current latency and
Lt−1 is the previous latency.
For example:
Previous latency: 20 ms
Current latency: 85 ms
Jitter: |85 - 20|
= 65 ms
These consecutive differences can then be aggregated to calculate mean jitter over a collection of measurements. The important detail is that comparisons must use consecutive measurements from the same target and measurement stream.
07 · Detecting Network Anomalies
A monitoring dashboard becomes considerably more useful when it can identify unusual behaviour automatically.
A fixed threshold sounds simple: mark every measurement above 100 ms as an anomaly. But a latency of 100 ms might be unusual for one target and normal for another. I wanted the detector to adapt to the normal behaviour of individual targets.
Rolling median and MAD
PacketLens uses statistical baselines based on rolling median and Median Absolute Deviation (MAD). The median represents the central value of a collection of measurements, while MAD estimates how far measurements typically deviate from it.
M = median(X)
Di = |Xi − M|
MAD = median(D)
A robust upper threshold can be expressed as:
T = M + k × (1.4826 × MAD)
Here, k controls sensitivity. The scaling factor makes MAD comparable
to standard deviation under a normal distribution. This illustrates the statistical
approach; the actual detection decision also depends on the rolling baseline and
episode-handling logic.
Anomaly episodes
I also wanted to avoid treating every consecutive anomalous measurement as a completely separate incident.
Normal
Normal
Anomaly
Anomaly
Anomaly
Normal
Normal
Those three anomalous measurements belong to one episode, not three unrelated incidents. PacketLens tracks anomaly episodes, including their onset and recovery behaviour.
08 · Time-Series Analytics
Collecting measurements is one thing. Displaying them correctly is another. I wanted the dashboard to show how latency changes over time without accidentally misrepresenting the data.
One important decision was how to handle missing measurements. Suppose a time bucket contains no successful probes. Should its latency be displayed as zero? Absolutely not. Zero milliseconds would imply that a successful operation completed instantaneously.
The bucket might contain no measurements at all, or every probe might have failed. These situations shouldn't be represented as successful measurements. PacketLens therefore keeps missing and all-failed buckets empty.
Anomaly markers
The latency charts also display anomaly information. The line represents mean successful latency per time bucket, while separate markers represent anomaly-onset latency. Multiple anomaly episodes can occur within the same bucket, and each onset is counted.
This keeps two different signals separate: how successful requests behaved, and when unusual network behaviour began.
09 · Real-Time Monitoring
I didn't want users to manually refresh the dashboard every few seconds to see new measurements. The backend streams updates to the frontend using WebSockets.
This lets the dashboard receive new monitoring information as it becomes available, without repeatedly requesting the entire historical dataset.
I also had to think about what happens when a connection drops. A real-time interface needs to handle disconnections and reconnect appropriately rather than silently stopping updates.
10 · What the Dashboard Looks Like
The dashboard is divided into sections, each focusing on a particular aspect of network observability:
- Overview: High-level network statistics and latency trends.
- TCP Analytics: Connection latency and TCP performance.
- DNS Analytics: Resolution statistics and resolver comparisons.
- Jitter: Network variability and consecutive latency differences.
- Availability: Probe success and availability statistics.
- Anomalies: Detected anomaly episodes.
- Incidents: Historical incident information.
- Correlations: Relationships between measurements from different targets.
- Targets and Exports: Configured targets and historical measurement exports.
11 · What I Learned
Successful requests don't necessarily mean a healthy network. A probe can succeed while taking hundreds of milliseconds to complete. Availability and performance are different dimensions.
Averages can hide interesting behaviour. Percentiles, distributions and historical trends often reveal things that a single average cannot.
Missing data is not zero. Treating unavailable measurements as valid values can quietly make monitoring dashboards misleading.
Anomaly detection is more complicated than setting a threshold. Different targets can have different normal behaviour. Adaptive statistical baselines are more useful than one universal latency threshold.
Real-time systems need to think about failure. Network connections drop, probes time out and data becomes unavailable. A monitoring application needs to handle these situations instead of assuming everything will work perfectly.
Perhaps the biggest lesson was that networking stopped feeling abstract once I built something that could observe it. TCP connections, DNS lookups, latency, jitter and concurrency became things I could actually measure and investigate.
12 · Why Am I Cooler Than Random Kids?
This section is obviously peer-reviewed science.
$ ./why-am-i-cooler
checking credentials...
[✓] built a network monitoring platform
[✓] implemented TCP probing
[✓] implemented DNS probing
[✓] measured latency and jitter
[✓] built time-series analytics
[✓] implemented statistical anomaly detection
[✓] tracked anomaly episodes
[✓] added real-time monitoring
[✓] built a dashboard
[✓] investigated college Wi-Fi
college-wifi.exe:
[!] still unstable
verdict:
PacketLens is cooler.
confidence interval:
probably
exit code: 0
Is this a scientifically valid way to establish coolness? No.
Did I spend an unreasonable amount of time investigating the college Wi-Fi instead of simply using mobile data? Also no comment.
13 · What's Next?
PacketLens is already useful as a monitoring platform, but there is plenty more I want to explore.
The biggest idea is machine learning. I'm interested in building a separate network intelligence engine that consumes measurements collected by PacketLens and learns to identify unusual network behaviour.
- Unsupervised anomaly detection using Isolation Forest.
- Predicting network degradation using historical measurements.
- Classifying network conditions automatically.
- Detecting correlated anomalies across multiple destinations.
- Forecasting future latency.
I'm also working on a separate Go-based network telemetry collector. The idea is to make network data collection reusable infrastructure that can eventually feed other monitoring and analysis systems.
14 · Source Code
PacketLens is open source. You can find the implementation, documentation and development history in the repository.
packetlens/
├── backend/
│ └── Go networking and API
├── frontend/
│ └── Next.js dashboard
└── README.md
I originally built PacketLens because I wanted to understand why my college Wi-Fi was behaving so strangely.
It turned into a project where I got to explore networking, Go concurrency, time-series analytics, statistical anomaly detection and real-time systems.
And I got a pretty useful dashboard out of it. Not a bad trade for being annoyed at the internet.