A Simple Illustration of Port Forwarding
What a Port is & How it Works?
We have a phone with an electronic switch board that would typically be used in a company. When someone wants to make a call to this company, and let’s say they wanted to talk to the sales department within this company they would dial the company’s phone number along with the extension of the sales department.
When the call comes in, the phone will answer the call and then the phone will look at the extension number and send or forward the call to the corresponding department number. Let’s say another person calls the company and they wanted to talk to the support department. The call comes in and is received by the phone.
Now the phone number has done its job which is to send the call to the specific company from the outside, but once the call is received using the phone number, the phone number is no longer needed because it is done its job so the only thing that is needed now is the extension (100). Now the phone will forward the call to the support department because of the matching extension number.
How is This Related to Networks?
In a network the router is contacted with an IP address along with a port number. The router will look at the port number and send or forward the request to the internal IP address that the port has been configured to. Another request from the internet comes into the network and reaches the router. So the IP address has done its job which was to bring the request to the router from the internet. The IP address is no longer needed.
Now the router will look at the port number and based on its port forwarding configuration it will now forward the request to the computer with the IP address that the port number has been configured to. In a network the IP address is similar to a phone number and the port number is similar to an extension. The router represents the phone and computers within that network represent different departments.
Ports are always associated with an IP address and they are identified by a unique number. Regardless if you see the port number or not a port number is always associated with an IP address because an IP address always has a purpose, and it uses the port number to determine what the purpose is. Whether it is pulling up a webpage, using an FTP (File Transfer Protocol) service or using a remote desktop.
It always has a purpose that is determined by the port number because not only are ports associated with an IP address but they are also always associated with an application or process such as FTP, webpages, email and so on.
Port numbers range from 0-65535. Of the 65,000 there is a few of these that are most common and that are used on a daily basis. For example such as port 80 which is used for web pages. There’s also ports 20 and port 21 which are used for FTP or port 443 which is used for bringing up secure webpages. These are just a few, in fact there is a privilege category of ports that are called the well-known ports which range from port 0 – port 1023.
Want new articles before they get published?
Subscribe to our Awesome Newsletter.