当前位置:网站首页>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

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 .

 Insert picture description here

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 .
 Insert picture description here

  1. 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 .
  2. 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 ).
  3. 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

  1. 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).
  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).
  3. 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

  1. 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 .
  2. 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).
  3. 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).
  4. 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%;

 Insert picture description here

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.
原网站

版权声明
本文为[qq_ thirty-seven million seven hundred and five thousand five h]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090552496266.html