1 Answer

As RFC 922 indicates, there are multiple types of broadcast IP addresses - there's 255.255.255.255, which means "broadcast to all hosts on the same local hardware network", and there are also broadcasts to all hosts on a given subnet. The IP address for the latter is constructed by setting all the bits in the host part of the address pattern for that subnet, e.g. if you have a network that's 192.168.42.0/8, the broadcast address would be 192.158.42.255.

To figure that out, you need to know the netmask for that network, so you know which bits in the address are in the network part and which bits are in the host part.