Jump to content
  • Advertisement
Sign in to follow this  
maya18222

Networking questions

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1. How would a public computer access a server on a private network? I know that the router would use NAT to create sub addresses for each computer on the private network, but in the example where the ISP has only provided a single unique IP address for that router, this means that from outside the private network, each computer is seen as having the same IP address, so how would a computer on a public network, say the internet, address a particular computer on the private network (the server)?

Lets say I wanted to have a MySQL server run on a computer behind a router, and I wanted to access that with a SQL client on some other computer around the world. How would I know what address to use with the client?

2. In the same example of a private network behind a router using a single IP address provided by the ISP. When a computer on the private network sends data to some server on a public network, NAT is used to create a packet as if produced from the Unique IP address assigned by the ISP, but how does data from the server get sent back to the correct computer on the private network when recieved by the router? ie, what data is stored in the packet that is sent and received? I assume its the ISP IP address, the port, and something else to distinguish the address of the correct private networked computer, but what?

Share this post


Link to post
Share on other sites
Advertisement
I use a VPN to do such things (Hamachi, specifically). Not sure if there are other options; it'd be cool to learn about them if there are though.

Share this post


Link to post
Share on other sites
You say you understand NAT, but the 2nd question imply you don't know the full story.

Anyway, for #1, On your private network router, you'd set specific ports for data to be forwarded to a specific PC on the private Network. Then, when a computer out on the internet wants to connect to it, it would have enter the Router's external IP address (assigned by the ISP) and one of the specific port's that is being forwarded. You can use dynamic DNS to handle the possible changing IP address of your router (dyndns.org).

#2, NAT handles all of this. When a PC sends data to another IP address on the internet, the router stores which which home network IP address is communicating to which external IP address computer. When datat comes back to the router, it matches the IP address and port, and sends the data on to the original PC that initiated the send.

You should do more research on NAT to get a better explanation than the one I gave you for #2.

Good Luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!