As far as I know, both MAC and IP broadcast addresses are used to send a packet to all hosts that are connected to a local area network. Why would anyone need two addresses to send a broadcast package?
-
At its core, this question is about the difference between a Layer 2 address and a Layer 3 address. To that end, I would point you to this [Q&A](http://networkengineering.stackexchange.com/questions/9571), and [this section of an article](http://www.practicalnetworking.net/series/packet-traveling/osi-model/#osi-layer-23) discussing the individual roles of each layer. Essentially, the IP Broadcast address determines where the packet goes, and the MAC Broadcast address actually gets it there. – Eddie Jun 13 '16 at 01:35
-
1Like the others have mentioned, it comes down to the layers each work in. Yes they both send packets to all hosts but sometimes you need one and not the other. One example is ARP. When you don't know the MAC address for the device, you send a layer 2 broadcast. But the layer 3 address remains unicast. So it comes down to where each is used. A broadcast on layer 3 may use a multicast on layer 2 as well. – Izy- Jun 13 '16 at 04:57
2 Answers
Remember, IPv4 is not the only layer-3 protocol. Traffic on a LAN is delivered by a layer-2 protocol, so layer-2 protocols need a broadcast address to be able to deliver a broadcast to all hosts on a LAN. Layer-2 protocols can carry any number of layer-3 protocols.
An IPv4 host will drop layer-3 traffic delivered to it that is not destined to its IPv4 address, a subscribed IPv4 multicast address, or an IPv4 broadcast address, even if it is delivered via a layer-2 broadcast frame.
IPv4 has two different broadcasts: the limited broadcast (255.255.255.255
), and the network broadcast (highest IPv4 address in the network). The limited broadcast cannot leave the network on which it originated. The network broadcast used to be enabled on network equipment, e.g. routers, by default, but it is now disabled by default. It allows traffic from one network to be sent to a different network's broadcast address, in order to broadcast to all IPv4 hosts on the other network.
IPv6 has done away with broadcast altogether. You must use multicast.

- 98,218
- 26
- 115
- 191
-
What is difference between limited broadcast (255.255.255.255) address and MAC broadcast (FF:FF:FF:FF:FF:FF) address? Both broadcast the packets within the same network right ? – Zephyr Dec 11 '17 at 04:16
-
That is comparing apples and oranges. Those are at different network layers.Layer-3 packets are encapsulated in layer-2 frames fro delivery from host to host. _Some_ layer-2 protocols (IEEE LAN protocols) use MAC, and thus have MAC addresses. The layer-2 addressing on the frames is different than the layer-3 addressing on the packets, just as the layer-3 addressing on the packets is different than the layer-4 addressing on the transport datagrams. – Ron Maupin Dec 11 '17 at 04:23
-
But the function of both the addresses is to transfer the packets to all the devices within the local network right (this looks entirely same to me)? – Zephyr Dec 11 '17 at 04:28
-
2Layer-2 addresses deliver frames on the local network. A frame with a broadcast address is delivered to all the hosts on the LAN. It doesn't matter what the layer-3 address is. When layer-2 sends the packet up to layer-3, then layer-3 will inspect the layer-3 address. If it not addressed to the layer-3 address or the layer-3 broadcast address, then layer-3 will drop it. If the layer-3 packet is addressed as broadcast, but the layer-2 frame is not, it doesen't get delivered to every host. – Ron Maupin Dec 11 '17 at 04:52
-
Thanks for your reply . The scenario of layer 3 packet addressed as broadcast and layer 2 frame as not a broad cast happens in case of directed broadcasting right ? Frame contains unicast MAC address of the router which is responsible for directed broadcasting. The router on inspecting the datagram at level 3 finds that it's directed broadcast address and puts MAC address as broadcast address and IP address as limited broadcast address so that datagram reaches every host within it's network. Am I right? – Zephyr Dec 11 '17 at 05:11
-
1Yes, but in reality, the sending host only knows that the destination layer-3 address is not on its network. It has no idea what the network mask of the other network is, so it doesn't know it is trying to broadcast to the other network. – Ron Maupin Dec 11 '17 at 05:16
-
Just to add an example. In a DHCP Offer (the DHCP server replying with the assigned IP to the host), the IP packet goes to a broadcast IP (255.255.255.255) but the frame (layer 2) contains the hosts MAC Address as destination. As you can see, Layer 2 and Layer 3 broadcast are not strictly related. – dantebarba Dec 16 '18 at 23:57
-
@dantebarba, what the DHCP server sends back to the client is actually, in most cases (barring an older client using the B flag), unicast at layer-3. That is explained in _[RFC 2131, Dynamic Host Configuration Protocol](https://tools.ietf.org/html/rfc2131). – Ron Maupin Dec 17 '18 at 00:04
-
Please explain, what is the real-life use-case of **"the network broadcast (highest IPv4 address in the network)"**? What is the need to send broadcast to another network? Suppose it makes sense. If I'm on the network `192.168.0.0/24` and sending broadcast IPv4-packet to hosts in `10.0.0.0/24`, then obviously the dst IP won't be `192.168.0.255`, but rather be `10.0.0.255`? So what is the need of `192.168.0.255`? – NK-cell Aug 09 '23 at 16:17
-
And if the feature of forwarding broadcast is disabled everywhere, what is the need to lose one address from each network? We could assign this address to the host. Does this the RFC-specific issue? – NK-cell Aug 09 '23 at 16:21
-
1@NK-cell, the original IP plan, prior to the public Internet, was that a host on one network would be able to broadcast on a different network. That requirement was changed to default to disabled when it became obvious that there are bad actors who simply want to disrupt another network. It can be useful inside a company. One case I know is to send stock data in near real-time from a service to a different network. Remember that IPv4 is a government/academic experiment that escaped the lab. IPv6 takes lessons learned in IPv4, and it has eliminated broadcast altogether as a bad idea. – Ron Maupin Aug 09 '23 at 16:59
-
-
-
If I'm on the network 192.168.0.0/24 and sending broadcast IPv4-packet to hosts in 10.0.0.0/24, then the dst IP should be 10.0.0.255? What if dst IP is 192.168.0.255? – NK-cell Aug 09 '23 at 21:17
-
1@NK-cell, "_If I'm on the network 192.168.0.0/24 and sending broadcast IPv4-packet to hosts in 10.0.0.0/24_" You would be sending a unicast packet to `10.0.0.255` because packets do not contain masks, your host, and anything before the final router, has no idea that it is a broadcast on the destination network. "_What if dst IP is 192.168.0.255?_" That is the source network, so hosts on that network know it is the broadcast address for that network. – Ron Maupin Aug 09 '23 at 21:24
-
Thanks! I.e. sending packet to the `192.168.0.255` is identical to sending packet to `255.255.255.255`? – NK-cell Aug 09 '23 at 21:31
-
Yes, in effect on modern networks. In any case, broadcast should not be used, except by legacy thing, e.g. ARP. The modern method is to use multicast. – Ron Maupin Aug 09 '23 at 21:58
You use it both every time you send an IP broadcast message. For example a broadcast message lets say looking for a DHCP server in network 192.168.0.0/24 the broadcast address would be 192.168.0.255 and by sending it to that address you also need to send it to the FF:FF:FF:FF:FF:FF in order to find all the ip addresses in that range. if you do not already have communication with any of the hosts in the network range.

- 356
- 1
- 5
-
2Doesn't DHCP actually use the limited broadcast address (255.255.255.255)? – dantebarba Dec 16 '18 at 23:49
-
1
-
DHCP Discover is made when host even doesn't know something about network. I.e. it doesn't know the network address, netmask and so on. So this packet obviously goes to `255.255.255.255` – NK-cell Aug 09 '23 at 21:33