0

I'm confused how CIDR broadcasts work when using the all 1's address (255.255.255.255).

From my early (Classful networking days), I recall that ping 255.255.255.255 from a machine on a Classful network causes every device on that subnet to respond. I also know that we can have directed broadcasts (e.g. 192.168.1.255).

Now, with CIDR, device addresses need not fall into the /24 (or /16, /8) buckets, and instead may be placed into smaller or larger buckets. This means that a directed broadcast address can be different. However, what happens when a device on a CIDR subnet pings 255.255.255.255?

For example:

    Hostname   Device IP      CIDR?     Directed Broadcast
    ------------------------------------------------------
    Host A     192.168.1.17   Class C   192.168.1.255
    Host B     192.168.2.12   /27       192.168.2.31
    Host C     192.168.2.35   /27       192.168.2.63
    Host D     192.168.2.72   /27       192.168.2.95

I know, for each of the above Directed Broadcast addresses, each Host (and any peers) will receive a ping from its respective broadcast address. That is, Host A runs ping 192.168.2.63 it is seen by Host C and not by Hosts B or D.

If Host A pings 255.255.255.255, every device on 192.168.1.0/24 receives that ping.

What happens if Host C runs ping 255.255.255.255? Will only subnet 192.168.32/27 see the ping? Will the all 1's address hit Hosts B and D, too?

5
  • note that in your specific example, CIDR has no impact whatsoever on a broadcast to 255.255.255.255. With CIDR, in this sense, you are not specifying a mask at all, except by the address you target, and leaving it up to the intermediary systems between target and destination to determine the scope of the packet on the networks they know. 255.255.255.255 will still hit all ip addresses in all rages. for example in your /27 networks, an upstream host does not know that they are /27, so if it sent to 192.168.2.255, it would broadcast to all of the /27 networks. the router determines that. Commented Nov 25, 2015 at 19:37
  • CONT. This approach is essential for Route Aggregation (in the old days called "Supernetting") so that an Internet backbone router in France can reffer to all the networks in North America with only a handful of routes. This is important for router performance. as the traffic gets closer to north america, the routes become more specific so that eventually you hit a router that knows a route to Iowa, and from there a route to the city Springfield, and then a route to the neighborhood clearcreek, etc. Big routes encompass many smaller routes. Commented Nov 25, 2015 at 19:41
  • OK, so I gathered from your comments and this CLN Post that the ICMP Ping broadcast travels until it hits the Router and dies when crossing into a different network. All intervening network devices propagate the packet to all appropriate network ports restricted by subnet and/or VLAN. Did I understand that correctly? Commented Nov 25, 2015 at 19:59
  • more or less. In theory you should be able to ping every device in the world with 255.255.255.255, but this is obiviously harmful, so the capability has been curtailed. In your case, an upstream device will see 192.168.2.0-255 as a single network, so the router that knows that these are differant networks will make decisions about teh scope of the delivery. this can lead to cases where an upstream device believes that .31 is a host, but the downstream router will treat it as a broadcast. Commented Nov 25, 2015 at 20:06
  • I should also point out that in my comments, I'm not really restricting my thoughts to specific protocols/applications like ICMP Echo, but discussing the meaning of the IP. Pinging in and of itself introduces another set of complexities as vendors try to implement the specs on their devices and have t make real world decisions. @DAvid Schwartz's answer is more specific to ping implenentations in particular, and is perfectly valid from that perspective. Commented Nov 25, 2015 at 20:21

1 Answer 1

1

If a host pings 255.255.255.255, the ping will go to every host in its broadcast domain. That will typically include every host in its subnet, but can be larger than that. Any number of subnets can be in the same broadcast domain.

4
  • In the above example, who gets the ping from Host C? Which addresses specifically? Commented Nov 25, 2015 at 19:23
  • I think you may be confusing layers 2 and 3. a broadcast that is limited by "broadcast domain" (eg a switch fabric with no interstitial routers or devices that reframe the datagram) is a MAC broadcast targeted to FF:FF:FF:FF:FF:FF. an IP broadcast however can hit multiple networks, and can cross routers if correctly they are configured. Most routers however will not pass an IP broadcast in this fashion however. Commented Nov 25, 2015 at 19:33
  • Pings to 255.255.255.255 are typically mapped to Ethernet broadcasts to FF:FF:FF:FF:FF:FF. Anything can be configured to happen. I don't think the OP's question is that broad. Commented Nov 25, 2015 at 19:43
  • fair enough. that is a very logical solution to the problem. Commented Nov 25, 2015 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .