Broadcasts

Broadcasts are packets that are sent to the entire network. The following explains two variants of broadcasts available in IPv4.

Slides


Limited Broadcast

In a limited broadcast packets are sent to the entire network, but do not cross a router/gateway to reach other broadcast domains. IP packets that should be broadcasted only to the local network are addressed to the destination IP 255.255.255.255.

../_images/limited_broadcast.png

Here is an IP packet that is sent sent from Host A with IP 192.168.0.100 to all other hosts in the same network:

IP Packet

Source IP

192.168.0.100

Destination IP

255.255.255.255

UDP Segment

When such an IP packet is put into an Ethernet frame, this target IP address causes the destination MAC to be set to the broadcast MAC address ff:ff:ff:ff:ff:ff.

Ethernet Frame

Source MAC

Host A MAC

Destination MAC

ff:ff:ff:ff:ff:ff

IP Packet

Source IP

192.168.0.100

Destination IP

255.255.255.255

UDP Segment

Ethernet frames with this special MAC address, when received by network switches, will be broadcast to all connected network devices in the same broadcast domain.

Directed Broadcast

When a packet needs to be broadcasted to all hosts in an external network, the destination IP address needs to be set to the target network’s broadcast address.

IP packets addressed to the broadcast address of an external network will be routed to the destination network like any other IP packet. However, once the packet reaches the target network it transmitted as a broadcast.

Here is an example with 3 networks. Our source network A contains host A which wants to send the broadcast to network C. Network A and network C are not directly connected, but have gateways that route traffic between them. Gateway 1 is connected to both Network A and Network B. Gateway 2 is connected to network B and C.

../_images/directed_broadcast.png

IP Address

Subnet Mask

Broadcast IP

Network A

192.168.0.0

255.255.255.0

192.168.0.255

Network B

unknown

unknown

unknown

Network C

192.168.1.0

255.255.255.0

192.168.1.255

Our initial IP packet is addressed to the broadcast address of network C:

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.255

UDP Segment

Since the destination IP is outside of the local network, it is sent to gateway 1. The IP packet is put into an Ethernet frame addressed to Gateway 1’s MAC address.

Ethernet Frame

Source MAC

Host A MAC

Destination MAC

Gateway 1 MAC

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.255

UDP Segment

Gateway 1 will determine that the IP address is not within its own network B. However, it forwards traffic for network C to Gateway 2. The IP packet is repackaged to a new Ethernet frame, addressed to Gateway 2’s MAC address.

Ethernet Frame

Source MAC

Gateway 1 MAC

Destination MAC

Gateway 2 MAC

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.255

UDP Segment

Finally, Gateway 2 receives the IP packet and since it is directly connected to the target network (network C) is repackages the IP packet into an Ethernet frame and sets the destination MAC address to the broadcast MAC address ff:ff:ff:ff:ff:ff. This Ethernet frame is then broadcast by the network switches to all connected network devices in the broadcast domain.

Ethernet Frame

Source MAC

Gateway 2 MAC

Destination MAC

ff:ff:ff:ff:ff:ff

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.255

UDP Segment