Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Q 2 DEVS]Some Local Network Multiplayer questions

Author
Message
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 14th Dec 2017 20:36
We're making an educational app for use in schools and other institutions - and this relies on multiplayer over local network.

Now, the issue we have is that networks at such places are usually locked down tighter than Fort Knox - as we experienced today when doing a test at a local school. Now, we were prepared and brough our own WiFi router, so we got to perform the test.

However for when we'll get to actual release, we will have to depend on the institutions own networks, and the whims of the local IT Crowd.

So we need to know exactly what ports are used for (Tier 1) LAN communication with AGK.

For the Host, it is not a problem, we've set this to port 1025 - and snooping with Wireshark confirm this. Also we realize that for named networks (that we use) ports 45631 and 45632 need be open for the initial handshake.

However for the clients, I noticed with Wireshark, that they do not inherit the port of the host, but rather set their own arbitrary port of a specific range. I've seen from 43325 to 43486 over a few tests. What I need to know is the entire range clients will choose from. And even better, is there a way to set the port manually?

I thought by perhaps having the host send its' IP to our backend, the clients could pick up this, and set the IP and port through this little detour. This would dispense the need for initial handshaking ports to be open (45631 & 45632) - but would this also lock down the port on the client so that the arbitrary port-selection there would not kick in?

It is much easier to convince the local IT lords and masters to open one single TCP port for LAN traffic, than several hundred...

All the best, merry Xmas and hoping for a fast reply
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 15th Dec 2017 18:14
Do it with the Socket commands,
they are the better choice for your kind of networking.

Of course you have to handle the clients on your own,
and add an own idenfication header in you message. I bet you will manage this with ease.

Quote: "
networks at such places are usually locked down tighter than Fort Knox"

Steal open ports from http, printer, maybe it will even get you an angry sys admin to your place who could actually help you opening a decent port.

[/url]
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 15th Dec 2017 20:59 Edited at: 15th Dec 2017 21:10
Thanks Jack. Yes, sockets are an alternative - but then I'd have to rewrite the entire networkIO functionality on both LAN server and the clients. Which isn't a problem per-se, it just takes some extra effort, and overcoming my fundamentally healthy level of laziness. That would also enable using the backend as the middleman in cases where the local IT people are less than cooperative.

Though I was hoping to avoid that, and just use AGKs built in multiplayer features to save dev time. Which works perfectly fine as is - where we got control over the LAN infrastructure and nothing is really locked down tight...

So perhaps a slight increase in dev time will have to be justified by the immortal words of programmers everywhere: "It turned out to be more complicated than we thought..."

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Dec 2017 12:51
You can specify the incoming port, as you have found, to something like 1025, but outgoing ports are assigned randomly by the operating system, usually in the 40,000-65,000 range. This shouldn't affect network connections since outgoing connections shouldn't be blocked based on their outgoing port, only on the port they are connecting to. Otherwise the device wouldn't be able to connect to anything. Both the AppGameKit multiplayer commands and the socket commands operate in this way, since the multiplayer commands use sockets underneath.

In this case it sounds like sending the IP out to a backend which can then be picked up by the clients would work, or some other method of getting the IP address on to the client that doesn't involve named networks. Named networks use broadcast packets, which is likely what is blocked by the network configuration.
MillaSays
6
Years of Service
User Offline
Joined: 15th Dec 2017
Location:
Posted: 20th Dec 2017 08:49
Thanks Paul.

I'll do the 'detour via backend' method for distributing the IP of the host. We're having another test in early February at the local school, with some thorough testing before then, all should be well
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 20th Dec 2017 09:16
Quote: "In this case it sounds like sending the IP out to a backend which can then be picked up by the clients would work, or some other method of getting the IP address on to the client that doesn't involve named networks."


Does this mean I can use network commands over internet without nat punch through? I have a lobby server that can pick up wan ip of game host and game client. My game is playable over the internet, but hosts have to do some port-forwarding with my current logics. And sorry for hijacking the thread!
13/0
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 20th Dec 2017 12:15
Quote: "Does this mean I can use network commands over internet without nat punch through? I have a lobby server that can pick up wan ip of game host and game client. My game is playable over the internet, but hosts have to do some port-forwarding with my current logics. And sorry for hijacking the thread!"


Not the multiplayer commands I think, though you can set up your own using websockets over a usually open port like 80 or 443.

As for my scenario - it's just using our backend to let the LAN host post it's local IP (with an ID code) over a bog standard http API, and have the users of the clients enter in the ID code, whereupon the client will look up that code by a get method to the backend API, and if found, receive the local IP of the host, and use that to connect to the host rather than have the clients listen for the host broadcast of the 'I'm here, and this is my name and details!' on port 45631 and 45632 on the LAN (aka named network).

(oh, and I posted something earlier that is still pending approval. I used the work account by accident, rather than this my private account. The work account was really only made for the company to purchase an AGK2 license - as we're getting close to launch, we couldn't just continue to use my private license. The work account was never really meant to be used for posting here on the forum...)

Login to post a reply

Server time is: 2024-11-24 06:12:49
Your offset time is: 2024-11-24 06:12:49