uProxy-p2p icon indicating copy to clipboard operation
uProxy-p2p copied to clipboard

Test ICE works symmetrically / add failures to FAQ

Open iislucas opened this issue 12 years ago • 6 comments

Here's the scenario: 2 macs, A and B. A has its firewall set up to 'deny all incoming connections' (A goes into firewall settings and checks 'Block all incoming connections'.). B is standard.

If A offers, and B accepts, the connection will not be established, and the fail handler is not called in any reasonable amount of time.

If B offers, and A accepts, the connection works fine.

Neither A nor B is behind a NAT.

TODO: test if this is normal symmetric NAT (if so, this is a WebRTC bug).

iislucas avatar May 07 '14 13:05 iislucas

Any followup / assignment I can do to help triage this?

Chrome bugs are going to have such a long lead time that its worth identifying potential stumbling blocks early. Our dogfooders are also likely going to be skewed towards the demographic that experiences this bug.

willscott avatar May 18 '14 18:05 willscott

We've ordered some equipment to test this; last I checked the way ICE works does not assume you've turned on a firewall on your local machine - that is, from the perspective of ICE, local firewalls are not the same as a restrictive NAT. This is my current hypothesis, and when we get our new networking setup, we will test it further.

iislucas avatar May 20 '14 18:05 iislucas

I tested this in depth today, with a Mac (set to "Block all incoming connections") and a Thinkpad, running https://bemasc.makes.org/thimble/the-worlds-smallest-webrtc-demo.

I ran wireshark on both machines, which confirmed that the Thinkpad was pinging the Mac every 50 ms, and both were pinging the STUN server every 480 ms, but the Mac was not pinging the Thinkpad. Then I launched chrome with debugging options:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --v=1 --enable-logging=stderr --vmodule=*talk/p2p/base/port*=4,*=0

This showed log messages like

[4915:25859:1001/170248:VERBOSE4:port.cc(1099)] Jingle:Conn[audio:ZHoyhzfl:1:0:local:udp:172.26.13.27:60538->:1:0.99:local:udp:172.26.13.164:50553|C--I|9114756780654345726|-]: UpdateState(): pings_since_last_response_=5064256 , rtt=3000, now=5064305
[4915:25859:1001/170248:VERBOSE4:port.cc(1174)] Jingle:Conn[audio:ZHoyhzfl:1:0:local:udp:172.26.13.27:60538->:1:0.99:local:udp:172.26.13.164:50553|C--I|9114756780654345726|-]: Sending STUN ping /SThx2JZLAfY at 5064305
[4897:35843:1001/170248:INFO:socket_host_udp.cc(298)] sendto() has failed twice returning a  transient error. Dropping the packet.

I used chrome://tracing (with "net", "p2p", "browser", "webrtc", and "render_host" enabled) to determine the error code, which turned out to be -10. Then I looked through the code and determined that -10 is ACCESS_DENIED, which means that the sendto() syscall returned EACCES (https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h&q=%22ACCESS_DENIED,%20-10%22&sq=package:chromium&type=cs&l=54).

I conclude that the Mac firewall, when blocking unexpected inbound packets from a particular source, also prevents any subequent outgoing traffic to that source (presumably only for some period of time). This is a broken NAT behavior.

We could possibly work around this, most obviously by attempting two PeerConnections with different Offerer/Answerer roles. We could also attempt to modify the ICE standard in some way to tolerate this behavior. However, my inclination is to note that users should not use this Mac firewall setting. (That's also what Chromecast does: https://support.google.com/chromecast/answer/3249268?hl=en .)

bemasc avatar Oct 01 '14 21:10 bemasc

Because of the security positioning of uproxy, I feel like it's more problematic for us to recommend lowering security settings than it is for chromecast / apple aircast.

It would be great to have a reduced test case for this. To make that happen, can we determine the set of system calls made by chrome? It could be that we simply need to make sure to use connect and send rather than sendto as recommended by Apple here: https://developer.apple.com/library/IOS/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html#//apple_ref/doc/uid/CH73-SW12

willscott avatar Oct 04 '14 16:10 willscott

Based on the NAT detection code in uProbe, with "Block all incoming connections" turned on MAC OSX, the detection code still report the NAT type to be port restricted cone. It does not seems the firewall setting of "Block all incoming connections" makes anything worse.

quantsword avatar Oct 06 '14 22:10 quantsword

Oops, this isn't obfuscation.

trevj avatar Apr 27 '15 15:04 trevj