A comprehensive review of network protocols: one article to string together all the key points

Have you ever encountered such a situation:

"My computer can't connect to the Internet. I have an IP address, but why can't I get online?"
"What is this subnet mask and default gateway? It's so confusing..."
Don't worry, this article is here to "solve the mystery". Just read it and you will no longer be confused when you set up your network next time.


1. What is an IP address for?

An IP address is like your house number. Without it, the courier can't find you.

In the Internet world, an IP address (Internet Protocol Address) is used to identify the location of each device. Just like the house we live in has an address, the devices on the Internet also need an "address" to communicate with each other.

For example, your computer's IP address may be like this:

This means you are in room 10 in the community "192.168.1".
2. What is the subnet mask used for?

The subnet mask is used to "divide" and decide who is your neighbor and who is not.

Let's take the address 192.168.1.10 as an example. If your subnet mask is:

Then your "neighbors" are all devices with IP 192.168.1.X (X is from 1 to 254). You all live in the same community and can chat with each other by just saying hello.
3. What is the default gateway?
A gateway is like the main entrance of a community. If you want to find someone who doesn't live in the community, you have to go out first.

For example, if the IP address of a website you want to visit is 8.8.8.8, which is not in your community, you have to find a gateway (usually your home router) to "pass the message" to you.

Usually the address of the gateway will be the first address of your network segment, for example:

It is your "entrance and exit".
4. Window Setting Example
If you want to manually set the IP address of a device, the following is a reasonable setting:

Remember: IP, mask, and gateway must match a network segment, otherwise you will be like moving to another neighborhood and can't find the door.

In summary: IP is your address, gateway is your door, and mask determines who your neighbor is