So when I use raw sockets will I see all messages going back and forth between the machines? Or is there still a lower protocol that handles messages before it reaches me (my raw socket)? Based on your reply there might be something happening at layer 1?
If you open at layer 2 you'll see all traffic on the network segment, some of which will be addressed to your NIC. You won't see the traffic being generated by other processes on your host.
If you open at layer 3 you'll see all traffic addressed to your NIC and you'll have to filter based on IP (like how you pass an address to bind()).
You can't go lower than Ethernet from software, since layer 1 is the physical protocol. You would need to build your own NIC and measure the electrical signals passing through the cable.
Okey. If I understood you correctly. When I've set up the raw socket, and sent a http request to my self from a client... I'll first have to handle the TCP/IP protocol, before I see the http request?