banner
ximalaya

ximalaya

这里是openkava 的blog,关注程序开发的一切技术。 ZZ 表示转载的文章,如涉及版权,请和我联系删除。 在这里你可以看到关于以下技术的文章: 移动开发技术,ANDROID ,IOS,WINDOWS PHONE平台开发,企业ERP开发,动态脚本PYTHON ,OPENGL ES 3D技术,游戏开发技术,HTML5 ,JAVASCRIPT ,MYSQL,AMAZON EC2 ,GOOGLE GAE ,GOOGLE CLOUD SQL 等 。 本站发展历程: 2010年,正式把所有的blog移到这里,租用godaddy的空间,记录生活和工作上的一些心得。 下面是关于我的个人介绍,写在这里权当凑字数啦。 职业:软件开发,开发经验6年,管理经验3年; 工作上使用的技术:C#, SQL SERVER 个人使用的技术:PYTHON,PHP, CSS, JAVA ,ANDROID ,object-c 等等 联系我请发邮件:<a href="http://blog.openkava.com/openkava@gmail.png"><img class="alignnone size-full wp-image-96" title="邮箱" src="http://blog.openkava.com/openkava@gmail.png" alt="" width="174" height="24" /></a>

zz Internal Network and External Network Communication Internal Network and Internal Network Communication NAT_noob_Baidu Space

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!

Through Internal Network and External Network Communication Internal Network and Internal Network Communication NAT_noob_Baidu Space.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.