rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Ping example doesn't work

Open brandonros opened this issue 3 years ago • 5 comments

PC 1:


C:\j2534-http>.\ping.exe
Local peer id: PeerId("REDACTED")
Listening on "/ip4/192.168.10.205/tcp/54002"
Listening on "/ip4/100.92.72.177/tcp/54002"
Listening on "/ip4/127.0.0.1/tcp/54002"

PC 2:

C:\j2534-http>.\ping.exe /ip4/REDACTED/tcp/54002
Local peer id: PeerId("REDACTED")
Dialed /ip4/REDACTED/tcp/54002
Listening on "/ip4/10.0.3.4/tcp/63362"
Listening on "/ip4/127.0.0.1/tcp/63362"

I never get an event back. What are my options here? I thought entire purpose of library was to ensure connectivity between two PCs.

brandonros avatar Feb 24 '22 19:02 brandonros

You would need to give us more context in order to help you. What network are you running on? What is the output run with RUST_LOG=debug? ...

mxinden avatar Feb 25 '22 10:02 mxinden

Is it expected to get around blocked ports?

brandonros avatar Feb 25 '22 16:02 brandonros

Only if you use hole punching. See https://docs.rs/libp2p/latest/libp2p/tutorials/hole_punching/index.html

mxinden avatar Feb 25 '22 16:02 mxinden

After the connection is made through the relay server, does the traffic flow directly P2P or does all traffic still go through relay server?

brandonros avatar Feb 25 '22 17:02 brandonros

After the connection is made through the relay server, does the traffic flow directly P2P or does all traffic still go through relay server?

Once the connection from A to B via R is established all data flows over R. Once A and B established a direct connection (hole punch) with the help of libp2p-dcutr and R, both the direct connection and the relayed connection exist. Given that the direct connection is faster and given that the relayed connection is limited and after some time and bytes terminates, the direct connection will prevail.

mxinden avatar Feb 28 '22 15:02 mxinden