<div dir="ltr">So does the libNice framework expect the client-as-a-server application to be able to listen on new local UDP ports for each client that attempts to connect via the signal channel? I guess what I'm trying to figure out here is - Does libNice fully hand over the UDP port and stream once the ICE process has completed or does it broker the client streams down to a single one the application feeds from?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 8:39 AM, Philip Withnall <span dir="ltr"><<a href="mailto:philip@tecnocode.co.uk" target="_blank">philip@tecnocode.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah, I see what you mean now. Yes, it will, but that is handled by<br>
libnice internally. When doing ICE negotiation, libnice will open UDP<br>
ports on each network interface on the client and send those port<br>
numbers through to the peer.<br>
<br>
You can control the range those ports are allocated from, but it will be<br>
a separate UDP port per client-acting-as-a-server / client connection:<br>
<br>
<a href="http://nice.freedesktop.org/libnice/NiceAgent.html#nice-agent-set-port-range" target="_blank">http://nice.freedesktop.org/libnice/NiceAgent.html#nice-agent-set-port-range</a><br>
<br>
In libnice terminology, you would have a separate ‘stream’ for each<br>
client-acting-as-a-server / client connection.<br>
<span class="HOEnZb"><font color="#888888"><br>
Philip<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sun, 2014-11-09 at 20:42 +1100, Scott Richmond wrote:<br>
> Yep all makes sense. Which brings me back to my original assumption:<br>
> Our application, when run as client-acting-as-a-server, will need to<br>
> listen on a new local UDP port per client correct?<br>
><br>
> On Sun, Nov 9, 2014 at 8:02 PM, Philip Withnall<br>
> <<a href="mailto:philip@tecnocode.co.uk">philip@tecnocode.co.uk</a>> wrote:<br>
> That is correct for certain NAT configurations, yes. You will<br>
> need to<br>
> perform an ICE negotiation between the client-acting-as-server<br>
> and each<br>
> of the clients trying to connect to it, in order to set up<br>
> additional<br>
> port forwarding rules (if the NAT translator needs them). Each<br>
> of these<br>
> ICE negotiations will need to go through a well-known,<br>
> non-NATed<br>
> signalling server, just to guarantee that the candidate<br>
> messages are<br>
> successfully sent between the two clients trying to connect.<br>
><br>
> Does that make sense?<br>
><br>
> Philip<br>
><br>
> On Sun, 2014-11-09 at 11:48 +1100, Scott Richmond wrote:<br>
> > Our application uses the client server model. Our users are<br>
> typical<br>
> > home users with typical NAT routers. At any point our users<br>
> can start<br>
> > a server and tell other users to join it as clients. The<br>
> server will<br>
> > not be run by users with the knowledge to setup port<br>
> forwards on their<br>
> > router. Using STUN, we could punch a port forward for the<br>
> user to a<br>
> > specific client. But no other clients will be able to use<br>
> the same<br>
> > port forward rule if the servers' local NAT router includes<br>
> the client<br>
> > external IP/port as part of the rule. This is correct yes?<br>
> ><br>
> > On Sun, Nov 9, 2014 at 10:08 AM, Philip Withnall<br>
> > <<a href="mailto:philip@tecnocode.co.uk">philip@tecnocode.co.uk</a>> wrote:<br>
> > On Wed, 2014-11-05 at 11:07 +1100, Scott Richmond<br>
> wrote:<br>
> > > This is something that has forced me to avoid ICE<br>
> as a<br>
> > solution for<br>
> > > our most recent project. Our project uses a server<br>
> that only<br>
> > listens<br>
> > > on 1 UDP port, expecting all clients to be able to<br>
> reach it.<br>
> > > Presumably this means we cannot reliably use<br>
> STUN/TURN to<br>
> > solve the<br>
> > > NAT traversal problem?<br>
> ><br>
> > The server should be reachable by all clients,<br>
> unless it’s<br>
> > behind a NAT<br>
> > itself, which is very rare. Using this as a<br>
> signalling server<br>
> > for<br>
> > transferring the ICE candidates between two clients<br>
> will allow<br>
> > ICE to<br>
> > work.<br>
> ><br>
> > I’m not sure I understand where you think ICE will<br>
> fail in<br>
> > this<br>
> > scenario?<br>
> ><br>
> > Philip<br>
> ><br>
> > > On Wed, Nov 5, 2014 at 12:47 AM, Philip Withnall<br>
> > > <<a href="mailto:philip@tecnocode.co.uk">philip@tecnocode.co.uk</a>> wrote:<br>
> > > On Tue, 2014-11-04 at 12:55 +0100,<br>
> <a href="mailto:fb111@web.de">fb111@web.de</a><br>
> > wrote:<br>
> > > > yes, very helpful! Can you describe what<br>
> the<br>
> > process is when<br>
> > > a node<br>
> > > > wants to stay registerd with a<br>
> singaling/<br>
> > rendevouzserver,<br>
> > > but does<br>
> > > > not receive a request for a connection?<br>
> > > > As far as I understand, the node first<br>
> performs<br>
> > the binding<br>
> > > request<br>
> > > > with STUN and TURN an THEN forwards the<br>
> > information of the<br>
> > > IPs and<br>
> > > > ports to the rendezvousserver, so that<br>
> other nodes<br>
> > know how<br>
> > > to reach<br>
> > > > this node, right?<br>
> > > > Do you need to keep this registration<br>
> with the<br>
> > > rendezvousserver alive,<br>
> > > > to avoid the shutdown of the portmapping<br>
> on the<br>
> > NAT router<br>
> > > by sending<br>
> > > > keep alive STUN signals?<br>
> > ><br>
> > > That’s incorrect. The STUN and TURN<br>
> negotiations are<br>
> > specific<br>
> > > to each<br>
> > > remote peer, so must be performed at the<br>
> point when<br>
> > two nodes<br>
> > > need to<br>
> > > connect.<br>
> > ><br>
> > > This has to be the case because various<br>
> NAT<br>
> > configurations can<br>
> > > limit<br>
> > > port bindings to packets coming from<br>
> specific<br>
> > external IP/port<br>
> > > combinations. So if you have node A which<br>
> has<br>
> > established a<br>
> > > port mapping<br>
> > > in its NAT and sent the WAN IP/port for<br>
> that mapping<br>
> > to the<br>
> > > signalling<br>
> > > server, then later node B tries to<br>
> connect, the<br>
> > packets may be<br>
> > > dropped<br>
> > > by the NAT because they’re coming from an<br>
> external<br>
> > IP/port<br>
> > > combination<br>
> > > (node B’s WAN address) which the mapping<br>
> wasn’t<br>
> > created for.<br>
> > ><br>
> > > You may still want to keep each node<br>
> registered with<br>
> > the<br>
> > > signalling<br>
> > > server, for control purposes, but you will<br>
> need to<br>
> > design your<br>
> > > own<br>
> > > protocol for doing that (or use whatever<br>
> protocol<br>
> > the existing<br>
> > > signalling server you’re using uses). That<br>
> protocol<br>
> > will be<br>
> > > entirely<br>
> > > separate from ICE.<br>
> > ><br>
> > > Philip<br>
> > ><br>
> > ><br>
> _______________________________________________<br>
> > > nice mailing list<br>
> > > <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> > ><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
> > ><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > nice mailing list<br>
> > > <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> > > <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > nice mailing list<br>
> > <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > nice mailing list<br>
> > <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> nice mailing list<br>
> <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> nice mailing list<br>
> <a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br>
</div></div><br>_______________________________________________<br>
nice mailing list<br>
<a href="mailto:nice@lists.freedesktop.org">nice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br></blockquote></div><br></div>