Joke Collection Website - Joke collection - Everybody help me come in and watch.

Everybody help me come in and watch.

Let me give you an example: (the same reason)

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 that 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 (needless to say, there are too many Class A and not enough Class C, 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, it is not suitable. What is an appropriate subnet mask? Let's make a formula first

M power of 2 = 560

First of all, we make sure that 2 must be greater than the eighth power, because we know that the eighth power of 2 is 256, which is the maximum number of computers in class C IP. Let's start with the ninth power and try one by one. The ninth power of 2 is 5 12, and the power of 10 less than 560 is 1024. It seems that the power of 10 of 2 is the most appropriate. The subnet mask 1 * * consists of 32 bits, and the last 10 bit has been determined to be 0, so the first 22 bits are1. The most suitable subnet mask is11111.165438+. +0 1 100.000000, converted to 10, is 255.255.252.0.

Can you assign and calculate subnet masks? Let's look at the network segments of IP addresses.

I believe many people think that as long as the first three paragraphs are the same, IP is in the same network segment. Actually, it's not. Similarly, I convert every segment of IP into a binary number, where I take IP:192.168.0.1and the subnet mask: 255.255.

192. 168.0. 1

1 1000000. 10 10 1000.00000000.0000000 1

(Note here that, just like the subnet mask, each segment has 8 bits. If it is less than 8 bits, it is completed by adding 0 in front. )

IP 1 1000000. 10 10 1000.000000 1

Subnet mask11111.1165438.

Here, I want to tell you what exactly is the same network segment.

If you want to be on the same network segment, you must have the same network identification. How to calculate the network logo? The network identification algorithms of various IP are different. Class a, only the first paragraph. Class b, only the first and second paragraphs. Category C, paragraphs 1, 2 and 3.

The algorithm only needs to add each bit of IP and subnet mask.

And methods: 0 and 1 = 0 0 and 0 = 0 1 and 1 = 1.

For example: and192.168.0.1,255.255.0, first convert to binary, and then compare with you.

IP 1 1000000. 10 10 1000.000000 1

Subnet mask11111.1165438.

AND the result is1100000.1010000001

Converted to decimal 192. 168.0.0, it is the network logo.

Then reverse the subnet mask, that is, 0000000000.0000000.11111165438.

The result is 000000000.00000000.000000.0000001,which is converted to 10, that is, 0.0.0. 1.

This 0.0.0. 1 is the host identifier. If you want to be on the same network segment, you must have the same network identification.

Let's take a look at this class B IP that has been changed to the default subnet mask.

For example, IP:188.188.0.1,188. 188.5.222, and the subnet mask is set to 255.255.254 ..

First, convert these into binary.

188. 188.0. 1 1 1 10 1 1 1 100. 10 1 1 1 1 00.00000000.0 1 10 1 1 1 1

188. 188.5.222 10 1 1 1 100. 10 1 1 1 100.00000 10 1. 1 10 1 10 10

255.255.254.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 10.00000000

Separate and then get

10 1 1 1 100. 10 1 1 1 100.00000000.00000000

10 1 1 1 100. 10 1 1 1 100.00000 100.00000000

The network identification is different, that is, it is not in the same network segment.

Judge whether you are in the same network segment, and you will know. Next, let's do something practical.

A company has 530 computers to form a peer-to-peer LAN. What is the most appropriate subnet mask and IP setting?

Forgot the subnet mask, the previous result was111111.165438.

What we need to determine now is how to allocate IP. First, select a Class B IP segment, and here select/kloc-0 188.6438+088.x.x

In this way, the key to determine the first two paragraphs of IP is to determine the third paragraph, as long as the network identification is the same. Let's confirm the network number first. (We put 1 in the subnet mask, and then? Right, get up, 0 and * correspond, as follows:)

255.255.252.0 1 1 1 1 1 1 1 1. 1 1 1 1 1 1 1 1. 1 1 1 1 1 100.00000000

188. 188 . x . x 10 1 1 100. 10 1 1 1 1 100。 ? **.********

Network id101100.101100. 00.00000000

So,? Just fill in (only 0 and 1, not all 0 and 1), so let's just fill in all 0 and *, so our IP is.

1 0111011100.000000. In this way, we have determined that the third segment of IP should be divided into three different numbers, that is to say, if the * * in 000000** is filled in three times, only 1 and 0 can be filled in, and the numbers are different each time. As for what to fill in, 000000 1 1 is converted into binary, which are 1, 2, 3 respectively. In this way, the third paragraph is confirmed. In this way, IP can be divided into188.188.1.y, 65438+.