[Translation] IP subnet division

Source: Internet
Author: User
Tags subnetting made easy

Original article title: IP subnetting made easy

Address: http://articles.techrepublic.com.com/5100-10878_11-6089187.html


IP network engineers need to have a solid understanding of how IP subnet division works. however, this topic is often ignored by instructors and the students are very confused and nervous about it. george ou developed a simple, graphical method to explain IP subnet division in a simple and easy-to-understand manner.


IP subnet division is a basic topic that IP network engineers need to understand, but in practice, it is difficult for students to master it. for many years, I have seen the struggle of students in school to practice and process subnet division, because no one has ever explained it to them in a way that is easy to learn. I used my graphical method to help countless students learn what subnet division is. Now I have summarized all my experiences in this article.


IP address and Subnet


Although IP supports the Internet protocol, it is actually a huge Internet communication protocol that is applicable to a small private network and a large world. an IP address is a unique identifier of a single device on an IP network. the IP address consists of 32 binary digits ranging from 0 to 4294967295. this means that theoretically the Internet can contain approximately 4.3 billion unique objects. however, in order to make such a large block easier to process, it is divided into four groups of 8 binary digits, or "Eight-bit group", which is used in the middle ". "To separate. 32 binary digits are hard to read. Instead, we divide them into four groups of numbers smaller than 256. an octal group consists of numbers ranging from 0 to 255. the following figures show how IP addresses grow.
... Increment 252 hosts...
... Increment 252 hosts...
... Increment 4 + billion hosts...


Subnet (subnet) is short for sub network, meaning a network smaller than a large network. in a subnet, the smallest subnet with no more sub-division is considered as a separate "broadcast domain". The broadcast domain is a separate LAN (local area network) on an Ethernet switch) segments are directly related. A broadcast domain provides an important function because it is a place where devices on the network communicate with other devices through MAC addresses. MAC addresses are not routed through multiple subnetworks, and MAC addresses are unique across the Internet. MAC address-based communication is only limited to small-scale networks. Because they rely on ARP broadcast to find routes, the number of broadcasts is limited. Otherwise, the amount of broadcast communication can paralyze the entire network, because the network is full of pure broadcast noises. for this reason, the most common minimum subnet is eight binary digits, which is precisely an eight-bit group, although the minimum subnet can be a little smaller or a little larger.


The subnet has a starting and ending number. The starting number is always an even number, and the ending number is always an odd number. the START number is "network ID", and the end number is "broadcast ID ". you cannot use these numbers because they both have special meanings that are created for special purposes. the network ID is the official address of a subnet. the broadcast ID is the broadcast address listened to by all devices on the subnet. whenever you want to reference a subnet, you can set the network ID and Its subnet mask. The subnet mask defines the size of the subnet. whenever you want to send data to all devices in the subnet, you can send your data to the specified broadcast ID. later, I will show you the mathematical and graphical methods for determining the network ID and broadcast ID.


Graphical subnet ruler


For many years, I have found that people have a headache in IP subnet division. I want a better way to teach this problem. I soon realized that many IT staff lacked the necessary mathematical background knowledge and had difficulty understanding the concept of binary numbers. to make up for this deficiency, I have shownChartTo illustrate the problem of subnet division. in this example, we observe the IP address range from to note that the ending IP address is actually the starting address of the next subnet. here the network range ends in the previous one, that is,




Note that the number of hosts doubles as the subnet size increases by one binary bit. the smallest step represents eight binary bits. The eight binary bits contain a subnet of 256 hosts. However, because you cannot use the first or last IP addresses, in fact, there are only 254 available hosts on the network. the easiest way to calculate the number of available hosts in a sub-network is to calculate 2.Number of binary digitsPower, and then 2. for example, if there are nine binary digits, We have 510 available hosts, because the 9 power of 2 is 512, but we need to remove the beginning and end. until 13 binary digits, We have 8190 available hosts on the entire ruler. (224d = 11100000b) (201710000224.0 = 11111111.111111.111160.00000000, of which 13 are 0)


Learn to divide subnets appropriately


Subnets can be divided into smaller subnets, or even further smaller subnets. the most important thing about dividing subnets is that you cannot randomly select the start and end points. this Division must conform to the clean binary division. the best way to learn this is to look at my subnet ruler and see what a valid subnet looks like. inChart BThe green subnet is valid, and the red subnet is invalid.


Chart B


The structure of this ruler is similar to that of other rulers. We split it into two parts in the middle. then, we split the remaining parts, and then we continued a new round of this bipartite. in the above example, we have five rounds of binary. if you take a closer look at each green (valid) subnet block, you will notice that all the scales contained in the subnet are no larger than the scales on the edge. here is a mathematical reason. We will explain it later, but this graphic explanation makes it easier to understand the mathematical explanation later.


Subnet Mask role


The subnet mask plays a key role in defining the subnet size.Chart C. Pay attention to the mode. Pay special attention to the red numbers. at any time, when you are processing subnets, this table will come in handy sooner or later to help you recall eight special numbers used to process subnet masks. they are:255,254,252,248,240,224,192, And128. You will see these numbers again and again on the IP network. Remember that they will make your life easier.


Chart C

I have three types of dimensions. you will see the first two categories. The host length is usually from 0 to 16 binary digits. it is very common for DSL and T1 IP segments in the range of 0 to 8 binary. A private network typically works in the range of 8 to 24 binary bits.


Note how the number of zeros in the binary mask increases from right to left. in binary mode, the subnet mask is 1 on the left and 0 on the right. the number of zeros is the same as the length of the subnet. I only demonstrated the interesting part of the binary subnet mask in the eight-bit group, because all the eight-bit groups on the right are composed of 0, and the left is composed of 1. therefore, if we look at the subnet mask with 11 binary digits in length, the Complete Binary subnet mask is 11111111.111111111000.00000000. this binary subnet mask is converted to the 256 mode, and is directly converted to


"Mask" in the subnet mask"


The subnet mask not only determines the subnet size, but also helps you precisely locate the subnet end point without any IP addresses of a subnet. the reason it is named subnet "Mask" is that it literally masks the binary bit of the host, leaving only the subnet for the starting address, that is, the network ID. once you know how a subnet starts and how large the subnet is, you can determine the subnet endpoint, which is the broadcast ID.


To calculate the network ID, you only need to calculate the IP address and subnet mask in the subnet. let's use an IP address and a subnet mask of as an example. note that this can also be abbreviated10.20.237.15/21,BecauseSubnet Mask LengthIs 21 (21 in 255.255.248 ).Chart DAndChart EDisplays the decimal and binary versions of operations.


Chart D

Decimal version

Chart E

Hexadecimal version


The binary version shows how so many zeros are used as masks to mask the top IP addresses. in the masking box, 0 changes all the numbers at the top to 0, No matter what number it is. if you convert the result back to decimal, you will get10.20.232.0This network ID.


During the course of teaching the subnet division, I always felt uncomfortable: the students did not have access to simple methods to bypass and perform binary conversions during operations. I even saw it workers in related fields use this slow and troublesome method to convert to binary values, and then perform and computation. After calculation, the Windows Calculator is used to convert back to decimal. in fact, there is indeed a simple shortcut to use the Windows Calculator, because operations can work directly in decimal format. press "237", Press "and" 248 ", and then type" 232. I don't understand why I don't explain this to students, because using a calculator makes the computing mask much easier.


Because the subnet mask has 11 zeros, The subnet is the length of 11 binary. This means that there can be a maximum of 2 ^ 11, that is, 2048 hosts in the subnet, And the last IP address of the subnet is10.20.239.255. You just need to glance at the Three Zeros In the third octal group, and you can quickly calculate this conclusion. This means that the IP addresses in the third octal group can be 2 ^ 3, 8 changes. therefore, the starting position of the next subnet is 10.20.0000+ 8.0, that is, if we reduce it by 1, we get, which is the end point of the current subnet. to make you feel this visually, please refer to my subnet ruler.


Chart F


Introduction to IP types


To classify IP subnets, the Internet creators choose to divide the Internet into several categories. note that this classification is not as important as subnet computing. It only shows how the Internet is opened. the Internet is divided into five categories: A, B, C, D, and E. class A accounts for half of the Internet, Class B accounts for half of the remaining half, Class C accounts for half of Class B, and Class D (Multi-broadcast) take half of the remaining half, and the rest is Class E. my students told me that they have been plagued by memory IP classification until they seeChart G.This is because you actually don't need to remember anything. You just need to learn how to use half of the available range to build a ruler.

Chart G



Remember, all subnets start from an even number and all subnet endpoints are odd. note that to ( is not used, and to ( is used for loop address. is interpreted as: the network ID is, The subnet mask is eight 1 on the left, and a bunch of 0 subnets on the right


The values of the first octal group of all Class A addresses are between 1 and 126, Because 127 is reserved as a loop address. a subnet is 24 bits long, meaning that the subnet mask is only 8 binary bits long. for example, GE owns the subnet (that is, the network ID of, 11111111.0.0.0 is a subnet mask). Because GE is lucky enough, it has long been assigned 16.8 million addresses. u. s. the army owns level 3 communications have IBM has at&t owns xerox has HP has and apple has


The value of the first octal group of all Class B addresses ranges from 128 to 191. A Class B subnet is 16 bits long, meaning that the subnet mask is 16 bits long. for example, BBN communications have, that is, to carnegie Mellon University owns


The first eight-digit iweizude value of all Class C addresses ranges from 192 to 233. the Class C subnet is 8 bits long, so the subnet mask is only 24 bits long. note that Arin (the organization responsible for managing Inernet addresses) only sells four class C addresses to a separate company, and the company must prove that it actually needs 1024 public IP addresses. if you need to run BGP to use multiple ISPs for redundancy, you have to own your own IP address block. it should also be noted that, not in the early years, Class A addresses of 16.8 million hosts in the early years should be allocated at no cost. now you need to pay an annual fee for a subnet IP block with 1024 IP addresses (the subnet mask is, of which 22 are 1.


The concept of subnet category can cause problems in actual operations. I have seen people forget how to turn the classification off from the old Cisco router, and when a write router is added in, vrouters with huge subnets configured as dynamic routing are hijacked. this is because the Cisco router assumes that the subnet mask is full/8 or/16 or/24, even if you define a value within these ranges. all new Cisco IOS software versions disable the concept of subnet classification and use the default classless routing mode. this is done through the default "IP No category" command.


Public IP address and private IP Address


In addition to the reserved IP addresses ( and mentioned above, there is also a type of IP address that is not used by the public internet. these private subnets are composed of free IP addresses and are usually behind the firewall or the router that executes NAT (network address translation. nat is required because private IP addresses cannot be routed over the public internet. Therefore, they must be translated as a common IP address before accessing the Internet. private IP addresses are never routed because no one actually owns them. because anyone can use it, the private IP address does not point to a correct point on the public internet. private IP addresses are mostly used in LAN and WAN environments. Unless you are lucky enough to have a class A or at least class B address block. In this case, you can have enough IP addresses to assign values to internal and external addresses.


The following IP addresses are all assigned to the private network.

  • ( to
  • ( to
  • ( to
  • ( to )*

* Note that is a private IP address block. When the DHCP server is unavailable, it is used as an automatically assigned IP address.


Under normal conditions, is used on a large network, because approximately 16.8 million IP addresses in this block are available. they can be divided into many smaller subnet groups for networks in different geographical locations. These groups can be further divided into smaller subnets. a smaller company typically uses the range as its own private IP address, and then divides it into smaller subnets, although there is no reason not to allow them to use, if they want to use it, they can still. the home network generally uses a subnet mask of 24 1 subnets within


The use of private IP addresses and Nat has lasted for a long time in IPv4 and will continue to be used in the foreseeable future. because they efficiently allow a public IP address to contain thousands of private IP addresses. at the rate at which the current IPv4 address is issued, our IPv4 address is about 17 years old. arin is already very stingy with the issue of IP addresses. Compared with the early years, small IP addresses are already very expensive. companies like apple were very easy to get 16.8 million IP address blocks. the next-generation IP address, called IPv6, has a length of BITs, which is million times longer than IPv4. even if you have one IP address for each of the 4.3 billion people on the earth, you will have 18 million IPv6 addresses left.

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.