01 logo

What exactly is the IP address?

Hacker technology

By Nell JonasPublished 2 years ago 5 min read
Like

III. Switch

In order to solve the complexity of peer-to-peer communication between computers, we introduced the concept of switch.

With the switch, it is up to the switch to distribute data from each machine.

At this time, there is a new problem. On the peer-to-peer data connection, if the two computers want to exchange data, they only need to find the corresponding host data cable from a large number of data lines, but now they are all sent to the switch. How should the switch distribute the data? This is like a package that should not have a clear address, the switch is like a courier company, you give it to the courier company, and if you don't give it the address, the courier company doesn't know who to send the package to. As long as the express company has the address of the express delivery, it knows where to send the package, and so does the switch. We can assign an ip address to each machine.

With the IP address, the switch can send data to the corresponding machine according to the specific IP address by adding the IP address of the corresponding host to the packet sent.

Local area network to wide area network

Through the switch, we can allow the computers connected to the switch to exchange data. if these machines are your school's computers, and if your school wants to cooperate with the school next door, it needs each other's computers to exchange data. the computer next door also uses a switch for data exchange, so as long as we connect the switches of the two schools, the computers on both sides can access each other.

By connecting two switches, the computers on both sides can exchange data, and if more local area networks are added later, the switches will be connected to each other.

As there are more and more switches in the local area network, and the switches are as complex as the point-to-point connections between computers, new switches are placed between the switches.

In this way, there are more and more switches until they cover the whole world, and you only need to enter any one of the nodes, and you can access any node in the world that is also connected to the network, which constitutes the wide area network. You can interpret it as:

The wide area network is the combination of countless local area networks.

Obviously, it must take a lot of money to build these networks. The companies that build these networks are called ISP Internet service providers. The familiar ISP providers are Mobile, Telecom and Unicom, who earn fees by providing networks for their users.

5. IPV4

Every machine on the Internet needs an IP address to access each other, so first we have to talk about the composition of IP addresses. IP address generally refers to the IP address of IPV4, which is made up of 32 bits, so the combination that IP address can use is 2 to the 32 power, which is greater than or equal to 4.228 billion.

In order to facilitate memory and input, every eight binaries are divided into four groups, which are converted to decimal

At the same time, IP addresses are classified, some for special purposes

In the end, there may not be 4.2 billion addresses that are really available. It is known that there are more than 7 billion people in the world. Although not everyone has access to the Internet, many people do not have more than one device. One person may have multiple mobile phones, computers, and so on. If you want to assign an IP to each device, will the 4.2 billion IP address be enough? It's not enough.

VI. NAT network address translation

In order to solve the problem of insufficient IP, we use a new technology, NAT network address translation. If there are five computers, their IP address is 192.168.0.1, and their IP address is 192.168.0.5, and they are connected to the same switch, or router, and the WAN IP of the switch they access is 6.6.6.6.

If these five machines are going to send data to an 8.8.8.8 server, then NAT will convert the original ip of these computers into 6.6.6.6 ip to send data to 8.8.8.8, achieving the effect that five devices share one IP.

If there are many devices mounted under the 8.8.8.8 switch, then these five servers are all sent according to the 8.8.8.8 machine, how can they be sent to the specific devices mounted under 8.8.8.8?

Port mapping

In order to solve the above problem, we introduce a new concept, port mapping. We can add a port after the IP address, as shown in the figure

For example, port 1000 binding of 192.168.0.1 and 6.6.6.6, and port 500 binding of 192.168.0.1 and 8.8.8.8 on the other side, so that if the machine mounted under 6.6.6.6 wants to access the machine mounted under 8.8.8.8, you only need to add the corresponding port.

8. Public network IP and private IP

If you open cmd, type ipconfig to view the IP address

The ip address you will read starts with 192.168. Why? Just mentioned, the ip address is not enough, but in order to enable most machines to access the Internet, we usually share a public network ip, you go to Baidu search ip query

You can see the public network ip on which your current device is mounted. Now you know why a lot of ip starts with 192.168? Because this is a class C private ip mounted to a small transit device, it relies on the public network ip of the converter to access the Internet under this private ip.

For example, the public network ip is the name of your community, and the private network ip is the floor unit where you live. Assuming that the names of the communities across the country are not repeated, then according to the community name, you can find your approximate location. This is equivalent to locating your specific local area network according to the public network IP, but in order to know your specific location, you also need to know how many units and numbers you are in this district. There are several yuan and numbers in each district, which is equivalent to the private network IP, and the private network IP of many machines are repeated.

hackers
Like

About the Creator

Nell Jonas

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.