A simple QUIC-based client/server that:
- can run as server or client
- uses QUIC connectivity (via
aioquic) - auto-generates TLS certificates (self-signed) if not provided
- client and server both send data to each other
- can push MTU by sending near-max datagrams
- can push data rate via configurable streaming sender
- allows port configuration
- uses Python + venv
Protocol framing is inspired by packet-style binary protocols (length-prefixed frames).
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython -m quic_tool server --host 0.0.0.0 --port 4433python -m quic_tool client --host 127.0.0.1 --port 4433 --insecure--insecure disables certificate verification (useful with auto-generated self-signed certs).
--port: UDP port to listen/connect--cert,--key: provide TLS cert/key. If omitted (server), tool generates./certs/server.pemand./certs/server.key.- MTU / datagram push:
--datagram-size: payload size for datagrams (will be clamped to a safe upper bound)--datagram-rate: datagrams/second
- Data-rate push (streaming):
--stream-bytes-per-sec: target bytes/sec on a stream--stream-chunk: write chunk size
Binary frames:
| type: u8 | flags: u8 | length: u32 (big-endian) | payload: bytes[length] |
Frame types (examples):
0x01HELLO: payload = UTF-8 name0x02DATA: arbitrary bytes0x03PING: empty payload0x04STATS: JSON payload (UTF-8)
Both sides:
- accept a bidirectional stream 0 for framed messages
- periodically send PING + STATS
- optionally blast DATAGRAM frames
- This is a test tool; don’t use in production.
- QUIC uses UDP; ensure firewall allows the configured port.