Talk about the concept and application of IP address and subnet mask

Personal homepage: insist--personal homepage

This article's column: Network Basics—Taking You Into the Network World

This column will continue to update the basic knowledge of the Internet . I hope you will support me a lot, and let us explore this magical and vast Internet world together.

Table of contents

1. The concept of IP address

2. Classification of IP addresses

1. Class A IP address

2. Class B IP address

3. Class C IP address

4. Class D IP address

5. Class E IP address

3. The concept of subnet mask

3. Application scenarios

Four. Summary


foreword

IP address and subnet mask are very important in the network, they together determine the logical address of the host computer in the network . This article will introduce the definition, types and how to use them to solve practical problems of IP address and subnet mask.

1c3b45946b8c4ce499fcb4340969b58a.jpg

1. The concept of IP address

The IP address is a logical address used to identify hosts in the network . It is composed of 32-bit binary numbers. For the convenience of memory, the 32-bits are divided into 4 groups, each group is 8 bits, and the groups are separated by "." (as shown below), and finally convert the binary of each group to decimal.

An IP address consists of two parts: a network identifier and a host identifier.

ef6f07aee91f41169246f0f95a4b4140.jpg

IP addresses can be divided into public addresses and private addresses .

A public address is a globally unique address on the Internet , which is assigned by the Internet Association (IANA).

The private address refers to the address used inside the local area network , which can be reused in different local area networks, and the Internet can be accessed through the private address.

Little fact: There are 4.3 billion IP addresses in the world. Although it sounds a lot, IPv4 addresses have been completely exhausted on November 25, 2019. In order to solve this problem, NAT technology is used to alleviate the problem of insufficient IP addresses.

2. Classification of IP addresses

IP addresses can be divided into five classes, which are Class A, Class B, Class C, Class D, and Class E.

0cc134c9f9dc414db8ef5020e11b37c5.png

1. Class A IP address

A class 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 range of class A IP addresses is 1.0.0.0 to 126.0.0.0 , and the default subnet mask is 255.0.0.0.

2. Class B IP address

A class B IP address consists of a 2-byte network address and a 2-byte host address, and the highest bit of the network address must be "10". The range of class B IP addresses is 128.0.0.0 to 191.255.0.0 , and the default subnet mask is 255.255.0.0.

3. Class C IP address

A class C IP address consists of a 3-byte network address and a 1-byte host address, and the highest bit of the network address must be "110". The range of Class C IP addresses is 192.0.0.0 to 223.255.255.0 , and the default subnet mask is 255.255.255.0.

4. Class D IP address

Class D IP addresses range from 224.0.0.0 to 239.255.255.255 and are used for multicast delivery.

5. Class E IP address

Class E IP addresses range from 240.0.0.0 to 247.255.255.255 , reserved.

3. The concept of subnet mask

A subnet mask is a 32-bit binary number that distinguishes the network portion and the host portion of an IP address . The subnet mask consists of consecutive 1s and 0s (1 for the network part, 0 for the host part). Through the bitwise AND operation of the subnet mask and the IP address, the network part and the host part of the IP address can be determined.

The calculation method of the subnet mask is to calculate according to the category of the IP address .

06ca1886989b4afabf10aeeb63326ff3.jpg

For a class A address, the first 8 bits are the network ID, and the last 24 bits are the host ID, so the subnet mask is 255.0.0.0; for a class B address, the first 16 bits are the network ID, and the last 16 bits are the host ID, so the subnet mask The netmask is 255.255.0.0; for a class C address, the first 24 bits are the network ID, and the last 8 bits are the host ID, so the subnet mask is 255.255.255.0.

3. Application scenarios

IP addresses and subnet masks are widely used in the Internet and local area networks . In the Internet, the IP address is used to identify the host for data packet transmission; the subnet mask is used to determine the network to which the host belongs for routing. In a local area network, IP addresses and subnet masks are used to identify different devices in order to communicate with each other.

For example : A company has many different departments, and each department has its own network equipment. In order to realize communication between different departments, it is necessary to assign different IP addresses and subnet masks to each department. By configuring the correct IP address and subnet mask, devices in different departments can communicate with each other to form an interconnected network.

Four. Summary

IP address and subnet mask are very important in computer network, they are used to identify the host and determine the network information of the host respectively . By understanding the definitions, types and calculation methods of these two concepts, we can better solve practical problems in network communication. In practical applications, correctly configuring the IP address and subnet mask is the key to ensuring the stability and security of network communication.

Guess you like

Origin blog.csdn.net/m0_73995538/article/details/132348297