[RESOLVED] Network connection to local server
A coworker and I are having a discussion and I'm wondering if anyone here knows the actual answer to it.
Say you have a server called Server1 and you have a folder on it called C:\Folder1 which you've shared out. If you open windows explorer on Server1 and navigate to \\Server1\Folder1, I think that you go out to the network and then go back to the same server that you're on, so there's a network trip involved. My coworker thinks that the whole thing is local, so there's no difference between navigating to \\Server1\Folder1 and just going to C:\Folder1.
Also, with databases, if you have a db on the machine and your connection string is ...<yadayada>DataSource=Server1, I think that it again involves a network trip in order to access the database, but the coworker thinks it's the same as using localhost.
Anyone know which of these is correct?
Re: Network connection to local server
I would guess that it goes over the network, unless Windows checks if it's local or not.
You can check this by downloading the free program WireShark and looking at the packets. If it shows the network packets then... well, it's going over the network.
Re: Network connection to local server
I'm 99% sure its local in the case of the shares, dunno about databases though.
If you wanted an easier way to test it than using Wireshark, just share a folder on your PC, pull your network cable out and then try and access it via UNC path :)
Re: Network connection to local server
Quote:
Originally Posted by
chris128
I'm 99% sure its local in the case of the shares, dunno about databases though.
If you wanted an easier way to test it than using Wireshark, just share a folder on your PC, pull your network cable out and then try and access it via UNC path :)
Duh. This is such a pathetically simple way to test it that it astounds me that an entire group of IT people couldn't come up with it. :blush: Thanks for doing the basic thinking that we are clearly unable to do. :thumb:
^^ That wasn't being sarcastic towards chris128, I'm just astonished that the whole lot of us never tried this and embarrassed that we needed someone to come up with it for us. Thanks for your help, chris128.
It turns out that if you unplug the network cable, you can't access your local server through the network path. Interestingly enough, you can see the folders you've shared out (that information must be stored somewhere locally), but you can't open up any of those folders.
Re: [RESOLVED] Network connection to local server
haha no worries :) I'm surprised it doesnt work with the network cable out... I could have sworn I've done that before. Just tested it though and you're right of course, and perhaps more surprisingly it wont even work when you use 127.0.0.1 to access the share. Learn something every day eh.
Re: [RESOLVED] Network connection to local server
Well I did a bit of digging and found that you can make this work by simply installing the loopback adapter (via the Add Hardware wizard in Control Panel). This basically just creates a virtual NIC and even if you just leave it set to use DHCP and it fails to get an IP address then the shares still work. So for example I can now do \\MyServer\ShareName even with the network cable unplugged... quite why you would want to do that I dont know but at least now we know its possible :P