In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is global IP and private IP". In daily operation, I believe many people have doubts about what global IP and private IP are. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what is global IP and private IP?" Next, please follow the editor to study!
You may often hear about global IP and private IP. What is the difference between them? Today's article will briefly explain what this is all about.
As we all know, the number of IP addresses in IPv4 is limited, and each time a part of the address is allocated, it means that fewer IP addresses can be allocated, and with the rapid development of mobile phones, computers, etc., if each mobile phone or computer requires an IP address, then obviously IP address is not enough.
In order to solve this problem, we can adopt this strategy: for example, for a company, each company will have its own intranet (also known as local area network).
Suppose we assign an IP=192.168.1.1 to this company A. Let's use this IP as the gateway of the company's intranet.
There are three computers in the intranet of Company A. if these three computers want to access the Internet, we need to assign him an IP, so do we have to apply for three IP addresses to use?
Answer no. We do not necessarily need to apply for three IP, in our intranet, we can specify our own rules, for example, we can assign three IP to these three computers at will (please note that these three IP are not applied for, and I assign them at will). Assign computer A = 192.168.1.2 computer B = 192.168.1.3 computer C = 192.168.1.4
If computer A wants to visit Baidu, we assume that the IP of Baidu is 172.168.30.3.
We all know that the IP of computer An is made up by us. In fact, there may not be such an IP. If you use the IP of computer A to visit Baidu, it certainly won't work.
We also know that since Baidu and computer An are not in the same local area network, if A wants to access Baidu, it has to go through the gateway. The IP address of the gateway is real and can be accessed by Baidu.
In order to allow A to access Baidu, then we can take this approach: let the gateway to help An access, and then Baidu pass the result to the gateway, and the gateway then pass the result to A, so it can be solved?
However, computers A, B and C may all ask the gateway to help visit Baidu, and the destination IP returned by Baidu is the IP=192.168.1.1 of the gateway. So how can the gateway tell whether the result is A, B or C?
When we visit Baidu, don't we need to specify a port? As long as we map the IP+ port of A to the IP+ port of the gateway, can we uniquely determine the identity?
For example, A uses port 60 to access Baidu, and the gateway maps IP+ port 60 of A to IP+ port 80 of the gateway.
After Baidu returns the result to port 80 of the gateway, the gateway can return the result to port 60 of A through the mapping table.
If B also uses port 60 to access Baidu, it is the same, it can be mapped to port 90.
This method of address mapping translation, we also call it network address translation. English is Network Address Translation, abbreviated as NAT.
IP addresses like A, B, C are also called intranet IP, that is, private IP;, while IP like gateway and Baidu are called extranet IP, that is, global IP. Now you know the external network IP and the intranet IP, right?
What do you need to pay attention to?
1. For the global IP, obviously each IP is unique, and for the private IP, it has to be unique within the same local area network, but there can be the same private IP in two different Lans.
2. There is no need for address translation for the communication between hosts in the local area network, but address translation is needed only if you need to access the external network.
In fact, we can also call this kind of address translation a kind of proxy. The gateway is equivalent to an agent, hiding some information of the hosts in the local area network. Baidu does not know that host An accesses it, only that it is the gateway that accesses it.
At this point, the study on "what is global IP and private IP" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.