Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a small network with the subnet mask 255.255.255.240 and the IP range is 192.168.2.1 - 192.168.2.12. From 192.168.2.1, I want to broadcast a packet. I don't want this packet to go anywhere outside this subnet. After reading several basic tutorials, I think the optimum broadcast address should be 192.168.2.255. But wikipedia says that

A special definition exists for the IP broadcast address 255.255.255.255. 
It is the broadcast address of the zero network or 0.0.0.0, 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.

Now, I'm bit confused. Does "the local network" refers to my subnet? Which one ensures that the packet doesn't go out of my subnet : 192.168.2.255 or 255.255.255.255?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Actually, your IP range for 192.168.2.0/28 (which is the network with the address and netmask you have given) is 192.168.2.1-192.168.2.14, and your broadcast is 192.168.2.15

here's an IPv4 calculator (there are others)

share|improve this answer

The bradcast address for 192.168.2.0/28, your subnet, is 192.168.2.15. If you do not want to reach anyone outside your net, this is it.

There are tools fro helping you out with these computations, I am on Linux and use ipcalc, on Windows there is Ipcalc.Net, but I am sure sure there are more on all OS's.

share|improve this answer

The 192.168.2.255 is s a directed broadcast which will be heard by all in the same subnet which is in your case 192.168.2.0.

If you use the 255.255.255.255 it will be received by everybody in the network and not just in a specific subnet.

  • 192.168.2.255 --> Limited to a specific subnet
  • 255.255.255.255 --> everybody

So if you don't want that your broadcast leaves your subnet, you have to choose 192.168.2.255

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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