IP address range

Source: Internet
Author: User
IP address range details-General Linux technology-Linux programming and kernel information. The following is a detailed description. I took A written test A few days ago. I asked about the range of A, B, C, D, and class IP addresses. At that time, I did not think much about it, so I wrote a rough story. but after careful research, I found myself wrong. Now, I want to re-calculate the range, and I hope you can remember it through my methods.

First, understand the two most basic rules:
1. the network number and host number cannot all be 1 or all are 0
2. calculate the network and host numbers separately.
With these two basic rules, you can determine the range of IP addresses by adding the headers of Class A, B, and C IP addresses.

Class a ip address:
The network number occupies one byte (8 bit), and the first digit of the network number is 0; the host number occupies three bytes (24 bit );
00000000. 00000000. 00000000. 00000000
Now we can use the above two rules to see the range of Class a ip addresses. The network number and host number cannot all be 0 or all are 1. First, it is impossible to set the network number to 1, because the 1bit is already fixed to 0. Then the network number must start from 00000001, that is, 1; until 126. The host number cannot all be 0, that is, 00000000, 00000000, or 0.0.1. To the maximum, it cannot all be 1 11111111 11111111 11111110 or 255.255.254.
Therefore, the range of Class a ip address is 1.0.0.1 ----- 126.255.255.254.
Type B IP address:
The network number occupies two bytes (16 bit), and the first two digits of the network number are fixed to 10; the host number occupies two bytes (16 bit)
10000000. 00000000. 00000000. 00000000
Network number cannot be all 0 10000000. 00000001 is 128.1 to 10111111. 11111111 is 191.255; host number 00000000. 00000001 is 0.1 to 11111111. 11111110 is 255.254
Therefore, the range of class B IP addresses is 128.1.0.1 ---- 191.20.255.254.

Class c ip address:
The network number occupies three bytes (24 bit), and the first three digits of the network number are 110; the host number occupies one (8 bit ).
11000000. 00000000. 00000000. 00000000
The minimum network number is 11000000. 00000000. 00000001, which is 192.0.1. the minimum host number is 00000001, which is 1. The maximum network number is 11011111. 11111111. 11111110, which is 223.0000254. The maximum host number is 11111110.
Therefore, the range of class c ip addresses is 192.0.1.1 ---- 223.20.254.



Note: In Xie xiiren's "computer network" (fifth edition) E-industry press. From page 114 to page 115, we will also elaborate on this in detail. Here is just a soft understanding of your own; also want to find the corresponding RFC document; but not found...

Original blog address: http://blog.chinaunix.net/space... & do = blog & id = 2942264
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.