How to divide a subnet mask

Source: Internet
Author: User

Subnet mask (Subnet masks):

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.

Classless Inter-Domain Routing (CIDR):

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.

CIDR values:
1. Mask 255.0.0.0:/8 (A class address default mask)
2. Mask 255.255.0.0:/16 (class B address default mask)
3. Mask 255.255.255.0:/24 (C class address default mask)

Division A Class B class C address subnet:

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)
According to the above shortcut to divide the specific example of the subnet:

Class C Address Example 1: Network address 192.168.10.0; Subnet mask 255.255.255.192 (/26)
1. Subnet number =2*2-2=2
2. Number of hosts = 2 of the 6 square -2=62
3. Effective subnet?: Block size=256-192=64; So the first subnet is 192.168.10.64, and the second is 192.168.10.128.
4. Broadcast address: Next subnet-1. So the broadcast addresses of 2 subnets are 192.168.10.127 and 192.168.10.191 respectively.
5. The effective host range is: the host address of the first subnet is 192.168.10.65 to 192.168.10.126; the second is 192.168.10.129 to 192.168.10.190

Class C Address Example 2: Network address 192.168.10.0; Subnet mask 255.255.255.128 (/26)
I know that the example I'm lifting has only one subnet bit, which is usually illegal (as stipulated by the RFC document). But! There is no absolute, is there? This subnet mask can help you when you need two subnets per subnet for 126 hosts, but it is implemented under special circumstances. In the Cisco router's global configuration mode, enter the IP subnet-zero command to tell your router to break the rules and use a 1-bit subnet mask (This command is typically present by default on all routers running Cisco IOS 12.x)
1. Subnet Number = 2
2. Number of hosts = 2 of the 7 -2=126
3. Valid subnet?: Block size=256-128=128; So the first subnet is 192.168 10.0, and the second is 192.168.10.128
4. Broadcast address: Next subnet-1. So 2 The broadcast addresses for subnets are 192.168.10.127 and 192.168.10.255
5. The effective host range is: the host address of the first subnet is 192.168.10.1 to 192.168.10.126; The second one is 192.168.10.129 to 192.168.10.254

Class B Address Example 1: Network address: 172.16.0.0; Subnet mask 255.255.255.128 (/25)
Attention! This is not a C-class address subnet mask, but this subnet division is a certain difficulty, but! This mask is very useful because it creates 510 subnets each subnet has 126 hosts, a good combination.
1. Subnet Number = 2 of the 9-time Square -2=510
2. Number of hosts = 2 of the 7 square -2=126
3. Effective subnet: Block size=256-255=1,2,3, ... This is the third eight-bit value, but you can't forget that there is one more subnet in the fourth eight-bit group. So the fourth eight-bit group is divided into two subnets. For example, the third eight-bit group represents Subnet 3, and the two subnets of the fourth eight-bit group are 172.16.3.0 and 172.16.3.128
4. Broadcast address: Next subnet-1. So the broadcast addresses of the first subnet and the last 1 subnets are
172.16.0.255 and
172.16.255.127
5. The effective host range is: the host address of the first subnet is 172.16.0.129 to 172.16.0.254; The last 1 are 172.16.255.0 to 172.16.255.126.
(add: Some people may ask why the first subnet is not 172.16.0.0-172.16.0.128?) Don't forget! The subnet and host bits cannot be 0 or full 1,172.16.0.0 representing the entire 172.16.x.x network, and, similarly, the last subnet cannot be 172.16.255.128-172.16.255.255. )

Class B Address Example 2: Network address: 172.16.0.0; Subnet mask 255.255.192.0 (/18)
1. Subnet number =2*2-2=2
2. Number of hosts = 2 of the 14 square -2=16382
3. Effective subnet?: Block size=256-192=64; So the first subnet is 172.16 64.0, and the last 1 is 172.16.128.0.
4. Broadcast address: Next subnet-1. So the broadcast addresses of 2 subnets are 172.16.127.255 and 172.16.191.255 respectively.
5. The effective host range is: the host address of the first subnet is 172.16.64.1 to 172.16.127.254; the second is 172.16.128.1 to 172.16.191.254

Class B Address Example 3: Network address: 172.16.0.0; Subnet mask 255.255.255.224 (/27)
1. Subnet = 2 of 11 -2=2046 (because the class B address default mask is 255.255.0.0, so the network bit is 8+3=11)
2. Number of hosts = 2 of the 5 square -2=30
3. Effective subnet?: Block size=256-224=32; So the first subnet is 172.16.0.32, and the last 1 is 172.16.255.192.
4. Broadcast address: Next subnet-1. So the broadcast addresses of the first subnet and the last 1 subnets are respectively 172.16.0.63 and
172.16.255.223
5. The effective host range is: the host address of the first subnet is 172.16.0.33 to 172.16.0.62; the last 1 are 172.16.255.193 to 172.16.255.223.

A-class address subnetting is no different from Class B and Class C, except that the mask is changed from 16-bit and 8-bit to 24-bit.

Let's just give you a simple example:
Network address: 10.0.0.0; Subnet mask 255.255.0.0 (/16)
1. Subnet Number = 2 of the 8-time Square -2=254
2. Number of hosts = 2 of the 16 square -2=65534
3. Effective subnet: Block size=256-255=1,2,3, ...; So the first subnet is 10.1.0.0, and the last 1 is 10.254.0.0.
4. Broadcast address: Next subnet-1. So the broadcast addresses of the first subnet and the last 1 subnets are respectively 10.1.255.255 and
10.254.255.255
5. The effective host range is: the host address of the first subnet is 10.1.0.1 to 10.1.255.254; The last 1 are 10.254.0.1 to 10.254.255.254.

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.