Question:
How is NAT (Network Address Translation) in routing possible?
?
2014-08-04 17:44:02 UTC
When the destination server or host that you request information from (e.g. www.google.com) sends information back to the host (my computer) how is the information understood when the destination I.P. address (the address that my router has given to google) will have the port number that was assigned by NAT (e.g. 37.101.145.12:50000)?

Doesn't it need unique port numbers for different protocols (such as port 80 for internet query's or 22 for SSH connections) to be associated with the correct application? Doesn't there need to be some kind of organization so that your computer knows what goes where?
Three answers:
efflandt
2014-08-04 21:36:26 UTC
In simple terms the destination port is usually specific to the protocol (unless specified when using a non-standard port), but the source port could be anything. So if you send a request to port 80 of a web server, the router sends it out with a unique source port like 50000 and associates that port with your LAN IP and its source port. When a reply comes back from the webserver to port 50000 the router knows to forward that to your LAN IP. Other outgoing connections will use other unique ports. And after a timeout period with no activity on that port, it will be freed up for other use.
187
2014-08-04 21:40:04 UTC
NAT is like leaving bread crumbs in the woods.

If you don't know your way back you get lost.

NAT attaches a port address so it knows how to get back (your pc) home. the lan ip and port address are one..when the packet hits your router it strips the lan ip and uses the wan ip.

The packet will now travel thru the different routers until it reaches its destination.

routers have tables (road maps) and it now knows how to deliver any messages coming back from the web to your pc



*very basic explanation. there is quite a bit to learn about NAT - too much to type on here.
Psychic Computer RepairĀ® PEBKAC?
2014-08-04 17:47:07 UTC
http://computer.howstuffworks.com/nat.htm

~


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...