Server-less UDP over NAT

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
JuddMan
New Member
Posts: 7
Joined: Thu Aug 26, 2004 3:09 pm
Contact:

Server-less UDP over NAT

Post by JuddMan »

hi. the post on "Netplay over AIM" brought up something interesting...

though i do agree that an IM plugin for zsnes is way overboard, the idea of entering the others ip and clicking connect brings up an interesting feature:

NAT connections, where both may be behind some sort of connection sharing router, should be possible if both are trying to connect to the other simultaneously. (both using connect to server, neither hosting) It works by fooling the routers into thinking their end started the communication, when it was more of a simultaneous thing. should work for some types of firewalls as well.

zsnes is sort of half capable of this already. when testing it, you can connnect, chat, start a game, but both clients think they are player 1 so it's not very playable of course. i dont know how easy or hard it would be to implement it, but something like both computers rolling random numbers to see who is the server and who is the client would work in theory...?

when used with a client similar to zbattle.net, it would greatly reduce the headaches of ADSL modem users who have to share their internet with other people, and don't want or know how to configure their modems or routers to foward ZSNES UDP to a specific computer.

just a thought.
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

Many PC LAN games will immediately display local servers behind the same router. It would not be hard for ZSNES to do the same. However, a feature like this should probably wait until the multiple client feature is implemented (I can't wait ;)).
JuddMan
New Member
Posts: 7
Joined: Thu Aug 26, 2004 3:09 pm
Contact:

Post by JuddMan »

i was talking about the possibility of 2 UDP clients connecting even when both are behind NAT based routers or ADSL modems, or even firewalls. not on the same network, i mean on diferent networks or ISPs

it's normal for one of these routers to foward incoming replies on the port that the client is connecting to back to the client. this means that if both try to connect to the other at once, they should both on the second attempt get through, as the first attempt has got their end to foward the incoming packets through to them.

it won't work, however with more than one person trying to connect to another from behind the same router unless each uses a diferent port (that's why starcraft is impossible to play behind internet connection sharing)

i now know someone who has implemented this in a few projects he is working on, so it is possible. but i agree for the moment getting more players on the one game is more fun.
(ahh... 2 smart allies in SOM! take the low level game to a new level)
ThunderClaw
I know where you live.
Posts: 148
Joined: Thu Aug 19, 2004 4:51 am

Post by ThunderClaw »

Again, that's probably a consideration when support for more than two linked computers is implimented. As it stands now, only two computers can be connected at the same time, so this issue is a moot point.

As a side note, does SOM even ALLOW three people connected at once? I don't remember it having support for something like that.
JuddMan
New Member
Posts: 7
Joined: Thu Aug 26, 2004 3:09 pm
Contact:

Post by JuddMan »

it worked on som using the multitap. if u have trouble getting it to work on zsnes, make sure use pl 3/4 as pl 1/2 is off. just hit start button on the second and third controllers.

Image

until more players are supported in zsnes netplay, you have to play all on one computer or two on one, one on the other.


anyway, this was just a suggestion for consideration, since the network code is being redone.

routers blocking incoming traffic is the cause of much dificulty on services like ZBattle.net. many times i have been frustrated when some dude on ADSL wants to host a game, then cant work out why no one can connect. get two of these players to try set up a game between them and you have a problem...

using the method i described (i think it's called "solicited udp"), many firewalls and all NAT based routers or modems will automatically redirect the traffic correctly, it has the added security of only fowarding traffic from the IP address and port of the computer you are connected to (if you foward it in your router setup, its likely it'll be fowarding it from any IP), and will stop redirecting it once the game is closed. ZSNES is already half capable of this by mistake, and i hope that with the changes in the networking, this method of connecting is also considered.
Post Reply