0

I have a file server in my local network with publicly accessible web url e.g. example.test-server.com

Local IP for the server is 192.168.1.10

The local iP of my pc is 192.168.1.11

Now, we have NAT hairpin enabled on the router so that we can access the server with the web url from inside the office.

So, example.test-server.com is accessible from both inside and outside the network.

My question is if i've accessed the server using the public IP or the web url and downloaded a file, whether it costs my bandwidth ?

How the request traverses ?

Whether my request goest out of my network up to the internet or it stays inside the local network ?

2 Answers 2

1

As said by JFL, if you request the public IP mapped to your service, your packets will reach the router where the hairpin NAT is configured (most probably the Router between your LAN and the ISP), and then your internal server. The difference between a request to the public IP and a request to the private one is that the packet flow will cross the router where the hairpin NAT is performed, rather than reaching the server through the best layer2 path, for instance (assuming you have 1 switch where your hosts and servers are connected):

  • Public IP: end host->switch->router->switch->server (and back)
  • Private IP: end host->switch->server (and back)

The main concern you could have is if the link between router and switch may become a bottleneck or not.

About DNS, it depends by the DNS server/s configured on your hosts. If your hosts have a public DNS (eg. 8.8.8.8), then your first request will cross the WAN link till the public DNS, then it will be cached for the time specified by the TTL field of 'example.test-server.com' record. If your hosts use an internal DNS, like your internal router (if it does support DNS Relay/ Proxy DNS), all the requests will cross the LAN, and the router will resolve the first request externally, caching the entry till the TTL expires (in other words, the cache of a local DNS server/router will be used by all the hosts in the LAN).

Either way, the DNS bandwidth usage isn't something I'd be very concerned of.

0
1

The request goes from your computer to the router that perform the hairpin NAT then to the server.

So it doesn't go up to the Internet.

(In some case the router can be hosted by an ISP on a remote site, so the request may cross a line in both sense, but this is not so common).

1
  • Hi JFL, Thank you. So it doesn't cost my internet bandwidth and everything happens inside my local network. But, how doest the router map my url to the public IP ? this should go out up until some outside DNS servers right ? Please excuse if it is a stupid question. Commented Aug 30, 2015 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.