6

Assume there are two programs running on the same computer at the same time. The computer is connected to a LAN. The two programs communicate via a TCP socket, and the socket is opened using the IP address of the computer on the network, for example 192.168.x.x

In this case, can someone having control over the router, but not over the computer, see anything? (either just the connection being prepared, or the data itself) Do any packets ever leave the computer? Would it make a difference if the client connected to 127.0.0.1 instead of 192.168.x.x ?

2

Either of those IP addresses should be fine to keep it internal to your machine. If you tried to connect through your public IP address (Which most likely would require port forwarding) could expose information at the router level, but not outside of the router. Your Network interface card knows that it does not need to send packets out when the destination is itself.

  • Almost right. The NIC won't even see the data - routing is handled higher in the stack (unless you've got a deliberately fudged setup). – symcbean Oct 23 '15 at 12:13
0

Assuming there is everything right with your set-up, the only two situations that come to mind in which some traffic might leak is when the said programs would for some reason use the broadcast address, or use something below the IP level. In the former case there would be some data broadcast on the LAN, a situation that would not happen if you used 127.0.0.1. The latter case is highly unlikely, but not impossible. Some old programs might use some obscure protocol to communicate.

The ultimate test would of course be to sniff all the traffic (using Wireshark for example), just to be sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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