IP address and subnet mask

Source: Internet
Author: User

IP address and subnet mask

1. IP Address:
The Internet is formed by the interconnection of different physical networks. The computer communication between different networks must have a corresponding address ID, which is called an IP address. IP addresses provide a uniform address format consisting of 32 bits. Because the binary format is inconvenient to use, users can use the "dot-decimal" method. The IP address uniquely identifies the number of the network where the host is located and the number of the location in the network. According to the size of the network, common IP addresses are divided into the following three categories:
A: These addresses start with 0. The first byte indicates the network number, and the second, third, and fourth byte indicates the host number in the network. If the number of networks is small, it can represent a maximum of 126 network numbers, each network can have a maximum of 16777214 host numbers.

0 *******************************
L-126 0-255 0-255 1-254

B: These addresses start with l0. The first and second bytes indicate the network number, and the second and third bytes indicate the host number in the network, which can represent a maximum of 16384 network numbers, each network can have a maximum of 66534 host numbers.

10 ******************************
128-191 0-255 0-255 1-254

C: these addresses start with 110. The first, second, and third bytes indicate the network number, and the fourth byte indicate the host number in the network. There are many networks and there can be 2097152 network numbers, each network can have a maximum of 254 host numbers.

110 *****************************
192-233 0-255 0-255 1-254

IP address rules:
The network number cannot start with 127, and the first byte cannot be all 0 or all L.
The host number cannot be 0 or L.

2. In order to quickly determine which part of the IP address represents the network number and which part represents the host number and determine whether the two IP addresses belong to the same network, the concept of subnet mask is generated, the subnet mask is given in the IP address format. The default subnet mask for A, B, and C IP addresses is as follows:

A: 255. O. o.0
B: 000000000.o
C: 255.255.255.0

You can use a subnet mask to determine the network number and host number of an IP address. You can use the IP address and the corresponding subnet mask to calculate the network number and host number.
For example, 10.68.89.1 is a Class a ip address. Therefore, the default subnet mask is 255.0.0 and O, which are converted to binary and computed respectively, and the network number is 10. For example, if 202.30.152.3 and 202.30.152.80 are Class c ip addresses, the default subnet mask is 255.255.255.0. After calculation, the network numbers are the same, indicating that the two hosts are in the same network.
Another function of subnet mask is to divide subnets. In practical applications, network numbers are often insufficient. You need to divide a certain type of network into multiple subnets, the method is to divide some binary bits in the host ID part to identify the subnet.

3. gateway address: in the Internet, a gateway is an intermediate device that connects the Intranet to other networks on the Internet, also known as a "Router ". The gateway address is a channel address that can be understood as Intranet and Internet information transmission.

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.