Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPIC] Signal Server Facilitates Relay + Removal of TURN #20

Open
8 of 15 tasks
neonphog opened this issue Apr 9, 2024 · 1 comment
Open
8 of 15 tasks

[EPIC] Signal Server Facilitates Relay + Removal of TURN #20

neonphog opened this issue Apr 9, 2024 · 1 comment

Comments

@neonphog
Copy link
Collaborator

neonphog commented Apr 9, 2024

stateDiagram-v2
direction LR
state "Signal Connect" as sc
state "Relay Messages via Signal" as rms
state "Try Open WebRTC" as rtc
note left of rtc: STUN only
state rtc_ok <<choice>>
state "Relay Messages via WebRTC" as rmrtc
sc --> rms
sc --> rtc
rtc --> rtc_ok
rtc_ok --> rms: error
rtc_ok --> rmrtc: success
@neonphog
Copy link
Collaborator Author

Moving these design musings down to a comment so the description can be real epic details:


Signal Server Protocol

  • register includes query string timestamped proof of private key
    • wait period then nonce response verify of private key
    • send limit values to client
  • forward request bytes be sent to peer (dest peer replaced by source peer when sent out again)
  • keepalive periodic client send

Limiting

  • limit X concurrent pending connections
  • limit X connections per IP
  • limit X IPs in memory
  • limit X messages per connection per time
  • limit message size to X MiB

Back Channel Protocol

  • online notify a peer server of client availability (after register success)
  • offline notify a peer server of client disconnect
  • forward request bytes be sent to peer
  • keepalive both peer servers should periodically keepalive

Signal Client Protocol

Client protocol is sodium secret stream based with logic to respect rate-limits and buffer messages into batch sends without going over the max message size returned by the server. Within the encryption are framed message types:

  • message an actual client message send--this is client communication relayed via the signal server
  • request_offer a polite node wants an offer from the impolite node
  • offer an impolite node wants to try negotiating webrtc
  • answer a polite node responding to an offer
  • ice webrtc connectivity message
  • open sent upon webrtc data channel connect success. When a node has both sent and received the open message, it switches to sending all data over the webrtc channel. (Note, this may not be needed, data channel open is probably a good enough signal to start using it).

@neonphog neonphog changed the title Signal Server Facilitates Relay + Removal of TURN [EPIC] Signal Server Facilitates Relay + Removal of TURN Apr 15, 2024
@abe-njama abe-njama transferred this issue from holochain/holochain May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant