IP address classification and subnet division of Class c ip addresses

Source: Internet
Author: User

International regulations: divide all IP addresses into A, B, C, D, E

Class A address: the range from 0 to 127,0 indicates that all IP addresses are retained, and 127 indicates that all IP addresses are retained and used to test the round-robin. Therefore

The range of Class A addresses is actually from 1.

For example:, the first part of the number is the network number, and the third part of the number is the number of the local computer. To convert to binary, A Class a ip address consists of A 1-byte network address and A 3-byte host address. The highest bit of the network address must be "0 ", the address range is to There are 126 available class A networks, each of which can accommodate more than 0.1 billion hosts (the number of hosts at the power of two is 24 ).

Use a subnet mask:

Class B address: the range is from 128 to 191, for example, 172.161.1. The first and second numbers are network numbers, and the remaining two numbers are the numbers of the local computer. In binary format, a Class B IP address consists of two bytes of network address and two bytes of host address. The maximum bit of network address must be "10 ", the address range is to 191.20.255. There are 16382 available class B networks, each of which can accommodate more than 60 thousand hosts.

Use a subnet mask to differentiate between them:

Class C address: the value ranges from 192 to 223, for example, The first, second, and third segments are network numbers, and the last segment is the number of the local computer. In binary format, a class c ip address consists of a 3-byte network address and a 1-byte host address. The maximum network address must be 110 ". The range is from to 223.20.255. A Class C network can contain more than 2.09 million hosts, and each network can accommodate 254 hosts.

Use a subnet mask for difference:

Class D address: the value ranges from 224 to 239. the first byte of the Class d ip address starts with "1110". It is a specially reserved address. It does not point to a specific network. Currently, this type of address is used in multi-point broadcast (Multicast. A multicast address is used to address a group of computers at a time. It identifies a group of computers that share the same protocol.

Class E address: the value ranges from 240 to 254. It starts with "11110" and is reserved for future use. The full zero ("") Address corresponds to the current host. The IP address ("") of "1" is the broadcast address of the current subnet.

In the daily network environment, B and C are basically used, and the three types of ADE addresses cannot be used.

From the above description, we can see that a lot of friends will make an error, that is, set the IP address starting with 192 to a Class B address, although Network Communication in the LAN is not affected, it is actually an irregular division. the default subnet mask is, where 0 indicates in binary notation, 8 0. therefore, eight locations are not occupied by network numbers. The power of 2 indicates that there are 256 addresses, removing one header (network address) and one tail (host address ), it indicates that there are 254 Computer Host addresses. Therefore, if we want to divide these 254 addresses, We will occupy some of the last eight 0 locations.

If the first 0. S is used, then the subnet mask in hexadecimal notation is 11111111.111111.111111.0000000. If it is converted to hexadecimal notation 2017100000000128, what should the Computer Host be? In fact, it is very simple, it is the 7 power of 2 (no longer the 8 power of 2), the 7 power of 2 = 128, so if the subnet mask is, this class C address can be divided into two networks, each with a maximum of 128 hosts. is one, and is the second.

For another example, for a class C address, the IP address range is For example, if the subnet mask is 255.255.192 (that is, the last 8 is the master location, it is occupied by two digits, in hexadecimal notation 11111111.11111111.11111111.11000000), the number of computer hosts in This CIDR block is the power 6 of 2 = 64, with a total of 2 to the power 2 = 4 CIDR blocks. The first CIDR block is, the second CIDR block is, the third CIDR block is, and the fourth CIDR block is

From the two examples, we can sum up a rule that the host is occupied by N digits, so there is a 2 N-power network, that is, there will be 2 hosts to the power of 8-n.

Finally, let's briefly describe the subnet division method for Class B addresses.

Assume that there is a Class B IP address segment, and the subnet mask of is Now we need to divide the network segment into subnets.

If you do not divide subnets, there is only one network. The network contains a power of 16 and more than 60 thousand hosts.

Therefore, if subnet division is required, the network address needs to be borrowed from the host address.

In example 1, the first step is to convert to binary,

10101100 00010000 00000000 00000000 128 + 32 + 8 + 4 = 172 16

11111111 11111111 00000000 00000000

If the network address asks the host address to borrow two digits, The subnet mask is

11111111 11111111 11000000 00000000


Because I borrowed two bits, I got 2 to the power of 2 and divided into 4 networks. Each network has a host address of 2 to the power of 14.

A brief description of the subnet mask: The subnet mask is a 32-bit address. It is used to shield a part of the IP address to distinguish the network ID and host ID. It indicates that the IP address is on the LAN, or remotely.

The preceding IP address is used as an example. For example, if a class c ip address is, The subnet mask is (convert to binary format, and 255 in binary format indicates 8 1, that is, all accounts are full ). yang's statement indicates that the network number of the class c ip address is 192.168.0 and the host address is 1.

Among so many network IP addresses, some IP addresses are used in our LAN, that is, private IP addresses, which are not used in the Internet. Their scope is: ~ ~ ~

Next, let's discuss the problem of subnet division.

Suppose you have a class c ip address segment:, where 192.168.0 belongs to the network number, and 1-254 represents the maximum capacity to accommodate computer hosts. What we need to do now is to divide the 254 hosts again and separate them.

Example 2

If the Class B address needs to be divided into smaller subnets, and the network address borrows 10 digits from the host address in total, from the binary perspective


Binary 10101100 00010000 00000000 00000000 128 + 32 + 8 + 4 = 172 16

11111111 11111111 00000000 00000000

After 10 digits are borrowed

The subnet mask in binary format is 11111111.11111111.11111111.11111111600.

In decimal format, it is decimal limit 192.

So there are a total of 2 10 to the power of the network number, each network has 2 6 to the power of the address,

If you use decimal to represent so many addresses, it should be as follows (because there is a power of 2, too many, and it cannot be written one by one)

First 6, ---

Last 6, ---




From the two examples, we can see that the division of Class B subnet addresses is actually the same as the division of Class C subnet addresses, except that when the division of Class C is to divide the fourth segment of the address, when dividing class B, you can either divide the third or fourth segment.


Related Article

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.