Monday, August 31, 2009

What is a Broadcast Address?

A broadcast address is an IP address that you can you to target all systems on a specific subnet instead of single hosts. The broadcast address of any IP address can be calculated by taking the bit compliment of the subnet mask, sometimes referred to as the reverse mask, and then applying it with a bitwise OR calculation to the IP address in question.

Some systems which are derived from BSD use zeros-broadcasts instead of ones-broadcasts. This means that when you create a broadcast address, you fill the host area of the IP address while displayed using binary values with zeros instead of ones. Most operating systems use ones-broadcasts. Changing systems to use zeros-broadcasts will break some communications in the wrong environments, so understand your needs before changing your broadcast address or its type.

Math example

If you have a system with IP address 192.168.12.220 and a network mask of 255.255.255.128, what should the broadcast address for the system be? Remember, to do this calculation, you need to convert all numbers to binary values. For bitwise OR, remember that any two values where at least one value is "1", the result will be "1", otherwise the result is "0".


IP Address: 11000000.10101000.00001100.11011100
Reverse Mask: 00000000.00000000.00000000.01111111
bitwise OR: -----------------------------------------------
Broadcast: 11000000.10101000.00001100.11111111

Convert the binary value back to octal, and you have your resulting value of 192.168.12.255. You can use the tech-faq.com subnet calculator to assist you in calculating network IP address values.

Setting up a broadcast address

In most cases the broadcast address will be properly set up by modern operating system once you enter the IP address and subnet mask. In some older unix systems that use classful definitions of subnets, the broadcast address is improperly formed, and you will need to change it.

Changing windows systems broadcast addresses

Windows systems do not allow you to change the broadcast address by hand. You can, however, choose whether the system uses zeros-broadcasts or ones-broadcasts. To change a windows system to use zeros-broadcasts, use the following procedure:

  • Log into the windows system with an account with administrator rights.
  • Open your registry editor. If you are not knowledgable in using the registry editor for windows, please do not perform these steps. A mistake can make your system unusable.
  • Find the registry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Tcpip\Parameters\Interfaces\[Adapter ID]". Replace [Adapter ID] with the actual adapter ID you want to change the broadcast address for. You can get a list of all the adapter IDs in your windows system by opening a command line prompt, and executing a "ipconfig /all" command.
  • Create a new DWORD value called "UseZeroBroadcast". Set its inital value to "1". You can use a hex or binary value in this case, since 1 is the same for both numbering systems.
  • Reboot your system for the changes to take effect.
  • You have enabled zeros-broadcast for that adapter.

Changing unix systems broadcast addresses

Unix systems give the administrator a method to change the broadcast address to whatever value that they see fit to change it to. Ensure you know what you are doing before changing your broadcast address. In some cases, when using ifconfig from the command line, the broadcase address gets set to a classful based broadcast instead of the proper broadcast. You can check your results using the "ifconfig" command. Unfortunately, every unix system has differing syntax for the ifconfig command, and not all command options are available for every unix system. Check your ifconfig man page if you get hung up. The sample procedure below is the process you would use on a linux system to change a system broadcast address.

  • Open a terminal window, telnet, or ssh into the unix system in question, and log into the system.
  • "Su" or "sudo" commands properly to get root priviledges.
  • Determine which adapter you want to change the broadcast address on the system by checking the output of "ifconfig -a".
  • Execute "ifconfig broadcast ". Replace and with the proper values.
  • Test your configuration.


No comments:

Post a Comment