Easy understanding of the concept and operation method of IP subnet division

Source: Internet
Author: User
Tags binary to decimal
Easy understanding of the concept and operation method of IP subnet division
, Subnet

For all IP addresses
Fang
For beginners, IP subnet division is a key skill and must be mastered, a true understanding of the concept of IP subnet division is also a phase
When it is difficult. Over the years, I have seen that the improper teaching mode has made it impossible for beginners to grasp the essence of the concept of IP subnet division. In fact, there is an easy-to-understand way to easily describe
This problem. Using self-created graphical methods and computers
Shortcuts: I have helped countless people master the key to dividing subnets. In this article, I will discuss all the key points.
  IP address
And Subnet


The IP address is an English Internet
Protocol stands for "protocol for intercommunication between networks", that is, the protocol designed for computer networks to communicate with each other. It applies to a range from the smallest private network to the largest global network.
All types of computer networks, including the Internet. In the network, each network device has a separate IP address as the identifier. 32-digit IP address range from 0 to 4.2 billion 94.96 million 7295
. Therefore, theoretically, this means that the Internet can contain up to 4.3 billion separate systems.
. However, such a large scale for Network Management
Therefore, it is very inconvenient. Therefore, it is divided into four parts, each of which is composed of eight bytes, separated by a "." in the middle. Because the binary number is too long to be easily read, it is converted to a decimal number between 0 and 256. The following figure shows the actual IP address format.

0.0.0.0
0.0.0.1
... Add 252 hosts in turn...
0.0.0.254
0.0.0.255
0.0.1.0
0.0.1.1
Add 252 hosts in turn...
0.0.1.254
0.0.1.255
0.0.2.0
0.0.2.1
... Add about 4 billion hosts in turn...
255.255.255.255
A subnet, as its name implies, refers to a secondary network, that is, a small network located in a large network. The smallest subnet that does not contain more branches is considered as a separate "broadcast domain" through an Ethernet Switch
Create a LAN
(LAN ). For the network, the broadcast domain service
It is a very important feature because it allows network devices to access through media.
The control address is directly connected without having to access multiple subnets or even the entire Internet. Communication through media access control addresses is limited to a small network, because they rely on a wide range of Address Resolution protocols.
Find your own Method
It will bring about broadcast noise. When the broadcast noise reaches the limit of normal broadcast information, communication will fail. For this reason, the common subnet is usually 8-bit, or exactly one byte, but it is also allowed to be slightly larger or smaller.
The subnet must have a start and end number. Generally, the start number must be special. In many cases, the end number is also special. The START number is called the "Network ID code ".
A number is called a broadcast identity code ". Because they are special numbers for special purposes, you cannot use these numbers. For a specific subnet, the network ID is a formal ID
End number is the broadcast address where each device in the network receives the broadcast information. When you introduce the subnet, you must mention the network ID code and subnet mask. Only in this way can you determine the actual size of the network.
If you want
Send it to all devices in the subnet (for example, group broadcast) and send it to the broadcast address. In the later part of this article, I will show you a simple way to easily determine the subnet network and broadcast identity codes in terms of graphics and mathematics.

Graph subnet Learning Method

Over the years, I have seen that people have mastered the technology of IP subnet division.
I am eager to find a better solution.
This
Problems. Soon I realized that the key to the problem was that many beginners in the IT field lacked the foundation of mathematics and had difficulty understanding the concept of binary numbers. To reduce the gap in this capability
I found a more effective solution to the difficulties brought by XI: The graphic display method can more clearly describe the nature of the subnet. For details, see Figure. In this example
10.0.0.0 to 10.0.32.0. Note that the last IP address 10.0.32.0 is the starting number of the next subnet. In fact, this subnet is
10.0.31.255 is over.
Figure



In general, each additional digit of the number means that the size of the subnet has doubled, and the number of hosts is also increasing. The minimum Classification contains eight digits. That is to say, the subnet can contain 256 hosts,
Because the first and last network addresses cannot be used, the network can have up to 254 hosts. The simplest way to determine the maximum number of available hosts in a subnet is to use the actual location of subnet 2.
Minus 2. For 9 bits, It is the 9 power of 2 minus 2 (we cannot use the start and end numbers), that is, 512 minus 2. the maximum number of available hosts is 510. For a 13-bit network
The maximum number of available hosts is as high as 8190 as shown in.

How can I divide subnets correctly?

Subnets can be further divided into smaller or smaller subnets. When dividing networks, the most important thing to note is that you cannot randomly select the start and end numbers. The division process must be based on the binary concept. The best way to divide learning is to find a valid subnet Based on the subnet learning method I provide. In Figure B, green
It indicates that the divided subnet is valid, and red indicates that the divided subnet is invalid.
Figure B



Like other methods, when using the subnet learning method, we need to find the intermediate point and divide it into two parts equally. Next, after marking, we continue to perform the average allocation operation in each part.
. In the example provided above, we performed five average allocation operations. If you carefully observe the valid (green) subnet module, you will find that all the subnet start signs are not lower than the end mark. This
This is due to mathematical reasons. We will explain it later in the article. However, the results clearly displayed through graphics are more helpful to the learner's understanding than the mathematical principles.
  Subnet Mask

The subnet mask plays a key role in determining the subnet size. Take a closer look at Figure C. Pay special attention to the red numbers in the figure. When you divide the subnet, these eight special numbers are the key. They are
255, 254, 252, 248, 240, 224, 192, and 128. When creating an IP network, you will frequently see these numbers. Remember that they will make your work easier.
Figure C


In the figure, three networks of different sizes are provided. In general, we often see the first two types, with the host bit length ranging from 0 to 16. In the digital user
Line and North America 24 pulse code modulation, that is, T1 line, often use a range of 0 to 8 bits. In a private network, 8 to 24 bits are usually used.
Note that all the zeros in the binary are from right to left. The subnet mask in binary form places all one on the left side, while the right side is all 0. The number of zeros is the same as the length of the subnet. From me
In the example given, we can see this very interesting rule, because all the 8-bit bytes on the right contain 0, and all the 8-bit bytes on the left are composed of one. Therefore, let's look at the length of the next subnet.
If it is an eleven-bit subnet mask, its binary subnet mask is in the form of 11111111.111111111000.00000000. As you can see
The subnet mask is in 3rd 8-bit bytes, And the subnet mask is converted from 1 to 0. The result of this subnet mask conversion is 255.255.248.0.

Why is the subnet mask called "Mask"

The subnet mask can be used not only to determine the size of the subnet, but also to determine the end position of the subnet. As long as you have any IP address in the network, you can perform such a query. Why is the subnet mask called?
What about "Mask? Because it actually ignores the host bit and only provides the network ID code as the beginning of the subnet. What's important is that you know the beginning and scale of the subnet, and you can find the end position, that is, broadcast.
ID code.
You only need to find any network IP address and subnet mask, and you can use the and operation to obtain the network ID code. For example, the network IP address 10.20.237.15 and the subnet mask
255.255.248.0 is used to determine the network identity code. Note that they are usually abbreviated as 10.20.237.15/21,21, which indicates the subnet.
The length of the mask. Figure D and Figure E show how to perform the and operation in decimal and binary conditions.
Figure D


Decimal Mode
Figure E

 

Binary Mode

The binary mode shows how the 0 operation masks the actual network IP address. During the entire masking process, all the preceding numbers are converted to 0, regardless of the actual number. When you convert the obtained network identity code from binary to decimal, you will get the actual network identity code 10.20.232.0.
One of the things that have plagued me for teaching about subnet division is that beginners are always confused about the time needed for binary conversion and the and operation, and they cannot find a simple and feasible method. I have even seen experts from the IT field use very slow and tedious techniques to convert all the data into binary, perform and operations, and use the Windows Calculator to convert it back to decimal. However, Windows
The calculator performs this operation very easily and quickly, and the and operation can be run directly in decimal format.
In the example of "237", you only need to select "and" and enter "248" and click "enter". Then, the real result shown in "F" is displayed. I don't know why no one is teaching this technique to beginners, because it makes it very easy to calculate subnets.
Figure F

 
 
When the subnet mask has 11 0's time, it means that the subnet size is 11 bits long. This indicates that there are 2 to the power of 11, or 2048 hosts can appear in this network, the last of this Subnet
The IP address is 10.20.239.255. In the third 8-bit byte, we can see three zeros, which means there is a difference between the 3rd bits of the IP address, that is, the 3rd power of 2, or the difference between 8.
Therefore, the next subnet starts with 10.20.0000+ 8.0, that is, 10.20.240.0. We reduced this address by 1, and we got 10.20.239.255.
That is, the end position of the subnetwork. To help you better understand it, Figure G shows its position in the subnet learning method.
Figure G

IP Classification makes everything easier

Because the IP subnet can be any classification
The Creator selects to make the network contain multiple different categories. Note that for subnet mask computing, this is not important; it is only related to how the Internet is "Planned. Internet score
Is A, B, C, D and E. Class A uses half of all Internet addresses, Class B uses half of the remaining parts, and class C uses half of the remaining parts.
Broadcast) on this basis, the remaining half is used, and all the remaining parts belong to Class E. Some students told me that they spent the whole week memorizing this category until they saw H's
A simple table is displayed. But in fact, you don't have to remember anything at all, as long as you know that you can use half of the available.
Figure H

 
 
The key point to remember is that all subnets end with a singular number starting with a double number. Please note that 0.0.0.0/8 (0.0.0.0 to 0.0.0 255.255) is disabled.
Reserved address. 127.0.0.0/8 (127.0.0.0 to 127.255.255.255) is used as the default return address.
The first 8-bit bytes of all Class A network addresses are in the range of 1 to 126, because 0 and 127 are reserved numbers. The length of a subnet is 24 bits, that is, the subnet mask is only 8 bits long. Example
For example, GE has a network address segment 3.0.0.0/8, which is lucky because it does not have to separate its own network until the number of hosts reaches 16.8 million. USA
The army has a network address of 6.0.0.0/8. Level 3 communication has a network address of 8.0.0.0/8. International Business Machine
The company has a network address of 9.0.0.0/8. At&t owns the network address of segment 12.0.0.0/8. Xerox owns a CIDR Block 13.0.0.0/8. HP owns the network addresses of 15.0.0.0/8 and 16.0.0.0/8. Apple has a network address of 17.0.0.0/8.
The first 8-bit bytes of all B-class network addresses are in the range of 128 to 191. The length of a Class B subnet is 16 bits, that is, the subnet mask is also 16 bits. For example, bolt Bella
Ke · Newman communication company has 128.1.0.0/16 segment network address, can provide from 128.1.0.0 to 128.1.255.255 network address. Carnegie Mellon University owns
The Network Address of 128.2.0.0/16.
The first 8-bit bytes of all Class C network addresses are in the range of 192 to 223. The length of the class C subnet is 8 bits, that is, the subnet mask has 24 bits. Note that internet number injection in America
Arin (the organization is responsible for allocating network addresses on the Internet), a management organization that sells only four class C network address segments for individual companies and users who actually need 1024 public network addresses. If you need to run
If the Border Gateway Protocol is used to perform redundant operations on the services of multiple Internet service providers, it must have its own network address segment. You should also understand that it is no longer the original network age, that time
It is easy to get a Class A network address containing 16.8 million hosts. Now you must set the/22 subnet mask, or 255.255.252.0, which contains 1024 hosts.
The network address is charged annually.
In practice, the concept of subnet classification may damage the network. I have seen this case because people forget to disable legacy Cisco routes.

Settings on
When a large Wan is configured as a dynamic route, the lines in the large Subnet are attacked by new connections.
, Resulting in line hijacking. The cause of this situation is that the Cisco Router
Assume that the subnet mask must be/8,/16, or/24, even if you set between the two, it is not feasible. However, all new versions of Cisco Internet Operating Systems have removed the default limits on subnet mask parameters. This operation is performed by the default "ip classless" command.
Completed.

Public and dedicated network IP addresses

Besides the reserved network IP addresses (0.0.0.0/8 and 127.0.0.0/8), some other network addresses cannot be used on the public internet. These private subnets include private network addresses, which are usually used in the firewall

Internal
Or a vro that performs the NAT (Network Address Translation) operation. Network Address Translation is required for private networks. Because private network addresses cannot be directly connected to the public Internet
To connect to the Internet, you must first convert it to a public network address. A private network address does not belong to anyone. Because everyone can use it, it means that no one actually owns it.
Private network address, it does not have a real location. Private network addresses are usually used in most LAN and WAN environments, unless you are lucky to have class A or at least a Class B address.
In this case, you may have enough network addresses allocated to all external and internal hosts.
The following network address segments are allocated to private network addresses.
L 10.0.0.0/8 (10.0.0.0 to 10.255.255.255)
L 172.16.0.0/12 (172.16.0.0 to 172.31.255.255)
L 192.168.0.0/16 (192.168.0.0 to 192.168.255.255)
L 169.254.0.0/16 (169.254.0.0 to 169.254.255.255 )*
* Note that the private network address segment 169.254.0.0/16 is allocated to the Protocol server on the Dynamic Host.

Unavailable time, used for Random Self-allocated network addresses.
Generally, 10.0.0.0/8 is used for a large network because the network segment contains 16.8 million network addresses. You can divide it
Different subnets are subdivided into smaller subnets. Small companies usually use 172.16.0.0/12 network address segments, which are divided into smaller subnets.
You can also use the 10.0.0.0/8 CIDR block. The home network usually uses a subnet of 192.168.0.0/16, and the subnet mask of/24 is selected.
Through the use of private network addresses and Network Address Translation, a single public network address is allowed to represent thousands of private network addresses. Therefore, in the foreseeable future, IPv4 is still guaranteed.
The validity period of the certificate is extended. According to the current usage, IPv4 can provide enough network addresses in the next 17 years. American Internet number registration authority
Now, the management of network addresses is more rigorous. Compared with the old era where Apple can easily obtain address segments containing 16.8 million network addresses, it is much more expensive to obtain network addresses. In the next
In the Internet Protocol version, that is, IPv6, the length of the network address will increase to 128 bits, which means that it will have a network address that is 79 Gigabit times larger than IPv4. Even for all
4.3 billion network addresses are allocated to each of the 4.3 billion users. You can leave the remaining 1800 MB network address.

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.