IP address, subnet mask, default gateway, DNS server knowledge detailed

Source: Internet
Author: User
Tags domain name server

Transferred from: http://www.cnblogs.com/JuneWang/p/3917697.html

In order to learn more about the TCP/IP protocol, recently read a lot of relevant information, collected and recorded as follows, for later use and convenient for you to learn:

IP address, subnet mask, default gateway, what does DNS server mean?

(a) Problem analysis

001. Q: IP address, subnet mask, default gateway, DNS server, what is the difference? I know that there is no IP address on the Internet, I also know that no DNS can not be Sisu network , but they have what function, what is the difference? Also really strange, my computer did not set DNS, unexpectedly can on QQ, but can't open the webpage, this is why >

A: IP is a 32-bit binary data, usually in decimal notation, with "." Separated. IP address is a logical address used to identify a host in the network, IP is unique, that is, the IP of each machine is the only one in the world.
DNS is a domain name server, used to resolve the domain name (domain and IP resolution), if there is no such thing, you have to enter the site's IP address, with the DNS, you can directly enter the URL.
Because QQ does not need to have DNS (QQ is just a client program, with no DNS), only browse the Web page (need to enter the URL) only use the DNS.

(ii) DNS server

DNS refers to the domain name server. On the internet between the domain name and IP address is one by one corresponding to the domain name, although convenient for people to remember, but the machine can only know each other IP address, the conversion between them is called Domain name resolution, domain name resolution needs to be dedicated domain name resolution server to complete, DNS is the server for domain name resolution.

The software that translates the domain name into an IP address is called the domain Name System, or DNS. It saves a domain name and a table of IP addresses (IP address) to resolve the domain name of the message. A domain is the name of a computer or group of computers on the Internet that identifies the computer's electronic orientation (and sometimes geographic location) when data is transferred. A domain name consists of a string of dotted names, usually containing an organization name, and always includes a two to three letter suffix to indicate the type of organization or the country or region in which the domain resides. Name Server Description: http://baike.baidu.com/view/543329.htm

Most of us have used google.com to search, but have you ever wondered why you can connect to Google's servers by typing google.com into your browser? To understand this, we need to understand the concept of domain name server (DNS).

Just as people in real life differentiate themselves by their names, in the world of computer networks, different computers are differentiated by assigning their IP addresses to each other. There are two types of IP addresses: public and private. Servers typically use public addresses because they are accessed by millions of computers worldwide. As for your PC connected to the router, it usually gets a private IP. Since the number of public addresses is limited, the local area network (built under a route with a public IP) is now set up to become popular and successful with private addresses.

Memory IP address Such tasks are difficult for most people, so each server has a name (such as Google.com). So the end user just need to remember the name, enter it in the browser, and then hit enter on it. Now let me see what happens when the user enters the name in the browser and taps into the enter. First, you need to convert the domain name to the corresponding IP. To complete this task, you need to send a DNS request to the default gateway (in most cases, the router). Routing configures a DNS server address, which is the destination for DNS requests.

The DNS server is used to convert the domain name to an IP address. When the DNS server receives a request, it checks that it has no conversion information that the request requires. Without this conversion information, the DNS server forwards this request to the other DNS servers. In this way, the conversion from the domain name to the IP address is completed. The conversion result is then sent back to the computer that made the request.

Reference: http://network.51cto.com/art/201406/442086.htm
(iii) IP address

To achieve network communication between computers, it is necessary to have a legitimate IP address.IP address = Network address + host address, (also known as: Host number and network number)The structure of IP addresses makes it easy to address on the Internet. The IP address is usually more intuitive, in dotted four decimal digits, each number from 0 to 255, such as the IP address of a host: the LAN, also need IP address, the general intranet IP address is beginning with 192.168, so it is easy to distinguish between the public network and the IP address of the intranet

Fully understand the meaning of IP address

Whether it's learning the Internet or surfing the Web, IP addresses are very high-frequency words. Windows system set the IP address of interface 1, the figure shows the IP address, subnet mask, default gateway and DNS server these need to set the place, only the correct settings, the network can pass, What do these nouns mean? Learn about IP address knowledge when you will also encounter network address, broadcast address, subnet and other concepts, what do these mean?

Figure 1

To answer these questions, take a look at an example of everyday life. 2, the residents in North Street should be able to find each other, must each have a number, the house number is the address of the home, the method is: North Street +xx. If the number 1th tenants are looking for the number 6th, the process is like this, Number 1th shouted in the street: "Who is number 6th, please answer.", then the residents of North Street heard, but only 6th answered, this shouting process called "Radio",all the users of North Street are his broadcast range,If there are 20 users in North Street, the broadcast address is: 21st North Street. That is to say, any user of North Street will be able to make a "broadcast address-1" user hear.

Figure 2

The following words can be drawn from this example:
Street Address: North Street, if you give the street an address to the first tenant's address-1, this example: North Street, No. No. 0
Number of tenants: such as Number 1th, No. 2nd, etc.
Address of the household: street address +xx, such as 1th North Street, 2nd North Street, etc.
broadcast address: Last tenant's address +1, this example is: No. 21st North Street

Internet network, each Internet computer has an address like the above example, this address is the IP address, is assigned to the network device number, in order to network computers can access each other, IP address = Network address + host address, the IP address in Figure 1 is , this address contains a lot of meaning. As shown below:

Network address (equivalent to street address):
Host address (equivalent to the door number of each household):
IP address (equivalent to household address): Network address + host address =
Broadcast address:

How are these addresses calculated? Why calculate these addresses? To know how, first to understand a truth, the purpose of learning Network is how to make the network of computers communicate with each other, that is, around the word "tong" to learn and understand the concept of the network, rather than just back a few nouns.

Note: is a private address that cannot be applied directly to an Internet network, and the Internet is converted to a public address, as detailed below.

One, why calculate network address

The bottom line is that the computers in the network can communicate with each other. First look at the simplest network, Figure 3 is to use a network cable (crossover) directly connect two computers. Here are several IP address settings to see if the network is on or off in different settings.

1, set the IP address of machine number 1th to the IP address of the subnet mask to,2 is The subnet mask is, and this computer will be able to communicate normally.

2, if the address of the number 1th is unchanged, the IP address of the 2nd machine is changed to subnet Mask or, then the two will not be able to communicate.

3, set the IP address of machine number 1th to the IP address of the subnet mask to,2 is subnet Mask is, notice that the 1th case differs in the subnet mask, 1 is This example is This computer will not be able to communicate properly.

Figure 3

The 1th situation can pass because the two computers are in the same network, so can pass, and 2, 3 cases two computers in different networks, so it does not pass.

Here is a conclusion: the computer with a direct connection to the network cable or through the hub (hub) or the ordinary switch between the computer to be able to communicate with each other, the computer must be on the same network, that is, their network address must be the same, And the host address must be different. If it is not a network will not be able to pass. This is like the example we cited above, the same as the North Street tenants because the street names are North Street, and their respective number, so they can find each other.Computing Network address is to determine the network in the computer is not the same network, in can pass, not on theNote that this is not the same network that is referring to the IP address and not the physical connection. So how do you calculate it?

Second, how to calculate the network address (subnet mask)

Our daily life address such as: 1th North Street, literally can see Street address is North Street, and we from the IP address is difficult to see the network address, to calculate network address, we must rely on the above mentionedSubnet mask.
The calculation process is such that the IP address and subnet mask are converted to binary, and then perform and operation, the result is the network address. As shown below, the upper and lower alignment, 1-bit 1-bit calculation, 1 and 1=1, the remaining combinations are 0

Figure 4

For example: The computed IP address is: The subnet mask is a network address step as follows:
1) Convert IP address and subnet mask to binary separately converted into binary for 11001010 01100011 10100000 00110010 converted into binary for 11111111 11111111 11111111 00000000
2) perform and compute the two

Figure 5

3) Convert the result of the operation into decimal, which is the network address.
11001010 01100011 10100000 00000000 converted into decimal is

Now we can solve the problem of the above three kinds of situations and not pass.

1, from the following results can be seen two computers network address is and IP address is different, so can pass.

Figure 6

2, from the results can be seen from the 1th Machine network address for the,2 number machine network address is not a network, so it does not pass.

Figure 7

3, from the results can be seen from the 1th Machine network address for the,2 number machine network address is not a network, so it does not pass

Figure 8

Believe you see this should understand why compute the network address and how to calculate it.

Thank you netizens: Listen to the rain HTTP://NEW.QZONE.QQ.COM/649329690/BLOG/9

(d) Subnet mask

A subnet mask is a basis for determining whether the IP addresses of any two computers belong to the same subnet. The simplest understanding is that the two computer's respective IP address and subnet mask after the and operation, the result is the same, then the two computers are on the same sub-network, you can make direct communication. (Specific subnet mask what you mean to add.) )

(v) Default gateway

What is a gateway?

So what exactly is a gateway? A gateway is essentially an IP address of a network to another network. For example, network A and network B, network A's IP address range is "" 168.1.254 ", the subnet mask is; The IP address range for Network B is" "and the subnet mask is In the absence of a router, TCP/IP communication between the two networks is not possible, even if the two network connections on the same switch (or hub), the TCP/IP protocol will determine the subnet mask ( on the two network hosts in a different network. To achieve communication between the two networks, you must pass through the gateway. If the host in Network a discovers that the destination host for the packet is not on the local network, forwards the packet to its own gateway, which is then forwarded by the gateway to Network B's gateway, and the gateway of Network B is forwarded to a host of network B (as shown in the accompanying drawings). The process by which network a forwards packets to network B. So, only set up the IP address of the gateway, the TCP/IP protocol can realize the mutual communication between different networks. So which IP address is the IP address of the machine? The IP address of the gateway is the IP address of the device with routing capabilities, a router with routing capabilities, a server with a routing protocol enabled (essentially a router), and a proxy server (also equivalent to a router). In the context of network interaction with Novell NetWare, the gateway acts as a bridge between the server information block (SMB) protocol used in the Windows Network and the NetWare Core Protocol (NCP) used by the NetWare network. Gateways are also known as IP routers.
examples ShowSuppose your name is little (very small), you live in a big yard, your neighbors have many small partners, your parents are your gateway. When you want to play with a little friend in the yard, as long as you shout his name in the yard, he hears it, responds to you, and runs out to play with you. But your parents do not allow you to walk out of the door, you want to contact with the outside world, all must be by the parents (gateway) to help you contact with the telephone. If you want to find your classmate Xiao Ming chat, Xiao Ming lives in a far away in another yard, his home also has parents (Xiao Ming's Gateway). But you don't know the telephone number of Xiao Ming's home, but your teacher in charge has a list of all the classmates in your class and telephone number, your teacher is your DNS server. So you have a conversation with your parents at home: 1. Little one: Mom (or dad), I would like to find a teacher in charge of Xiao Ming's telephone number line? 2. Parents: OK, you wait. (then your parents to your teacher hung a telephone, asked clearly Xiao Ming's telephone) asked, his family's number is Tiny: Great! Mom (or dad), I want to find Xiao Ming, you can help me contact Xiao Ming. 4. Parents: No problem. (then the parents sent a request to the telephone office, the last of course was transferred to the parents of Xiao Ming's home, then his parents to the phone to Xiao Ming). So you and Xiao Ming have been contacted.

Gateway Example

Gateway Concept from: http://baike.baidu.com/view/807.htm

What is the default gateway?

If you know what a gateway is, the default gateway is understandable. It's like a room can have more than one door, a host can have multiple gateways. The default gateway means that if a host cannot find an available gateway, it sends the packet to the default designated gateway, which handles the packet. The gateway used by the host is now generally referred to as the default gateway.

How to set the default gateway

The default gateway for a computer cannot be specified casually and must be specified correctly, or a computer will send the packet to a computer that is not a gateway, so that it cannot communicate with other computers on the network. The default gateway is set up manually and automatically in two different ways.

1. Manual Setup

Manual settings are suitable for situations where the number of computers is relatively small and the TCP/IP parameters are basic, such as only a few to more than 10 computers. Because this method needs to set the "default gateway" on each computer in the network, it is very laborious, if the IP address of the default gateway must be modified because of the migration and so on, it will cause great trouble to the network management, so it is not recommended.

In Windows 9x, the way to set the default gateway is to right-click on "My Network Places", click "Properties" in the pop-up menu, select "TCP/IP protocol" in the Net Properties dialog box, click on "Properties", and in the "Default Gateway" tab, fill in the IP address of the new default gateway.

It is important to note that the default gateway must be the IP address in the computer's own network segment, not the IP address in other network segments.

2. Automatic Setup

Automatic provisioning is the use of DHCP (Dynamic Host configuration Protocol) servers to assign IP addresses, subnet masks, and default gateways to computers in the network. The advantage of this is that once the default gateway for the network changes, all computers in the network get the IP address of the new default gateway as long as the settings for the default gateway in the DHCP server are changed. This method is suitable for networks with large network size and possible changes of TCP/IP parameters. Another way to automatically obtain a gateway is by installing Proxy Server software (such as MS Proxy) of the client program to automatically obtain, its principle and method and DHCP have similarities. As space is limited, it is no longer detailed

Reprint Please specify source: http://www.cnblogs.com/JuneWang/p/3917697.html

Reference content from: http://www.cnblogs.com/songQQ/archive/2009/05/27/1490612.html


IP address, subnet mask, default gateway, DNS server knowledge explained (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.