How to Calculate Network and Broadcast Address

  1. 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.

      Image titled 1636270 1b1

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

      Image titled 1636270 1b2

    • 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)

      Image titled 1636270 1b4

  2. Image titled 1636270 2

    2

    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

      Image titled 1636270 2b1

  3. Image titled 1636270 3

    3

    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

      Image titled 1636270 3b1

  4. Image titled 1636270 4

    4

    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.
  5. Image titled 1636270 5

    5

    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 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 .

      Image titled 1636270 5b1

 

Method 2

For CIDR

  1. 1

    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.

      Image titled 1636270 6b1

      • 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.
    2. Convert the corresponding bit according to the below table and represent in quad-dotted decimal format.

      Image titled 1636270 6b2

    3. Let an IP address be 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 .

      Image titled 1636270 6b3

  2. 2

    Total 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.

      Image titled 1636270 7b2


       
    • 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)

      Image titled 1636270 7b4

  3. Image titled 1636270 8

    3

    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
  4. Image titled 1636270 9

    4

    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

      Image titled 1636270 9b1

  5. 5

    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 4 subnets (as calculated in previous step) are

      Image titled 1636270 10b1

    • Each of them has 64 addresses.

      Image titled 1636270 10b2

  6. Image titled 1636270 11

    6

    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 .

      Image titled 1636270 11b1

猜你喜欢

转载自my.oschina.net/u/2275100/blog/1634899