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 202.160.4.40: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 202.202.202.202, then NAT maps it to 202.202.202.202:5000 (with a random port number). So the connection becomes 202.202.202.202:5000 to -> 202.160.4.40: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 202.202.202.202: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!