Port forwarding is a technique that is used to allow external devices access to services on private networks.
Most online gaming Applications will require you to configure port forwarding on your home router.
To understand port forwarding you need to understand what a TCP/IP port is and how ports and IP addresses are used together.
You will also need to appreciate the difference between internal and eternal IP addresses.
A TCP/UDP port identifies an application or service on a machine in a TCP/IP network.
On a TCP/IP network every device must have an IP address.
The IP address identifies the device.
However a device can run multiple applications/services.
The port identifies the application/service running on the machine.
The use of ports allow computers/devices to run multiple services/applications.
Standard Port numbers are allocated to server services (0-1023) by the Internet Assigned Numbers Authority (IANA). e.g Web servers normally use port 80 and SMTP servers use port 25.
The combination of IP address plus port is known as a socket
As an example. Imagine sitting on your PC at home, and you have two browser windows open. One looking at the Google website and the other at the Yahoo website.
the connection to Google would be:
Your PC – IP1+port 2020 ——– Google IP2 +port 80 (standard port)
the connection to Yahoo would be:
our PC – IP1+port 2040 ——–Yahoo IP3 +port 80 (standard port)
Notes: IP1 is the IP address of your PC. Client port numbers are dynamically assigned and can be reused once the session is closed.
Returning to Port forwarding..
On home /small office networks the DSL router uses NAT (Network Address Translation) which allows internal devices to share a single external IP4 Address.
The IP addresses on the Internal network are private addresses and are not routable on the Internet.
External computers/devices only see the public IP address that is assigned to the DSL router Interface.
The NAT router maps an Internal IP address and Port to the external IP address and port.
External devices send packets to the external IP address and port. The NAT router re-transmits those packets on the Internal network to the Internal IP address/port.
The ports used by NAT are normally randomly assigned which is OK when the session is initiated from the Internal network.
However if you want,for example, to host a website on your internal network and have that website be accessible to external clients then you will need to use a standard port (port 80 for http) as the external client expects this.
To do this you statically map the external IP address + port 80 to the Internal IP address of the web server +port 80.– This is port forwarding.
For home users the most common reason to use port forwarding is gaming.
Enabling Port forwarding and Checking Open Ports
Depending on your Application you may need a list of ports that need to be available from the the external network (i.e. Internet)
To configure port forwarding on your router you will need admin privileges.
This site has a comprehensive guide covering 100s of routers, and also port lists for many of the games/applications.
This video shows how to configure port forwarding on a BT Home Hub.
This video shows you how to set it up on a Linksys router.
It also shows you how to set a static IP address for your machine.
This step is important as the forwarding will be set to send packets to a specific internal IP address.
Once you have forwarded the ports you may want to check that they are really open using an open port checker.
Common Questions and Answers
Q- Is the External IP address mapped to the Internal IP Address?
A- No the external port is mapped, and not the external IP address. the external IP address might change see Dynamic DNS
Q- Should I use a static Internal IP address or can I use one assigned by DHCP?
A- You should always use a static one.
Q- Do I need to forward both the TCP and UDP port?
A- It depends on the application. You need to check which ports the application uses.
- Understanding TCP/IP Ports and Sockets
- The TCP/IP Protocol Suite Explained
- How to setup a home network
- How to setup a home router
- Wiki- port forwarding
- Internal and External IP Addresses
- Definition of TCP/IP ports