Nat 穿越:UPnP/IGD 与 NAT-PMP
我正在编写一个 P2P 应用程序,希望避免用户手动设置端口转发。
我有点困惑,因为似乎有两种不同的协议来配置 NAT,UPnP/IGD 和 NAT-PMP。我应该使用哪一个?所有 NAT 都支持它们吗?或者我应该同时支持两者以确保 NAT 至少支持其中之一?
I'm writing a P2P application and would like to avoid the need for users to manually set up the port forwarding.
I'm a bit confused since there seem to be two different protocols to configure a NAT, UPnP/IGD and NAT-PMP. Which one should I use? Are they both supported by all NATs? Or should I support both to make sure that at least one of them will be supported by the NAT?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
NAT-PMP(现在的 PCP)是一项 ietf 草案,因此应该是您实施的草案。但是,为了兼容性,您应该允许您的应用程序静默回退到 UPnP/IGD,因为并非所有 NAT 设备都支持 PCP/NAT-PMP,并且许多旧设备仅支持 UPnP/IGD。
NAT-PMP (now PCP) is an ietf draft, so should be the one that you implement. However, for the sake of compatibility, you should allow your application to silently fallback to UPnP/IGD, as not all NAT devices support PCP/NAT-PMP, and a lot of the older devices only support UPnP/IGD.