IP Address/subnet mask/gateway Analysis

Source: Internet
Author: User


IP addresses, subnet masks, and gateways in network management are the basic knowledge that each network administrator must master. Only by mastering them can you really understand the TCP/IP protocol settings. The following describes what a subnet mask is.
To understand what the subnet mask is, you must understand the composition of the IP address. The Internet is composed of many small networks, each of which has many hosts, thus forming a hierarchical structure. When designing an IP address, considering the hierarchical features of Address Allocation, each IP address is divided into two parts: the network number and the host number to facilitate IP address addressing.
What are the network numbers and host numbers of IP addresses? If this parameter is not specified, you do not know which bits are the network numbers and which are the host numbers. This requires subnet masks. What is a subnet mask? The subnet mask cannot exist independently. It must be used together with an IP address. The subnet mask has only one function, namely dividing an IP address into a network address and a host address. The subnet mask must be set according to certain rules. Same as the IP address, the subnet mask length is also 32 bits, the network bits on the left are represented by the binary number "1", and the host bits on the right are represented by the binary number "0. Www.2cto.com "192.168.1.1" and the subnet mask is "255.255.255.0. Among them, "1" has 24, representing the corresponding 24-bit IP address on the left is the network number; "0" has 8, the eight-digit host number on the right of the corresponding IP address. In this way, the subnet mask determines the network number and host number in the 32-bit binary number of an IP address. This is very important for networks using the TCP/IP protocol. Only by using the subnet mask can the relationship between the subnet of a host and other subnets be indicated, so that the network can work normally.
There are hundreds of commonly used subnet masks. Here we will only introduce the two most commonly used subnet masks: 255.255.255.0 and 255.255.0.0 ".
1. The subnet mask is "255.255.255.0" network: the last digit can be 0 ~ Any change within the range of 255, so 256 IP addresses can be provided. However, the actual number of available IP addresses is 256-2, that is, 254, because the host number cannot be "0" or all "1 ". 2. The subnet mask is a network of "255.255.0.0". The two numbers can be 0 ~ Any change within the range of 255 can provide 2552 IP addresses. However, the actual number of available IP addresses is 2552-2, that is, 65023.
The subnet mask of the IP address is not set arbitrarily. If the subnet mask is set too large, that is, the subnet range is expanded, data from the destination machine in the same subnet as the local machine may be sent according to the subnet routing rule, if the destination machine is considered to be in the same subnet due to incorrect judgment, the data packet will be circulated in the subnetwork until it times out and is discarded, so that the data cannot reach the destination machine correctly, network Transmission Error. If the subnet mask is set too small, the communication between machines in the same subnet will be considered as cross-subnet transmission, and data packets will be handed over to the default gateway for processing, this will inevitably increase the burden on the default gateway, resulting in reduced network efficiency. Therefore, the subnet mask should be set based on the network size. If a network has no more than 254 computers, you can use "255.255.255.0" as the subnet mask. Currently, most local networks will not exceed this number, therefore, "255.255.255.0" is the most commonly used IP address subnet mask. I have seen that the largest primary and secondary school campus network has more than 1500 computers, and such a LAN can use "255.255.0.0 ". Www.2cto.com
The default subnet mask is in Windows 2000 Server. If you specify an IP address for a network adapter, the system automatically fills in a default subnet mask. This is the subnet mask automatically generated by Windows 2000 Server to save user input time. For example, the default subnet mask of "192.168.x.x" is "255.255.255.0 ". Generally, the IP address can use the default subnet mask. As you all know, the gateway of network management must pass through one door to go from one room to another. Similarly, sending information from one network to another must go through a "Gateway", which is the gateway. What is a Gateway, as its name implies, is the "Gateway" connecting a network to another network ". There are also many types of gateways according to different classification standards. The Gateway in TCP/IP protocol is the most commonly used. The "Gateway" mentioned here refer to the gateway under TCP/IP protocol. So what is the gateway? A gateway is essentially an IP address from a network to another network. For example, if Network A and Network B exist, the IP address range of Network A is "192.168.1.1 ~ 192. 168.1.254 ", The subnet mask is 255.255.255.0, And the IP address range of Network B is" 192.168.2.1 ~ 192. 168.2.254 ", The subnet mask is 255.255.255.0. Without a router, the two networks cannot communicate with each other through TCP/IP, even if the two networks are connected to the same vswitch (or hub, the TCP/IP protocol also determines that the hosts in the two networks are in different networks based on the subnet mask (255.255.255.0. To realize the communication between the two networks, you must use the gateway.
If the host in Network A finds that the destination host of the data packet is not in the local network, it forwards the data packet to its own gateway, and then the gateway forwards the data packet to the gateway of Network B, the gateway of Network B is then forwarded to a host of Network B. The same is true for packet forwarding from Network B to Network. To realize the communication between the two networks, you must use the gateway. If the host in Network A finds that the destination host of the data packet is not in the local network, it forwards the data packet to its own gateway, and then the gateway forwards the data packet to the gateway of Network B, the gateway of Network B is then forwarded to a host of Network B. So is the process in which Network B forwards data packets to network A. Only by setting the IP address of the gateway can the TCP/IP protocol communicate with each other. Which machine is the IP address? The IP address of a gateway is the IP address of a device with the routing function. A device with the routing function has a router and a server with the routing protocol enabled (essentially equivalent to a router), proxy server (also equivalent to a vro ).
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.
How can I 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 the data packets to a computer that is not the gateway, thus, it cannot communicate with computers on other networks. The default gateway can be set manually or automatically. Www.2cto.com 1. Manual setting: manual setting is applicable to situations where the number of computers is relatively small and the TCP/IP parameters remain unchanged. For example, there are 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 Configuration: the DHCP server is used to 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.
Through a simple experiment, the subnet mask of the gateway and ARP protocol is deeply analyzed, the concept and working principle of the gateway and ARP Protocol are several important knowledge points that Beginners first encounter when learning network knowledge, among them, the role and basic working principle of subnet mask and ARP protocol is also the key and difficult point in Semester 1, a tutorial by Cisco Network Technology College. It is difficult for beginners to grasp these abstract and complex mechanisms at once. Therefore, it is necessary to use experiments to help students gain a deeper and more intuitive understanding of the basic concepts and working principles of subnet masks, gateways, and ARP protocols. Before explaining the experiment, we will first give an overview of the subnet mask, the basic knowledge of the gateway and ARP protocol. The main function of the subnet mask is to inform the network device, which part of a specific IP address includes the network address, subnet address, and host address. The routing device of the network can make a routing addressing decision by identifying the network number and subnet number of the destination address. The host part of the IP address is not involved in the routing addressing operation of the router, only an interface that uniquely identifies a network device in a CIDR block. Originally, if only the primary class addresses A, B, and C are used in the network system, and the primary class addresses are not divided into subnets or summarized, the network device can determine which primary network belongs to A, B, and C based on the value range of the first byte of the IP address, and then determine the network part and host part of the IP address, the subnet mask is not needed.
However, in order for the system to divide the primary class Networks A, B, and C into subnets, or use Classless Inte r-Domain Routing and CIDR) when CIDR blocks are summarized, the network and subnet of IP addresses can be correctly differentiated from those of hosts. Therefore, you must rely on the help of the subnet mask. Www.2cto.com
The subnet mask uses the same address format as the IP address. The subnet mask of 1 corresponds to the network and subnet of the IP address, and the subnet mask of 0 corresponds to the host of the IP address. After the subnet mask and IP address are used as "and" operations, the host part of the IP address will be discarded, and the remaining are the network address and subnet address. For example, the destination IP address of an IP group is 10.2.2.1. If the subnet mask is 255.255.255.0, the operation "and" is calculated as 10.2.2.0, the network device considers the IP address's network number and subnet number as 10.2.2.0. ========================================================== ==================================== IP address English IP address is the 32-bit address allocated to the host, it identifies a node on the network and specifies the route information on an interconnected network. each HOST on the INTERNET has a unique IP address. however, when we see users or ISDN users on dial-up, network access providers generally use dynamic IP addresses to save resources, that is, you assign an IP address to your ISP every time you dial-up. IP Address: It is equivalent to your phone number or your address. therefore, do not give your IP address to others unless otherwise specified. (I want to know who has them online now. the IP bomb is flying. if you are not careful about it, you can win it! It cannot be said that your machine has security vulnerabilities, and someone else has hacked you .) the IP protocol transmits information between hosts using this address, which is the basis for the operation of the INTERNET. the IP address is 32 characters long and can be divided into 4 segments. Each segment has 8 digits, which are expressed in decimal numbers. The range of each segment is 1 ~ 254. segments and segments are separated by vertices. example: 202.103.44.194. www.2cto.com consists of two parts: the network address and the host address. IP addresses are classified into A, B, C, D, and E5 categories. B and C are commonly used. class A: the first digit range of Class a ip address is 1 ~ 127. The class A address can be connected to 16387064 hosts, and there are 126 Class A addresses on the INTERNET. Class B addresses: The number range of the first segment is 128 ~ 191. Each Class B address can connect 64516 hosts, and there are 16256 Class B addresses on the INTERNET. Class C: 192 ~ 133, can be connected to 254 hosts, with 2054512 D: 224 ~ 239, Class D addresses are used for the transmission of information for multiple purposes, for backup E: 240 ~ 254. Class E addresses are retained and used only for INTERNET experiments and development. Web pages cannot be opened only on WINDOWS. To do this, you must use IIS and other software. What is a Domain Name Server (DNS ). As mentioned above, you can identify a computer on the Internet by using an IP address, but the IP address is represented by a number, which has no special meaning and is hard to remember. Therefore, we usually get a Name that has some meaning and is easy to remember for the computer on the Internet. This Name is called "Domain Name ".

For example, for the famous YAHOO! For search engines, when users browse this website, they will enter [url] http://www.yahoo.com [/url], few people will remember what the IP address of this Server is? So the [url] http://www.yahoo.com [/url] is YAHOO! The Domain Name of the site. This is just like when we say hello to a friend, it must be his name. Almost no one calls the other's ID card number! However, because www.2cto.com identifies the IP address of the machine on the Internet, after the user enters Domain Name in the browser, the browser must first query the IP address of the computer on a host with the corresponding Domain Name and IP address, and the queried host is called Domain Name Server (DNS for short,

For example, when you enter a [url] http://www.yahoo.com [/url], the browser sends the name [url] http://www.yahoo.com [/url] To the DNS Server closest to it for identification, if the query results are FOUND, the IP address of the host is returned and connected to it. However, if no query is FOUND, alarms such as dns not found will appear. So once your computer's DNS Server is set incorrectly, it's like a road sign is wrong and the computer doesn't know where to send the information.
Generally, ISP dialing servers have default DNS, so you do not need to set DNS. If you need to specify a DNS, you must understand the accurate IP address of this DNS (for example, the DNS of 163 users in Fuzhou is 202.101.98.55 ). DNS settings are as follows: Open "properties" of "TCP/IP" in "network" under "Control Panel", and select "Enable DNS" in the "DNS settings" column ", add the dns ip address. Author kinghanhannah

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.