Calculate network and broadcast addresses (with pictures)

Table of contents:

Calculate network and broadcast addresses (with pictures)
Calculate network and broadcast addresses (with pictures)
Anonim

If you are going to set up a network, you also need to know how to distribute it. It is then essential to have knowledge of network and broadcast addresses. It is also essential to be able to calculate network and broadcast addresses, if you have an IP address and a subnet mask.

Steps

Method 1 of 2: For a 'classful network'

Step 1. For a 'classful network' the 'Total number of bits' is 8

So Total Bits = Tb = 8.

  • Subnet mask can be 0, 128, 192, 224, 240, 248, 252, 254, or 255.

    1636270 1b1
  • The table below provides the 'Number of bits used for subnets'(n) for the corresponding subnet mask.

    1636270 1b2
  • Subnet mask 255 is default, and not suitable for subnet masking.
  • For example:

    Set the IP address = 210.1.1.100 and the subnet mask = 255.255.255.224

    Total bits = Tb = 8 Number of bits used for subnets = n = 3(the subnet mask = 224 and the corresponding 'number of bits used for subnets' = 3, as follows from the table above)

    1636270 1b4
1636270 2

Step 2. From the previous step you have the 'Number of bits used for subnets'(n) and you know 'Tb', after which you enter the 'Number of bits remaining for the host'(m) = Tb - n, because the total number of bits is the sum of the number of bits used for subnets and the number of bits remaining for the host, e.g. Tb = m+n.

  • Number of bits remaining for host = m = Tb - n = 8 - 3 = 5

    1636270 2b1
1636270 3

Step 3. Now you need to calculate 'Number of subnets' = 2 and 'Value of last bit used for subnet masking'(Δ) = 2m.

Number of hosts per subnet = 2m - 2.

  • Number of subnets = 2 = 23 = 8

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

    1636270 3b1
1636270 4

Step 4. Now you can find previously calculated numbers of subnets by dividing subnets by 'Value of last bit used for subnet masking' or Δ addresses

  • The 8 subnets (as calculated in the previous step) are listed above.
  • Each has 32 addresses.
1636270 5

Step 5. Now you need to determine which subnet your IP address is in, where the first address of the subnet is the network address and the last address is the broadcast address

  • The IP address chosen here is 210.1.1.100. 210.1.1.100 exists in the subnet 210.1.1.96 - 210.1.1.127 (see the table from the previous step). So 210.1.1.96 is the network address and 210.1.1.127 is the broadcast address for the example IP address 210.1.1.100.

    1636270 5b1

Method 2 of 2: For CIDR

Step 1. In CIDR, you have an IP address followed by a prefix of one bit in length, separated by a slash (/)

Now you need to convert the prefix to decimal numbers separated by four dots. You do this according to the steps below.

  1. Record the prefix in the format below.

    1636270 6b1
    • If it is 27, you write 8 + 8 + 8 + 3.
    • If it is 12, you write 8 + 4 + 0 + 0.
    • If it is the default 32, you write 8 + 8 + 8 + 8.
  2. Convert the corresponding bit according to the table below and display it as decimal numbers separated by four dots.

    1636270 6b2
  3. Take the IP address 170.1.0.0/26. Using the table above, you can write this as:
  4. 26 = 8 + 8 + 8 + 2
    255 . 255 . 255 . 192

    Now the IP address is 170.1.0.0 and the subnet mask is 255.255.255.192.

    1636270 6b3

    Step 2. Total Bits = Tb = 8.

    • Subnet mask can be 0, 128, 192, 224, 240, 248, 252, 254, and 255.
    • The table below shows 'Number of bits used for subnets'(n) according to their corresponding subnet mask.

      1636270 7b2

    • Subnet mask 255 is default, so it cannot be used for subnet masking.
    • Using the previous step you will get the IP Address = 170.1.0.0 and Subnet Mask = 255.255.255.192

      Total bits = Tb = 8 Number of bits used for subnets = n = 2 (subnet mask = 192 and the corresponding 'Number of bits used for subnets' is 2 according to the table above)

      1636270 7b4
    1636270 8

    Step 3. Using the previous step, you obtained the 'Number of bits used for subnets'(n) and you know 'Tb', after which you enter the 'Number of bits remaining for host'(m) = Tb -n can figure out, because the total number of bits is the sum of the number of bits used for subnets and the number of bits remaining for the host, thus. tb = m+n.

    • Number of bits remaining for host = m = Tb - n = 8 - 2 = 6
    1636270 9

    Step 4. Now calculate the 'Number of subnets' = 2 and the 'Value of last bit used for subnet masking'(Δ) = 2m.

    Number of hosts per subnet = 2m - 2.

    • Number of subnets = 2 = 22 = 4

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

      1636270 9b1

    Step 5. Now you can determine the previously calculated number of subnets by separating subnets with each a 'Value of last bit used for subnet masking' or Δ addresses

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

      1636270 10b1
    • Each of them has 64 addresses.

      1636270 10b2
    1636270 11

    Step 6. Now you need to figure out which subnet your IP address falls into, where the first address is the network address and the last address is the broadcast address

    • The IP address is 170.1.0.0. 170.1.0.0 is in the subnet range 170.1.0.0 - 170.1.0.63 (see the table from the previous step). So, 170.1.0.0 is the network address and 170.1.0.63 is the broadcast address for the selected IP address, thus 170.1.0.0.

      1636270 11b1

    Examples

    For a 'classful' network

    • IP address = 100.5.150.34 and subnet mask = 255.255.240.0

      Total bits = Tb = 8

      Subnet Mask 0 128 192 224 240 248 252 254 255
      Number of bits used for subnets (n) 0 1 2 3 4 5 6 7 8

      Number of bits used for subnets for subnet mask 240 = n1 = 4

      (because subnet mask = 240 and its corresponding 'Number of bits used for subnets' is 4 according to the table above)

      Number of bits used for subnets for subnet mask 0 = n2 = 0

      (because subnet mask = 0 and its corresponding 'Number of bits used for subnets' is 0 according to the table above)

      Number of bits remaining (for host) for subnet mask 240 = m1 = Tb - n1 = 8 - 4 = 4

      Number of bits remaining (for host) for subnet mask 0 = m2 = Tb - n2 = 8 - 0 = 8

      Number of subnets for subnet mask 240 = 2 1 = 24 = 16

      Number of subnets for subnet mask 0 = 2 2 = 20 = 1

      Value of last bit used for subnet masking for subnet mask 240 = Δ1 = 2m1 = 24 = 16

      Value of last bit used for subnet masking for subnet mask 0 = Δ2 = 2m2 = 28 = 256

      For subnet mask 240 the addresses are divided in increments of 16 and for subnet mask 0 in increments of 256. According to the value Δ1 and2 the 16 subnets are as follows:

      100.5.0.0 - 100.5.15.255 100.5.16.0 - 100.5.31.255 100.5.32.0 - 100.5.47.255 100.5.48.0 - 100.5.63.255
      100.5.64.0 - 100.5.79.255 100.5.80.0 - 100.5.95.255 100.5.96.0 - 100.5.111.255 100.5.112.0 - 100.5.127.255
      100.5.128.0 - 100.5.143.255 100.5.144.0 - 100.5.159.255 100.5.160.0 - 100.5.175.255 100.5.176.0 - 100.5.191.255
      100.5.192.0 - 100.5.207.255 100.5.208.0 - 100.5.223.255 100.5.224.0 - 100.5.239.255 100.5.240.0 - 100.5.255.255

      IP address 100.5.150.34 is in the range 100.5.144.0 - 100.5.159.255 and therefore 100.5.144.0 is the network address and 100.5.159.255 is the broadcast address

    For CIDR

    • IP address in CIDR = 200.222.5.100/9
    • 9 = 8 + 1 + 0 + 0
      255 . 128 . 0 . 0

      IP address = 200.222.5.100 and subnet mask = 255.128.0.0

      Total bits = Tb = 8

      Subnet Mask 0 128 192 224 240 248 252 254 255
      Number of bits used for subnets (n) 0 1 2 3 4 5 6 7 8

      Number of bits used for subnets for subnet mask 128 = n1 = 1

      (because subnet mask = 128 and its corresponding 'Number of bits used for subnets' is 1 according to the table above)

      Number of bits used for subnets for subnet mask 0 = n2 = n3 = 0

      (because subnet mask = 0 and its corresponding 'Number of bits used for subnets' is 0 according to the table above)

      Number of bits remaining (for host) for subnet mask 128 = m1 = Tb - n1 = 8 - 1 = 7

      Number of bits remaining (for host) for subnet mask 0 = m2 = m3 = Tb - n2 = Tb - n3 = 8 - 0 = 8

      Number of subnets for subnet mask 128 = 2 1 = 21 = 2

      Number of subnets for subnet mask 0 = 2 2 = 2 3 = 20 = 1

      Value of last bit used for subnet masking for subnet mask 128 = Δ1 = 2m1 = 27 = 128

      Number of hosts per subnet = 2m1 - 2 = 27 - 2 = 126

      Value of last bit used for subnet masking for subnet mask 0 = Δ2 =3 = 2m2 = 2m3 = 28 = 256

      Number of hosts per subnet for subnet mask 0 = 2m2 - 2 = 2m3 - 2 = 28 - 2 = 254

      For subnet mask 128 the addresses are separated in increments of 128 and for subnet mask 0 in increments of 256. Using the value Δ1,2 and3, the 2 subnets can be given below as follows:

      200.0.0.0 - 200.127.255.255 200.128.0.0 - 200.255.255.255

      IP address 200.222.5.100 falls within 200.128.0.0 - 200.255.255.255 and so 200.128.0.0 is the network address and 200.255.255.255 is the broadcast address

    Tips

    • In CIDR, immediately after converting the bit length prefix to a number separated by four dots, you can follow the same procedure as for the classful network.
    • This method is only suitable for IPv4, not for IPv6.

Popular by topic