changes all the numbers at the top to 0, No matter what number it is. if you convert the result back to decimal, you will get10.20.232.0This network ID.
During the course of teaching the subnet division, I always felt uncomfortable: the students did not have access to simple methods to bypass and perform binary conversions during operations. I even saw it workers in related fields use this slow and troublesome method to convert to binary values, and
This example describes a Python implementation method that calculates a network segment based on an IP address and subnet mask. Share to everyone for your reference. Specific as follows:
This code is tested in the Linux environment 2.6.6python version!
#!/usr/bin/env python#_*_encoding:utf-8_*_#input your IP address
IP address segment: 210.143.144.1 ~ 210.143.159.254,
210.143. (1001) 0000.00000000 indicates the network address and identifies a network,
210.143. (1001) 1111.11111111 is the broadcast address, which can broadcast messages to all addresses in the network.
This CIDR block is equivalent to 210.143.144.0/20, that is, 210.143. (1001) 0000.00000000, and 20 indicates the subnet
The following small series for everyone to bring an article WinForm C # get the MAC address, IP address, subnet mask, the default gateway instance. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
1. Add an assembly
2. Introduce namespaces
Using System.Management;
3.
JS verification IP address, subnet mask, Gateway and MAC Method, jsmac
This article describes how to verify the IP address, subnet mask, gateway, and MAC in JS. Share it with you for your reference. The details are as follows:
I
In this paper, a complete example of the implementation of C + + to obtain IP, subnet mask, gateway, DNS and other local network parameters of the method for your reference, the specific complete example is as follows:
#pragma comment (lib, "Ws2_32.lib") #include
This article describes how to verify the validity of IP addresses and subnet masks in js. For more information, see
The Code is as follows:
Function checkIP){Obj = ip;Var exp =/^ (\ d {1, 2} | 1 \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ d {1, 2} | 1 \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ d {1, 2} | 1 \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ d {1, 2} | 1 \ d | 2 [0-4] \ d
Transferred from:
Http://bbs.51cto.com/thread-68584-1-1.html
Subnet Mask and subnet divisionDirectory:I. SummaryIi. Concepts and functions of subnet mask3. Why do I need to use the subnet mask?4. How to obtain the Network/Host ad
Subnet Mask and subnet division
Directory:I. SummaryIi. Concepts and functions of subnet mask3. Why do I need to use the subnet mask?4. How to obtain the Network/Host address using the subnet
Directory:I. SummaryIi. Concepts and functions of subnet mask3. Why do I need to use the subnet mask?4. How to obtain the Network/Host address using the subnet maskV. Classification of subnet masksVi. subnet addressing technology7
subnet mask and subnet partitioningDirectory:
I. Summary
The concept and function of subnet mask
Third, why do I need to use the subnet mask
Four, how to use the
A summary of the concept and function of two-subnet mask how to use subnet mask four how to get network/host address by subnet mask classification of five subnet masks six
I. Concepts and functions of two subnet masks 3. Why do I need to use a subnet mask 4. How do I use a subnet mask to obtain a network/Host address 5? What is the classification of a subnet mas
As for subnet division, the subnet mask is odd. 1.0.1.0 -- 1.0.3.255 Fujian Telecom converts the subnet mask to an IP segment 1.0.1.0/24--1.0.2.0/23, if two IP addresses are replaced by
is. if you convert the result back to decimal, you will get10.20.232.0This network ID.
During the course of teaching the subnet division, I always felt uncomfortable: the students did not have access to simple methods to bypass and perform binary conversions during operations. I even saw it workers in related fields use this slow and troublesome method to convert to binary values, and then perform and computation. After calculation, the Windows
each segment of the IP to binary. (Some say I won't convert yes, it doesn't matter, we use Windows to bring a calculator on the line.) Open Calculator, point to view > programmer, enter decimal number, then click "Binary" This single point, you can switch to binary. )
Switch the netmask to binary, and we'll find that all the
odd IP addresses. It wouldn'T is a range at all!Consequently, there is only a few valid network masks. Each specify a number half the size of the prior netmask. Summary: From the reference article, the subnet mask in front of 1 is not allowed to exist 0, of course, if there is 0, then the calculation of the length of the mas
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.