756523927a
The relay now keeps active peer sessions alongside room admission state. After a successful hello/welcome handshake, the connection enters a datagram loop and stays registered until the QUIC connection closes. Incoming datagrams are only considered for forwarding when their overlay room id, peer id, and Ethernet frame type match the peer assigned by the relay. The relay then reuses the existing room forwarding decision logic, clones the matching live target sessions, and sends a relay-stamped Ethernet datagram to each connected target that can carry the frame. This keeps spoofable wire metadata out of the trust boundary: clients can put whatever they want in an overlay header, but the relay forwards using the room and peer identity established during the control handshake. Test Plan: - cargo fmt --check - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings Refs: PLAN.md QUIC DATAGRAM Ethernet forwarding path
2.3 KiB
2.3 KiB
softlan-vpn
Monorepo for a Layer 2 over QUIC LAN party bridge.
Workspace crates
lanparty-proto: shared frame format, MAC validation, MTU helpers.lanparty-ctrl: control-plane messages (join/hello/role/version).lanparty-obs: shared diagnostics/logging event models.lanparty-client-core: platform-agnostic client session state.lanparty-client-win: Windows TAP + route/metric handling binary.lanparty-gateway: Linux AF_PACKET gateway binary.lanparty-relay: public QUIC relay binary.
lanparty-proto
Transport-agnostic tunnel contract shared by all binaries:
- overlay datagram header encoding and decoding
- Ethernet frame header parsing
- MAC address parsing and identity validation
- QUIC datagram to TAP MTU budget helpers
lanparty-ctrl
Reliable control-plane schema shared by the QUIC stream handlers:
- endpoint hello messages with role, room, MAC, and datagram budget
- server welcome, reject, peer lifecycle, stats, and disconnect messages
- room-code, role/MAC, peer-id, and effective-MTU validation
- length-prefixed JSON control frames for reliable QUIC streams
lanparty-obs
Shared diagnostics and structured logging vocabulary:
- gateway/relay frame logs with MACs, ethertype, length, peer, and action
- tunnel counters shared by control messages and runtime diagnostics
- client connectivity/TAP diagnostics and user-facing status messages
lanparty-relay
Public relay binary and relay-owned room state:
- QUIC endpoint binding and first-stream hello/welcome admission
- room admission for clients and gateways
- one gateway per room, duplicate client MAC rejection, and room limits
- stable effective room MTU chosen before Ethernet datagrams flow
- live Ethernet datagram forwarding with no ingress reflection
- peer leave cleanup for room membership and MAC indexes
Build
cargo check --workspace
Relay
cargo run -p lanparty-relay -- --listen 443/udp
--listen accepts either a socket address or a UDP port shorthand such as
443/udp. The relay binds a QUIC endpoint, accepts a control-stream hello,
replies with welcome or reject, and forwards live Ethernet QUIC datagrams
between accepted peers in the same room. It currently uses a generated
self-signed development certificate; production certificate and client trust
handling remain future work.