What happens in background when a local file is accessed over the network

1

If I share a file which is i.e. located at C:\share\somefile.txt to the network what happens when I call it on my computer this way \\MYCOMPUTER-PC\share\somefile.txt. Does the communication flow over the network or does the OS recognize the file I want access is locally stored and goes through the file system without using the network?

In short:

There is a file: C:\share\somefile.txt shared to the network.

Does the OS make a difference between this call C:\share\somefile.txt and this \\MYCOMPUTER-PC\share\somefile.txt when it's executed on the same computer it got shared from to the network?

arminb

Posted 2013-08-07T08:44:03.340

Reputation: 218

Answers

0

It's going through the OS network stack, but that doesn't mean it's actually going over the wire to your router and back. To check, you need to:

$ nbtstat -a MYCOMPUTER-PC

That should indicate what the IP address your computer has. Then, check the routing table with:

$ route print

To determine what interface that IP address is going over. If it's the localhost 127.0.0.1 interface, the OS will route it itself, otherwise, I believe it is going to the router and back.

ckhan

Posted 2013-08-07T08:44:03.340

Reputation: 5 689

The packets will not be send over the wire. If Windows sees that the destination address is the address of one of Windows' own NICs, then Windows will just move the packet around inside memory but not send it over the wire (why should it do so?). – Werner Henze – 2013-08-07T11:34:18.813

That was my question. Why shouldn't it do so? Maybe because of bad implementation or other reasons which I don't know. But do you have any prove for your statement? – arminb – 2013-08-07T20:16:40.180