Hey all,
I was thinking about NAT and I couldn't figure out how a router with NAT would know which pc to send the packet to.
Does the router send packets out to the internet using only the ip assigned by the ISP or does it use a range of non private addresses? Also does this mean that the ISP's routers accept any packets from any ip address so as long as they're not private?
If A router does you only one IP address to send packets through to the net then how would it know which computer data received was ment for seeing as the IP address and mac address doesn't match anything on the LAN.
I was told NAT uses a sort of table to keep everything in check so does that mean there are mutiple ip address used to send data out to the internet?
Edit:
The router tracks basic data about each active connection (particularly the destination address and port). When a reply returns to the router, it uses the connection tracking data it stored during the outbound phase to determine where on the internal network to forward the reply; the TCP or UDP client port numbers are used to demultiplex the packets in the case of overloaded NAT, or IP address and port number when multiple public addresses are available, on packet return. To a system on the Internet, the router itself appears to be the source/destination for this traffic.
If this is the case then isn't it highl improbably but possible that data could be sent to me mistakenly because my my router using NAT used the same IP address as someone elses? Or is this not an issue because of routing protocols?
With something like distance vector protocols (RIPv1/v2) routers could have all their data rewritten because they're routing by rumor right?