IP address must know

IP address classification:
Class A IP segment 0.0.0.0 ~ 127.255.255.255 (0nnnnnnn.hhhhhhh.hhhhhhhh.hhhhhhhh) (reserved for ZF or large enterprises)
Class B IP segment 128.0.0.0 ~ 191.255.255.255 (10nnnnnn.nnnnnnnn.hhhhhhhh) hhhhhhhh) (assigned to medium-sized companies)
Class C IP segment 192.0.0.0 ~ 223.255.255.255 (110nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh) (assigned to small companies or individuals)
Class D IP segment 224.0.0.0 ~ 239.255.255.255 ( 1110xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx) (for multicast)
Class E IP segment 240~(1111xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx) (for experiment) The
subnet mask determines the number of computers in a subnet, and the computer formula is 2 to the power of m, where we can see how many 0s are behind m. For example, 255.255.255.0 is converted into binary, that is 11111111.11111111.11111111.00000000, and there are 8 0s behind, then m is 8, and the subnet mask 255.255.255.0 can accommodate 2 to the 8th power (sets) computers, that is, 256 sets, But there are two IPs that cannot be used, that is, the last segment cannot be 0 and 255, minus these two, it is 254.
If you want to be on the same network segment, you must have the same network ID. How to calculate the network ID? Different types of IP network identification algorithms are not the same. Category A, only the first paragraph. Category B, only the first and second paragraphs. Category C, count the first, second, and third paragraphs. (Note: The subnet masks of the two IPs must be the same. If they are not the same, even if the network identifiers are the same, they are not in the same network segment)
For example: IP: 192.168.0.111, 192.168.5.222, the subnet mask is set to 255.255.254.0, are they in the same network segment?
  These first converted into binary
  192.168.0.111 11000000.10101000.00000000.01101111
192.168.5.222 11000000.10101000.00000101.11011010
  255.255.254.0 11111111.11111111.11111110.00000000
  each phase, to obtain the network identification
   11000000.10101000.00000000.00000000
11000000.10101000.00000100.00000000
  network identity is not the same, i.e. not in the same network segment.

IPV6 address:
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A is a complete IPv6 address
with all 0s in the middle represented by ::, but it can only be used once

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325022812&siteId=291194637