Link to home
Start Free TrialLog in
Avatar of Jay Raja
Jay Raja

asked on

NAT and port assignment

Hi guys,

I have a question about nat. Suppose host A is sending a http packet to 8.8.8.8 from its ip 10.1.1.1 with source port 45000.
The router that does the Nat sees the following
source:10.1.1.1:45000 ---- dest: 8.8.8.8:80
and it proceeds to nating the ip and lets assume that the source port chosen by the host is already taken. So router will assign another free port to the host nat.
NAT entry
source: 123.12.23.1:5555 ----dest: 8.8.8.8:80.
My question is, what happens when the response comes back and the router needs to send the packet back to the host. Will the router preserve the port number that the host choose initially i.e. 45000 and use that port along with the private ip of the host and forward the packet to the host or will the router use the same port it used for nat  or other random ones.

Kind regards
ASKER CERTIFIED SOLUTION
Avatar of Alan
Alan
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Raja
Jay Raja

ASKER

Thanks Guys, That was helpful