2

I used this code, which is explained here to create a webrtc datachannel connection without using any fancy libraries. Websockets are used for signaling.

Now, when I run the node app on my server, which has a global IP, I can connect with two browser instances through websockets. Both browsers are then able to connect via datachannels.

Now I replaced one browser instance by using my mobile phone browser (latest chrome browser) and tried the same. Sadly, no connection was engaged. When I use two 2 browser instances on by mobile phone, every works as well.

So, maybe there is something wrong with the signaling, if two browsers are not within the same machine, or NAT traversal does not work for mobile phones with mobile internet, which is what I suspect, but I'am not sure.

Can someone say for sure that mobile internet devices are theoretically able to NAT traverse ? (I do not know, how mobile providers setup their network topology)

Kr0e
  • 2,149
  • 2
  • 24
  • 40
  • 1
    I have successfully done numerous data channel connections and video calls from my Android phone on 4g and on wireless to other networked devices. Having good ICE servers is a must for any connection and you MAY have to have a turn server but I was able to connect from 4glte with only a STUN server. – Benjamin Trent Jan 22 '15 at 01:06
  • So the quality of the STUN server as impact on traversal ? Alright, I'm going to test this with a STUN server running on my own global linux box. I though carrier grade NAT (symmetric NAT) could prevent hole punching. Good to hear, that you had luck! – Kr0e Jan 22 '15 at 07:58

1 Answers1

1

Devices connected through mobile networks are definitely able to traverse NATs, but it's a lot trickier and less likely to succeed.

You should look into using a TURN server as fallback when normal STUN is not sufficient for hole punching.

I found the following resources helpful for this purpose:

Any service that's running in production needs a TURN server, or it'll be unreliable and flaky for users. Unless your application doesn't require exact point-to-point connectivity between two users. For example WebTorrent is one such project where you only need to be able to connect to some peers, but not specific peers, for it to work.

Feross
  • 1,541
  • 14
  • 17
  • Alright, I'm actually already happy, if I would know, that the code is not missing some important part. I thought that carrier grade NATs can prevent hole punching, so maybe it's really a mobile provider issue ? I'm sitting in Germany with H+ mobile internet with 1and1 as provider. Who knows ? – Kr0e Jan 22 '15 at 08:01