Skip to content

vladborovtsov/l2-test-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L2 LAN Tester 🎮

Main UI

A cross-platform Rust GUI application designed to test Layer 2 network connectivity between computers. It is specifically built to simulate and troubleshoot the discovery and latency requirements of LAN gameplay, especially over virtual networks like ZeroTier, Tailscale, Radmin VPN, Hamachi, or OpenVPN TAP connections.

Features

  • Peer Discovery: Automatically detects other instances running on the same local subnet using UDP broadcasting (just like classic LAN game discovery).
  • Subnet Broadcast Mode: Toggleable option to send broadcasts specifically to each interface's subnet (e.g., 192.168.1.255), offering higher reliability than standard global broadcasting.
  • Network Interface Resolution: Automatically identifies and displays which readable network interface (e.g. "Wi-Fi", "ZeroTier", "Ethernet") the peer was discovered on, ensuring your traffic is flowing through the VPN and not the physical LAN.
  • Peer Analytics: Real-time graphing of latency metrics for any selected peer, allowing you to visualize stability and spikes over time.
  • Integrated Speed Test: High-performance UDP-based speed testing (Download/Upload/Both) with configurable duration, chunk size, and target bandwidth.
  • Stability Grading: Automatically grades connection quality from A to F based on measured packet loss.
  • Cross-Platform: Pre-compiled and confirmed working natively on Windows, macOS, and Linux.

Understanding Latency Metrics

Traditional ping commands only test lowest-level routing. L2 Tester provides three distinct types of latency to mimic what a game client actually experiences. Hover over any metric in the UI for a detailed tooltip.

1. ICMP (ms)

  • What it is: A standard raw ICMP ping (identical to running ping <ip> in your terminal).
  • Requirements: Requires Administrator/root privileges on macOS and Linux to send raw sockets. If not run with sudo, this column will display a (dash).
  • Use case: Checking base OS-level routing capability.

2. UDP (ms)

  • What it is: A standard UDP echo round-trip on port 47778.
  • Requirements: None. Works out of the box for all users.
  • Use case: Games primarily use UDP. This latency perfectly reflects network latency without the overhead of application processing.

3. App (ms)

  • What it is: Application-layer timestamp ping. Send a high-resolution timestamp byte array, wait for the remote application to parse it and echo it back.
  • Requirements: None.
  • Use case: The most accurate representation of actual game-loop latency. It includes thread scheduling, context switching, and the overhead of the OS network stack in user space. If your OS is under heavy load, App (ms) will spike while ICMP might stay low!

Peer Analytics & Speed Testing

Select any peer from the discovery table to open the Peer Analytics sidebar.

  • Real-time Graphs: View live scrolling plots for ICMP, UDP, and App latency. Use the ➕/➖ buttons to zoom or ⟲ to reset the view.
  • Speed Test Parameters:
    • Duration: 5s to 60s.
    • Chunk Size: Up to 4096 bytes (1400 bytes recommended for standard MTUs).
    • Target Mbps: Rate-limit the test to prevent line saturation, or set to 0 for unlimited.
  • Grading Legend:
    • A: <1% loss (Excellent - Competitive Gaming Ready)
    • B: 1-3% loss (Good)
    • C: 3-5% loss (Fair)
    • D: 5-15% loss (Poor)
    • F: >15% loss (Unusable)

Building / Usage

Running Locally (Development)

Ensure you have Rust installed via rustup.

cargo run --release

Building via Docker

To maintain clean environments, the repository includes shell scripts that utilize Docker to cross-compile the application for various platforms. Ensure Docker is running before executing:

  • Build for all platforms:
    ./scripts/docker-build-all.sh
  • Build for Windows (from Mac/Linux):
    ./scripts/docker-build-windows.sh
  • Build for macOS:
    ./scripts/docker-build-macos.sh
    (Creates native .app bundles and packages them into a .dmg for distribution).
  • Build for Linux:
    ./scripts/docker-build-linux.sh

Note on macOS Builds: If you launch the packaged .app bundle, macOS might block incoming UDP responses due to local network privacy rules or firewall sandboxing, resulting in dashes () for latency. For guaranteed results during testing, run the binary directly via the terminal: ./target/release/l2-test-rust.

License

This project is licensed under the MIT License. See the LICENSE file for details. Third-party notices are generated automatically using ./scripts/generate-licenses.sh and can be viewed in the app's About window (ℹ button).

About

L2 network tester to troubleshoot connectivity over L2 tunnels

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors