The subnet mask is the elementary knowledge which each network management must grasp, only then grasps it, only then can understand the TCP/IP agreement truly the establishment. The following we with profundity and an easy-to-understand approach explain anything are the subnet masks.
IP address structure
Must want to understand that anything is the subnet mask, has no alternative but to understand the IP address the constitution. The Internet is by many small-size network constitutions, in each network many main engines, then like this constituted a stratified structure. IP address when design considered the allocation the level characteristic, divides each IP address the network number and the main engine number two parts, is advantageous for the IP address the addressing operation.
How many positions the IP address's network number and are the main engine number each? If does not assign, did not know that which positions are the network number, which are the main engine numbers, this needs to realize through the subnet mask.
The subnet mask cannot exist alone, it must unify the IP address to use together. The subnet mask only then an function, is divides some IP address the network address and the host address two parts.
The subnet mask's hypothesis must follow certain rule. Is the same with the IP address, the subnet mask's length is also 32, left side is the network position, “1” expressed with the binary numeral; Right side is the main seat on a plane, “0” expressed with the binary numeral. The attached figure shows is the IP address is “192.168.1.1” and the subnet mask is “255.255.255.0” binary comparison. And, “1” has 24, represents left side of the IP address which corresponds with this 24 are the network numbers; “0” have 8, represents right side the IP address which corresponds with this 8 are the main engine numbers. Thus, the subnet mask had determined in a IP address's 32 binary numeral which are the network number, which are the main engine numbers. This regarding used the TCP/IP agreement the network to be important, only then through the subnet mask, could indicate a main engine was at the subnet with other subnet's relations, caused the network normal work.
The subnet mask's terminology is the expansion network prefix code is not an address, but may determine that a network level address which part is the network number, which part is the main engine number 1 part represents the network number, the mask is 0 parts gains the main engine IP network address information on behalf of the main engine worker's chant network mask function, uses in distinguishing the main engine correspondence different situation, from this chooses the different way A kind of network the subnet mask is 255.0.0.0; B kind of network is 255.255.0.0; C kind of network address is: 255.255.255.0
How to determine the network number or the network address through the subnet mask?
Carries on through the IP address's binary system and the subnet mask's binary system with the operation carries on decides some equipment's network address,
That is distinguishes a network through the subnet mask the network part and the main engine partial subnet mask, once establishes, the network address and the host address fixed.
Is opposite in the use subnet mask recognition network address, the early use category carries on the network address the classification to have the address massive wastes the insufficiency.
A subnet most remarkable characteristic has the subnet mask. Is the same with the IP address, the subnet mask's length is also 32, may also use decimal base's form. For example, is the binary mode subnet mask: 11111111111111111111111100000000, use decimal base's form is: 255.255.255.0.
1. subnet mask concept
The subnet mask is a 32 bit address, uses in shielding the IP address a part to distinguish the network identifier and main engine marking, and explained that this IP address is on the local area network, on telenet.
2. determination subnet mask number
Uses in the subnet mask the figure deciding in the possible subnet number and each subnet main engine number. Before defining the subnet mask, must clarify the subnet number which and the main engine number uses originally.
The definition subnet mask's step is:
A, determined that which groups of addresses turn over to us to use. For instance we apply the network number is “210.73.a.b”, this network address is c kind of IP address, the network identifier is “210.73”, main engine marking is “a.b”.
The subnet number which now B, according to us to need the subnet number which as well as the future possibly expands, will define the subnet mask with host machine's some. For instance we need 12 subnets now, will need in the future possibly 16. With third byte first four definite subnet mask. First four set is “1”, namely the third byte is “11110000”, this counts us to be called as the new binary subnet mask for the time being.
C, sets at corresponding initial network's various units places is “1”, namely the first two bytes set are “1”, the fourth byte sets is “0”, then the subnet mask's interrupted binary mode is: “11111111.11111111.11110000.00000000”
D, transforms this number for the interrupted decimal base form is: “255.255.240.0”
This number is this network subnet mask.
3.IP mask labelling
A, non-subnet labelling law
To the non-subnet's IP address, might write the main engine number is 0 masks. If IP address 210.73.140.5, the mask is 255.255.255.0, may also the default mask, only write the IP address.
B, has the subnet labelling law
When has the subnet, certainly wants the two pair to appear. Take C kind of address as an example.
in the 1.IP address's first 3 byte expression network number, the latter byte both indicates the subnet number, and explanation main engine number, but also explained whether two IP addresses do belong to a webpage. If belongs to the identical network sector, exchange of information between these two address's does not pass the router. If is not the identical network sector, is also the subnet number is different, two address's exchanges of information must carry on through the router. For example: Regarding the IP address for 210.73.140.5's main engine, its main engine marking is 00000101, regarding the IP address for 210.73.140.16's main engine its main engine marking is 00010000, the above two main engines mark front three all are 000, explained that these two IP address in the identical network region, these two main engines when exchanges the information does not need through the router to carry on 10.73.60.1's main engine marking is 00000001,210.73.60.252 main engine marking is 11111100, these two main engines mark front three 000 and 011 different, explained that the two in the different network region, must exchange the information to need to pass the router. On its subnet the main engine number each is 1 and 252.
2. the mask function is showing has the subnet and has several subnets, but subnet several can express that is a scope, cannot speak the concrete several subnets accurately, the mask did not explain that the concrete subnet number, has the subnet mask form (to C kind of address).
Subnet mask and ip address relations
Pays attention to this lecture to have a kind of net!
The subnet mask is uses for to judge the random two computer's IP address whether to belong to the identical child network basis.
After the simplest understanding is two computer respective IP address and the subnet mask carry on and operation, if obtains the result is the same, then explained that these two computers are in the identical sub-network, may carry on the direct communication. Such is simple.
Please watch the following demonstration:
One of operation demonstrations: aa
I P address 192.168.0.1
Subnet mask 255.255.255.0
AND operation
Transforms carries on the operation for the binary system:
I P address 11000000.10101000.00000000.00000001
Subnet mask 11111111.11111111.11111111.00000000
AND operation
11000000.10101000.00000000.00000000
Transforms after the decimal base is:
192.168.0.0
Second operation demonstration:
I P address 192.168.0.254
Subnet mask 255.255.255.0
AND operation
Transforms carries on the operation for the binary system:
I P address 11000000.10101000.00000000.11111110
Subnet mask 11111111.11111111.11111111.00000000
AND operation
11000000.10101000.00000000.00000000
Transforms after the decimal base is:
192.168.0.0
Third operation demonstration:
I P address 192.168.0.4
Subnet mask 255.255.255.0
AND operation
Transforms carries on the operation for the binary system:
I P address 11000000.10101000.00000000.00000100
Subnet mask 11111111.11111111.11111111.00000000
AND operation
11000000.10101000.00000000.00000000
Transforms after the decimal base is:
192.168.0.0
Through above after three group of computer IP address and subnet mask AND operation, we may see it operates the result is the same. Is 192.168.0.0
Therefore the computer will regard as these three computers is the identical child network, will then carry on the communication. I the unit uses now the agent server, the internal network is plans like this.
Perhaps you must ask that actually such subnet mask did have how many IP address to be possible to use? You may calculate like this.
We may see according to above, the local area network internal ip address is we stipulates (with other ip address is certainly same), this is decides by the subnet mask through to 255.255.255.0's analysis. May obtain:
The first three IP code by the digit which assigns can only fix is 192.168.0, therefore only has been left over final one, then has been obvious, the ip address can only have (2 8 powers of exponent - 1), namely the 256-1=255 general lowliest place is 0 or is 255 has its special function.
Then you possibly must ask: If my subnet mask is not 255.255.255.0? You may also make the supposition your subnet mask are 255.255.128.0 like this
Then in your local area network's ip address's first two definitely were fixed
Thus, you may have a look in the identical subnet according to under computation to be able to have how many machines
1st, decimal base 128 = binary systems 1000 0000
2nd, the IP code must carry on and operation with the subnet mask
3rd,
I P address 11000000.10101000.1 *******. ********
Subnet mask 11111111.11111111.10000000.00000000
AND operation
11000000.10101000.10000000.00000000
Transforms after the decimal base is:
192. 168. 128. 0
4th, may know our intranet available IP address is:
11000000.10101000.10000000.00000000
11000000.10101000.11111111.11111111
5th, transforms for the decimal base:
192. 168.128.0 to 192. 168.255.255
6th, 0 and 255 usual achievement network internal special use. Usually does not use.
7th, therefore the final result is as follows: Our unit all available IP address is:
192.168.128.1 - 192.168.128.254
192.168.129.1 - 192.168.129.254
192.168.130.1 - 192.168.130.254
192.168.131.1 - 192.168.131.254
.
192.168.139.1 - 192.168.139.254
192.168.140.1 - 192.168.140.254
192.168.141.1 - 192.168.141.254
192.168.142.1 - 192.168.142.254
192.168.143.1 - 192.168.143.254
.
192.168.254.1 - 192.168.254.254
192.168.255.1 - 192.168.255.254
8th, the total is (255-128+1)*(254-1+1) =128 * 254 = 32512
9th, has a look the result is whether correct
(1)th, establishes the IP address is 192.168.128.1
Ping 192.168.129.233 through test
Visits http://192.168.129.233 to be possible to demonstrate the main page
(2)th, establishes the IP address is 192.168.255.254
Ping 192.168.129.233 through test
Visits http://192.168.129.233 to be possible to demonstrate the main page
10th, conclusion
Above proved that our conclusion is.
Now you may look that in your subnet could have how many machines
255.255.255.128
Decomposition: 11111111.11111111.11111111.1000000
Therefore your internal network's ip address can only be xxxxxxxx.xxxxxxxx.xxxxxxxx.0??????? To xxxxxxxx.xxxxxxxx.xxxxxxxx.01111111