Search code examples
linuxnetwork-programmingethernetdpdk

Is there an easy way to send a packet by IP address(without knowing MAC) from a network application?


I am developing a small NAT application, using DPDK. Currently, I use pcap_pmd driver, so the devices are still visible for ifconfig and mates. Now I want to send a packet by a specific IP address, but I do not want to run ARP, and tinker with routing tables myself.

Is there a way to just give a packet to the interface, and have it figure out how to deliver it automatically? If not, what is the easiest way to query that MAC address by the known IP? The device is still managed by the kernel, so maybe I can somehow query its routing table?

What if I would use a lower level driver, like e1000, which unbinds the device from the kernel management, could I still avoid implementing my own routing?


Solution

  • One way is to use a broadcast MAC address: ff-ff-ff-ff-ff-ff, and let the others take care if they know where is the intended IP address located.