My devices are connected to my home network, I.e my phone, tablet etc all use the same WiFi and presumably the same public IP address.
There for without nat punchthrough will my devices be detectable?
I see some people made a php master server but is this a folly if it doesn’t have a nat facilitator too?
In other words is it best to use master server rather than php?
Yep, NAT sure is important - without it we would have ran out of addresses long ago as the amount of available addresses is pretty small. If you had no NAT, yes, your devices would have their own public address and would be easily detected.
As for php vs. some other master server, the server side of NAT doesn’t matter much at all - it can be just about any technology that you’re comfortable with using. I think the best way of describing why this is would be a simple overview of what NAT punch through really is.
You live in a house with lots of doors to outside and you want to go to the shops. The thing is, you can’t take your door keys with you. So as you leave, you also leave the door you went through unlocked so you can get back in later. You also make a note of which one it was.
This happens every time you leave, no matter what shop you go to.
- The shops are servers.
- Inside the house is the private side of NAT.
- The doors represent the holes in the NAT that are being ‘punched through’ (from the inside) - these are more commonly known as ports.
- You are actually a packet; a message from the client to the server.
- The door you chose temporarily identifies which program and which particular computer on the private side sent the message, so the response knows where to go.
A punch through occurs when you tell someone outside which door is open, and they go through it. A mater server simply allows you to meet other people and tell them this.
Immediately you’re probably thinking woah, woah, surely that’s a big security hole, and why does this even happen? The response that comes back from a server is different from the request. The person who left the house (the request) tells the person going back (the response) which door is unlocked, so it can get in and be sent to the correct computer and program. Security wise, there’s so many doors and because their all locked by default that the chances of randomly coming across an unlocked one are very low (on a side note that doesn’t stop people trying! Check your routers incoming traffic and you’ll probably see lots of requests getting denied on a daily basis).
So in summary, pick the one which you are most happy to use
I think I get it.
But does the nat facilitator have to keep running while your playing your game and makesure every so-often that the doors are open and to keep them open? I think I read that somewhere.
Yep that’s right; after a particular delay, usually a few hours of inactivity, NAT locks those doors again automatically. This is so they can be reused and because NAT can’t always tell when a particular door is done with.
Normally just holding a connection to the facilitator is all it requires to prevent this happening. Using a PHP facilitator for example, that’s like opening a webpage which just never loads - it opens a connection, but doesn’t transfer much at all. When the request is received by PHP, it makes a note of the door/house (port/public ip, a combo called an ‘endpoint’) the request came from and makes it available to other people.
Request: “Hey php, door #14 is open - feel free to use it”
PHP: “Ok, I’ll make sure it stays open, and tell everybody else where it is”
Hopefully that makes sense!