Tuesday, May 26, 2020

Noob networking question (NAT)

Probably going to get a lot of rolled eyes for asking such a basic question here. I'm about to take my Net+ exam next month and am trying to fill in the gaps in my knowledge.

Here's an instance:

Say a PC on a LAN tries to access a webpage on port 80. The PC sending the request assigns the packet's source IP/port and destination IP/port. When the packet hits the router, NAT translates the private IP to the public IP and reassigns the source port to a brand new source port along with the IP. I understand why the IP address needs to be translated, but why does the source port number NEED to be reassigned to a whole different number? Why can't it be kept as the same source port that was assigned by the local PC? Does it have to do with the possibility of the same source port number potentially being assigned by another PC on the LAN? In other words, the NAT table ensures that the source port doesn't end up in use by another PC?

Sorry for the basic question. I can't stand knowing small details sometimes and it distracts me from moving forward.



No comments:

Post a Comment