The IP address mentioned in this Article refers to IPv4, and IPv6 is not covered in this article.
The IP address is composed of 32-bit binary numbers, which are usually expressed in four groups of decimal digits for convenience,
If the two IP addresses have the same Net_ID and only the Host_ID is different, they are in the same CIDR block. In the LAN, data in the same CIDR block can be transmitted through broadcast, different CIDR blocks must be transmitted through routers.
In the same CIDR Block, two IP addresses are reserved. One is that all Host_ID values are 0 (for example, 192.168.0.0), which indicates the IP address of the entire CIDR block; the other is that all Host_ID values are 1 (for example, 192.168.0.255 ), it indicates the broadcast address of the CIDR block.
IP Classification
The above three major levels are ABC. D is used as a special function of multicast, while E is reserved for unused network segments.
The following ip cidr blocks are dedicated to private IP addresses (used internally by the enterprise) and cannot be used as public IP addresses for internet connection.
Subnet division
As mentioned above, the use of Net_ID and Host_ID to divide network segments is relatively rigid. Sometimes we do not need such a large network segment. In this case, we need to use Netmask (subnet mask) to flexibly divide network segments, as shown below:
Generally, when we know the Network and Netmask, we can define all the IP addresses of the Network. Therefore, we often use Network/Netmask to represent a Network, such:
IP and MAC
Each host has an ARP table (in memory), which records the binding information of IP and MAC in real time and will be automatically refreshed (20 minutes ), we can use the arp command to view the content of the ARP table:
# arp -nAddress HWtype HWaddress Flags Mask Iface192.168.1.61 ether 84:8f:69:db:e2:d5 C eth0192.168.1.40 ether e0:db:55:01:a5:08 C eth0192.168.1.15 ether 18:03:73:0e:e0:81 C eth0192.168.1.1 ether 70:7b:e8:26:2d:f0 C eth0