Module voice

Module voice 

Source
Expand description

The UDP voice plane. No shard task takes part in it.

  1. recv_from(addr)
  2. peers.by_address(addr)        -> one hash; absent means the cold path
  3. peer.decrypt(datagram)        -> this connection's OCB2 domain alone
  4. peer.routing()                -> the shard's table, an Arc read
  5. routing.receivers(sender)     -> a borrowed slice, no allocation
  6. per receiver, if the cursor gate passes: encrypt with ITS key,
     then send_to, or push onto its queue for the TCP tunnel

The gate at step 6 is the whole of the audio ordering protocol:

  receiver.cursor >= routing.since(sender)

One atomic load and one comparison. It is conservative on purpose - a lagging receiver loses audio from speakers it already knew about, at worst a few hundred milliseconds of silence for a client already in trouble - and it replaces every handshake a “is the view ready” protocol would have needed.

Revocation needs no gate at all: the shard publishes its table before it pushes any view, and a route that is gone is simply absent. Cutting too early is always safe; you hear less than your due, never more.

REF: docs/design/guide-implementation.md 9.5, 9.7

Structs§

VoicePlane
The UDP plane.

Functions§

generate_crypt_setup
Generate a fresh OCB2 key and the two nonces for a new connection.

Type Aliases§

Datagram
A sealed datagram and where it goes.