When it comes to the Internet, IP addresses cannot be ignored, because IP addresses are a very important concept, whether from the perspective of learning or using the Internet, and many services and features of INTERNET are reflected through IP addresses.
1. The concept of IP address
We know that the Internet is the general term for communication networks formed by computers all over the world. When two computers connected to a certain network communicate with each other, the data packets they transmit will contain certain additional information, which is the address of the computer sending the data and the address of the computer receiving the data. In this way, for the convenience of communication, people assign each computer a identification address similar to the phone number in our daily life, which is the IP address we are going to introduce today. According to the TCP/IP protocol, IP addresses are composed of 32-bit binary numbers and are unique within the INTERNET range. For example, the IP address of a computer on the Internet of a certain * connection is:
11010010 01001001 10001100 00000010
It is obvious that these numbers are not easy to remember for people. In order to facilitate memory, people divide the 32-bit binary that constitutes the computer's IP address into four segments, each segment is 8 digits, separated by a decimal point in the middle, and then convert each eight-bit binary into a decimal number, so that the IP address of the above computer becomes: 210.73.140.2.
2. Classification of IP addresses
We have said that the Internet is a huge internet network that connects countless networks around the world. The computer in each network is uniquely identified through its own IP address. Based on this, we can also imagine that in this huge internet network on INTERNET, each network also has its own identifier. This is very similar to the phone number in our daily life. For example, there is a phone number 0515163. The first four digits in this number indicate which region the phone belongs to, and the numbers behind represent a phone number in the area. Similar to the above example, we also divide the computer's IP address into two parts, namely the network identifier and the host identifier. All hosts on the same physical network are identified by the same network, and the 4 bytes of the IP address are divided into 2 parts, one is used to indicate the specific network segment, that is, the network identification; the other part is used to indicate the specific node, that is, the host identification, that is, the specific computer number in a certain network. For example, the IP address of the server of Yancheng Information Network Center is 210.73.140.2. For this IP address, we can divide it into two parts: network identifier and host identifier, so that the above IP address can be written as:
Network ID: 210.73.140.0
Host ID: 2
Let's write together: 210.73.140.2
Since the network may contain different computers, some networks may contain more computers, and some networks may contain fewer computers. Therefore, people set the 32-bit address information into three location division methods according to the size of the network. These three division methods correspond to Class A, Class B, and Class C IP addresses respectively.
1. Class A IP address
A Class A IP address means that among the four segments of the IP address, the first segment is the network number, and the remaining three segments are the number of the local computer. If the IP address is represented in binary, the Class A IP address consists of a 1-byte network address and a 3-byte host address, and the highest bit of the network address must be "0". The identity length of the network in Class A IP address is 7 bits, the length of the host identification is 24 bits, and the number of Class A network addresses is small, which can be used for large networks with more than 16 million hosts.
2. Class B IP address
A Class B IP address refers to the four segment numbers of the IP address, the first two segment numbers are network numbers, and the remaining two segment numbers are the numbers of the local computer. If the IP address is represented in binary, the Class B IP address consists of a 2-byte network address and a 2-byte host address. The highest bit of the network address must be "10". The identity length of the network in a Class B IP address is 14 bits and the length of the host identifier is 16 bits. The Class B network address is suitable for medium-sized networks, and each network can accommodate more than 60,000 computers.
3. Class C IP address
A C IP address refers to the four segments of the IP address, the first three segments are network numbers, and the remaining segment is the number of the local computer. If the IP address is represented in binary, the C IP address consists of a 3-byte network address and a 1-byte host address. The highest bit of the network address must be "110". The network identification length in a Class C IP address is 21 bits, and the host identification length is 8 bits. The number of Class C network addresses is large, which is suitable for small-scale local area networks. Each network can only contain up to 254 computers.
In addition to the above three types of IP addresses, there are several special types of IP addresses. The TCP/IP protocol stipulates that the address starting with "lll0" in the IP address is called a multicast address. Therefore, any IP address with the first byte greater than 223 and less than 240 is a multicast address; an address with each byte in the IP address of 0 ("0.0.0.0") corresponding to the current host; an IP address with each byte in the IP address of 1 ("255.255.255.255") is the broadcast address of the current subnet; any address with "llll0" in the IP address will be reserved for future use.
3. IP addressing rules
1. Network addressing rules
A. The network address must be unique.
B. The network identifier cannot start with the number 127. In Class A address, the number 127 is reserved for the internal loopback function.
C. The first byte of the network identification cannot be 255. The number 255 is used as the broadcast address.
D. The first byte of the network identification cannot be "0". "0" means that the address is the local host and cannot be transmitted.
2. Host addressing rules
A. The host identity must be unique within the same network.
B. Each bit of the host identification cannot be "1". If all bits are "1", the address of the machine is the broadcast address, not the address of the host.
C. Each bit of the host identification cannot be "0". If each bit is "0", it means "only this network", and there are no hosts on this network.
4. Overview of IP subnet mask
1. The concept of subnet mask
The subnet mask is a 32-bit address that is used to block part of an IP address to distinguish the network and host identity, and to indicate whether the IP address is on a local area network or a remote network.
2. Determine the number of subnet masks
The number of bits used for the subnet mask is determined by the number of possible subnets and the number of hosts per subnet. Before defining the subnet mask, you must figure out the number of subnets and hosts that you originally used.
The steps to define the subnet mask are:
A. Determine which group addresses belong to us. For example, the network number we applied for is "210." The network address is a C IP address, the network identification is "210.73", and the host identification is "".
B. Define the subnet mask using some bits of the host based on the number of subnets we need now and the number of subnets that may be expanded in the future. For example, we need 12 subnets now, and maybe 16 in the future. Use the first four bits of the third byte to determine the subnet mask. The first four bits are set to "1", that is, the third byte is "11110000". We will temporarily call this number the new binary subnet mask.
C. Set all bits of the corresponding initial network to "1", that is, set the first two bytes to "1", and the fourth byte is set to "0", then the interrupted binary form of the subnet mask is: "11111111.11111111.111110000.000000000"
D. Convert this number into a discontinuous decimal form: "255.255.240.0"
This number is the subnet mask of the network.
Mask annotation
A. The labeling method of subnetless network
For the IP address of the subnetless network, it can be written as a mask with the host number 0. If the IP address is 210.73.140.5 and the mask is 255.255.255.0, you can also default mask and only write the IP address.
B. The labeling method of subnet
When there is a subnet, the two must be paired up. Take Class C address as an example.
The first 3 bytes in the address represent the network number, and the latter byte not only indicates the subnet number, the host number, and whether the two IP addresses belong to the same network segment. If it belongs to the same network interval, the information exchange between these two addresses does not pass through the router. If it does not belong to the same network interval, that is, the subnet numbers are different, the information exchange between the two addresses must be carried out through the router. For example: for a host with an IP address of 210.73.140.5, its host identification is 00000101, and for a host with an IP address of 210.73.140.16, its host identification is 00010000. The first three digits of the above two host identifications are all 000, indicating that these two IP addresses are in the same network area.
The host address, for example, the host identifier of 10.73.60.1 is 00000001, and the host identifier of 210.73.60.252 is 11111100. The first three digits of these two host identifiers are different from 011, indicating that the two are in different network areas, and to exchange information, you need to pass through the router. The subnet host numbers are 1 and 252 each.
2. The function of the mask is to indicate that there are subnets and how many subnets are, but the number of subnets can only be expressed in one range. It cannot be precisely mentioned how many subnets are. The mask does not indicate the specific subnet number. The mask format of the subnet (for C-class address): the first few digits of the host are subnet numbers, and the host is not written later, and all 0 is written.
V. Other matters of IP
1. Generally, the International Internet Information Center allocates IP addresses according to the network. Therefore, the statements of Class A, Class B, and Class C can only be used when talking about network addresses;
2. When allocating network addresses, the network identifier is fixed, while the computer identifier can change within a certain range. The following are the composition forms of three types of network addresses:
Class A address: 73.0.0.0
Class B address: 160.153.0.0
Class C address: 210.73.140.0
Each 0 in the above can be varied between 0 and 255.
3. Because the first three digits of the IP address have determined what type of network an IP address belongs to, the Class A network address cannot be divided into Class B IP addresses, and Class B IP addresses cannot be divided into Class C IP addresses.
4. When talking about a specific computer IP address, it is not advisable to use Class A, Class B, or Class C, but it can be said that the host address belongs to which Class A, Class B, or Class C network.
Through the above learning, everyone must have an understanding of IP addresses. With an IP address, you can send emails and obtain other information on the Internet, such as obtaining WWW services, BBS services, FTP services, etc. on the Internet. Article entry: dnbm Editor: dnbm
1. The concept of IP address
We know that the Internet is the general term for communication networks formed by computers all over the world. When two computers connected to a certain network communicate with each other, the data packets they transmit will contain certain additional information, which is the address of the computer sending the data and the address of the computer receiving the data. In this way, for the convenience of communication, people assign each computer a identification address similar to the phone number in our daily life, which is the IP address we are going to introduce today. According to the TCP/IP protocol, IP addresses are composed of 32-bit binary numbers and are unique within the INTERNET range. For example, the IP address of a computer on the Internet of a certain * connection is:
11010010 01001001 10001100 00000010
It is obvious that these numbers are not easy to remember for people. In order to facilitate memory, people divide the 32-bit binary that constitutes the computer's IP address into four segments, each segment is 8 digits, separated by a decimal point in the middle, and then convert each eight-bit binary into a decimal number, so that the IP address of the above computer becomes: 210.73.140.2.
2. Classification of IP addresses
We have said that the Internet is a huge internet network that connects countless networks around the world. The computer in each network is uniquely identified through its own IP address. Based on this, we can also imagine that in this huge internet network on INTERNET, each network also has its own identifier. This is very similar to the phone number in our daily life. For example, there is a phone number 0515163. The first four digits in this number indicate which region the phone belongs to, and the numbers behind represent a phone number in the area. Similar to the above example, we also divide the computer's IP address into two parts, namely the network identifier and the host identifier. All hosts on the same physical network are identified by the same network, and the 4 bytes of the IP address are divided into 2 parts, one is used to indicate the specific network segment, that is, the network identification; the other part is used to indicate the specific node, that is, the host identification, that is, the specific computer number in a certain network. For example, the IP address of the server of Yancheng Information Network Center is 210.73.140.2. For this IP address, we can divide it into two parts: network identifier and host identifier, so that the above IP address can be written as:
Network ID: 210.73.140.0
Host ID: 2
Let's write together: 210.73.140.2
Since the network may contain different computers, some networks may contain more computers, and some networks may contain fewer computers. Therefore, people set the 32-bit address information into three location division methods according to the size of the network. These three division methods correspond to Class A, Class B, and Class C IP addresses respectively.
1. Class A IP address
A Class A IP address means that among the four segments of the IP address, the first segment is the network number, and the remaining three segments are the number of the local computer. If the IP address is represented in binary, the Class A IP address consists of a 1-byte network address and a 3-byte host address, and the highest bit of the network address must be "0". The identity length of the network in Class A IP address is 7 bits, the length of the host identification is 24 bits, and the number of Class A network addresses is small, which can be used for large networks with more than 16 million hosts.
2. Class B IP address
A Class B IP address refers to the four segment numbers of the IP address, the first two segment numbers are network numbers, and the remaining two segment numbers are the numbers of the local computer. If the IP address is represented in binary, the Class B IP address consists of a 2-byte network address and a 2-byte host address. The highest bit of the network address must be "10". The identity length of the network in a Class B IP address is 14 bits and the length of the host identifier is 16 bits. The Class B network address is suitable for medium-sized networks, and each network can accommodate more than 60,000 computers.
3. Class C IP address
A C IP address refers to the four segments of the IP address, the first three segments are network numbers, and the remaining segment is the number of the local computer. If the IP address is represented in binary, the C IP address consists of a 3-byte network address and a 1-byte host address. The highest bit of the network address must be "110". The network identification length in a Class C IP address is 21 bits, and the host identification length is 8 bits. The number of Class C network addresses is large, which is suitable for small-scale local area networks. Each network can only contain up to 254 computers.
In addition to the above three types of IP addresses, there are several special types of IP addresses. The TCP/IP protocol stipulates that the address starting with "lll0" in the IP address is called a multicast address. Therefore, any IP address with the first byte greater than 223 and less than 240 is a multicast address; an address with each byte in the IP address of 0 ("0.0.0.0") corresponding to the current host; an IP address with each byte in the IP address of 1 ("255.255.255.255") is the broadcast address of the current subnet; any address with "llll0" in the IP address will be reserved for future use.
3. IP addressing rules
1. Network addressing rules
A. The network address must be unique.
B. The network identifier cannot start with the number 127. In Class A address, the number 127 is reserved for the internal loopback function.
C. The first byte of the network identification cannot be 255. The number 255 is used as the broadcast address.
D. The first byte of the network identification cannot be "0". "0" means that the address is the local host and cannot be transmitted.
2. Host addressing rules
A. The host identity must be unique within the same network.
B. Each bit of the host identification cannot be "1". If all bits are "1", the address of the machine is the broadcast address, not the address of the host.
C. Each bit of the host identification cannot be "0". If each bit is "0", it means "only this network", and there are no hosts on this network.
4. Overview of IP subnet mask
1. The concept of subnet mask
The subnet mask is a 32-bit address that is used to block part of an IP address to distinguish the network and host identity, and to indicate whether the IP address is on a local area network or a remote network.
2. Determine the number of subnet masks
The number of bits used for the subnet mask is determined by the number of possible subnets and the number of hosts per subnet. Before defining the subnet mask, you must figure out the number of subnets and hosts that you originally used.
The steps to define the subnet mask are:
A. Determine which group addresses belong to us. For example, the network number we applied for is "210." The network address is a C IP address, the network identification is "210.73", and the host identification is "".
B. Define the subnet mask using some bits of the host based on the number of subnets we need now and the number of subnets that may be expanded in the future. For example, we need 12 subnets now, and maybe 16 in the future. Use the first four bits of the third byte to determine the subnet mask. The first four bits are set to "1", that is, the third byte is "11110000". We will temporarily call this number the new binary subnet mask.
C. Set all bits of the corresponding initial network to "1", that is, set the first two bytes to "1", and the fourth byte is set to "0", then the interrupted binary form of the subnet mask is: "11111111.11111111.111110000.000000000"
D. Convert this number into a discontinuous decimal form: "255.255.240.0"
This number is the subnet mask of the network.
Mask annotation
A. The labeling method of subnetless network
For the IP address of the subnetless network, it can be written as a mask with the host number 0. If the IP address is 210.73.140.5 and the mask is 255.255.255.0, you can also default mask and only write the IP address.
B. The labeling method of subnet
When there is a subnet, the two must be paired up. Take Class C address as an example.
The first 3 bytes in the address represent the network number, and the latter byte not only indicates the subnet number, the host number, and whether the two IP addresses belong to the same network segment. If it belongs to the same network interval, the information exchange between these two addresses does not pass through the router. If it does not belong to the same network interval, that is, the subnet numbers are different, the information exchange between the two addresses must be carried out through the router. For example: for a host with an IP address of 210.73.140.5, its host identification is 00000101, and for a host with an IP address of 210.73.140.16, its host identification is 00010000. The first three digits of the above two host identifications are all 000, indicating that these two IP addresses are in the same network area.
The host address, for example, the host identifier of 10.73.60.1 is 00000001, and the host identifier of 210.73.60.252 is 11111100. The first three digits of these two host identifiers are different from 011, indicating that the two are in different network areas, and to exchange information, you need to pass through the router. The subnet host numbers are 1 and 252 each.
2. The function of the mask is to indicate that there are subnets and how many subnets are, but the number of subnets can only be expressed in one range. It cannot be precisely mentioned how many subnets are. The mask does not indicate the specific subnet number. The mask format of the subnet (for C-class address): the first few digits of the host are subnet numbers, and the host is not written later, and all 0 is written.
V. Other matters of IP
1. Generally, the International Internet Information Center allocates IP addresses according to the network. Therefore, the statements of Class A, Class B, and Class C can only be used when talking about network addresses;
2. When allocating network addresses, the network identifier is fixed, while the computer identifier can change within a certain range. The following are the composition forms of three types of network addresses:
Class A address: 73.0.0.0
Class B address: 160.153.0.0
Class C address: 210.73.140.0
Each 0 in the above can be varied between 0 and 255.
3. Because the first three digits of the IP address have determined what type of network an IP address belongs to, the Class A network address cannot be divided into Class B IP addresses, and Class B IP addresses cannot be divided into Class C IP addresses.
4. When talking about a specific computer IP address, it is not advisable to use Class A, Class B, or Class C, but it can be said that the host address belongs to which Class A, Class B, or Class C network.
Through the above learning, everyone must have an understanding of IP addresses. With an IP address, you can send emails and obtain other information on the Internet, such as obtaining WWW services, BBS services, FTP services, etc. on the Internet. Article entry: dnbm Editor: dnbm