Joke Collection Website - Cold jokes - How to set the calculation subnet mask
How to set the calculation subnet mask
These are my original works.
The following is from copy, paying high tribute to the author!
IP and subnet mask
As we all know, IP is composed of four numbers. Here, let's take a look at three commonly used IPS.
Class A IP segment 0.0.0 to 127.255.255.255.
Class B IP segments 128.0.0 to191.255.255.
Class c IP segment 192.0.0 to 223.255.255.255.
The default subnet mask of XP is only 255 or 0 per segment.
The default subnet mask for Class A is 255.0.0.0. A subnet can accommodate more than16.77 million computers at most.
The default subnet mask for Class B is 255.255.0.0. A subnet can accommodate up to 60,000 computers.
The default subnet mask for Class C is 255.255.255.0. A subnet can accommodate up to 254 computers.
I used to think that if I wanted to put several computers on the same network segment, as long as the first three segments of the IP were the same, today, I realized that I was wrong. If I say so, a subnet can only accommodate 254 computers? This is a joke. Let's be specific.
Want to be in the same network segment, as long as the logo is the same, how do you see the logo? The first thing to do is to convert the IP of each segment into binary. Some people say, I can't convert, it doesn't matter, we can just use the calculator that comes with Windows. Open the calculator, click View > Science Type, enter a decimal number, and then click the "Binary" radio point to switch to binary. )
Switching the subnet mask to binary, we will find that all subnet masks are composed of a series of [red] consecutive [/red] 1 and a series of [red] consecutive [/red] 0s (a ***4 segment with 8 bits each and a ***32 bit each).
255.0.0.0 1 1 1 1 1 1 1 1.00000000.00000000.00000000
255.255.0.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1.00000000.00000000
255.255.255.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1.00000000
This is the binary form of the A/B/C default subnet mask. In fact, there are many kinds of subnet masks, as long as it is a continuous string of 1 and a continuous string of 0 (8 bits per segment). For example,1111.11165438+. The subnet mask determines the number of computers in the subnet. The computer formula is 2 to the power of m, and here we can see that m is the number of zeros behind. Such as 255.255.255.0, that is,1111.11. 0111.0000000, followed by 8 zeros, so m is 8,255.255.0. This subnet mask can accommodate 2 to the power of 8, that is, 256 computers, but it cannot use two IPS, that is, the last segment cannot be 0 and 255. Let's make another one.
255.255.248.0 How many computers can this subnet mask hold?
Calculation method:
Convert to four binary numbers (8 bits in each segment, if it is 0, it can be written as 8 zeros, that is, 00000000).
1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1. 1 1 1 1 1000.00000000
Then, there are several zeros after the number. A * * with 1 1 is the second power of 1 1, which is equal to 2048. This subnet mask can accommodate up to 2048 computers.
How many computers can a subnet hold at most? You'll forget. Let's do a reverse algorithm.
A company has 530 computers to form a peer-to-peer LAN. What is the most appropriate subnet mask?
First of all, there is no doubt that Class B IP is most suitable for 530 computers (Class A is not ... >>
Question 2: How to calculate the subnet mask IP address is a 32-bit binary value, which is used to mark the address of each computer in TCP/IP communication protocol. Usually we use dotted decimal system, such as 192.5438+068.0.5 and so on.
Each IP address can be divided into two parts. That is, the network number part and the host number part: the network number indicates the network segment number to which it belongs, and the host number indicates the address number of the host in the network segment. According to the size of the network, IP addresses can be divided into five categories: A, B, C, D and E, among which A, B and C are the three main types of addresses, D is the multicast address used for multicast transmission, and E is used to expand the standby address. The valid range of class a, b and c IP addresses is as follows:
Category Network Number/Occupancy Host Number/Occupancy Purpose
A1~126/80 ~ 2550 ~ 2551~ 254/24 national level
B128 ~1910 ~ 255/160 ~ 2551~ 254/16 cross-organization.
C192 ~ 223 0 ~ 255 0 ~ 255/241~ 254/8 enterprise organization
With the continuous expansion of Internet applications, the disadvantages of the original IPv4 are gradually exposed, that is, the network number takes up too many places and the host number is too few, so the host address it can provide is becoming scarcer and scarcer. At present, in addition to using NAT to allocate reserved addresses within enterprises, a high-level IP address is usually subdivided into multiple subnets for users of different sizes.
The main purpose here is to effectively use IP addresses in the case of network segmentation. By using the high-order part of the host number as the subnet number, the subnet mask is expanded or compressed from the usual network bit boundary to create more subnets of a certain address. However, when more subnets are created, the number of available host addresses on each subnet will be less than before.
The subnet mask indicates whether two IP addresses belong to the same subnet, and it is also a 32-bit binary address. Its number per plant is 1, which means that this bit is the network bit, and 0 represents the host bit. Like an IP address, it is expressed in dotted decimal. If two IP addresses get the same result under the bitwise AND calculation of subnet mask, it means that they * * * belong to the same subnet.
When calculating the subnet mask, pay attention to the reserved addresses in the IP address, that is, the "0" address and the broadcast address. They refer to the IP addresses when the host address or network address are both "0" or "1", which represent the local network address and broadcast address, and generally cannot be counted.
Here is an example to illustrate the subnet mask algorithm:
For an IP address that does not need to be subnetted, its subnet mask is very simple, that is, according to its definition, it can be written as follows: If a class B IP address is 10. 12.3.0 and it does not need to be subnetted, then the subnet mask of this IP address is 255.255.0.0. If it is a Class C address, its subnet mask is 255.255.255.0. I won't repeat other analogies. What we are going to introduce below is an IP address, and its high host number needs to be used as the divided subnet network number, and the rest is the host number of each subnet. How to calculate the mask of each subnet at this time?
First, use the number of subnets to calculate.
Before finding the subnet mask, it is necessary to find out the number of subnets to be divided and the number of hosts required for each subnet.
1) converts the number of subnets into binary.
2) get the number of binary digits, which is n.
3) Obtain the subnet mask of the IP address, and set the first n bits of the host address part as 1 to obtain the subnet mask for subnetting the IP address.
To divide the class B IP address 168. 195.0.0 into 27 subnets:
1)27= 1 10 1 1
2) The binary number is five digits, and N = 5.
3) Put the first five digits of the host address of the subnet mask 255.255.0.0 of the class B address in 1 to get 255.255.248.0.
It is the subnet mask of Class B IP address 168. 195.0.0 divided into 27 subnets.
Secondly, the number of hosts is used for calculation.
1) converts the number of hosts into binary.
2) If the number of hosts is less than or equal to 254 (pay attention to remove the reserved two IP addresses), get the binary number of hosts, where ... >; & gt
Question 3: Knowing an IP address, how to calculate its subnet mask? Knowing only one IP cannot calculate its subnet mask; Just like an IP191.22.168.0; Unable to calculate the subnet mask fixed to it; The characteristic of network address is that the host number part is all 0; When the IP is converted into binary, it can be seen that its host number can be any one of 1 1-2, so its subnet mask can be 255.255.248.0 or 255.255.252.0; 255.255.255.252 There are many more;
Question 4: How to calculate the subnet mask? I want detailed steps. I am a novice. The following answers are original, not plagiarized. Answer your question in two parts.
First, the meaning of subnet mask and subnet division according to subnet mask
The IP address must belong to a network or subnet. Subnet mask is used to specify the network address of IP address, in other words, it is used to divide subnets.
For example, a class A network can accommodate 167772 14 hosts. However, in practice, Class A network can't be used for only one subnet, because it is inconvenient to manage, and there will be various problems such as broadcast storms, which need to be divided into several smaller subnets according to actual needs. A Class B network can accommodate 65,534 hosts and usually needs to be subnetted. Even in small enterprises, in order to meet the functional requirements between departments, it is necessary to configure which computers can access each other and which computers cannot access each other through subnetting.
The problem of subnetting seems to be very complicated, but it is not very complicated. As long as the concepts of the number of bits of IP address, the number of bits of network, the number of bits of host and the number of bits of subnet mask are clarified, it will be very simple.
IP address bits = network bits+host bits =32 bits. The number of bits in the subnet mask is the number of bits in the network.
The number of network bits of Class A network is 8, and the subnet mask is11111.000000000.0000000, which is converted into two.
The number of network bits of Class B network is 16, and the subnet mask is1111.1165438.
The number of network bits of Class C network is 24, and the subnet mask is11111.1165438. 38+011.000000, expressed in decimal as 255.255.255.0.
By extending the subnet mask to 16 bits, the class A network is divided into 256 networks with the same size as the class B network, and then each class B subnet is extended to 24 bits, which is divided into 256 subnets with the same size as the class C network. That's the truth. Large networks increase the number of network bits by extending the subnet mask, that is, the more networks, the more subnets.
Of course, you can divide it into 128, 64, 32, 16, 8, 4, 2 instead of 256 subnets.
The default subnet mask for Class B networks is 255.255.0.0. If it is to be divided into two subnets, the number of network bits will be 17, which means that the subnet mask will be 255.255. 128.0. I want to divide it into 16 subnets, because 16 is the fourth power of 2, so the number of network bits plus 4 becomes 20 bits, which means that the subnet mask becomes 20 bits, which is 255.255.240.0. And so on.
The default subnet mask of Class C network is 24 bits, so the host bits =32-24=8 bits, and the eighth power of 2 equals 256, so the number of IP addresses (including network addresses and broadcast addresses) of Class C network is 256.
However, you can still divide the Class C subnet into more subnets by extending the subnet mask. The number of subnets must be the n power of 2, and the number of IP in each subnet must be the (8- n) power of 2.
The subnet mask is lengthened by 1 bit to divide two subnets; Lengthen 2 bits, divide 4 subnets, lengthen 6 bits, divide 2 to the 6th power, that is, 64 subnets.
The number 1 in the subnet mask indicates the number of network bits. Simply put, the network bit is not yours, it is given to you by the superior supervisor. But you can control the host bit. You can shorten it and add the shortened bits to the network bits, so that the network bits will be longer, the number of subnets will be more, and the corresponding IP number of each subnet will be less.
Remember the following formula, no matter how complicated the subnet problem is, it won't bother you.
Number of IP address bits =32
Network bit+host bit =32
If the subnet mask is lengthened by n bits, it will be divided into n 2 subnets on the basis of the current subnet. Number of IP addresses per subnet = 2(32- number of subnet mask bits before dividing by n)
Second, how to calculate subnet mask according to the goal of subnet division
Simply put, the subnet mask is the number of bits of the network address.
The IP address * * * has 32 bits, the first few bits indicate the network address ... >; & gt
Question 5: Knowing the IP address, how to calculate the subnet mask? Suppose that five departments allocate 50 computers on average, and each department has 10 computers. According to the subnetting rules, the fourth power of 2 minus 2 is equal to 14,14 >; 10 is ok. So the ip address is: 209.205438+0.202.16-209.205438+0.202.36438+0/28, the first host address, the last broadcast address, 209.438+0.202.32-. . . . . . . . . . . . . . . . 209.20 1.202.48-209.20 1.202.63/28 .。 . . . . . . . . . . . . . . . Add it yourself below.
Question 6: Know how to calculate the subnet mask of IP addresses and numbers. The IP address and subnet mask in each network segment are 8-bit binary, in which * * * is 32 bits.
/28 means the first 28 1 and the last 4 0s.
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 / kloc-0/ 1 1 1 165 438+0 1 1 1 1 1 10000 - 255.255.255.240
Question 7: Do you know how to calculate the subnet mask and default gateway of ip? We all know the IP and subnet masks of more than 255 computers. IP consists of four numbers. Here, let's take a look at three commonly used IPS.
Class A IP segment 0.0.0 to 127.255.255.255.
Class B IP segments 128.0.0 to191.255.255.
Class C IP network segments 192.0.0 to 223.255.255.255 XP have a default subnet mask of only 255 or 0.
The default subnet mask for Class A is 255.0.0.0. A subnet can accommodate more than16.77 million computers at most.
The default subnet mask for Class B is 255.255.0.0. A subnet can accommodate up to 60,000 computers.
The default subnet mask for Class C is 255.255.255.0. A subnet can accommodate up to 254 computers. I used to think that if you want to put several computers on the same network segment, as long as the first three segments of the IP are the same. Today, I realized that I was wrong. If I say so, a subnet can only accommodate 254 computers? This is a joke. Let's be specific. Want to be in the same network segment, as long as the logo is the same, how do you see the logo? The first thing to do is to convert the IP of each segment into binary. Some people say, I can't convert, it doesn't matter, we can just use the calculator that comes with Windows. Open the calculator, click View > Science Type, enter a decimal number, and then click the "Binary" radio point to switch to binary. ) Switch the subnet mask to binary, and we will find that all subnet masks are composed of a series of [red] consecutive [/red] 1 and a series of [red] consecutive [/red] 0s (a ***4 segment with 8 bits each and a ***32 bit each).
255.0.0.0 1 1 1 1 1 1 1 1.00000000.00000000.00000000
255.255.0.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1.00000000.00000000
255.255.255.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1.00000000
This is the binary form of the A/B/C default subnet mask. In fact, there are many kinds of subnet masks, as long as it is a continuous string of 1 and a continuous string of 0 (8 bits per segment). For example,1111.11165438+. The subnet mask determines the number of computers in the subnet. The computer formula is 2 to the power of m, and here we can see that m is the number of zeros behind. Such as 255.255.255.0, that is,1111.11. 0111.0000000, followed by 8 zeros, so m is 8,255.255.0. This subnet mask can accommodate 2 to the power of 8, that is, 256 computers, but it cannot use two IPS, that is, the last segment cannot be 0 and 255. Let's make another one.
255.255.248.0 How many computers can this subnet mask hold?
Calculation method:
Convert to four binary numbers (8 bits in each segment, if it is 0, it can be written as 8 zeros, that is, 00000000).
1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1. 1 1 1 1 1000.00000000
Then, there are several zeros after the number. A * * with 1 1 is the second power of 1 1, which is equal to 2048. This subnet mask can accommodate up to 2048 computers.
How many computers can a subnet hold at most? You'll forget. Let's do a reverse algorithm.
A company has 530 computers to form a peer-to-peer LAN. What is the most appropriate subnet mask?
First of all, there is no doubt that Class B IP is most suitable for 530 computers (needless to say, Class A is too many, and Class C is not enough, so it must be Class B), but the default subnet mask of Class B is 255.255.0.0, which can accommodate 60,000 computers. Obviously, this is inappropriate ... >>
Question 8: What is the function of subnet mask and how to set subnet mask? Subnet mask is the basis for judging whether the IP addresses of any two computers belong to the same subnet.
The simplest understanding is that after AND operation of IP addresses and subnet masks of two computers,
If the results are the same, it means that the two computers are in the same subnet.
Can communicate directly. It's that simple.
Please look at the following example:
One of the operation demonstrations:
I P address 192 5438+068.0.6438+0.
Subnet mask 255.255.255.0
And operation
Convert to binary for operation:
I P address11010000.1010000005
Subnet mask11111.1165438.
And operation
1 1000000. 10 10 1000.00000000.00000000
After conversion to decimal, it is:
192. 168.0.0
The second operation demonstration:
I P address 192 438+068.0.254.
Subnet mask 255.255.255.0
And operation
Convert to binary for operation:
I P address11010000.1010000000.165438+
Subnet mask11111.1165438.
And operation
1 1000000. 10 10 1000.00000000.00000000
After conversion to decimal, it is:
192. 168.0.0
The third operation demonstration:
I P address 192 5438+068.0.4
Subnet mask 255.255.255.0
And operation
Convert to binary for operation:
I P address11010000.1010000008
Subnet mask11111.1165438.
And operation
1 1000000. 10 10 1000.00000000.00000000
After conversion to decimal, it is:
192. 168.0.0
Through the above AND operation of IP addresses and subnet masks of three groups of computers, we can see that
Its operation result is the same. Both are 192 5438+068.0.0.
So the computer will regard these three computers as the same subnet and then communicate with each other.
The internal network of the proxy server used by our company is planned in this way.
Maybe you have to ask again, how many IP addresses can be used for this subnet mask?
You can count it this way.
According to the above, we can see that the ip address inside the LAN is stipulated by ourselves (of course, there are also
Other ip addresses are the same), which is determined by the subnet mask.
Through the analysis of 255.255.255.0. It can be concluded that:
The first three digits of the IP code can only be fixed as 192.5438+068.0 by the allocated digits.
So there's only one person left,
Then it is obvious that the ip address can only be (2 to the eighth power-1), which is 256- 1=255.
Generally, those with the last digit of 0 or 255 have their special functions.
Then you may have to ask
What if my subnet mask is not 255.255.255.0?
You can do the same.
Suppose your subnet mask is 255.255. 128.0.
Then the first two digits of the ip address in your LAN must be fixed.
What? Why is it fixed? Didn't you see it up there? ? #¥)
In this way, you can follow the following calculation to see what you can do in the same subnet.
How many machines are there?
1, decimal 128 = binary 1000000.
2, IP code and subnet mask and operation.
3、
I P address 00010000.01.1* * * * * * ... >>
Question 9: How to calculate subnet mask and subnet division? The IP address * * * is a 32-bit dot, and the dot represents an 8-bit dot. For example, the subnet mask of network segment`192.168.1.0 is 255.255.0. You should be able to see that his subnet is a 24-bit point. 8+8+8+0 =24 (corresponding to 255.255.255.0 above). For example, the subnet mask of 255 is actually an 8-bit number, and its 8-bit number is1286432168421. You can calculate it. Does it add up to 255? If it is a network segment like192.168.1.1/24. You can tell at a glance that the network ID (that is, the network segment you belong to) is192.168.1.0. What if it is192.168.1/26? Do you think his subnet mask number 26 is equal to 8+8+8+2=26? What is his subnet mask? Insert 8+8+8+2 and the written data given to you above, and analyze an 8-bit =127+64+32+16+8+4+2+1= 255. What about two people? He is equal to 127+64= 192 (remember. The number of digits should be increased from the big net. ) if it is 3 digits, that is, 127+64+32=224, then the subnet mask of192.168.1/26t is 255.50000.00000066666 Can you work out the subnet mask192.168.1.1/28? Now let's take a look at the network number, the so-called network bit, which is divided by subnet192.168.1.0/26. Look, his subnet is 26 bits, and his subnet mask is 255.255.255. 192. Do you remember how it was 192? 127+64' hehe'' Tell me the simplest way to divide network bits'' As long as the last bit borrowed from the last 8 bits of his subnet mask is used as the network bit, his subnet is 26 bits. . That is to say, there are two excuses. It is mentioned above how the 8-bit 255 between points is obtained (127+64+0+0+0 =192). Network bits can also be obtained by adding the power of the value of the last bit you borrowed. Ok, then the network bits can be easily divided. 192.168.1.0/26192.1.64/26192./kloc The four subnets are divided by192.168.1.0/26. The number between one network bit and the next is the number of hosts that can be accommodated in the subnet. 192.168.1.192.168.1.2 = = These are the number of hosts in the first network bit, and the last IP in the first network bit is/. And192.168.10.64 His broadcast bit is192.168.1. Are you clear? You'd better read relevant books, all of which have detailed introductions.
Question 10: How to calculate the subnet mask of192.168.0.1/24? 24 indicates that the subnet mask is 24 bits. That is, the subnet mask is 255.255.255.0. How to calculate it? Actually it's very simple.
We represent 255.255.255.255 as binary:111111. 5438+01111.111. 1 1. 1 1 165438。 438+011.0000000. Convert this into 10 base subnet mask, which is: 255.255.0. Just remember that /24 converts its binary from the left to 24 1 and then to decimal.
- Related articles
- What's the name of a Cantonese song "I just want you to know what you know"? The man sang ``.
- "Dalang, it's time to take medicine." When Wu Zhi woke up, he suddenly found a charming man in front of him.
- Why do you always say exo is not harmonious? There are always people who say that Bai was isolated and excluded first. I'm going crazy. . . .
- An honest joke
- Interesting talk show script recommendation
- Anime lovers, what animation is better? What do you recommend?
- When Degang Guo first praised Yun-peng Yue, was Sun Yue his partner?
- What about Wuxi Hairun Photovoltaic Technology Co., Ltd.? Evaluate
- Ask for a Japanese New Year greeting joke, preferably a jingle, a short sentence and a little rhyme. By the way, type Chinese characters under a pseudonym, thank you.
- Today is the beginning of winter. How cold is it in your home?