Broadcast address
A broadcast address is a network address used to transmit to all devices connected to a multiple-access communications network. A message sent to a broadcast address may be received by all network-attached hosts.
In contrast, a multicast address is used to address a specific group of devices, and a unicast address is used to address a single device.
For network layer communications, a broadcast address may be a specific IP address. At the data link layer on Ethernet networks, it is a specific MAC address.
IP networking
In Internet Protocol version 4 networks, broadcast addresses are special values in the host-identification part of an IP address. The all-ones value was established as the standard broadcast address for networks that support broadcast. This method of using the all-ones address was first proposed by R. Gurwitz and R. Hinden in 1982. The later introduction of subnets and Classless Inter-Domain Routing changed this slightly, so that the all-ones value becomes the local broadcast address and the all-ones host address of each subnet is that subnet's directed broadcast address.The directed broadcast address for any IPv4 host can be obtained by taking the bit complement of the subnet mask and then performing a bitwise OR operation with the host's IP address. A shortcut to this process is to simply take the host's IP address and set all bits in the host identifier portion of the address to 1.
As shown in the example below, in order to calculate the directed broadcast address to transmit a packet to an entire IPv4 subnet using the private IP address space, which has the subnet mask, the broadcast address is calculated as bitwise ORed with =. Directed broadcasts always work within a subnet but, for security reasons, many routers disable the forwarding of these by default.
A special definition exists for the IP address. It is the broadcast address of the zero network or, which in Internet Protocol standards stands for this network, i.e. the local network. Transmission to this address is limited by definition, in that it is never forwarded by the routers connecting the local network to other networks.
IP broadcasts are used by BOOTP and DHCP clients to find and send requests to their respective servers.
Internet Protocol version 6 does not implement this method of broadcast, and therefore does not define broadcast addresses. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. No IPv6 protocols are defined to use the all-hosts address, though; instead, they send and receive on particular link-local multicast addresses. This results in higher efficiency because network hosts can filter traffic based on multicast address and do not need to process all broadcasts or all-hosts multicasts.
Ethernet
Broadcast is possible also on the underlying data link layer in Ethernet networks. Frames are addressed to reach every computer on a given LAN segment if they are addressed to MAC address. Ethernet frames that contain IP broadcast packages are usually sent to this address.Ethernet broadcasts are used, among other purposes, by Address Resolution Protocol to resolve IP addresses to MAC addresses.