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

turn only as fallback - try first with only stun #86

Closed
wants to merge 4 commits into from

Conversation

neonphog
Copy link
Collaborator

@neonphog neonphog commented Mar 29, 2024

---
title: Check for known cases where STUN likely won't work.
---
graph TD;

stunCheck("STUN Check")
udpCheck("UDP Check")
natCheck("NAT Check")
stunOkay("STUN Okay")
turnOnly("TURN Only")

stunCheck-->udpCheck
udpCheck-->|If UDP Blocked|turnOnly
udpCheck-->|If UDP Okay|natCheck
natCheck-->|If Bad NAT|turnOnly
natCheck-->|If NAT Okay|stunOkay
Loading
---
title: Message flow and acceptance.
---
graph LR;

subgraph a [" "]
  send("Send with No Open Connection")
  inOffer("Incoming Offer")
  inRestart("Incoming Restart Offer")
  ignore("Ignore")
end

subgraph b [" "]
  outRestart("Outgoing Restart Offer")
  outOffer("Outgoing Offer")
end

subgraph c [" "]
  tryStun("Try Connecting STUN Only")
  tryTurn("Try Connecting STUN+TURN")
end

send-->outOffer
send-->|If STUN Okay|tryStun
send-->|If TURN Only|tryTurn
tryStun-->|If Error|tryTurn
tryStun-->|If Error + Impolite|outRestart
inOffer-->|If Impolite|ignore
inOffer-->|If Polite + STUN Okay|tryStun
inOffer-->|If Polite + TURN Only|tryTurn
inRestart-->|If Impolite|ignore
inRestart-->|If Polite|tryTurn
Loading
classDiagram

class SigConn {
  Cli sig_conn
  send()
}

class SigConnFut {
  SigConn sig_conn
}
SigConn *-- SigConnFut

class SigConnMap {
  Map~SigConnFut~ sig_map
  assert_sig() SigConnFut
}
SigConnFut *-- SigConnMap

class PeerConn {
  FFIPeerCon peer_conn
  Option~SigConn~ tmp_sig_conn
  send()
}
SigConn *-- PeerConn
note for PeerConn "PeerConn holds a temp ref to SigConn\nwhile still iceGathering, then drops it"

class PeerConnFut {
  PeerConn peer_conn
  in_offer(offer)
  in_restart_offer(restartOffer)
}
PeerConn *-- PeerConnFut
note for PeerConnFut "Restarting on offers *within* the future\nprevents race conditions."

class PeerConnMap {
  Map~PeerConnFut~ peer_map
  assert_peer(url) PeerConnFut
  in_offer(url, offer)
  in_restart_offer(url, restartOffer)
}
PeerConnFut *-- PeerConnMap
note for PeerConnMap "PeerConnMap is no longer under SigConn.\nInstead PeerConn itself now holds\na temporary dependency"
Loading

@neonphog neonphog changed the title initial checkpoint turn only as fallback - try first with only stun Mar 29, 2024
@neonphog neonphog self-assigned this Apr 1, 2024
@neonphog
Copy link
Collaborator Author

closing in favor of holochain/sbd#20

@neonphog neonphog closed this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant