search
HomeOperation and MaintenanceSafetyHow to classify IP addresses and divide subnets

How to classify IP addresses and divide subnets

May 17, 2023 pm 07:01 PM
IP address

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!

Statement
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment