What is a subnet mask

Source: Internet
Author: User
Tags valid

What is a subnet mask? The subnet mask, also known as a netmask, address mask, and subnet mask, is a way to indicate which bits of an IP address identify the host's subnet and which bits identify the host's bitmask. The subnet mask cannot exist alone, it must be used in conjunction with an IP address. The subnet mask has only one function, that is, to divide an IP address into two parts: network address and host address. The subnet mask (subnet mask) is the basic knowledge that every person who uses the Internet must master, and only if they have mastered it can they truly understand the TCP/IP protocol settings. Here's a simple explanation of what a subnet mask is.

How do I divide subnets? The first thing to memorize is 2 power: 2 of the 0 to 9 of the value of the square is: 1,2,4,8,16,32,64,128,256 and 512 respectively. Also have to understand is: The subnet division is to take away the host bit, this take away part as a subnet bit. So this means more subnets, fewer hosts.

The subnet mask is used to identify which part of the IP address is a network address. Which part is the host address, there are 1 and 0 components, long 32 bits, all 1 of bits represent the network number. Not all networks require subnets, so there are 1 concepts: The default subnet mask (defaulted subnet mask). The default subnet mask for class A IP addresses is 255.0.0.0; Class B is 255.255.0.0; The class C is 255.255.255.0.

CIDR is called inter-domain routing without class, ISPs often use this method to assign addresses to customers, and ISPs provide 1 blocks (block size) to customers, similar to this: 192.168.10.32/28, this row of numbers tells you how much your subnet mask is,/28 represents how many digits are 1, max/32. But what you have to know is that, whether it's a class A or B or other class address, the maximum available is only/30, that is, keep 2 digits to the main seat.

Several shortcuts for dividing subnets:

1. How many subnets will be generated by the subnet mask you choose?: 2 of x -2 (x for subnet bits, 2 for 1) PS: Here x is the subnet bit after the default mask is removed, For example, the network address 192.168.1.1, Mask 255.255.255.192, because it is a class C address, the mask is 255.255.255.0. Then 255.255.255.192 (x.x.x.11000000) uses two one as the subnet bit.

2. How many hosts can each subnet have?: 2 y-square -2 (Y represents the host bit, that is, the 2 to 0 portion)

3. Effective subnet is: Valid subnet number =256-10 subnet mask (result called block size or base numbers)

4. The broadcast address of each subnet is?: Broadcast address = lower Subnet number-1

5. The effective host for each subnet is?: Ignoring the addresses of all 0 and all 1 in the subnet is the valid host address.

Last valid 1 host address = Next Subnet number-2 (that is, broadcast address-1)

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.