How To Find Broadcast Address From IP Address And Subnet Mask

Broadcast IP addresses serve as the communication gateway to reach all host devices within a network. Any network or subnetwork must have a broadcast IP address, and it is always the last IP address in the IP address range for that network (subnetwork).

At times, you might be given some network information and be asked to find the broadcast address. In this post, I will be showing you How To Find Broadcast Address From IP Address And Subnet Mask.

How To Find Broadcast Address From IP Address And Subnet Mask

Here are steps to find Broadcast address from IP address and subnet mask;

Step 1: Find the first subnetwork Address

Given an IP address and subnet mask, you can get the first subnetwork address by identifying the octet with the value less than 255 in the subnet mask and then replacing the matching octet on the IP address with 0. Here’s a breakdown using an example:

  • IP Address: 192.168.2.20
  • Subnet Mask: 255.255.255.0

In the subnet mask (255.255.255.0), the fourth octets is less than 255(value is 0). Now, you replace the corresponding portion of the IP address with 0 in the octets.

  • Original IP address: 192.168.2.20
  • Replace the fourth octet with 0: 192.168.2.0

This resulting IP address, 192.168.2.0, is the first subnetwork address.

Step 2: Find the group size

Group size for a subnet mask is equal to the value of the IP address range for that prefix length. It is gotten using the formula: 2^(number of host bits). In this case, the subnet mask is 255.255.255.0, which means there are 8 host bits (32 total bits minus 24 network bits).

So, 2^8 = 256.

So, the group size is 256

Step 3: Add the group size to the network address

To find the broadcast address, add the group size to the network address; in this case, where the network address is 192.168.2.0 and the group size is 256,

  • 192.168.2.0 + 256 = 192.168.3.0

The resulting IP address is the “Second subnetwork address”.

Remember: The maximum value in each octet is 255; hence, in the above summation, 1 was added to the octet by left because 256 is greater than 255.

Step 4: Find the broadcast address

If the original IP address is less than the second network address(gotten above), then the broadcast address is obtained as follows:

ALSO READ:  /25 Subnet Mask

Broadcast address = Second subnetwork address – 1 = 192.168.3.0 – 1 = 192.168.2.255

Else, we need to add more group size till we get a subnetwork address that is higher than the original IP address.

Example

Find the broadcast address if the subnet mask is  255.255.255.240 and the IP address is 192.168.5.20

Answer;

Step 1: Find the first network address.

Given the IP address and subnet mask,

  • IP address: 192.168.5.20
  • Subnet Mask: 255.255.255.240

Identify the octet in the subnet mask with a value less than 255. In this case, it’s the fourth octet. Replace the corresponding portion of the IP address with 0:

  • Original IP address: 192.168.5.20
  • Replace the fourth octet with 0: 192.168.5.0

The resulting IP address, 192.168.5.0, is the first network address.

Step 2: Find the group size.

The group size is calculated using the formula: 2^(number of host bits). In this case, where the subnet mask is 255.255.255.240, the number of host bits is 4 (32 total bits minus 28 network bits).

So, 2^4 = 16 usable hosts. Therefore, the group size is 16.

Step 3: Add the group size to the network address.

To find the “Second Network Address,” add the group size to the first network address:

  • Second Network Address = 192.168.5.0 + 16 = 192.168.5.16

Now, this IP address is still less than the original IP address (192.168.5.16 is less than 192.168.5.20), so we need to add another group size to get the third network address.

  • Third Network Address = 192.168.5.16 + 16 = 192.168.5.32
ALSO READ:  /29 Subnet Mask

Now, 192.168.5.32 is greater than 192.168.5.20

Step 4: Find the Broadcast Address

The broadcast address for the second subnet is equal to the third network address minus 1.

=> 192.168.5.32 – 1 = 192.168.5.31

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top