
43
Appendix D: Understanding port forwarding
Taken directly from:
https://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
There are plenty of projects we’ve covered that use your computer as a server for other devices.
When you’re inside of your network, most things will work fine. But some apps, if you want to
access them when you’re outside your network, make things significantly hairier. Let’s start by taking
a look at why that is.
How your router handles requests and uses ports
Here’s a map of a simple home network. The cloud icon represents the greater internet and your
public, or forward-facing, Internet Protocol (IP) address. This IP address represents your entire
household from the oustide world–like a street address, in a way.
The red address 192.1.168.1 is the router address within your network. The additional addresses all
belong to the computers seen at the bottom of the image. If your public IP address is like a street
address, think of the internal IP addresses like apartment numbers for that street address.
The diagram raises an interesting question which you may not have thought about before. How does
all the information from the internet get to the right device inside the network? If you visit
howtogeek.com on your laptop how does it end up on your laptop and not your son’s desktop if the
public-facing IP address is the same for all devices?
This is thanks to a wonderful bit of routing magic known as a Network Address Translation (NAT).
This function occurs at the router level where the NAT acts like a traffic cop, directing the flow of
network traffic through the router so that a single public IP address can be shared among all the
devices behind the router. Because of the NAT, everyone in your household can request web sites
and other internet content simultaneously and it will all be delivered to the right device.