Reputation: 2780
I am getting confused why do we require mac addresses in ARP packet, when we can extract it from ethernet header. Just keep the IP addresses and other fields as they are and remove the MAC address. We can extract them from ethernet. AM I missing something in my thinking.
Thanks.
Upvotes: 2
Views: 1424
Reputation: 6452
An ARP request goes out with the broadcast destination MAC address and the sender's MAC address as the source MAC address. This is because the sender doesn't know the destination MAC address and is asking for it. The broadcast destination MAC address makes sure that every host on the LAN will receive the request.
The ARP reply has the original sender's address as the destination address so that the reply only goes to the original sender, and it doesn't bother all the hosts on the LAN.
Upvotes: 0
Reputation: 2527
why do we require mac addresses in ARP packet, when we can extract it from ethernet header
Not having MAC addresses in the ARP packet body would result in (at least) the following:
ARP would not work over L2 bridge: the bridge needs to forward incoming ARP request putting MAC of own outgoing interface in the source field of the L2 protocol header. Replies (unless broadcasted) would be destined to the bridge itself and not forwarded. (See here for the table, showing and comparing L2 and L3 fields of ARP messages.)
Any ARP implementation would be dependent on the underlying MAC protocol: the code receiving ARP messages would need information about where to look for the source MAC address in the MAC layer, and this information must be accessible by the ARP code.
Upvotes: 1