简体   繁体   English

用于p2p模型的移动网络上的NAT穿透?

[英]NAT punch-through on mobile network for p2p model?

I am writing a p2p messaging Android app, and I'm trying to solve the problem of NAT on mobile networks. 我正在编写一个p2p消息传递Android应用程序,并且试图解决移动网络上NAT的问题。 I cannot currently find a way for a device to connect to another listening device on a 3G/4G network due to the carrier's NAT service. 由于运营商的NAT服务,我目前无法找到一种设备连接3G / 4G网络上另一台侦听设备的方法。

I have heard of a few NAT punch-through methods, but a lot of those involve using some sort of centralized server as a mediator. 我听说过几种NAT穿通方法,但是很多方法都涉及使用某种集中式服务器作为中介。 I am trying to use a completely decentralized p2p approach to accomplish this task. 我正在尝试使用完全分散的p2p方法来完成此任务。

Are there any feasible ways of allowing a device on a mobile network to be publicly addressable? 是否存在允许移动网络上的设备可公开寻址的可行方法?

Thanks! 谢谢!

No, it is not possible. 不,不可能。 Most of the time, subscribers with IP addresses NATed are behind NAT444 and many subscribers are anycasted ( subscribers have the same IP on their mobile phone, but nated behind a different NAT devices). 在大多数情况下,IP地址已被NAT的用户位于NAT444之后,并且许多用户被任意广播(用户在其移动电话上具有相同的IP,但位于不同的NAT设备之后)。 And 2 anycasted suscribers cannot communicate together. 2个任播的订户无法一起通信。

The only way left you is to open a VPN to get a real IP of Internet Public. 剩下的唯一方法是打开VPN以获取Internet公有的真实IP。

My suggestion would be: Do not use VPN for IPv4 ! 我的建议是:不要将VPN用于IPv4! Use VPN to get a real IPV6 to your mobile phone application, and build your p2p application over IPv6. 使用VPN将真实的IPV6获取到您的手机应用程序,并通过IPv6构建您的p2p应用程序。

You are fighting with very old problem that drove IETF to build IPv6. 您正在与驱使IETF构建IPv6的非常老的问题作斗争。

So, go to IPv6, and forget ipv4. 因此,转到IPv6,而忘记ipv4。 The ONLY good solution for your problem is to build your app over IPv6, and your app has to bring the ipv6 tunnel to the phone. 解决您问题的唯一好的方法是通过IPv6构建您的应用程序,并且您的应用程序必须将ipv6隧道引入电话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM