Idea · Oct 15, 2026
Build Your Own Persistent P2P Tunnel
A staged networking project where students build a paired, encrypted file-sharing tunnel that discovers its public address, punches through NATs, and falls back to a relay, then measure how often each path actually works.
What it would do
Flipflop on Show HN uses Iroh to keep a tunnel alive between trusted devices so sharing a file needs no setup after the first pairing, and the comments show how hard NAT traversal still is in practice. In this assignment students build the core of such a tool themselves in Python or Go. Milestone 1: a reliable framed protocol over UDP with acknowledgements and retransmission. Milestone 2: a tiny STUN-like rendezvous server so peers learn their public address and port. Milestone 3: UDP hole punching with simultaneous open, tested against a provided Docker lab that emulates full-cone, restricted and symmetric NATs with iptables. Milestone 4: pairing with a short code, a Noise or libsodium handshake, and an end-to-end encrypted relay fallback the server cannot read. Milestone 5: chunked, resumable file transfer and a measurement report on which NAT combinations get a direct path, how long hole punching takes, and the throughput cost of relaying.
Key features
- Docker NAT lab with configurable NAT types so every student can reproduce hard cases on one machine
- Rendezvous and relay servers written by students, with a reference relay for comparison
- Short-code pairing and an authenticated encrypted handshake (Noise IK or libsodium box)
- Resumable chunked transfers with integrity hashes
- Final measurement milestone with a connectivity matrix and latency and throughput plots