I feel confused about the relationship between router and the switch My question is how switch knows that if distension is not in my network i will send it to router
what will happen if 2 machine are trying to access 8.8.8.8 via the same port say 123, how will the router decide which machine to forward the response to?
I discussed that at the end I think. Each machine will use a unique source port and the router will use that in the NAT table to uniquely identify the response
@@hnasr Ports are limited in numbers. Say each machine generates a random source port (49152-65535). By any change can multiple machines have same port numbers? If yes, then the router will have two mapping with same source port. How is this use case handled?
@@rootuser5027 Thanks for suggesting this. I went through this concept. I see how it is connected. Let me rephrase the question. Can two or more machines connected to the same router and having same IP addresses, have same source port numbers? After reading about PAT, I think not. Please correct me if I'm wrong.
I think I understand now. Local IP address of each device will be unique under same public IP address (same router). So for a router, combination of source IP address and source port will always be unique. So for two devices sending a request to internet (some remote host), even if they have same source port, the IP address (which is local) would be different. Am I right?