Understand IP addresses in one article: meaning, classification, subnet division, check and change, routers and IP addresses

Understand IP addresses in one article: meaning, classification, subnet division, check and change, routers and IP addresses

This article will combine easy-to-understand pictures and texts to carefully sort out and summarize the high-frequency term in the Internet era - IP address, and tell the "story" about IP address for readers!

1. What is an IP address?

In the 21st century, one of the most common words people hear about the Internet is: IP address! For example, "What is the IP address of the computer?", "How to set the IP address of the router?", "How to modify the IP address of the computer?", "What is the IP address of the server?"... So what exactly is an IP address?

1. IP address explanation

IP, which stands for Internet Protocol in English, refers to the Internet protocol in the TCP/IP network system and works in the network layer of the OSI model (just understand it briefly).

IP address: The IP protocol stipulates that all devices connected to the Internet must have their own unique "identity number" - IP address. When network devices exchange information, the IP address of the target device must be set in the data message in order to accurately transmit the data to the target device, just like the courier must fill in the recipient's address so that the courier can successfully deliver the courier to the recipient according to the recipient's address. A network device on the Internet can have multiple IP addresses, but one IP address can only correspond to one network device, that is, the IP address is unique:

IP address uniqueness

After understanding what an IP address is, let's look at the writing format of an IP address.

2. How is an IP address constructed?

An IP address is a string of numbers that follows international writing standards and consists of 32 binary digits 0/1 (for binary, please refer to: Understanding Computer Data in One Article: From Each Digit Never Greater Than 9 to Binary 0-1), with each digit in a group of 8, separated by dots. Similar to the data segment of an ID number (6 digits for place of origin + 8 digits for date of birth + 3 digits for sequence code + 1 checksum), IP address data is divided into two functional segments:

★ Network address/network number + host address/host number (32 bits in total), divided into the following five categories, among which A/B/C are commonly used IP addresses:

  • Class A IP address: 8-bit network address + 24-bit host address
  • Class B IP address: 16-bit network address + 16-bit host address
  • Class C IP address: 24-bit network address + 8-bit host address
  • Class D IP addresses are multicast addresses, and Class E IP addresses are reserved addresses and are not introduced here.

Five categories of IP addresses and ranges

The IP address encoding specification stipulates that: a network address and a host address that are all 0s are local addresses, indicating a local network or host; a network address and a host address that are all 1s are broadcast addresses, indicating that all websites can receive the information sent. Usually, these two types of IP addresses cannot be used as host IP addresses on the Internet. Therefore, removing these two from each type of IP address, the number of network addresses of the three types of IP addresses, ABC, and the number of hosts that can be accommodated in each network address can be calculated:

  • Class A IP address: 126 (2^7-2) network addresses, which can accommodate 16777214 (2^24-2) hosts
  • Class B IP address: 16382 (2^14-2) network addresses, which can accommodate 65534 (2^16-2) hosts
  • Class C IP address: 2097150 (2^21-2) network addresses, which can accommodate 254 (2^8-2) hosts

For details about the classification of IP addresses (AE), subnet division, host capacity calculation, the relationship between subnet mask and IP address, subnet address, network address, etc., please refer to the next section!

2. IP address classification and subnet division

This section requires readers to have binary knowledge. You can refer to: Understanding computer data in one article: From each digit never greater than 9 to binary 0-1. Then the following will introduce the classification of IP addresses and subnet division and other technical contents in detail!

The Internet Information Center (InterNIC) of the United States uniformly manages the global IP addresses and stipulates that all network devices joining the Internet must apply for IP addresses from it or from the local information center. Of course, if you only communicate in a local area network, you can flexibly design the IP address mechanism according to actual needs. The following is a simple LAN IP address division scheme - subnet mask addressing:

Subnet Mask Example

1. Subnet mask: All bits except the host address are 1.

In the previous article, we have introduced in detail the composition of IP addresses: network address + host address. In the subnet mask addressing scheme in the figure above, in order to more flexibly allocate the number of hosts, the original 16-bit host address of the Class B IP address is further divided into: sub-address mask + new host address, thus forming a three-level IP address format of network address + subnet address + host address, and defining the subnet mask to achieve three-level addressing. In order to make everyone more clear about the mechanism, we will explain it in detail through actual cases.

2. University IP address three-level addressing case introduction

In fact, the IP addresses that an organization or institution applies for from the local NIC are all network addresses. After obtaining the network address, all IP addresses corresponding to the network address will be regarded as network devices within the organization or institution by the Internet, such as:

A university has four colleges. The school applied for a Class B network address - 128.1.0.0 from the local information center. That is, the IP addresses of all the school's hosts are in the range of 128.1.0.0 to 128.1.255.255. The school plans to use a three-level addressing method to divide the applied IP address into four subnets and allocate them to the corresponding colleges. So how to divide it?

As we have already known from the previous article, the network address and host address in a Class B IP address each occupy 16 bits, so the IP address assigned by the Information Center to the school corresponds to:

  • The network address is: 128.1 is equivalent to 10000000.00000001
  • The host address is: 0.0~255.255 is equivalent to 000000000.00000000~11111111.11111111

We already know that the three-level addressing requires the host address to be further divided into: subnet address + new host address. The school requires four subnets to be divided into four colleges. Then we can divide two bits (00, 01, 10, 11) from the original host address to form four subnets. Then the new three-level IP address structure corresponds to:

  • The network address is: 128.1 is equivalent to 10000000.00000001
  • Subnet address: 0~3 is equivalent to 00~11
  • New host address (14 bits): 0000000.00000000~111111.11111111
  • The subnet mask is: 255.255.192.0 is equivalent to 11111111.11111111.11000000.00000000

The diagram is as follows:

Case Analysis of Level 3 IP Addressing

The subnet address in the three-level IP address addressing mechanism is only valid internally. The Internet always believes that the school network address is 128.0.0.0 and there is no subnet address. When the network equipment in the Internet sends data to the host in the school, when the IP data packet arrives at the school network, the border router will read the IP address in the IP data packet and perform an "AND" operation with the school's subnet mask. The result is the college subnet. The router then forwards the IP data packet to the corresponding college based on the subnet, and the college subnet then forwards the data packet to the target host, thus completing the process of the Internet host sending data to the host in the school.

I believe that through the above case analysis, readers have a good understanding of IP address division and subnet mask. In fact, the content of this section is just a starting point. Based on the above content, interested readers can learn another more effective IP address addressing scheme - variable-length subnet mask addressing! This scheme can make full use of IP address resources and reduce IP address waste. Due to space limitations, this article will not go into details.

Why use IP addresses?

Regarding this issue, in fact, it has been mentioned in previous articles. In the actual use of the Internet, although users rarely need to use IP addresses directly, for example, when surfing the Internet, users obtain information through URLs, but in fact, URLs are finally mapped to IP addresses. See: Understand in one article: URLs, URLs, domain names, IP addresses, DNS, domain name resolution, so all network behaviors of Internet users require the use of IP addresses for data transmission. So why is this?

[[281784]]

Why use IP addresses?

Reason answer:

First of all, we need to make it clear that all Internet terminal devices that ordinary Internet users come into contact with are based on the TCP/IP protocol. Of course, relevant professionals will use more protocols, such as: DHCP (Dynamic Host Configuration Protocol), FTP (File Transfer Protocol) File Transfer Protocol, HTTP (Hypertext Transfer Protocol) Hypertext Transfer Protocol, etc. In the TCP/IP protocol, it is agreed that IP addresses are indispensable for data transmission between all network devices, such as computers and mobile phones, computers and servers, and computers and computers. IP addresses are indispensable. As the only network identifier of the destination device in Internet device communication, IP addresses are indispensable (important things must be said three times), otherwise IP data packets will be like headless flies, rushing around in the Internet and will never reach the target device.

IP datagram frame format

4. Total number and usage of global IP addresses

1. Total number of IP addresses worldwide

The IP addresses described in this article are all IPv4 versions. As mentioned above, IPv4 addresses are divided into four segments, each with a numerical range of 0 to 255, totaling 256. The number of IP addresses in the four segments = 256 to the fourth power, which is nearly 4.2 billion (actually 32-bit binary, the total number of IP addresses = 2 to the 32nd power). Excluding some unusable IPs, the total number of available IP addresses in the world is about 4 billion.

2. Number of IP addresses used worldwide

Through BCZS, you can query the usage of IP addresses in cities around the world (some countries have only a few IP addresses):

IP address usage by country around the world

Detailed data query for specific IP addresses:

Example of the machine's IP address information

5. How to view/modify IP address

This article will take a computer as an example to explain how to query and modify the IP address, as well as how to view and modify the IP address on a mobile phone.

1. Computer IP address query - direct graphic explanation

How to open the control panel: Win key (the win key on the lower left and right corners of the keyboard) + R key, enter "control" and press Enter

How to view the computer IP address

2. Check the mobile phone IP address

If you use wifi on your mobile phone, you can check the IP address. If you use a mobile network, there is no need to check the IP address, so I will not introduce it.

Mobile IP address check

3. IP address modification

Under normal circumstances, the mobile phone does not need to modify the IP address, unless the proxy is set to capture packets or relevant professional technicians need it, so here we only introduce the modification operation of the IP address on the computer:

The IP addresses modified by computers are generally Class B or Class C.

  • Class B default subnet mask: 255.255.0.0
  • Class C default subnet mask: 255.255.255.0
  • Default gateway: The last segment of the IP address is 1. For example, if the IP address is 192.168.1.x, the default gateway is 192.168.1.1.

Modify the computer IP address

6. Routers and IP addresses

The IP address is most closely related to the IP address setting and allocation of home routers. For the setting of home routers, you can refer to the previous article: Learn the functions and setting methods of various router parameters in three minutes to cope with all router settings! Nowadays, the installation and setting of home routers are becoming simpler and simpler. You only need to set up a broadband account, so this article only explains the principles.

Unlike enterprises, organizations or institutions, home users' IP addresses do not apply for an address segment, but a specific address assigned by the operator, such as 183.185.21.171. Since IP addresses are unique, if a router is not used, only one network device can access the Internet through a home broadband. However, after the broadband passes through a router, multiple devices can access the Internet at the same time. Why is this?

A router is equivalent to a pool. After the broadband allocated by the operator is accessed to the router, the router can reallocate a batch of IP addresses based on its own address pool. These IP addresses are the IP addresses obtained by our mobile phones, computers, and TVs.

Router Function Diagram

However, these addresses are only different for home networks. Compared with the Internet, the IP addresses of all home network devices connected to the router are IP addresses assigned by the operator:

Home network equipment topology diagram

Summarize

This article uses easy-to-understand language and pictures to explain and introduce all the "stories" of IP addresses in detail. I hope that through the explanation of this article, more people will have a new understanding of IP addresses, computers, and the Internet!

<<:  Should you change your 5G package? You will understand after reading this!

>>:  Do you know how HTTP uses TCP connection? Today I will tell you

Recommend

These 22 IoT terms will make others worship you just by saying any one of them

Improve your chat style and enter the IoT circle ...

Ten Tips to Simplify Fiber Optic Cable Installation

Installing fiber optic cable is a complex and tim...

The 5G license has been issued, what should we do now?

The 5G license really came a bit suddenly. People...

5G latency is less than 1 millisecond and will it replace Wi-Fi? Not true!

As the fifth generation of mobile communication n...

In the 5G era, how do the three major operators fight the edge war?

5G makes the Internet of Everything possible. Whi...

Data Center and IT Facilities Priorities

Today, businesses undergoing digital transformati...

PoE Troubleshooting Guide: Common Problems and Solutions

Power over Ethernet (PoE) is a revolutionary tech...