So we set up a server yesterday, and I started thinking- how does this really work? I’ll be setting up several virtual environments and labs so I can have a fast and stable learning environment. I have quite a few things on my I-would-love-to-learn-list, and setting up a server will make it easier for me. But, anyways- to the question! How does this work? My computer, remote desktop client and a server at home. What is the magic?
It goes something like this:
On your phone, tablet or computer when you aren’t connected on the same network as at home but you want to access for example a server (or a computer) at home (and it has to be turned on), then you can use a program called Remote Desktop. This program will allow you to connect to another computer first through a router where you are, then the router at hom (not on the drawing for simplicity, it’s actually severeal routers involved),- in this case my server at home. The gatekeeper is my router, it decides what goes in and what goes out. Like the door to my house.
The adress to the house is my public IP-adress. I said public, because there are private IP-adresses as well and I’ll soon explain the importance of them. The door has several ports, or entrance codes if you like. So to get in you need the IP adress and a port. If you don’t give the program a port it will use the default port :3389. But you still can’t get in. I will have to tell my router to allow access through the port and which local IP it should send yout to. I will have to activate the code so it will open the door for you/me. Once you get through the door you will go through a routingtable, this will match you to the local IP adress.
Inside the house I have several devices, and they all have their own adresses, local IP’s. And how do the devices get their local IP’s ? This is done through a service that is attached to the router, called DHCP, Dynamic Host Configuration Protocol- or through a static adress. But then what happens when different local IP’s want to get out just one public IP? Another service called NAT , Network Adress Translator, converts the local IP to that one public IP.
So you’ve opened the remote desktop program, and entered the adress to where you want to go. Once you get to the door you get sent to the correct device/host. The server (in this case) will do all the work, and the the result will be sent back through the router to your program on your device and the result will be displayed on a graphical interface (what you see- the ‘images’)- all this in a few milliseconds.
– note: you go through several routers not just one, but for simplicity I’ve talked mostly about the router at home- as most routers work kind of the same way. But this is more complex than this, but for me this explanation (if it is right haha) will do for now 🙂
Here is how it may look when you log on to the router. You can see my laptop and the server. To access a device you need the name or the local IP (local IP is shown next to the name, but I’ve cut it out of the picture 😉 )