Thorough understand the IP address

xiaoxiao2021-03-06  49

Understand thoroughly the IP address of: burden Source: CCID

I. Introduction to the IP address 1, the IP address representation IP address = INTM host number puts the entire Internet network, the IP address is to assign one of the hosts in the Internet network. The only marker, the Internet Management Committee defines the 5 types of addresses A, B, C, D, E E, in each type of address, the network number and host number are specified. In the TCP / IP protocol, the IP address is in the form of binary digital, with a total of 32bit, 1 bit is 1 binary in binary, but this form is very unsuitable for people reading and memory. Therefore, the Internet Management Committee decided to use a "point division decimal representation" to represent an IP address: in a user-oriented document, 32-bit IP addresses consisting of four sections are intuitive as four decimal integers separated by polka dot. Where each integer corresponds to one byte (8 bits are called one byte). The most common use of A, B, Class C, hereby introduced. This article describes the IP address of version 4, called IPv4.

As can be seen from the above: ● Class A address: The network identity of the Class A address is represented by the first set of 8-bit binary numbers, and the class A address is characterized by the first binary number of the network identity must be "0". It is not difficult to calculate, the first address of the Class A address is 00000001, the last address is 01111111, the conversion into a decimal is 127, where 127 is left to reserve the address, the first segment of the A class address is: 1 ~ 126, class A address Allow 27 -2 = 126 network segments (reduced 2 is because 0 is not used, 127 is allowed to use), the host identifier in the network accounts for 3 groups of 8 binary numbers, each network is allowed to have 224-2 = 16777216 (Dimension 2 is because the full 0 address is the network address, all 1 for the broadcast address, which is generally not assigned to the host). Usually assigned to a network with a large number of hosts. ● Class B address: The network ID of class B address is represented by the first two sets of 8-bit binary numbers. The host identifier in the network accounts for two groups of 8-bit binary numbers. The B-class address is characterized by the first two binary values ​​of the network identity. Must be "10". The first address of the class B address is 10000000. The last address is 10111111. The first segment of the 10-based B-class address is 128 ~ 191. The class B address allows 214 = 16384 network segments, the host ID in the network accounts for 2 Group 8-bit binary numbers, each network allows 216-2 = 65533 mainframes, suitable for networks with more nodes. ● Class C Address: The network identity of Class C addresses is represented by the first 3 groups of 8-bit binary numbers. The host identifies 1 set of 8-bit binary Class C addresses in the network is that the top 3 binary number of network identities must be "110". The first address of the C class address is 11000000. The last address is 11011111, the first segment of the decimal Class C address is from 192 to 223, the C class address allows 221 = 2097152 network segments, the host ID in the network accounts for 1 Group 8-bit binary numbers, each network allows 28-2 = 254 hosts, suitable for networks with less nodes. Some people are not understood by 2X, and a simple example will be explained. Such as C-network, each network allows 28-2 = 254 hosts. Because the host of C-network is 8 bits, the changes are as follows: 000000000000111 00000010 00000011 ... 11111110 11111111 None 聽 0000000 and 11111111 Unexpected, 254 variations from qi and 11111110, that is, 28-2. The following figure is the range of use of IP addresses. Network Category Maximum Network Number The first available network number The last available network number Each network A126 (27-2) 112616777214B16384 (214) 128.0191.2556534C2097152 (221) 192.0.023.25555254

2, several special IP addresses 1) The private address mentioned above the IP address is unique worldwide. Seeing this sentence you may have such questions, like 192.168.0.1, the address like 192.168.0.1 can see many places Not only, why? The Internet Management Committee stipulates that the following address segment is a private address, private address can be used by the network, but cannot be used online, the Internet network does not have the route of these addresses, and the computer with these addresses must be connected to the legal IP address, Also known as public information, this is like there are many world parks, you can name the same streets in each park, such as Champs Elysées, but we can only see the address of the park and the true Champs Elysées. Shest Street. Here are private address segments in the A, B, C network. You can use these addresses when you have your own network. 10.0.0.0 ~ 10.255.25.0-172.131.0-9255 192.168.0.0-92.168.255.255 2) The return address A-class network address 127 is a reserved address for network software testing and local machine processes, called return addresses. Loopback address. Regardless of the program, once the return address is used, the protocol software returns now, and no network transmission is not performed. Packets with INT 127 cannot appear on any network. [Tips] ● ping 127.0.0.1, if the feedback information fails, the IP protocol stack is wrong, and the TCP / IP protocol must be reinstalled. If successful, ping the native IP address, if the feedback information fails, indicating that your network card cannot communicate with the IP protocol stack. ● If the network card does not pick up the network cable, use some of the services such as SQL Server, IIS, etc., can use 127.0.0.1 this address. 3) Broadcast address TCP / IP regulations, the host number is "1" network address is used for broadcasting, called broadcast addresses. The so-called broadcast refers to sending messages to all hosts from the same subnet. 4) Network address TCP / IP protocol regulations, all network numbers that are all "0" are interpreted as "this" network. It can be seen from the above: (1) Packet containing the network number 127 cannot appear on any network; (2) The host and gateway cannot broadcast any find information for the address. It can be seen from the above provisions that the host number "0" "1" address has special meanings in the TCP / IP protocol, which is generally not used as a valid address of a host. 3, the subnet mask can be seen from the above example, the role of the subnet mask is to draw the network address after the IP address and the operation, the subnet mask is also 32bit, and it is a string 1 followed by a string of 0 Where 1 indicates the number of bits corresponding to the network number in the IP address, and 0 represents the number of bits corresponding to the host in the IP address. 1) Standard subnet mask A network (1 ~ 126) Default subnet mask: 255 · 0 · 0 · 0 255 · 0 · 0 · 0 conversion into binary to 111111 · 000,000 · 000,000 · 00000000 can be clear It is seen that the first 8 is the network address, then 24 bits are host addresses, that is, if used, it is a standard subnet mask, see if it is the same network. As 21.0.0.0.1 and 21.240.230.1, the first paragraph belongs to a class A, if used by the default subnet mask, the two addresses are a network segment.

Class B network (128 ~ 191) Default subnet mask: 255 · 255 · 0 · 0 C network (192 ~ 223) Default subnet mask: 255 · 255 · 255 · 0 B, Class C analysis Ibid. 2) Special subnet mask standard subnet mask is a combination of 255 and 0, and there is a subnet mask 255 · 128 · 0 · 0 255 · 192 · 0 · 0, in practice. ... 255 · 255 · 192 · 0 255 · 255 · 240 · 0 ... 255 · 255 · 255 · 248 255 · 255 · 255 · 252 What does these subnet mask do? The appearance of these subnet masks is to divide a network into multiple networks. Remember the above example? As shown below: 192 · 168 · 0 · 1 and 192 · 168 · 0 · 200 If it is the default mask 255.255.255.0 The two addresses are a network, if the mask becomes 255.255.255.192, the addresses are not one Internet. The subnet division below will be described in detail. 192.168.0.111000000.10101000.00000000.00000001192.168.0.20011000000.10101000.00000000.11001000255.255.255.011111111.11111111.11111111.00000000192.168.0.111000000.10101000.00000000.00000001192.168.0.20011000000.10101000.00000000.11001000255.255.255.19211111111.11111111.11111111.11000000

The following table is a very useful decimal and binary comparison during several subnet mask computing.

The subnet mask for the equivalent decimal and binary decimal 1286432168421 control 1000000001000000001000000001000000001000000001000000001000000001 common subnet mask binary and decimal binary decimal 128192224240248252254255 binary control 1000000011000000111000001111000011111000111111001111111011111111

Second, thorough understanding the meaning of the IP address, whether it is learning the network or the Internet, the IP address is a very high frequency. The interface for setting the IP address in the Windows system is shown in the figure below. The IP address, subnet mask, default gateway, and DNS servers need settings, only correct settings, the network can pass, that these nouns What does it mean? If you learn about the IP address, you will also encounter the concept of network address, broadcast address, and subnet. What do you mean?

To answer these questions, look at an example in your daily life. As shown in the figure below, the households living in the North Street must find each other to find each other. They must have a house number. This house number is the address of each home, the number of house numbers is: North Street XX. If the residents are to be hung by Households, the process is like this, and the No. 1 shouted on the street: "Who is No. 6, please answer." At this time, the households in North Street have heard, but only 6 Answer, this shouting process is "broadcast", all users of North Street are his broadcast range, and there are 20 users in North Street, and the broadcast address is: No. 21 North Street. In other words, any user of the North Street calls a "broadcast address -1" user to hear.

From this example, you can take the following words: street address: North Street, if an address is given to the street, use the first resident's address -1, this example is: No. 0, North Street: No. 1, No. 2 et al. Address: Street Address XX, Sui North Street No. 1, North Street 2, etc., etc. There is an address like the above example. This address is the IP address, which is the house number assigned to the network device. For the computer in the network, the IP address = network address host address, the IP address in Figure 1 is 192.168. 100.1, this address contains many meanings. As shown below: Network Address (equivalent to the street address): 192.168.100.0 Host address (equivalent to the gate number of each household): 0.0.0.1 IP address (equivalent to the household address): Network address host address = 192.168.100.1 Broadcast Address: How is these addresses calculated? Why calculate these addresses? To know how, you must understand a truth. How to learn the network in the network, that is to say to learn and understand the concept of "Tong", not only for the back Several nouns. Note: 192.168.100.1 is a private address, it is not possible to apply directly in the Internet network, and the Internet is converted to public addresses, which will be described in detail below. 1. Why do you calculate a network address is that a computer in your network can communicate with each other. Let's take a look at the easiest network. The following picture is directly connected to the two computers directly. Below is a few IP address settings, see if the network in different settings is or not. 1) Set the IP address of the No. 1 machine to 192.168.0.1 subnet mask of 255.255.2555.0, 2, the IP address of 192.168.0.200 Subnet mask is 255.255.255.0, which can communicate normally. 2) If the 1st machine address is unchanged, the IP address of the No. 2 machine is changed to 192.168.1.200 subnet mask or 255.255.255.0, then the two cannot communicate. 3) Set the IP address of the No. 1 machine to 192.168.0.1 subnet mask is from 255.255.255.192, the IP address of the 192.168.0.200 subnet mask is 255.255.255.192, pay attention to the difference between the first situation is Subnet mask, 1 is 255.255.255.0 This example is 255.255.255.192 These two computers can communicate normally. The first case is perceived because the two computers are in the same network 192.168.0.0, so it can pass, and two computers in different networks in 2, 3 cases, so it is not.

Here, give a conclusion: a computer directly connected to a network or an indirect connection between Hub or a normal switch, the computer must be in the same network, that is, their network addresses must be the same, and the host address must Different. If it is not in a network, it will not pass. This is like the examples we have, the same is that the resident of North Street is the North Street because the street name is the North Street, and the number of house numbers can be found, so they can find each other.

The calculation network address is to determine that the computer in the network is not in the same network, and it can pass, it will not pass. Note that it is said that the IP address is not in the same network instead of physical connection. So how do you calculate? 2, how to calculate the network address

The address in our daily life is: No. 1 North Street, you can see the street address from the literals is North Street, but we are difficult to see the network address from the IP address. To calculate the network address, we must use us to mention it. The subnet mask.

The calculation process is such that the IP address and subnet mask are converted into binary, then perform and calculate, the result is the network address. As shown below, the above alignment, 1 bit 1 bit, 1 and 1 = 1, the remaining combinations are 0.

1 ... 0 ... 1 ... 0

1 ... 0 ... 0 ... 0

With the operation ________________

1 ... 0 ... 0 ... 0

For example, the IP address is: 202.99.160.50 Subnet mask is 255.255.255.0 network address steps as follows:

1) Convert the IP address and subnet mask to binary

202.99.160.50 Conversion into binary is 11001010 · 01100011 · 10100000 · 00110010

255.255.255.0 Conversion into binary is 1111111 · 11111111 · 1111111 · 00000000

2) Make two

11001010 · 01100011 · 10100000 · 00110010

11111111 · 11111111 · 11111111 · 00000000

With the operation _____________________________________

11001010 · 01100011 · 10100000 · 00000000

3) Change the calculation result into a decimal, which is the network address.

11001010 · 01100011 · 10100000 · 00000000 Conversion into Ten Become is 202.99.160.0

Now we can answer the passions of the above three situations.

1. From the following operation results, it can be seen that the network address of the two computers is 192.168.0.0 and the IP address is different, so it can be passed.

192.168.0.1 11000000.10101000.00000000.00000001

255.255.255.0 111111111111111111111111111111.11111111111111.1111111111111.1111111111111.1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)

With the operation ____________________________________________________

192.168.0.0 11000000.10101000.00000000.00000000

192.168.0.200 11000000.10101000.00000000.11001000

255.255.255.0 111111111111111111111111111111.11111111111111.1111111111111.1111111111111.1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)

With the operation ____________________________________________________

192.168.0.0 11000000.10101000.00000000.00000000

2. From the following operation results, you can see the network address of 192.168.0.0, and No. 19 network address is 192.168.1.0 is not in a network, so it is not.

192.168.1.200 11000000.10101000.00000001.11001000

255.255.255.0 111111111111111111111111111111.11111111111111.1111111111111.1111111111111.1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)

With the operation ____________________________________________________

192.168.1.0 11000000.10101000.00000001.000000003, from the following operation results, the network address of the No. 1 machine is 192.168.0.0, and the network address is 192.168.0.192 is not in a network, so it is not

192.168.0.1 11000000.10101000.00000000.00000001

255.255.255.192 11111111.11111111.11111111.11000000

With the operation ____________________________________________________

192.168.0.0 11000000.10101000.00000000.00000000

192.168.0.200 11000000.10101000.00000000.11001000

255.255.255.192 11111111111111111.11111111.00000000

With the operation ____________________________________________________

192.168.0.182 11000000.10101000.00000000.11000000

I believe that this should understand why calculating the network address and how to calculate, but may have a lot of questions, why is the IP address written in this, the subnet mask is going to work, etc., don't worry, let's introduce it.

Third, calculate the related address - You can calculate the IP address and subnet mask by IP address and subnet mask and calculation calculations.

● Network address

● Broadcast address

● Address range

● There are several hosts in this website.

[Example 1] The following example IP address is 192 · 168 · 100 · 5 subnet mask 255 · 255 · 255 · 0. Calculate the network address, broadcast address, address range, and the number of hosts.

1. Sub-step calculation 1) Convert IP address and subnet mask to binary, subnet mask continuously 1 is the network address, which is the host address. Before the dotted line is the network address, the host address is the host address.

192.168.100.5 11000000.10101000.01100100.

00000101

BAI JOURNAL OF ANITATION ELECTRONICS.

00000000

2) The IP address and subnet mask are made and calculated, the result is the network address

192.168.100.5 11000000.10101000.01100100.

00000101

BAI JOURNAL OF ANITATION ELECTRONICS.

00000000

With the operation ____________________________________________________

The results were: 192.168.100.0 11000000.10101000.01100100.

00000000

3) The part of the network address in the above network address is constant, the host address is all 1, and the result is the broadcast address.

The network address is: 192.168.100.0 11000000.10101000.01100100.

00000000

____________________________________________________________________

Get the host address to all 1

The broadcast address is: 192.168.100.255 11000000.10101000.01100100.

11111111

4) The address range is to contain all hosts in this network segment.

Network address 1 is the first host address, the broadcast address -1 is the last host address, whereby the address range is: Network Address 1 to Broadcast Address-1

The network range of this example is: 192 · 168 · 100 · 1 to 192 · 168 · 100 · 254

That is to say, the following address is a network segment.

192 · 168 · 100 · 1, 192 · 168 · 100 · 2 ... 192 · 168 · 100 · 20 ... 192 · 168 · 100 · 111 ... 192 · 168 · 100 · 254

5) The number of hosts

The number of hosts = 2

Binary host bits -2

Dimension 2 is because the host does not include network addresses and broadcast addresses. This example is 8 bits.

The number of hosts = 2

8-2 = 254

2, the overall calculation We set up the examples of the upper side to calculate the process as follows:

192.168.100.5 11000000.10101000.01100100.

00000101

BAI JOURNAL OF ANITATION ELECTRONICS.

00000000

2) The IP address and subnet mask are made and calculated, the result is the network address

192.168.100.5 11000000.10101000.01100100.

00000101

BAI JOURNAL OF ANITATION ELECTRONICS.

00000000

With the operation ____________________________________________________

The result is a network address: 192.168.100.0 11000000.10101000.01100100.

00000000

____________________________________________________________________

The part of the network address in the result is constant, the host address is all 1

The result is a broadcast address: 192.168.100.0 11000000.10101000.01100100.

11111111

The number of hosts:

28-2 = 254

The address range is: Network Address: 192.168.100.0 ...... broadcast address is: 192.168.100.255

The address range of the host is: Network address 1: 192.168.100.1 ...... broadcast address is: 192.168.100.254

[Example 2] IP address is 128 · 36 · 199 · 3 subnet mask is 255 · 255 · 240 · 0. Calculate the network address, broadcast address, address range, and the number of hosts.

1) Convert IP address and subnet mask to binary, the subnet mask continuously 1 is the network address, which is the host address, the dashed line is the network address, and the host address is the host address.

128 • 36 • 199 • 3 10000000 • 00100100 • 1100

0111 00000011

255 • 255 • 240 • 0 11111111 • 11111111 • 1111

0000 00000000

2) The IP address and subnet mask are made and calculated, the result is the network address

128 • 36 • 199 • 3 10000000 • 00100100 • 1100

0111 00000011

255 • 255 • 240 • 0 11111111 • 11111111 • 1111

0000 00000000

With the operation ____________________________________________________

The result is the network address: 128 • 36 • 192 • 0 10000000, 00100100 • 1100

0000 00000000

3) The network address in the calculation result is unchanged, the host address becomes 1, and the result is the broadcast address.

128 • 36 • 192 • 0 10000000 • 00100100 • 1100

0000 00000000 _________________________________________________________________________________________________

Broadcast Address: 128 • 36 207 • 255 10000000 • 00100100 • 1100

1111 11111111

4) The address range is to contain all hosts in this network segment.

Network address 1 is the first host address, broadcast address -1 is the last host address, thereby

This example of the network range is: 128 • 36 • 192 • 1 to 128 • 36 • 207 • 254

5) The number of hosts

The number of hosts = 2

Main unit of binary digits - 2 = 2

12-2 = 4094

From the above two examples, it can be seen that no matter the net mask is standard or special, when the network address, the broadcast address, the number of addresses will be converted into binary, and then it is clear from the subnet mask. The network address, it is the corresponding calculation after the host address. (to be continued)

转载请注明原文地址:https://www.9cbs.com/read-56181.html

New Post(0)