So if i have two routers and each router has lets say 2-3 computer devices.I am connected to the 1st router. So if i want to connect from my device to a device on the 2nd router than I will send the request to the public IP of the 2nd router. How does the router determine for which specific device the request is meant for?
- PUBLIC IP 1
- PUBLIC IP 2
I want to connect from A to C so how does that work. Does C need to be listening on a port on IP2 or is there some other way ?
One of the way I could find was port forwarding that request to a specific port on the router is forwarded to a specific IP. Does that mean router checks the port which is in the layer 4 or the transport layer segment?
And are there some other way in which the router determines for which specific IP my request is meant for.