3

I'm kinda new to networking. I have a small question, how can I determine what type of casting (unicast, multicast or broadcast) is it based on IPv4 address. For example: 142.55.172.200

I tried to search up but I still don't understand. Thank you.

2 Answers 2

6

For IPv4, unicast addresses are in the 0.0.0.0 to 223.255.255.255 range*, multicast addresses are in 224.0.0.0 to 239.255.255.255 address range.

*Broadcast addresses are more complicated. There is the limited broadcast address (255.255.255.255) that works on all networks, but there is also a network broadcast address that is the last address in a network.


For a full explanation of IPv4 network addressing, see this two-part answer.

3
  • 0.0.0.0 to 223.255.255.255 are normally unicast.
  • 224.0.0.0 to 239.255.255.255 are multicast
  • 240.0.0.0 to 255.255.255.254 are reserved and will most likely never be allocated. Some operating systems refuse to work with them at all, others treat them as regular unicast addresses.
  • 255.255.255.255 is limited broadcast. This will be broadcast to all systems on the same "link" as the sender.
  • The last address of a subnet (other than a /31) is also broadcast. This can be used to broadcast to a specific subnet, either if a system is multi-homed or if the router serving that subnet allows "directed broadcasts"

Directed broadcast is nearly always disabled nowadays, since it is a useful tool for attackers.

Unfortunately there is no way to reliablly distinguish a unicast address from a broadcast one. Since subnets can vary in size and some systems may not use traditional subnets at all there is no general way to determine the "last address of a subnet".

1
  • And the "special case" /31 point-to-point subnet has no broadcast. (it's an address saving hack.)
    – Ricky
    Commented Dec 6, 2022 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.