A little literacy. Inspired by previous copy-paste of various rubbish on this topic. Forgive the nosing staff.
The IP address (v4) consists of 32-bit. Any self-respecting administrator, and indeed an IT specialist (I’m silent about network engineers), being awakened in the middle of the night or in a state of severe alcoholic intoxication, correctly answer the question "how many bits does an IP address consist of?" Generally desirable about IPv6 too: 128 bits.
The first circumstance. Total theoretically IPv4 addresses can be:
2 32 = 2 10 * 2 10 * 2 10 * 2 2 = 1024 * 1024 * 1024 * 4 ≈ 1000 * 1000 * 1000 * 4 = 4 billion
Below, we will see that quite a few of them are “eaten up” by any kind of garbage.
IPv4-, , , . ( , , , «» — ) , : «192.168.11.10».
IP- source IP destination IP: ( ) (). . IP- . . 32- 32 .
, IP- ( ) , . :
IP-.
— — . , [], — . (- «», «IP-».) , «», — ( , ). , .
— 32-. IP-, . - , - .
120.22.123.12=01111000.00010110.01111011.00001100.
255.255.248.0=11111111.11111111.11111000.00000000.
N , 32-N . , . N, . : 192.168.11.10/21 192.168.11.10 255.255.248.0. , .
, ( ) IP- , . 192.168.11.10/21:
11000000.10101000.00001011.00001010
11111111.11111111.11111000.00000000
----------------------------------------------
11000000.10101000.00001000.00000000 = 192.168.8.0
. IP- , .
192.168.8.0, , , . () . , , 192.168.15.255. () . : - , , . () . — . 192.168.8.1 192.168.15.254 192.168.8.0/21, .
, , , () . . , , — . 192.168.8.0/21 192.168.8.0 255.255.248.0 . , . ( ), . .
. 232-N-2, N — . , .
, N=30. /30 point-to-point- .
/31, ( ) () , , « ».
/32 . -, . . loopback-, -, : /32 — , , , . , , , , . , , , — . , , , .
, IP-, IP- L3- («-», .
OSI).
IP-, , «» . , «», — (). , , : 192.168.8.1 — .
. , ( — ) 192.168.8.1 , , , 192.168.8.5 192.168.8.7. - . , .
( ) IP- (2+) ( , ), .
— . 192.168.8.0/21 2 /22, /23, /24 . . , , : K=2
X-Y, K — Y, X.
. IT-, , , 0 16.
( , ) ( , ) ( !). , , . , , /29, . /19 .
-.
. , , «» , . /29 (232-29 = 8 ) 5 (62,5%). , , /29. , IP- ( ) — , .
, 10.0.0.0/8, 172.16.0.0/12 192.168.0.0/16, , , : /8, /16, /24 , , 255.0.0.0, 255.255.0.0 255.255.255.0. , . , , .
. . , ! . 20 (!), . , , , /8, .
« » « -» . , « C» - 10.1.2.0/24. ( ) ( ). . 10.1.2.0/24 C.
. , — ,
RFC3330, . , , 10/8, 172.16/12 192.168/16 (, , )
, . . 224.0.0.0/4
. . , . ( ), , .