0

If theoretically, I passed 4 relay candidates to an agent, will the agent determine the priority of which candidate to use based on latency/RTT?

I've read that in some messages on SO, but have been unable to find that in the actual WebRTC codebase. If that is the case, is it only for some implementations of WebRTC?

Mmm Donuts
  • 9,551
  • 6
  • 27
  • 49

1 Answers1

3

No, the priorities will be used. https://datatracker.ietf.org/doc/html/draft-uberti-mmusic-nombis-00 describes a better approach but its not implemented.

https://datatracker.ietf.org/doc/html/draft-thatcher-ice-renomination-00 is implemented and can be activated through a parameter enable_ice_renomination in the configuration but it isn't documented further.

Community
  • 1
  • 1
Philipp Hancke
  • 15,855
  • 2
  • 23
  • 31
  • This assumption is incorrect? https://stackoverflow.com/a/34452904/3783770 I did try to find that prioritization in the codebase but came up empty. – Mmm Donuts Feb 21 '19 at 14:54
  • Are you trying to pass four different TURN servers (instead of relay candidates) to the peerconnection and hoping it will figure out the closest one? – Philipp Hancke Feb 21 '19 at 16:01
  • Not presently, but I read that comment and figured that if the client determines the path of lowest RTT, then why not other than longer call setup time. If we assume 4 TURN servers are in 4 different regions, lowest RTT is quite impactful. – Mmm Donuts Feb 21 '19 at 16:02
  • that isn't how one deploys TURN. Typically latency-based dns (route53) together with round robin for per-region scaling is quite sufficient. You might find https://medium.com/the-making-of-appear-in/keep-your-turn-servers-close-8fff0a2a91f5 helpful. Now whether a webrtc client would pick the relay candidates with the lowest latency when given TURN servers in four different regions is something that should be easily observable -- check whether you get one or four. I think that is that what the post you're linking refers to. – Philipp Hancke Feb 21 '19 at 17:23
  • ... one or four relay candidates when passing four different servers. They might be sorted out. – Philipp Hancke Feb 21 '19 at 18:37
  • creating a peerconnection with turn server in different regions somewhat implicitly assigns them latency based priorities from my testing. Mostly because of different foundations and how that is included in the priority. – Philipp Hancke Feb 21 '19 at 21:08
  • Hey again. That's pretty interesting... I suppose Route53 latency-based routing is the way to go, but if I passed say 4 TURN servers in different AWS regions to a peer, then it would prioritize the closest region (if that is the case)... I mean, I suppose that also depends on the implementation of ICE for the software in question. – Mmm Donuts Feb 21 '19 at 21:10
  • easy to test: pass four turn servers in different regions, look at the priorities on the ice candidates and backfill regions. – Philipp Hancke Feb 21 '19 at 21:50