How jdtsillas/udpvpn works
UDP VPN Tunnel is a Linux command-line program that forwards IP packets between a TUN device and a remote UDP endpoint. The workflow parses local and remote endpoints, optionally loads symmetric encryption and signing keys, opens the tunnel and UDP sockets, then asynchronously relays packets in both directions. When encryption is enabled, outgoing packets are AES-encrypted and HMAC-signed; incoming packets are signature-checked and decrypted before delivery to TUN. The excerpts show the relay and cryptographic operations; other details are based on README statements.
Main entry points: udpvpn.cpp Tunnel server
Components 14
Configuration
- CLI options
udpvpn.cpp - Endpoint parsing
udpvpn.cpp - Key loading
udpvpn.cpp
Packet relay
- Tunnel server
udpvpn.cpp - TUN device
- TUN receive
udpvpn.cpp - UDP send
udpvpn.cpp - UDP receive
udpvpn.cpp - TUN delivery
udpvpn.cpp
Optional security
- Encrypt and sign
udpvpn.cpp - Verify and decrypt
udpvpn.cpp
Other components
- Operator
- Remote UDP peer
- Key file
Connections 15
- Operator → CLI options: sets options
README.md - CLI options → Endpoint parsing: parses endpoints
udpvpn.cpp - CLI options → Key loading: loads keys
udpvpn.cpp - Key file → Key loading: provides keys
README.md - CLI options → Tunnel server: configures
udpvpn.cpp - Tunnel server → TUN device: opens
README.md - Tunnel server → Remote UDP peer: configures endpoint
README.md - Tunnel server → TUN receive: starts reads
udpvpn.cpp - Tunnel server → UDP receive: starts reads
udpvpn.cpp - TUN receive → Encrypt and sign: encrypts and signs
udpvpn.cpp - TUN receive → UDP send: sends packets
udpvpn.cpp - UDP send → Remote UDP peer: sends datagrams
udpvpn.cpp - UDP receive → Verify and decrypt: checks and decrypts
udpvpn.cpp - UDP receive → TUN delivery: writes packets
udpvpn.cpp - TUN delivery → TUN device: delivers packets
udpvpn.cpp