I have created a udp socket under linux to discover another system on the network. After creating a udp socket and assigning src IP , src Port, dst port (I know the correct value) and a dst IP (broadcast), application sends a UDP packet to the other end. The idea is to make the other computer sends back a UDP packet so my computer deduce the destination IP address. The other end is responding with an ARP message that contains its IP, port as well as my IP&port.
Although, the socket I am using is datagram my application declares the other end is discovered and can get its IP. It seems like the udp socket I am using has received the ARP message sent by the other end, which looks confusing to me.
Please has anyone an explanation of what happens.
Thank you very much.