IPv4 – Difference Between Limited Broadcasting and Directed Broadcasting in the Same Network

broadcastipipv4

I understand that limited broadcasting happens locally and can be done by using destination address as 255.255.255.255. The directed broadcasting happens across networks.

To be precise, i want to know if following two broadcasting will have the same result –

1) I am at IP address 10.2.2.0 and I have broadcasted the packet to 255.255.255.255 (local limited broadcasting).

2) I am at same IP address 10.2.2.0 and this time I have broadcasted packet to 10.255.255.255 (i.e. directed broadcast address of this network).

I know that we should use limited broadcasting in such case but I want to know if (2) will work or not. Also, will it produce same result as above.

Best Answer

As well as the IP addressing, covered already by other answer, you have to consider the level 2 behaviour. What makes a packet broadcast is really whether it is sent to "all hosts within range". I'm speaking about the mechanism by which the signal actually arrives on the hosts. In the case of a broadcast medium such as radio, coax, or hub, it just goes to all hosts by the property of the medium.

But in the typical deployment of twisted-pair ethernet, the intervening switches need to see the destination broadcast address ff:ff:ff:ff:ff:ff to forward to all ports. (Same would be true of most bridges.)

Additionally, once the frame arrives on the target nodes, most interfaces do ethernet address filtering themselves. So unless the incoming frame is for this interface or the broadcast, it won't be sent off the interface to the CPU for processing by the IP layer, which decides if this packet is for this host.

It's up to the detail of the OS and its configuration to know whether such directed broadcast IP addresses are actually broadcast at L2. (Ie, at the stage of deciding whether to look in ARP cache for the ether address.) As far as I am aware, all modern OS will correctly L2-broadcast the L3-directed broadcast address. But I've certainly seen older ones which do not.

And clearly, if the packet arrives via a router, it's the router which decides whether to broadcast it, or more usually, throw it away.