Skip to content

kuchmenko/monkey-d-tcp

Repository files navigation

Monkey D. TCP

    ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣾⣿⣿⣿⣿⣷⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠀⠀⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀
    ⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀
    ⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀
    ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
              STRETCHING TCP SINCE 2025

CI License: MIT Rust

"I'm gonna be King of the Networking!" — Monkey D. TCP

Network programming playground. The Grand Line where packets learn to fight.

The Crew

Crate Status Description
basic-tcp-proxy Ready Async TCP proxy with metrics
echo-server Ready Simple echo server for testing
load-tester Ready Benchmarking and load testing
load-balancer WIP Multi-backend load balancer

Quick Start

# Run the proxy (forwards localhost:3000 → localhost:8081)
just proxy

# Run echo server for testing
just echo

# Run tests
just test

# Run all quality checks
just quality

Performance

The proxy sustains ~90k requests/sec with sub-millisecond latency.

Metric Value
Peak RPS 91,599
p50 Latency 110μs
p99 Latency 294μs
Throughput 90 MB/s
Max Connections 500+

See basic-tcp-proxy README for full benchmark matrix.

Load Testing

Run the built-in load tester to benchmark the proxy:

# Terminal 1: Start echo server
just echo

# Terminal 2: Start proxy
just proxy

# Terminal 3: Run load test
just load-test

Configure test scenarios in load_test.toml:

target_addr = "127.0.0.1:3000"

[[scenarios]]
name = "baseline"
connections = 10
duration_secs = 5
message_size = 1024

[[scenarios]]
name = "stress-test"
connections = 500
duration_secs = 5
message_size = 1024

Project Structure

crates/
├── basic-tcp-proxy/     # Async TCP proxy with metrics
├── echo-server/         # Simple echo server for testing
├── load-balancer/       # (WIP)
└── load-tester/         # (WIP)

Development

just fmt          # Format code
just clippy       # Run lints
just test         # Run tests
just quality      # All checks
just fix          # Auto-fix issues

Requirements

  • Rust 1.85+ (edition 2024)
  • Tokio runtime

License

MIT

About

Network programming battlefield

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published