Packet Loss Test


WebRTC is the cutting-edge technology (as of 2019) that makes this site possible. It comprises several JavaScript APIs for real-time communications. How it all works with the STUN server and ICE candidates is pretty complicated, but basically it uses magic to figure out a way to communicate quickly both ways.

The real reason WebRTC is important for this site is that it is the first and only way for a browser to communicate in a unreliable method without some (likely slow and unsecure) plugin. See, everywhere else, your browser uses TCP, which, when a packet fails, it will keep resending it until it works or gives up. This is ordinarily very good because it would be bad if random paragraphs or part of some code failed to load and nobody knew about. However, this made it basically impossible to test the packet loss. If your computer just kept trying until it worked, there would never be any lost packets. Now with WebRTC, I can tell it to just send the packets in the test once and to never retry them. Then I can just see which ones are missing.

Also, thanks to Google for its free STUN server I'm using to help establish connections.