Latency – Difference Between Public and Internal IP Addresses

ipv4latencyperformance

Should there be a difference in latency when accessing resources by their public IP address versus their private, internal IP address? And if there is, would (mis)configuration be to blame?

My understanding (probably over-simplified) is the router will be smart enough to know that packets don't need to go out and back in when calling the public IP address and therefore there shouldn't be any performance hit.

Is that accurate?

Context: accessing a web server that is hosted on the internal LAN with a private address, but is accessible through the firewall via a public IP address on the WAN.

Best Answer

Technically yes there will be a small difference and notability will depend on your devices/configuration. This is because of the different paths the packets have to take, but like i said, depends on how your setup is designed - there are plenty of variables.

1) If you are on the LAN then your path to the webserver via its private IP is merely just switched.

2) If you are on the LAN and you try and access the webserver via its public IP then the traffic has to go out through your LAN gateway (which I am assuming is your router with a public ip address on the other side) , get natted out, get natted inbound and forwarded to the private IP address of the server and then return the traffic.

So you can see there will be marginally more resources used than #1