Supporting IPv6 (Specifically for Mobile Networking)

descrubb

Member
Hello...

I am looking into creating native extensions for iOS and Android for the purpose of mobile peer networking. I understand that IPv6 networks are unreachable, to an extent, from IPv4 networks and since, from what I've seen and heard, much of mobile network space is "IPv6 only" which is why some people say "gamemaker won't support IPv6"(which is completely understandable as it is simply not an uncomplex issue). It would seem plausible to be able to send network requests from one IPv6 client device to a peer IPv6 client device on a IPv6 only network assuming they know each other's IPv6 Addresses, of course.

Looking at iOS for example, I've looked into it a bit and I assume I could create an extension using an objective-c Class? as a wrapper and #import the <Network/Network.h> framework from the iOS Framework libraries and use the custom extension as a 'middleware' to handle all the networking requests and responses while passing the IPv6 Address as a string, PORT as a double/string, and the rest of the network data as a string into Game Maker. At that point, Game maker could be game maker and handle data responsibly and prepare other data to send back the other peer's way.

I tried connecting from my mobile networked phone to an IPv4 server address through gamemaker and there was simply no recognition on the server that any attempt to access the server was made. Which makes me wonder how it would ever be possible for a p2p game to host an Mobile IPv4 peer client (on IPv4 WAN > wifi) for example with an Mobile IPv6 peer (on IPv6 Cellular) as host... I know some people say having a mobile device running as host on a cellular network is ridiculous, but the speed is there, and there are fallback strategies using 3rd party servers if connections are dropped and new IPs somehow become attached to a device. The biggest problem I see is getting the two to connect...

Is the idea to create these extensions over the top? is there something already in place?
 

descrubb

Member
Update with some testing...

I found out my ISP doesn't support IPv6 whatsoever. Which now possibly makes sense as to why my mobile device wasn't able to query my server. It would seem as though in order to run or connect to a server in any IPv6/IPv4 capacity, an ISP must provide support for either protocol. So in order to host a server for a networked GM game and have both IPv6 and IPv4 clients connect to the server I would need to either find a datacenter/hosting platform that supports the IP translation services needed so that either protocol can connect seamlessly, or move ISPs to one that supports IPv6. I'm wondering if Game Maker actually already can deal with IPv6 addresses but there's just not enough test/use cases right now for networked mobile GM games. Currently I don't have a way of testing this, but the mobile market needs some good indie multiplayer games so... I guess I'm gonna find out one way or another.
 

descrubb

Member
Of course unity becomes the fierce competitor for attention in this case since they support IPv6. I learned from This Blog Post that
  • IPv4 and IPv6 networks do not interoperate, although it is possible to pass traffic from one type of network over the other with tunneling.
  • Devices can operate on an IPv4-only network (the previous standard), and IPv6-only network, or a network with both protocols in use.
  • you must test on an IPv6-only network to ensure everything is working well. If your device has both IPv6 and IPv4 addresses, then socket operations could succeed using IPv4 (which means IPv6 could have failed, so make sure to test IPv6 only without the chance for using the IPv4 protocol as a backup)
  • Some of 3rd party native and managed networking plugins(extensions in gm case) might also be not compatible with IPv6 networks, please consider reaching out plugin vendor for their compatibility status.

Does Unity support IPv6?

Yes! WWW and UnityWebRequest are IPv6 compatible on iOS out of the box because they are based on high level Apple networking APIs.
So, as it were, apple's iOS networking APIs support IPv6, which makes me wonder if Game Maker's networking functions are also based off of these high level APIs. If they are then, theoretically, putting a domain name into a network_connect function should work straight up in an IPv6 environment.

I still have yet to be able to test WAN IPv6, I just don't know how to test it without having a server to connect to, and I'm poor right now so I'll have to wait on purchasing an external server. For now I will attempt setting up an local IPv6 server through the guide at the bottoms of this Apple Developer post.

it would be a shame to have to use unity, coding in GML is so much more relaxing than C#
 

FrostyCat

Redemption Seeker
So, as it were, apple's iOS networking APIs support IPv6, which makes me wonder if Game Maker's networking functions are also based off of these high level APIs. If they are then, theoretically, putting a domain name into a network_connect function should work straight up in an IPv6 environment.
If "WWW and UnityWebRequest" is the limit to what Unity supports, then that's no different than what GMS supports through http_* functions. Neither imply the ability to conduct transport-layer TCP or UDP over IPv6.
 

descrubb

Member
If "WWW and UnityWebRequest" is the limit to what Unity supports, then that's no different than what GMS supports through http_* functions. Neither imply the ability to conduct transport-layer TCP or UDP over IPv6.
True. I was realizing that as I was copying over the text.

My main focus was on the part that said "because they are based on high level Apple networking APIs." which implies that:
  1. Apple's High level APIs resolve to IPv6 Addresses naturally given a domain name(such as a game server domain name). Which hopefully leads to being able to accept incoming connections on IPv6 which should then be able to be used with the ip:port structure for things like udp networking.
  2. The APIs can be used through an app. This is obvious, however, I would assume Game Maker's networking functions such as http_* use Android and iOS native networking APIs.
Which goes to say, if Game Maker does use the native high level APIs then it's a matter of testing on an IPv6 network to make sure it works and dispell the myth of "GM doesn't support IPv6" .

However, if Game Maker doesn't use the native high level APIs and uses some sort of low level networking code which is somehow incompatible with IPv6 network addresses then it will be a matter of finding out how to either get yoyo to address the issue so I can code my games in peace OR make an extension which uses the Android and iOS high level APIs to make use of mobile IPv6 compatibility and pass IPv6 strings to GM through the extension and just run it that way. Either way, there is a wayšŸ¤ž to get mobile networking to work, and since I haven't found a definitive "mobile networking for gm studio" guide (which is the first result in google), I am on the road to discovery.

It may be as simple as making sure the server running the GM game has ipv6 and ipv4 tunneling capabilities. but when it comes to peer to peer(p2p), I'm assuming after exchanging peer information for UDP holepunching it will be up to the peer's:
  1. ISP capabilities then the
  2. Device capabilities and then
  3. GM app capabilities.
 
Top