Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p2p nat penetration #248

Closed
jolestar opened this issue Apr 17, 2020 · 6 comments
Closed

p2p nat penetration #248

jolestar opened this issue Apr 17, 2020 · 6 comments

Comments

@jolestar
Copy link
Member

利用 libp2p 实现 p2p nat 穿透

@sanlee42
Copy link
Member

rust-libp2p 应该是不支持upnp协议的(bitcoin的nat方案) substrate的这个issue讨论过: paritytech/polkadot-sdk#567

@sanlee42
Copy link
Member

还有个内网不可达 ip 污染 dht 的问题: paritytech/polkadot-sdk#564

@jolestar
Copy link
Member Author

@fikgol 这两个 issue 确实和我们遇到的问题相关,看怎么去实现这个。

@sanlee42
Copy link
Member

libp2p 开发者对 nat 的现状描述和开发计划: libp2p/rust-libp2p#794 (comment)
总结下就是不打算支持 upnp, 但做了一个类似stun/tun的协议,但 relay 部分还在开发中。还不能用。目前的 rust-libp2p 版本没法打洞。

@sanlee42
Copy link
Member

附2个代码实现的例子用于理解:

  1. bitcoin/ethereum 的 nat 方案 upnp pythone example: https://raw.githubusercontent.com/miniupnp/miniupnp/master/miniupnpc/testupnpigd.py
  2. TCP hold punching example in rust:
    Use https://crates.io/crates/p2p for NAT traversal? libp2p/rust-libp2p#348

@sanlee42 sanlee42 modified the milestones: halley, proxima Jun 1, 2020
@jolestar jolestar reopened this Jun 9, 2020
@jolestar jolestar removed this from the proxima milestone Jul 13, 2020
@jolestar jolestar added this to the starcoin-1.0 milestone Jan 13, 2021
@jolestar
Copy link
Member Author

等 rust-libp2p 那边的实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants