How to Calculate Network and Broadcast Address

If you are going to set up a network, then you have to know how to distribute them. For this to know network and broadcast addresses is very essential. So to know how to calculate network and broadcast addresses if you have IP address and sub-net mask.

Method 1

For Classful Network

For a classful network total bits is 8. So Total bits = Tb = 8.

  • Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.

1

  • Below table gives you the “Number of bits used for subnetting”(n) to their corresponding subnet mask.

2

  • For subnet mask 255 is default, so it’ll not consider for subnet masking.
  • For example:
    Let, IP address = 210.1.1.100 and Sub-net mask = 255.255.255.224

    Total bits = Tb = 8 Number of bits used for subnetting = n = 3 (as subnet mask = 224 and its corresponding “No. of bits used for Subnetting” is 3 from above table)

34

From the previous step, you got the “Number of bits used for subnetting”(n) and you know the “Tb“, then you can get “Number of bits left for host”(m) = Tb – n as total bits is the summation of number of bits used for subnetting and number bits left for host i.e. Tb = m+n.

  • Number of bits left for host = m = Tb – n = 8 – 3 = 5

56

Now you have to calculate “Number of subnets” = 2n and “Value of last bit used for subnet masking”(Δ) = 2m. Number of host per subnet = 2m – 2.
  • Number of subnets = 2n = 23 = 8

    Value of last bit used for subnet masking = Δ = 2m = 25 = 32

78

Now you can find previously calculated number of subnets by separating subnets each having “Value of last bit used for subnet masking” or Δ addresses.

 

  • The 8 subnets (as calculated in previous step) are shown above.
  • Each of them has 32 addresses.

9Now you have to find that your IP address is in which subnet, that subnet’s first address is network address and last address is broadcast address.

  • Here the taken IP address is 210.1.1.100 . 210.1.1.100 comes in 210.1.1.96 – 210.1.1.127 subnet (see the previous step table). So 210.1.1.96 is network address and 210.1.1.127 is broadcast address for the taken IP address i.e. 210.1.1.100 .

10

For CIDR

Method 2

In CIDR, you have a IP address followed by bit-length prefix separated by slash(/). Now you have to convert bit-length prefix to quad-dotted decimal representation. To do this follow below steps.

  1. Write the the bit-prefix in below format.

11

    • If it’s 27, then write it as 8 + 8 + 8 + 3 .
    • If it’s 12, then write it as 8 + 4 + 0 + 0 .
    • Default is 32, which is 8 + 8 + 8 + 8.
  • Convert the corresponding bit according to the below table and represent in quad-dotted decimal format.

12Let IP address is 170.1.0.0/26 . Using above table, you can write:

26 = 8 + 8 + 8 + 2
255 . 255 . 255 . 192

Now the IP address is 170.1.0.0 and subnet mask in quad-dotted decimal format is 255.255.255.192 .

13Total bits = Tb = 8.

  • Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.
  • Below table gives you the “Number of bits used for subnetting”(n) to their corresponding subnet mask.

14

  • For subnet mask 255 is default, so it’ll not consider for subnet masking.
  • From the previous step, you got IP address = 170.1.0.0 and Sub-net mask = 255.255.255.192

    Total bits = Tb = 8 Number of bits used for subnetting = n = 2 (as subnet mask = 192 and its corresponding “No. of bits used for Subnetting” is 2 from above table)

1516

From the previous step, you got the “Number of bits used for subnetting”(n) and you know the “Tb“, then you can get “Number of bits left for host”(m) = Tb – n as total bits is the summation of number of bits used for subnetting and number bits left for host i.e. Tb = m+n.

  • Number of bits left for host = m = Tb – n = 8 – 2 = 6

17

Now you have to calculate “Number of subnets” = 2n and “Value of last bit used for subnet masking”(Δ) = 2m. Number of host per subnet = 2m – 2.

  • Number of subnets = 2n = 22 = 4

    Value of last bit used for subnet masking = Δ = 2m = 26 = 64

18Now you can find previously calculated number of subnets by separating subnets each having “Value of last bit used for subnet masking” or Δ addresses.

  • The 4 subnets (as calculated in previous step) are

19

  • Each of them has 64 addresses.

2021

Now you have to find that your IP address is in which subnet, that subnet’s first address is network address and last address is broadcast address.

  • Here the taken IP address is 170.1.0.0 . 170.1.0.0 comes in 170.1.0.0 – 170.1.0.63 subnet (see the previous step table). So 170.1.0.0 is network address and 170.1.0.63 is broadcast address for the taken IP address i.e. 170.1.0.0 .

22

 

Advertisements