当前位置:网站首页>Allocation principle of IP address
Allocation principle of IP address
2022-06-09 05:57:00 【qq_ thirty-seven million seven hundred and five thousand five h】
Network model introduction
1 Network model introduction
In the computer network there is a famous OSI Seven layer protocol architecture , The concept is clear , The theory is complete , But it's complex and not practical .TCP/IP Architecture is different ,
Has been widely used . Finally combine OSI and TCP/IP The advantages of , It uses an architecture with only five layers of protocols , This article is about IP All based on the five layer cooperation
Discuss the network layer in the model .

2 Classified IP Address
2.1 IP Address representation
IP The address is for every host on the Internet ( Router ) Each interface assigned to one is unique worldwide 32 Bit identifier . The first field of its composition is network number , The second field is the host number . A host number must be unique within the network range indicated by the previous network number , So a IP The address is unique throughout the network . It's divided into A、B、C、D、E Five category IP Address .
- stay A、B、C The gray part of the three types of addresses is the network number , The first three digits of the network number are category bits , Namely 0,10,110. That is to say, we can judge the network category by this category position .
- 32 The total length of bits , because A、B、C The length of three kinds of network numbers is different , Lead to A、B、C The number of bytes in the host number field of the class address is respectively 3、2、1( A byte 8 position ).
- D The network number of the class address is 1110, For multicast ( One to many communication ).E The network number of the class address is 1111, Keep it for later use .
So what we usually use is ABC Three types of network addresses ,IP The address is 32 Bit binary , To improve readability , hold 32 Bit IP Every... In the address 8 Bit use
The equivalent decimal system is expressed ( dotted decimal ), So what we often see in our daily life is IP The address appears .
for example :IP Address ,128.11.3.31, Convert to binary to 100000000 00001011 00000011 00011111 , We can see that the category bit is 10, Sure
Judged as one B Class address .
3 Commonly used IP Address assignment range
3.1 Network number assignment range
- A Class address network number takes a byte , But because one of them is a category bit , Only 7 Bits are available for use , But because of the rules , Network fields are all 0 It's a reserved field indicating the network , and 127(01111111) It's another reserved field , As a loopback test for local software . Our common 127.0.0.1 Indicating the machine , And that's why . therefore A The number of network numbers that can be assigned to a class address is (27-2).
- B Class network address network number has two bytes , The first two are 10 Fixed , only 14 Bits available , Because of this 14 No matter how the bit is taken, the network number will not be full 0 Or all 1, It is actually stipulated that , Regulations B Class minimum network address is 128.1.0.0. therefore B The number of network numbers that can be assigned to class address is (214-1).
- C Class address has 3 Network field number of bytes , The first three are fixed 110, There's only... Left 21 Bits available , Again C Class address the smallest network address that can be assigned is also 192.0.1.0. therefore C The number of network numbers that can be assigned to class address is (221-1).
3.2 Host number assignment range
- Because the host number is specified , whole 0 The host number of represents IP The address is “ This host ” The single network address to which you are connected ( example , A host address is 5.6.7.8, Then the network address of the host is 5.0.0.0), And the whole 1 said “ be-all ”, All hosts on the network .
- A The host number of the class address is made up of three bytes ,24 A composition , So every one A The number of hosts that can be allocated in a class network is (224-2).
- B The host number of the class address is made up of two bytes ,16 A composition , So every one B The number of hosts that can be allocated in a class network is (216-2).
- C The host number of the class address is made up of a byte ,8 A composition , So every one C The number of hosts that can be allocated in a class network is (28-2).
3.3 summary IP Assign scope
To sum up, the assignment description of network number and host number shows that ,IP Address space is shared by 232 An address .
all A Class addresses share (27-2)∗∗(224-2) individual , about 231, Occupy 50%;
all B Class addresses share (214-1)∗∗(216-2) individual , about 230, Occupy 25%;
all C Class addresses share (221-1)∗∗(28-2) individual , about 229, Occupy 12.5%;

1. So it can be used to express a A class IP Address n.x.y.zn.x.y.z, if 1≤n≤1261≤n≤126,0≤x,y,z≤2550≤x,y,z≤255, among x,y,zx,y,z Different at the same time 0 You can't do it at the same time 255.
2. So it can be used to express a B class IP Address n.m.x.yn.m.x.y, if 128≤n≤191128≤n≤191,0≤m≤2550≤m≤255,0≤x,y≤2550≤x,y≤255, among I. When n=128n=128 when ,m≠0m≠0; II. x,yx,y Different at the same time 0 You can't do it at the same time 255;
3. So it can be used to express a C class IP Address n.m.k.xn.m.k.x, if 192≤n≤223192≤n≤223,0≤m,k≤2550≤m,k≤255,1≤x≤2541≤x≤254, among When n=192n=192 when ,k≠0k≠0.
边栏推荐
- CEF 拦截URL,重定向新的网址
- Entity to map tool
- Ctf: find the most collinear points in the point set
- SSL證書包含了哪些信息?
- Topic26——11. 盛最多水的容器
- What information does the SSL certificate contain?
- This paper gives a comprehensive overview of the application, methods and classification of the multi traveling salesman problem
- Wechat applet wx Getlocation location error information summary
- Helvetic Coding Contest 2017 online mirror (teams allowed, unrated) K - Send the Fool Further! (medi
- 【论文】CBAM: Convolutional Block Attention Module
猜你喜欢

synchronized 详细解析

Yolov5-6.0 series | yolov5 model network construction

srs-nodejs

Go language tutorial 02 go common libraries + compile consult

IP地址的分配原理

Several implementation methods of redis distributed lock
![[paper] cbam: revolutionary block attention module](/img/62/3fde7346dae090567f749e63e5b25f.png)
[paper] cbam: revolutionary block attention module

Wireshark图解TCP三次握手与四次挥手

Morsel driven parallelism: a NUMA aware parallel query execution framework

杭州某家小公司一面
随机推荐
代码签名证书的时间戳验证码签名方法
After the SSL certificate is installed, the website still shows insecurity
VK cup 2017 - round 1 C. bear and tree jumpsdp
IP地址的分配原理
Embedded audio and video solutions webrtc vs metartc
测试和线程
Thread interrupted detailed parsing
Seaweedfs client adapts to the higher version of seaweedfs service
This paper gives a comprehensive overview of the application, methods and classification of the multi traveling salesman problem
About the problem of code wrapping when formatting code with vscode
Morsel-Driven Parallelism: 一种NUMA感知的并行Query Execution框架
MySql使用模糊查询中文时查询语句出现乱码的解决
MVCC多版本控制
VK Cup 2017 - round 3 B. Dynamic problem Scoring
Notes on index building and search execution in Lucene
Window closing process of duilib kernel principle analysis
Dynamic data source
Educational Codeforces Round 20 E. Roma and Poker
Topic24——3. 无重复字符的最长子串
VK Cup 2017 - Round 2 A. Voltage Keepsake