Three minutes of network infrastructure - to calculate subnet

As the number of bits in the subnet mask depends on the number of possible number of subnets and hosts per subnet. Before the definition of the subnet mask, you must figure out the number of subnets and number of hosts original use.

Use to calculate the number of subnets

We must find out the number of subnets to be divided, and the number of hosts in each subnet required before seeking the subnet mask.

  1. The number of subnets into binary to represent

  2. Get the binary digit, is N

  3. Class obtains the IP address, subnet mask, the N position thereof before the host address part of a subnet mask for the IP address that is obtained subnetting

For a class B IP addresses 168.195.0.0 into subnets 27:

  • 27=11011

  • Five-digit binary number which is, N = 5

  • Class B subnet mask address before the host address 255.255.0.0 1 5 position (bit host address class B comprises the two bytes, so here take the third byte position of the first 5 1), to give 255.255.248.0

According to the number of hosts

Calculated using the number of hosts.

  1. The number of hosts is converted to binary to represent

  2. If the number is less than or equal to the host 254 (note that the removal of two reserved IP address), to obtain the number of bits of the host, is N, where certainly N <8. If more than 254, the N> 8, which means that the host address will take more than 8.

  3. Using the IP address 255.255.255.255 class to the host address bits all set to 1, and then from back to front of the N bits are all set to 0, is the subnet mask value.

For a class B IP addresses 168.195.0.0 divided into several subnets, each with a host subnet 700:

  • 700=1010111100

  • The ten binary bits, N = 10

  • The address of Class B subnet mask 255.255.0.0 host address all set to give 255.255.255.255

  • After 10 and then forwardly from the position 0, that is: 11111111.11111111.11111100.00000000, i.e., 255.255.252.0.

This is to be the host 700 into the class B IP addresses 168.195.0.0 of subnet mask.

发布了6 篇原创文章 · 获赞 0 · 访问量 47

Guess you like

Origin blog.csdn.net/u014626074/article/details/104063604