

The receiving computer’s software knows that port 80 is used for serving http documents, so it listens there and responds accordingly. When you fetch a web page, for example, it uses port 80. Some ports have specific applications which are standards throughout the computing industry. Once computers became sophisticated to run multiple applications, early computer scientists had to wrestle with the issue of ensuring applications connected to the right applications. Back in the day, when computers could only run one application at a time, all you had to do was point one computer at another computer on the network to connect them as they would be running the same application. So where do ports come into this process? Ports are an old but useful holdover from the early days of network computing. 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. 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. This is thanks to a wonderful bit of routing magic known as a Network Address Translation (NAT). How does all the information from the internet get to the right device inside the network? If you visit 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?

The diagram raises an interesting question which you may not have thought about before. If your public IP address is like a street address, think of the internal IP addresses like apartment numbers for that street address. The additional addresses all belong to the computers seen at the bottom of the image. The red address 192.1.168.1 is the router address within your network.
