关于子网划分,子网掩码出现奇数的有关问题
关于子网划分,子网掩码出现奇数的问题
1.0.1.0--1.0.3.255 福建省 电信 转换为 1.0.1.0/24--1.0.2.0/23
上面是一个IP段,划分子网后得到后面的两个网段和子网掩码,如果用一般的方法,
把两个IP换成二进制进行异或预算
00000001.00000000.00000001.00000000
00000001.00000000.00000011.11111111
得到的子网掩码为
11111111.11111111.11111101.00000000
255.255.253.0
但是第三段 明显不符合连续一和连续零的规则,但是又不知道最上面的划分成两个网段的依据是什么,望高手解答,在线等,谢谢!
------解决方案--------------------
你是想搞懂原理还是有什么具体点的需求,说说先。
------解决方案--------------------
1.0.1.0--1.0.3.255 按 24 位掩码(C类网址) 划分,共 3 个网段
11111111 11111111 11111111 00000000 掩码
00000001 00000000 00000001 00000000 网段1
00000001 00000000 00000010 00000000 网段2
00000001 00000000 00000011 00000000 网段3
当掩码为 23 位时
11111111 11111111 11111110 00000000 掩码
分别于三个网段相与,得(红色部分)
00000001 00000000 00000001 00000000 网段1
00000001 00000000 00000000 00000000 结果1
00000001 00000000 00000010 00000000 网段2
00000001 00000000 00000010 00000000 结果2
00000001 00000000 00000011 00000000 网段3
00000001 00000000 00000010 00000000 结果3
很明显,结果2和结果3相等,所以是一个网段

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...
