Valve has open sourced the source code for GameNetworkingSockets, a basic transport layer for games that is used as the foundation for the SteamWorks SDK. Features include:
- Connection-oriented protocol (like TCP)
- ... but message-oriented instead of stream-oriented
- Mix of reliable and unreliable messages
- Messages can be larger than underlying MTU, the protocol performs fragmentation and reassembly, and retransmission for reliable
- Bandwidth estimation based on TCP-friendly rate control (RFC 5348)
- Encryption. AES per packet, Ed25519 crypto for key exchange and cert signatures. The details for shared key derivation and per-packet IV are based on Google QUIC.
- Tools for simulating loss and detailed stats measurement
The project has dependencies for OpenSSL, Google protobuf, and ed25519-donna and curve25519-donna. It's also only been tested on Ubuntu 17.10.
Learn more at https://github.com/ValveSoftware/GameNetworkingSockets.