Skip to content

openpacketloss/OpenPacketLoss-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenPacketLoss™ is a modern, open-source network diagnostic tool built to measure raw packet loss directly from any web browser.

Unlike throughput tests that hide packet drops behind TCP retransmission, or legacy CLI tools like ping and traceroute that rely on rate-limited ICMP, OpenPacketLoss uses WebRTC Data Channels configured with ordered: false and maxRetransmits: 0, delivering unreliable, unordered SCTP datagrams that behave like raw UDP. The result is a true, protocol-accurate measurement of network stability as experienced by latency-sensitive applications like Zoom, Discord, and online gaming.

OpenPacketLoss Demo

Deployment Guide

Full self-hosting guide: openpacketloss.com/selfhosted-server

Deploy your own packet loss testing server with full control over infrastructure, performance, and privacy.

Key Features

  • High-Performance WebRTC: Built on Rust and Tokio for high concurrency and low overhead.
  • Built-in STUN: Includes an integrated STUN server (port 3478) for zero-dependency ICE candidate gathering.
  • Self-Generating Config: Automatically creates a .env file with sensible defaults on the first run.
  • Directional Analysis: Supports both Client-to-Server and Server-to-Client testing.
  • Security: Built-in limits for concurrent connections and per-IP rate limiting.

How It Works

The server acts as a WebRTC endpoint that echoes back data sent via DataChannels. By configuring the DataChannel with ordered: false and maxRetransmits: 0, it simulates UDP-like behavior. The client transmits sequence-numbered packets, and the server increments a receive counter before echoing them back, allowing for precise measurement of network stability.

Compatible frontend: OpenPacketLoss WebApp

Getting Started

1. Clone the repository

git clone https://github.com/openpacketloss/OpenPacketLoss-Server.git
cd openpacketloss-server

2. Run the server

Ensure you have the Rust toolchain installed.

cargo run --release

The server will automatically generate a .env file with default settings on its first run.

Environment Variables

Configure your server by passing these environment variables to the Docker container or setting them in your .env file.

Server Configuration Options

Variable Default Description
PLATFORM_MODE self 'web' (public service) or 'self' (self-hosted with flexible limits).
PORT 8080 HTTP server port for signaling.
STUN_PORT 3478 Built-in STUN server UDP port.
STUN_URL auto STUN URL (auto, explicit stun:ip:port, or none).
NAT_1TO1_IP - Public/External IP for NAT environments (SDP mangling). Auto-detects LAN IP if empty.
MAX_CONNECTIONS 500 Maximum total concurrent connections.
MAX_CONNECTIONS_PER_IP 10 Maximum concurrent connections per unique client IP.
ICE_PORT_MIN - Minimum UDP port for WebRTC ICE candidates (optional).
ICE_PORT_MAX - Maximum UDP port for WebRTC ICE candidates (optional).
ICE_GATHERING_TIMEOUT_SECS 2 Seconds to wait for ICE candidate gathering.
OVERALL_REQUEST_TIMEOUT_SECS 30 Maximum time for the entire SDP handshake process.
STALE_CONNECTION_AGE_SECS 120 Maximum age in seconds for inactive connections.
PERIODIC_CLEANUP_INTERVAL_SECS 5 Interval to scan and clean up stale connections.
RUST_LOG info Logging verbosity (trace, debug, info, warn, error).

Related Repositories

License

This project is licensed under the MIT License. See the LICENSE file for details.


Maintained by OpenPacketLoss.com

About

OpenPacketLoss Server backend to facilitate WebRTC signaling and packet echoing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages