This is a blog post about an application for UDP packet loss/tamper rate measurement that I have written in February 2026 using Copilot Pro.
How reliable is the Internet? If I send packets via WiFi, some of the Ethernet frames will most likely be dropped (surrounding routers make it happen, as well as walls and the weather). But will they be retransmitted at layer 2? If yes, then my UDP packets have a chance of reaching their destination with 100% success rate. Only timeout or queue overflow could cause them to be dropped at this so-called “last mile” (or last-kilometer?)
And yet, I have observed ~20% packet drop rate when trying to get to my GCP instance in Iowa, US. The experiment I have conducted was done as a side project that I have developed using Copilot Pro licence that I decided to purchase for educational purposes.
Not going into too much detail – the app consists of a producer and consumer. Producer sends small UDP packets (header + 12 bytes payload + 4 bytes flag field). Consumer verifies the checksum, logs the contents and sends it back with ACK flag set (effectively recalculating the checksum). This combines a few measurements:
- latency
- error-rate (should be 0.0% assuming that UDP checksum is there to prevent)
- tampering rate
An even better approach would be to test encrypted communication, although this adds some overhead and complicates the implementation significantly.
It's not a trivial task to measure the latency of a one-way trip, due to the fact that the clocks may not be synchronized with sub-millisecond precision. Therefore, we measure the RTT - round-trip time.
The random numbers are there to simulate the real-life traffic.
After a conversation with my dad, I understood that the reliability of the transfer may vary with the size of the packet. Therefore, the next step is to make it send packets with varying size distribution (I dream of a draggable 3D chart where you can steer the density in time and size domains).