A port is a physical docking point that can be used to connect an external device to the computer. It may also be a programmatic docking point from which knowledge flows to the computer or over the Internet from a program.
A network port that is provided by the Transport Layer protocols of the Internet Protocol Suite, such as Transmission Control Protocol (TCP) and User Diagram Protocol (UDP) is a number that serving endpoint communication between two computers.
Each networking mechanism or system uses a particular port of the network to transmit and receive data. That means listening for incoming packets whose destination port matches the port number, and/or transmitting outgoing packets whose source port is matched to that port number. Processes can use multiple ports in the network to receive and send data.
The port numbers that range from 0 to 1023 are known as well-known port numbers. Well-known port numbers, such as FTP and Telnet, are assigned to common server processes. They are referenced by system processes that provide widely used network service types. The Internet Assigned Numbers Authority (IANA) assigns and registers the relevant port numbers.
Port forwarding is also known as tunneling, is the behind-the-scenes process of intercepting data traffic headed for a computer’s IP/port combination and redirecting it to a different IP and/or port. A program that’s running on the destination computer usually causes the redirection, but sometimes it can also be an intermediate hardware component, such as a router, proxy server or firewall.
It begins with the packets that get created when you send a data request over the Internet.
Normally, a network router will examine an IP packet’s header and send it to a linked and appropriate interface, which in turn sends the data to the information in the header for a destination.
But the intercepting program (or device) reads the packet header in port forwarding, notices the destination, then rewrites the header information and sends it to another machine which is different from the one intended.
The secondary host destination may be a different IP address using the same port, a different port at the same IP address or a completely different combination of the two.