Are TCP packets destined to local IP (not localhost) re-routed through the adapter or sent on wire?
Posted on 2010-09-23
If I have a server and client running on the same machine, is it better to bind the server to localhost rather than the ethernet IP address? I realize I can bind to both or even all interfaces (0.0.0.0). And I also realize UNIX sockets might be better for inter-process communication. My question is really to understand if TCP packets destined to the local server IP address are re-routed though the TCP/IP stack in the same way that packets destined to localhost (127.0.0.1) are. Or does that traffic actually hit the physical layer?
My question is UNIX (Linux) specific.