IP address, subnet mask, default gateway, preferred DNS server, and backup DNS Server
IP address
The IP address is the identifier used by the computer in the network when accessing the Internet. This identifier is unique globally. The IP address consists of the network address and host name, the specific partitioning method is determined by the subnet mask.
Subnet Mask
A subnet mask is a group of numbers used to parse network addresses from IP addresses. The most common subnet mask is 255.255.255.0. What does it mean. First, we can see that the subnet mask is written in decimal format. The above is, we need to first convert it into a binary format, then the above subnet mask is
11111111.111111.1111111111.00000000
This is much clearer. The first 24 digits produced by the 32-bit binary notation are the network address of the IP address, if the network address of the two computers is the same and the host address is different, the two computers are in the same network (for example, our most common situation: the first three digits of the IP address are the same, the last one is different, and the subnet mask is 255.255.255.0.
When the subnet mask is 255.255.255.0, the first 24 digits generated by the resolved IP address are the network address. Therefore, the host address can only be 256 from 0-255, that is, the internal network capacity is 256. In some campus networks, the network capacity may be larger than 256, so its subnet mask can be 255.255.0.0, that is to say, the first 16 digits parsed by the IP address of the campus are the network address of the campus network, and the last 16 digits are the Intranet capacity of the campus network, A total of 4096 machines, that is, machines, can meet the needs of the campus network.
Default Gateway
First, you need to understand the gateway. If a computer wants to send data to or accept data from the network, it must pass through the gateway. It is like a person who wants to go out to visit a friend must go out of his home (his own gateway) and enter his home (his gateway ). However, a computer can have many gateways, that is, there are many ways to access the Internet. Among these gateways, you need to set a default gateway. When you send data packets to the network through a computer, if no available gateway is found, the data packets will be sent to the default gateway. The default gateway can be a server address or a router address. Generally, set the parameter based on your actual situation.
Preferred DNS server and backup DNS Server
DNS is the Domain Name System, which can also be called the Domain Name resolution System. It consists of a parser and a Domain Name Server. The server saves the domain names of all hosts in the network and their corresponding IP addresses. When we enter a website name, the domain names of the website are entered, the main function of the parser is to convert the domain name to the IP address corresponding to the domain name on the Domain Name Server. For example, if we enter www.baidu.com through the Internet, we need the domain name resolution System (DNS) to parse www.baidu.com into the IP address of the Baidu website, and then find the IP address on the network, we can see the Baidu page after finding it. We generally only need to add the address of the preferred DNS server. It is best to add a domain name resolution system address closest to us, so that, for example, any webpage domain name address we enter when accessing the Internet will be converted to an IP address immediately, then, compress the IP address of the website on the Internet. You can download the addresses of China Netcom and China Telecom's main DNS servers from the Internet.
※Reference: http://gaofeilonglcu.blog.163.com/blog/static/1308642912010953495956/
(1) Problem Analysis
001. Q: What is the difference between IP address, subnet mask, default gateway, and DNS server?I know noIPYou cannot access the Internet at the address.DNSYou cannot access the Internet.But what are their functions and differences? It's strange that my computer has no DNS and can access QQ, but cannot open the webpage. Why?>
A: The IP address is a 32-bit binary data, which is usually expressed in decimal format and separated. An IP address is a logical address used to identify a host in the network. The IP address is unique, that is, the IP address of each machine is unique in the world.
Because QQ does not need DNS (QQ is only a client program and cannot use DNS), it is only used to browse the Web page (when the web site needs to be entered.
(2) DNS Server
DNSDomain Name Server
Server ). Domain names and IP addresses on the Internet correspond one by one. Although domain names are easy to remember, machines can only know each other's IP addresses. The conversion between them is called domain name resolution, domain name resolution must be completed by a dedicated domain name resolution server. DNS is the server for domain name resolution. (For details, see "Cultural Foundation P242)
(3) IP Address
To implement network communication between computers, you must have a valid IP address.IPAddress=Network Address+Host address (also known as host number and network number)The IP address structure enables convenient addressing on the Internet. Generally, IP addresses are displayed in four decimal numbers separated by dots. Each number ranges from 0 to 255. For example, the IP address of a host is 128.20.4.1.In the LAN, you also needIpAddress.IpThe address is192.168It is easy to distinguish between the Internet and the Intranet.IpAddress.
Thoroughly understand the meaning of IP addresses
IP addresses are frequently used in terms of learning networks and surfing the Internet. as shown in interface 1 for setting IP addresses in Windows, the figure shows the IP addresses, subnet masks, default gateways, and DNS servers. The network can only be accessed if the IP addresses are correctly set, what do these terms mean? When I learn about IP addresses, I also encounter concepts such as network addresses, broadcast addresses, and subnets. What do they mean?
To answer these questions, let's take a look at an example in daily life. as shown in figure 2, residents of North Street must have a house number for each other to find the other party. The house number is the address of each house. The house number is expressed as: North Street + XX. if the number 1 household is looking for the number 6 household, the process is like this. The number 1 shouted on the street: "Who is the number 6? Please answer. "At this moment, the residents of the North Street heard this, but only answered on the 6th. This shouting process is called" broadcast ",All users in North Street are their broadcast range.,If there are 20 users in North Street, the broadcast address is No. 21 North Street. That is to say, any user in North Street can hear the "broadcast address-1.
In this example, you can extract the following words:
Street address: North Street. If you give the street an address, use the address-1 of the first household. In this example, the street address is no. 0.
Number of residents: for example, number 1 and number 2.
Residential Address: street address + XX, such as No. 1 North Street and No. 2 North Street
Broadcast address:Address of the last resident+ 1In this example: No. 21, North Street
In an Internet network, each computer on the Internet has an address similar to the above example. This address is an IP address, which is the house number assigned to the network device, so that computers on the network can access each other, IP address = network address + host address. The IP address in Figure 1 is 192.168.100.1, which contains many meanings. as follows:
Network Address (equivalent to street address): 192.168.100.0
Host address (equivalent to the number of each house): 0.0.0.1
IP address (equivalent to residential address): network address + host address = 192.168.100.1
Broadcast address: 192.168.100.255
How are these addresses calculated? Why do we need to know how to calculate these addresses? First, we need to understand the principle that the purpose of learning the network is to allow computers in the network to communicate with each other, that is to say, we need to learn and understand the concepts in the network around the word "tong", rather than just a few nouns.
Note: 192.168.100.1Yes private address,You cannot directlyInternetThe,UpperInternetConvert to Public Address,The following details.
I. Why do I need to calculate the network address?
In a word, computers in the network can communicate with each other. first, let's look at the simplest network. Figure 3 uses a network cable (crossover line) to directly connect the two computers. the following are several IP address settings to see if the network is accessible under different settings.
1. Set HOST 1's IP address to 192.168.0.1's subnet mask to 255.255.255.0, and host 2's IP address to 192.168.0.200's subnet mask to 255.255.255.0, so that the computer can communicate normally.
2. If the address of Host 1 remains unchanged and the IP address of host 2 is changed to 192.168.1.200 subnet mask or 255.255.255.0, the two cannot communicate.
3. Set HOST 1's IP address to 192.168.0.1's subnet mask to 255.255.255.255.192, and host 2's IP address to 192.168.0.200's subnet mask to 255.255.255.255.192. Note that the subnet mask is different from the subnet mask in the 1st cases, 1 is 255.255.255.0. In this example, 255.255.255.255.192. The computer cannot communicate normally.
In 1st cases, the two computers are in the same network as 192.168.0.0, so the two computers are in different networks.
The following is a conclusion: computers that are directly connected by a network cable, or computers that are indirectly connected through a HUB or common switch, must be in the same network, that is to say, they must have the same network address and the host address must be different. if you are not in the same network, you cannot connect. as shown in the preceding example, residents of the North Street can find each other because their street names are both North Street and their street numbers are different.The computing network address is used to determine that the computer in the network is not in the same network.,You can access,It cannot be accessed when it is not in use.Note: here we are talking about IP addresses rather than physical connections in different networks. How can we calculate them?
2. How to calculate the network address (subnet mask)
In our daily life, we can see from the literal that the street address is North Street, but we cannot see the network address from the IP address. We need to calculate the network address, the preceding calculation process must be used to convert IP addresses and subnet masks into binary values. Then, the calculation result is the network address. as shown in the following operation, alignment up and down, 1 bit and 1 = 1, and the remaining combinations are 0.
For example, if the calculated IP address is 202.99.160.50 and the subnet mask is 255.255.255.0, follow these steps:
1) convert the IP address and subnet mask to binary
202.99.160.50 is converted to binary 11001010 · 01100011 · 10100000 · 00110010
Convert 255.255.255.0 to 11111111 · 11111111 · 11111111 · 00000000
2) perform and calculate the two
3) convert the calculation result to decimal, which is the network address.
11001010 · 01100011 · 10100000 · 00000000 is converted into decimal format: 202.99.160.0
Now, we can answer the communication and communication problems in the above three cases.
1. The calculation result below shows that the network addresses of the two computers are 192.168.0.0 and the IP addresses are different.
2. The calculation result below shows that the network address of machine 1 is 192.168.0.0, and the network address of Machine 2 is 192.168.1.0.
3. The calculation result below shows that the network address of machine 1 is 192.168.0.0, and the network address of Machine 2 is 192.168.0.192 and is not in the same network.
(4) Subnet Mask
The subnet mask is used to determine whether the IP addresses of any two computers belong to the same subnetwork. The simplest understanding is that after the IP addresses and subnet masks of the two computers perform the and operation, the results are the same. It means that the two computers are on the same subnet, direct communication is supported.. (The meanings of subnet masks are to be added .)
(5) Default Gateway
What is the default gateway?
If you find out what the gateway is, the default gateway is easy to understand. Just like a room can have multiple doors, a host can have multiple gateways. The default gateway means that if a host cannot find an available gateway, it sends data packets to the default gateway, which processes data packets. The gateway currently used by the host generally refers to the default gateway. (Culture Basis P222 gateway concept)
How to set the Default Gateway
The default gateway of a computer cannot be specified at will, and must be correctly specified. Otherwise, a computer will send data packets to a computer that is not the gateway, and thus cannot communicate with other networks.The default gateway can be set manually or automatically.
1. manually set
Manual settings, such as only a few to a dozen computers. This method requires setting the "Default Gateway" on each computer connected to the network, which is very difficult. Once the IP address of the default gateway must be modified due to migration or other reasons, this will cause a lot of trouble to the network management, so it is not recommended.
In Windows 9x, you can set the Default Gateway by right-clicking "Network neighbors" and clicking "properties" in the pop-up menu ", in the network Properties dialog box, select "TCP/IP protocol" and click "properties". On the "Default Gateway" tab, enter the IP address of the new default gateway.
Note that the default gateway must be an IP address in the CIDR block where the computer is located, rather than an IP address in another CIDR block.
2. Automatic settings
Automatic setting is to useDHCP(Dynamic Host Configuration Protocol,Dynamic Host Configuration Protocol) ServerTo automatically assign IP addresses, subnet masks, and default gateways to computers on the network. The advantage of this is that once the default gateway of the network changes, you only need to change the settings of the default gateway in the DHCP server, then all the computers on the network obtain the IP address of the new default gateway. This method is applicable to networks with large network sizes and variable TCP/IP parameters. Another way to automatically obtain the gateway is to automatically obtain the Gateway by installing the agent server software (such as MS Proxy) client program. Its principles and methods are similar to those of DHCP. Due to space limitations, we will not go into detail anymore.
※Reference: http://wenku.baidu.com/view/64042e85d4d8d15abe234e09.html