Calculation of the number of subnets

Source: Internet
Author: User
In network division, if you want to use a subnet, you must know the number of subnets.
For example, if a class C network needs to be divided into subnets and six subnets are to be created, what is the mask?

First, let's talk about the IP address and the mask
The total length of the IP address is 32 characters, which is 4 bytes long.
The mask is also 32-bit and consists of 4 bytes.
The IP address uses mask to know the network number and host number, for example:
192.168.0.5
255.255.255.0
Obtain the network number 192.168.0.0.
Host No.: 5
This mask is a non-subnet mask, which is the standard mask for Class C networks.

Set 6 subnets and the binary value of 6 is 110. Therefore, we know that the last byte of the mask is 11100000,
Then how does the mask obtain six subnets?
Take a look at the binary 110 of 6, from 1-6
001
010
011
100
101
110
Perform the and operation with mask 111 respectively, and the IP addresses of each subnet can be calculated.
For example, the first subnet 001
The available address is
00100001-33, 192.168.0.33/192.168.0.33
00100010-34
.
.
.

00111110-62
30 addresses from 192.168.0.33-62
Both 32 and 63 are reserved addresses, which represent the network itself and broadcast addresses, so they are not included.

The formula for calculating the number of subnets is as follows:
Subnet COUNT = (the bit power of the subnet mask of 2)-2

Number of hosts = (bit power of 2 hosts)-2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.