First of all, it is important to know that internal network addresses cannot directly communicate with the external network. This involves a NAT protocol. The most commonly used one now is a technology called NAPT (Network Address/Port Translator). In simple terms, NAPT is: when you establish a connection with the external network, the local IP is 192.168.0.11:4000, and you want to establish a connection with the external network 188.8.131.52:3300. The work of NAT is to map the local address to the external network address (you need at least one external network IP to connect to the internet). For example, if the external network IP is 184.108.40.206, then NAT maps it to 220.127.116.11:5000 (with a random port number). So the connection becomes 18.104.22.168:5000 to -> 22.214.171.124:3300. Then, if the server sends a packet, it will be reverse-translated by NAT to the internal network IP, and communication can be established. Of course, other IPs sending information to 126.96.36.199:5000 will be discarded. How to establish a connection? This is internal network communication. Here, a server is needed, and both parties log in. The server records the IP addresses of both party A and party B. Both party A and party B can communicate with the server. So how do A and B communicate with each other? This requires the magical technique of hole punching. A wants to send information to B, so A informs the intermediary S about this. S informs B. Since the anonymous IP will be discarded by B, A's address needs to be changed to a non-anonymous one. So B sends information to A's address (this is hole punching). Obviously, the connection cannot be established, but the gateway records A's address. At this time, A can send information to B. The connection is established! A->B? A->S S->B B->A? A->B ok!