What should be the destination MAC address for a limited broadcast address(255.255.255.255)

ethernetip

configuration: host(H1-10.10.10.55/24) has a default gateway(g1) 10.10.10.1/24.

Question 1:H1 sends a packet to 255.255.255.255. What should be the destination MAC address in the outgoing frame?

Should it be the MAC address of the gateway(g1) or FF:FF:FF:FF:FF:FF?

Question 2:H1 sends a packet to 10.10.10.255. What should be the destination MAC address in the outgoing frame?

Should it be the MAC address of the gateway(g1) or FF:FF:FF:FF:FF:FF?

Best Answer

If you're using a broadcast IP, you should be using a broadcast MAC. Use FF:FF:FF:FF:FF:FF for both cases.

When a device sends a packet to the broadcast MAC address (FF:FF:FF:FF:FF:FF), it is delivered to all stations on the local network. It needs to be used in order for all devices to receive your packet at the datalink layer.

For IP, 255.255.255.255 is the broadcast address for local networks. On top of Ethernet, this address will make sure that the packet is received by all nodes on your local network.

10.10.10.255 is the broadcast address for the 10.10.10.0/24 subnet. Here again, a broadcast MAC is appropriate.