Previous Topic: IP Broadcast or BCASTNext Topic: IP Multicast or MCAST


Calculate a Broadcast Address

You can use the following logic algorithm to calculate a computer's broadcast address:

Broadcast address = (sub_net_mask AND IP_address)
OR (NOT(sub_net_mask)) 

To calculate a broadcast address

  1. Translate the subnet mask and distributing system's IP address into their binary equivalents.

    For example, an IP address of 172.16.29.156 and a subnet mask of 255.255.0.0 would be expressed as follows:

    IP address = 10101100.00010000.00011101.10011100
    
    sub_net_mask = 11111111.11111111.00000000.00000000
    

    Using AND, the concatenated result is as follows:

    10101100.00010000.00000000.00000000
    
  2. Perform a binary OR with the inverse of the subnet mask. This provides you with the broadcast address for the network to which the broadcast computer belongs, along with the appropriate subnet mask.

    Using the IP address and subnet mask from Step 1, this is expressed as follows:

    sub_net_Mask AND IP_address =
    
    10101100.00010000.00000000.00000000 (171.16.0.0)
    
    NOT (sub_net_mask)=
    
    00000000.00000000.11111111.11111111 (0.0.255.255)
    

    Using OR, together we get the following broadcast address:

    172.16.11111111.11111111 = (172.16.255.255)