4 VoRS uses Opus codec with 20ms frames with 48kHz 1ch 16-bit S-LE sound.
5 It uses native @code{libopus}'es Packet Loss Concealment (PLC) feature
6 if number of lost frame does not exceed 32 count. DTX (discontinuous
7 transmission) is also on.
9 Each frame has single byte stream identifier (unique identifier of the
10 participant) and 24-bit big-endian packet counter. Reordered packets are
11 dropped. 24-bit counter is long enough for very long talk sessions.
13 Each packet is encrypted with ChaCha20-Poly1305. Key is generated during
14 handshake procedure with the server and is shared among other participants.
15 Stream identifier with packet counter are used as a nonce. Only 64-bits
18 It is tuned for 32Kbps bandwidth. 24Kbps should be enough, but 40B of
19 IPv6 header, +8B of Poly1305 authentication tag, +4B of stream
20 identifier with the counter, +8B of UDP header for 50pps means also
21 24Kbps of bandwidth only for overhead transmission.
23 Each client handshakes with the server over TCP connection using
24 @url{http://noiseprotocol.org/, Noise}-NK protocol pattern with
25 curve25519, ChaCha20-Poly1305 and BLAKE2s algorithms.
29 @item Client sends @code{VoRS v1} to the socket. Just a magic number.
31 @item All next messages are prepended with 16-bit big-endian length.
33 @item Client sends initial Noise handshake message with his username as
36 @item Server answers with final Noise handshake message with the payload
37 of @code{OK HEX(COOKIE)}, or any other failure message. It may reject
38 client if there are too many peers or its name is already taken.
40 @item That 128-bit cookie is sent by client over UDP to the server every
41 second. If UDP packets are lost, then no connection is possible and
42 after timeout server drop TCP connection.
44 @item Otherwise it replies with @code{SID XXX}, where XXX is ASCII
45 decimal stream number client must use.
47 @item @code{PING} and @code{PONG} messages are then sent every ten
48 seconds as a heartbeat.
53 S <- C : e, es, "username"
54 S -> C : e, ee, "OK COOKIE"
62 S -> C : "ADD SID USERNAME HEX(KEY)"
69 Every second client sends UDP packet with his single-byte stream
70 identifier, even if it is muted. That may help punching holes in
73 Clients are notified about new peers appearance with @code{ADD}
74 commands, telling their SIDs, usernames and keys. @code{DEL} notifies