3

A simple question but important one.

Why do I need as a programmer, to have the "port forwording" phrase in my world, if I have a simple tools within my language I use, called "bind()", "listen()" "accept()" that hellps me to listen as a server to clients in sime port I decided on?

  • As a programmer, unless you're programming a router function, you wouldn't. As someone that may need to explain how to get your programmed server service up and running to a client that may not be fully network aware, it's something you should at least be aware of. – Radhil Feb 27 '17 at 23:34
  • Those are all fine and good as long as you are on the same subnet for all your devices. Port forwarding allows incoming connections from the outside world. – SDsolar Mar 1 '17 at 20:14
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 16 '17 at 23:02
2

I will try to explain in layman terms. The concept of port forwarding comes into picture when a host in WAN side( eg. Internet) need to contact the Private Server/PC hosted at the LAN side of a modem.

Having an IPv4 Public address for all the clients in the world is not possible due to technical limitations, but this problem can be solved with Port Forwarding.

Use Case #1

let us Say you have a static public IP address (111.22.33.44)for your Modem from the ISP.You also have a linux PC connected to the modem with private IP 192.168.1.15.

In this particular condition the PC host cannot be reached from the WAN side/Internet. Imagine you have to access the LAN PC via SSH when you were on vacation.

If you could just enable the Port forwarding for SSH (port 22) in your modem to the Destination IP of 192.168.1.15 then the same PC can be accessed from Internet simply by accessing the ssh at 111.22.33.44 IP address. Modem will take care of the routing when it gets a TCP syn packet at its's WAN IP's 22 port.

2

As a programmer you really don't need. This is network function usually used to connect to server sitting after NAT via public network. Sometimes can also be used to convert TCP/UDP port X to port Y or alike network needs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.