Address Resolution Protocol (ARP)

if ( (IP_dest & netmask_src) == (IP_src & netmask_src) )
{
// CASE 1
//The source and the destination are in the same network (LAN)
//Broadcast the packet to all the hosts in the LAN, specifying the IP_dest
//The host with IP equal to IP_dest, replies with a unicast ARP response to the sender host specifying its MAC address as MAC_dest
}
else
{
//CASE 2
//The source and the destination are not in the same network (LAN)
//Broadcast the packet to all the hosts in the LAN, specifying the gateway IP as IP_dest
//The host with IP equal to gateway IP, replies with a unicast ARP response to the sender host specifying its MAC address as MAC_dest
}

ARP message

- CodeDescription
Last updated