A most elegant TCP hole punching algorithm
Summary
This article describes a deterministic, infrastructure-free TCP hole punching algorithm for establishing direct connections between hosts behind NATs. It covers bucket selection, port derivation, socket handling, winner selection, and a final integration, emphasizing timing sensitivity, non-blocking I/O, and minimal coordination, with references to a tcp_punch.py implementation.