1

I am trying to understand how the network stack (TCP/IP) handles a UDP message to localhost. I am assuming it goes down the stack and gets to the IP layer, if it sees localhost it then sends it back up the stack?

I am also trying to understand how the network stack (TCP/IP) handles a UDP message destined for your own NIC? If my NIC is assigned 192.168.0.1 and the source and destination address are the same, what happens? Does it leave the hardware, how far down the stack does it even go?

Any Linux source of where these things occur is greatly appreciated!!

0

It does not reach the hardware. In the former case it is handled in the loopback interface, linux/drivers/net/loopback.c. In the latter case, it is handled in whatever driver supports your NIC. You can use "netstat -i" to see statistics associated with each interface and things like netcat to generate traffic to and from them.

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.