paint-brush
Port Forwarding for Noobsby@vishaalgrizzly
225 reads

Port Forwarding for Noobs

by Vishaal GrizzlyNovember 10th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Port computing makes it possible for other computers on the internet to connect to a networked computer. It opens up the gateway for users on remote networks to communicate with devices on home/office networks. Although this might sound like rocket science in networking, it is a relatively simple concept that most people already use in everyday scenarios. One needs to have strong knowledge of the functioning of networks, and their common terminologies, to get a proper understanding of port forwarding. A handful of synonyms can be confusing, so let's have a quick glance at them for a better understanding.
featured image - Port Forwarding for Noobs
Vishaal Grizzly HackerNoon profile picture

Port computing makes it possible for other computers on the internet to connect to a networked computer. It opens up the gateway for users on remote networks to communicate with devices on home/office networks. Although this might sound like rocket science in networking, it is a relatively simple concept that most people already use in everyday scenarios.

One needs to have strong knowledge of the functioning of networks, and their common terminologies, to get a proper understanding of port forwarding. A handful of synonyms can be confusing, so let's have a quick glance at them for a better understanding.

How does the internet work?

The internet can be referred to as a worldwide system of networks in which computers communicate with each other. Although it was used by most people only for the consumption of information during its nascent stages, its adoption into other devices has paved the way for several business models, as well as ecosystems.

The internet has two major components. namely:

  • Network protocols, and
  • hardware.

It primarily works on two protocols called Transmission Control Protocol/Internet Protocol. They have a set of rules that every device should follow in order to work properly and communicate with each other. Hardware is the second major component that includes all the physical modules like computers, smartphones, satellites, cables, servers, routers, and so on.

While transferring information on the internet, the data will be sent as “packets” from the source to the destination. This process is called packet switching and it will contain a unique IP address and port number which will be received by the router on the receiver’s end. The data will be properly transferred to the destination address by the router based on the routing data in the packets.

What is port forwarding?

Before diving into the technicalities, let's look into the basics of port forwarding.

Port forwarding is a way of making a computer from your home/business network accessible by other computers on the internet. It is crucial to provide remote access for other computers to access data from a personal computer. Firewalls typically keep unwanted visitors away unless they have the right IP address with the port number.

Why do we need port forwarding?

The most common use cases are to enable peer-to-peer connection and Remote Desktop Protocol. It helps to direct the request to the right port, adding another layer of security against potential threats. With port forwarding, accessing one’s home/private computer has become much easier than ever and has unlocked more possibilities.

Might sound more complicated than it actually is

Visualize the router as an administrator telephone with an electronic switchboard which will be typically used in companies. Whenever someone from outside the organization wants to speak with an employee, they will have to add an extension number after the phone number. The phone call will be automatically forwarded to the employee as the call will pass through the admin telephone. If someone enters the wrong extension, the call will not be forwarded to the employees.

This process can help with maintaining the anonymity of the employees and can protect them. Port forwarding is roughly based on this concept, but it will have various port numbers for different purposes.

Where do we use port forwarding?

Virtual desktops
Apart from accessing data on home/private networks, computers that are used for large-scale technical implementations will be effectively stored in cloud environments. The hospital or research institute can make use of the computing potential from anywhere in the world with remote computing.

Backups
As the internet speed kept increasing, it opened up the possibility to access large files from a backup server without any hindrances. Proper authentication systems were also introduced to avoid loss or breach of data.

Game servers
Port forwarding provides opportunities for gamers to host private game servers with their friends. This is also used to host gaming tournaments during fests as it will improve the overall gameplay and connection speed.

Peer-to-peer connections
It is a decentralized model in which either party can initiate a transfer session as they will act as a node for file/data sharing within the network. Napster was the pioneering peer-to-peer file-sharing service that offered digital audio distribution. Torrenting is also based on peer-to-peer connections and port forwarding helps to connect with more peers for faster file transfer.

CCTV surveillance
Port forwarding plays a crucial role in CCTV surveillance as it makes DVR accessible from anywhere. By properly setting up the encryption methods, the footage can be accessed only by the admin.

How to implement port forwarding?

Here is a step-by-step guide to implementing port forwarding on a home router

Step: 1

Open your browser and type in the default gateway address - 192.168.0.1

Step: 2

Enter your credential in the respective fields which can be found at the bottom of the router.

Step: 3

Navigate to port forwarding settings under the advanced section in the menu.

Step: 4

Enter the name of your device, select “TCP/UDP” or both under the protocol, enter the IP address of the device, and click apply.

Note: If you are unsure about your IP address, Go to Control Panel > Network and Internet > Network and Sharing Center> Click the type of connection being used. Click details and you will find the computer’s IP address next to IPv4 address.

Step: 5

Enter the default port number 80 for port forwarding.

Tip: As there are thousands of ports available with many of them being unassigned, programs can use them as needed. Check for their availability here

Is port forwarding safe?

The security risks in port forwarding depend on the type of device as gaming consoles. With a strong password and encryption method, port forwarding will be safe in cameras and DVRs. Firewalls ensure an extra layer of safety in computers and it is updated regularly with security patches.

How to safeguard yourself when port forwarding

VPN port forwarding can be used for additional security to channel web traffic. However, it is important to choose a VPN that provides the feature to drive traffic to specific ports. By following the best security practices and not sharing the details of the open port on public forums or with others, anonymity can be maintained and data will not be vulnerable.

Frequently asked questions

1. What is the effect of port forwarding on ping time?

- Port forwarding has got nothing to do with ping time, it just establishes a connection between remote server and device.

2. Which IP address should be used, the one assigned by DHCP or the static address?

- For port forwarding, it is recommended to use a static internal IP address.

3. Can two devices from the same network use the same port number?

- No, it is not possible as each device should have a unique combination of IP address and port.

To conclude

Port forwarding is a neat feature enabling direct access from an external computer to a computer on a home/private network for various purposes. Despite having potential downsides, port forwarding can be safe if the right steps are followed.