How to classify IP addresses and divide subnets
ip is a 32-bit unsigned integer, its range is 0.0.0.0 - 255.255.255.255. Specifically, an IP consists of two parts: the network number and the host number. If the network numbers are the same, it means that they are in the same network segment. , you can use mac data frame to communicate directly
Given a network number
IP with host number all 0 represents the network address
IP with all host number 1 represents broadcast address
Representation of ip address:
xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
|--net--|---------host------------|
Class A address network The beginning of the network number is 0, the beginning of the network number of class B address is 10, the beginning of the network number of class C address is 110
The representation range of class A address is: 0.0.0.0~126.255.255.255, the default network mask The code is: 255.0.0.0; Class A addresses are allocated to particularly large-scale networks. Class A networks use the first set of numbers to represent the address of the network itself, and the next three sets of numbers as the addresses of hosts connected to the network. Assigned to large networks with a large number of hosts (direct individual users) and a small number of LANs. For example, IBM's network.
The representation range of Class B addresses is: 128.0.0.0~191.255.255.255, and the default network mask is: 255.255.0.0; Class B addresses are allocated to general medium-sized networks. Class B networks use the first and second sets of numbers to represent the network address, and the last two sets of numbers represent the host address on the network.
The representation range of Class C address is: 192.0.0.0~223.255.255.255, and the default network mask is: 255.255.255.0; Class C address is allocated to small networks, such as general LAN and campus network, it can The number of connected hosts is the minimum, and the users are divided into several network segments for management. Class C networks use the first three sets of numbers to represent the network address, and the last set of numbers as the host address on the network.
In fact, there are also Class D addresses and Class E addresses. However, these two types of addresses have special uses. Here is a brief introduction: Class D addresses are called broadcast addresses and are used by special protocols to send information to selected nodes. Class E addresses are reserved for future use.
The definition of netmark is very simple. Netmask is also 32 bits. Numerically, the Net-ID is 1 and the Host-ID is 0
For example, a common Class C IP address
Net-id=24 bits, host-id=8 bits, with 2**8-2=254 ips
A traditional Class C network, such as 192.168.10.0, its netmark It must be 255.255.255.0. If you divide this network into two sub-networks, it is very simple. Set the net-id to use 25 digits, and the host-id will only have 7 digits. Then the netmark at this time = 255.255.255.1 0000000 = 255.255.255.128 , the two subnets obtained this time are
129.168.10.0/25
192.168.10.128/25
Obviously, /25 is the number of digits occupied by the net-id in this IP (these 2 The host-id of each IP is all 0, so these two IPs represent the subnetwork where they are located)
This representation method is easy to calculate the size of the subnetwork, for example
192.168 .0.0/27 means 2 raised to the power of 5 (32-27=5) -2 (the first and last addresses of each network segment are occupied by special purposes) = 62 ip
192.168.0.0/28 , indicating 2 to the power of 4 (32-28=4) -2=30 ip
, so 192.168.1.1/24 marks a subnetwork 192.168.1.0 (with 254 ip addresses: from 192.168 .1.1 to 192.168.1.254)
The above is the detailed content of How to classify IP addresses and divide subnets. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Xiaohongshu is a popular social e-commerce platform where users can share their daily life and discover their favorite products. Some users are more sensitive to personal privacy and hope that their IP address will not be displayed on Xiaohongshu to protect their online privacy. So, how to set Xiaohongshu not to display the IP address? This article will answer this question in detail. 1. How to set Xiaohongshu not to display the IP address? 1. Modify Xiaohongshu settings: Open Xiaohongshu APP, click "Me" in the lower right corner to enter the personal center. Then click on the avatar to enter account settings. In the account settings, find "Privacy Settings" and click to enter. Here, you can find the setting options for IP address, just turn it off. 2. Clear cache: Sometimes, Xiaohongshu may display an error

How to view all IP addresses on the LAN using cmd: 1. Press the "Win+R" shortcut key to open the "Run" window; 2. After entering "CMD" in the "Run" window, press the Enter key; 3. In the open "Command" In the "Prompt" interface, enter the command "arp -a" and press the Enter key; 4. From the returned results, you can see the IP addresses of all computers in the local LAN that communicate with the machine.

Sometimes everyone encounters the need to manually modify the IP address, but some Windows 10 customers report that the IP address cannot be saved after setting it. How to solve this situation? The IP address is stored basically because there is an error in filling in your IP address. You can check whether the subnet prefix has been written with the subnet mask. If so, change it back. After the change, you can save it normally. IP address. How to solve the problem that the Windows 10 IP address cannot be saved after it is set: The error picture is as follows: The prompt "Unable to save the IP setting, please check one or more settings and try" caused by filling in the error. This is the subnet prefix length, not the subnet mask. as the picture shows. As shown in the picture above, many users actually write out the subnet prefix as the subnet mask.

Where is the IP address of Xiaomi mobile phone? You can check the IP address on Xiaomi mobile phone, but most users don’t know where to check the IP address. Next is the graphic tutorial on how to check the IP address of Xiaomi mobile phone brought by the editor. Interested users come and take a look! Where is the IP address of Xiaomi mobile phone? 1. First open the settings function in Xiaomi mobile phone, select [My Device] and click to enter; 2. Then on the My Device function page, click [All Parameters] service; 3. Then on the All Parameters page , slide to the bottom and select [Status Information]; 4. Finally, you can see the IP address in the status information interface.

Xianyu is a very practical second-hand trading platform. Here we can buy many different products and sell our own idle items. What if we want to modify our address? Let’s take a look with the editor below! Share how to modify the Xianyu IP address. First, open the Xianyu software. After entering the homepage, you can see seafood market, recommendations, address and other options in the upper left corner. Click "Address". 2. Then on the address page, we click the [Down Arrow] next to the address; 3. After the final click, we click on the city on the city selection page;

Users share their lives, show off their talents, and interact with netizens across the country and even the world through Douyin. Some users wish to change their IP addresses on Douyin due to reasons such as privacy protection or geographical restrictions. So, how does the Douyin IP address change its location? 1. How to change the location of Douyin IP address? A proxy server is an intermediary service used to forward user requests to the Internet and return responses. By configuring a proxy server, users can hide their real IP addresses and change their IP addresses. This approach helps protect user privacy and improves network security. Proxy servers can also be used to access restricted content or bypass geolocation restrictions. Overall, using a proxy server is a practical network tool that can help users browse the Internet more safely and freely.

Each host has a unique address identifier called an "IP address." The IP address is a unified address format provided by the IP protocol. It assigns a unique logical address to each network and each host on the Internet to shield the differences in physical addresses. Because of this unique address, it is ensured that users can efficiently and conveniently select the objects they need from thousands of computers when operating on connected computers.

With the rapid development of the Internet, IP addresses have become an indispensable part of network communications. IP address information is very important in network security monitoring, traffic management, and targeted e-commerce advertising. Therefore, in order to facilitate users to query IP address/domain name information, many websites provide IP address query functions. This article will introduce how to use PHP to implement the IP address query function for readers' reference. 1. What is an IP address? IP address (InternetProtocolAddress) is the network protocol
