Subnet Mask calculation method)

Source: Internet
Author: User

1. Use the number of subnets for Calculation

Before obtaining the subnet mask, you must first understand the number of subnets to be divided and the number of hosts required in each subnet.

1) convert the number of subnets to binary representation.
2) The number of digits to obtain the binary value is N.
3) obtain the subnet mask of the IP address, and obtain the subnet mask of the IP address.

To divide Class B IP address 168.195.0.0 into 27 subnets:
1) 27 = 11011
2) the binary is five digits, n = 5
3) set the subnet mask of the Class B address to the first 5 locations 1 of the host address of 255.255.0.0 to obtain 255.255.248.0, which is the subnet mask of the Class B IP address 168.195.0.0 divided into 27 subnets.

Ii. computing using the number of hosts

1) convert the number of hosts to binary representation
2) If the number of hosts is less than or equal to 254 (note that the reserved two IP addresses are removed), the binary number of the host is obtained, which is N. N <8. If it is greater than 254, N> 8, which means the host address occupies more than 8 digits.
3) Use 255.255.255.255.255 to set the number of host addresses of this type of IP address to 1, and then set all the N digits to 0 from the forward, that is, the subnet mask value.

To divide B (c) class IP address 168.195.0.0 into several subnets, each subnet contains 700 hosts (17 ):
1) 700 = 1010111100
2) the binary is ten digits, n = 10 (1001)
3) set all the host addresses of the subnet mask 255.255.0.0 of the B-type address to 1, get 255.255.255.255.255, and then forward the last 10 positions to 0, that is, 11111111.1111.111100.00000000, that is, 255.255.252.0. This is the subnet mask of the Class B IP address 168.195.0.0 to be divided into 700 hosts.

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.