Solved

Are TCP packets destined to local IP (not localhost) re-routed through the adapter or sent on wire?

Posted on 2010-09-23
5
380 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:Uncle_J
5 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 400 total points
ID: 33749252
The difference between localhost and the real IP is that latter might pass thru all IP layers, but not the physical. In no case the packet is sent out on any media.
0
 
LVL 2

Assisted Solution

by:ashwin42
ashwin42 earned 100 total points
ID: 33749378
The packets are routed through the TCP/IP stack the same way as the packets destined for the localhost.

However they dont reach the physical layer as the packet reaches the IP address layer before it reaches the physical layer
0
 
LVL 24

Expert Comment

by:rfc1180
ID: 33749831
>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)

It is all software based not touching any hardware (Never reaching the NIC), a frame is never built, so the TCP packet is never encapsulated into a frame. The last layer that the PDU (Packet) functions at is layer 3.

Billy
0
 

Author Closing Comment

by:Uncle_J
ID: 33749930
Both gave the same answer, but Qlemo was in first so most point go to him. I did some testing verified the answer is true. Thank you.
0
 

Author Comment

by:Uncle_J
ID: 33749936
Thank you rfc1180... Saw your response after I already awarded the points. I have my answer.. thank you all.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now