Search Unity

Mobile networking over cellular data

Discussion in 'Multiplayer' started by steveEXC, Dec 9, 2017.

  1. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    Hey guys, I can connect two phones over a wifi network using the NetworkManager. I have one phone act as the host and one act as the client. What I can't figure out is how I would get these phones to connect if they're over a cellular data network instead of wifi. I can get the IP address of the phones, but putting their values into the NetworkManagerGUI doesn't seem to let them connect. What am I missing here in getting these phones to connect over cellular data?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I don't know about your cell network, but mine (AT&T in the US) hands to my phone a 10.x.x.x address. This is a non-routable address space, meaning it is an internal network IP address not much different than the address assigned to a home computer connected to a consumer grade router. Routers within AT&T will route packets for that address according to their rules, but routers on the greater internet will drop any packets for that address space.

    https://en.wikipedia.org/wiki/Private_network

    So the first thing I'd consider is using something like the Unity Multiplayer Relay service, which is intended to overcome exactly this type of issue. Photon Cloud is another. Or you could design your own relay server.
     
  3. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    I figured there was something going on here that was beyond my current understanding. Now I've got some specific stuff I can look into. Thanks for pointing me in the right direction!