Find the starting and ending IP addresses of a network segment For example: network segment (192168.1.5/24), its subnet mask is divided according to 24: 11111111.11111111.11111111.00000000(255.255.255.0) Explanation: The IP address is 32bits, In dividing the network segment, 24 means that there are 24 1s in the front and 8 0s in the back. The algorithm of the starting IP address is: the binary of 192.168.1.5 is ANDed with the binary of the subnet mask. The algorithm for ending the IP address is: first invert the binary number of the subnet mask, and then perform an "OR" operation with the binary number of 192.168.1.5 In actual application, what is obtained is the network address and broadcast address, network address + 1 is the first host address, and the broadcast address -1 is the last host address.
Related labels:
source:php.cn
Previous article:"Perfect" anti-XSS and anti-SQL injection code spray
Next article:PHP version of MySQL very large database volume backup and recovery tool
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
How to display the mobile version of Google Chrome
Hello teacher, how can I change Google Chrome into a mobile version?
From 2024-04-23 00:22:19
0
11
2310
There is no output in the parent window
document.onclick = function(){ window.opener.document.write('I am the output of the child ...
From 2024-04-18 23:52:34
0
1
1823
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|