Documentation

Developer Docs

Get started with KSP in minutes. Build from source, run your first connection, and explore the protocol.

Quick Start

1. Start a KSP Serverbash
# Clone & build
git clone https://github.com/Kush2272/ksp
cd ksp
cargo build --release

# Run the server on port 9876
cargo run --bin ksp-server
2. Connect a Clientbash
# In a separate terminal
cargo run --bin ksp-client

# The client will:
# 1. TCP connect to 127.0.0.1:9876
# 2. Perform KSP handshake (X25519 + HKDF)
# 3. Open a stream and send encrypted data
3. Observe with Wiresharkbash
# Load the KSP Lua dissector in Wireshark
# Wireshark → Preferences → Protocols → Lua
# Load: wireshark/ksp_dissector.lua

# Filter KSP traffic
tcp.port == 9876
4. Run Benchmarksbash
# Run all Criterion benchmarks
cargo bench

# Run specific benchmark
cargo bench -- handshake
cargo bench -- serialization
cargo bench -- throughput

Protocol Constants

Default Port9876/tcp
Header Size48 bytes
Max Payload16 MB
Auth Tag16 bytes
Handshake Timeout10 seconds
Keepalive Interval30 seconds
Session Timeout3600 seconds
Max Streams256 per session
Window Size65,535 bytes
Replay Window1024 packets
Sequence Numbers64-bit unsigned
Nonce Size12 bytes