ARP (Address Resolution Protocol) is a link-layer protocol used to translate hardware address into a network layer address. The major application of ARP is on Ethernet networks connected to the internet, where there must be some mechanism to translate MAC addresses (which are fixed in hardware and assigned uniquely by the manufacturer) to an IP address (which will vary depending on what network the device is plugged into).
ARP from an application perspective[]
A network interface that supports ARP will let etharp_output
handle all outgoing packets and will also set a flag in its netif structure to enable the "gratuitous ARP" (see "Writing a device driver" for an explanation of how this is done). A table of recent IP addresses and corresponding hardware addresses is maintained, and if an outgoing packet does not match any known hardware address, the code will perform an ARP query on the link to discover the right address.
An application programmer should not need to invoke this protocol directly, because if things are working right, this all happens transparently. There are a few flags that determine the size of the ARP table, how packets are queued behind a pending ARP query, and if the ARP code should learn MAC-IP address bindings from incoming packets. These options are set in the lwipopts.h options file.
ARP support history in lwIP[]
HEAD | Stable. New LWIP_ARP flag, various optimizations, better ARP queueing. |
1.2.0 | Stable. |