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

The relay system is not working properly #10615

Closed
3 tasks done
Griss168 opened this issue Dec 6, 2024 · 6 comments
Closed
3 tasks done

The relay system is not working properly #10615

Griss168 opened this issue Dec 6, 2024 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws) kind/stale need/author-input Needs input from the original author

Comments

@Griss168
Copy link

Griss168 commented Dec 6, 2024

Checklist

Installation method

dist.ipfs.tech or ipfs-update

Version

Bob
Kubo version: 0.31.0
Repo version: 16
System version: amd64/darwin
Golang version: go1.23.2

Alice
Kubo version: 0.31.0
Repo version: 16
System version: amd64/darwin
Golang version: go1.23.2

Config

Under the description.

Description

It is not possible download contents over relay nodes.

Notice: I have not tested this behavior on the latest Kubo version 0.32.1 because its content-providing system appears to be broken, and added content cannot often be found on the IPFS network.

I attempted to publish and download IPFS content on nodes that are not directly accessible from the internet and rely on the relaying system.
My setup includes two PCs behind symmetric NAT in the same network. We'll call these PCs Alice and Bob. Both are running the Kubo daemon v0.31 with the --profile server option to prevent local LAN discovery. I also have a VPS with a publicly accessible Kubo node running v0.27, used for bootstrapping and as a peering node. The network topology is as follows:

IPFS_Topo

Node Bob

On Bob, I ran the command:
~$ ipfs id
{ "ID": "12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ", "PublicKey": "CAESIDlkmJtYnGs0J7N1my9VhlTZJ3Q+AkCFOxl5sDi6MbF3", "Addresses": [ "/ip4/89.38.129.138/tcp/4001/p2p/12D3KooWBaEMaZBRX3VumWcan4XPeRoVunCYhFtFTTm3EzozcCSp/p2p-circuit/p2p/12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ", "/ip4/93.127.215.160/tcp/4001/p2p/12D3KooWSobLujLpmfyXBx29ipzPwYDseFgeVk6fbjvC6E1KCDcP/p2p-circuit/p2p/12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ", ]...}

Alice successfully obtained /p2p-circuit/ addresses for connecting via relay.
I then published content to the IPFS network using the command:
ipfs add ~/Downloads/Crysis.png added bafybeib75xrttell65kx7yzlfkpqzagxdlelbtqsaxfejr5rdodzvyauqe Crysis.png 1.42 MiB / 1.42 MiB [===================================================================] 100.00%

Node Alice

On Alice, I checked if the node obtained a relay address:
~$ ipfs id
{ "ID": "12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "PublicKey": "CAESIB5XhbF2yOom/SLSp6RONtaCDOHlK+MI65rCD17HFIY8", "Addresses": [ "/ip4/2.228.138.36/udp/23007/quic-v1/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/2.228.138.36/udp/23007/quic-v1/webtransport/certhash/uEiDfF3_p8NPewxre376TtIH-etivvw94JHHAYbr-bFhhlQ/certhash/uEiCxMlNn7h9DG7EGq0gvUtOehCy1MaerRY5V4jygF6uJdg/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/2.228.138.36/udp/50110/quic-v1/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/2.228.138.36/udp/50110/quic-v1/webtransport/certhash/uEiDfF3_p8NPewxre376TtIH-etivvw94JHHAYbr-bFhhlQ/certhash/uEiCxMlNn7h9DG7EGq0gvUtOehCy1MaerRY5V4jygF6uJdg/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/2.228.138.36/udp/52094/quic-v1/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/2.228.138.36/udp/52094/quic-v1/webtransport/certhash/uEiDfF3_p8NPewxre376TtIH-etivvw94JHHAYbr-bFhhlQ/certhash/uEiCxMlNn7h9DG7EGq0gvUtOehCy1MaerRY5V4jygF6uJdg/p2p/12D3KooWAh4c5PbWH4tmrC8etSUzsJrvrFF8bpDzTvWcEmmYcBNF/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/95.214.53.201/tcp/4001/p2p/12D3KooWMmyvbib9ahTPDjcoEMmyni4q3Hdctd2TH5Y3Dfs7oaY7/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/95.214.53.201/udp/4001/quic-v1/p2p/12D3KooWMmyvbib9ahTPDjcoEMmyni4q3Hdctd2TH5Y3Dfs7oaY7/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip4/95.214.53.201/udp/4001/quic-v1/webtransport/certhash/uEiB8_cRFzehw1NT0G7XCNkj73oY2LPWosyApM0nSZIIqwQ/certhash/uEiDLlJee-4Swe4m52bmn8oCd7XCDIk9zX9YIVQRK2JlaCw/p2p/12D3KooWMmyvbib9ahTPDjcoEMmyni4q3Hdctd2TH5Y3Dfs7oaY7/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq", "/ip6/2a03:cfc0:8000:7::5fd6:35c9/tcp/4001/p2p/12D3KooWMmyvbib9ahTPDjcoEMmyni4q3Hdctd2TH5Y3Dfs7oaY7/p2p-circuit/p2p/12D3KooWBroodnZHhgbT4UdCWvYx5Yo4pAQSEvdvPsBBM9JWteRq" ],...

Next, I attempted to locate the published content:
~$ ipfs routing findprovs bafybeib75xrttell65kx7yzlfkpqzagxdlelbtqsaxfejr5rdodzvyauqe 12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ

I obtained the PeerID and checked for the address of this node:
~$ ipfs routing findpeer 12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ /ip4/89.38.129.138/tcp/4001/p2p/12D3KooWBaEMaZBRX3VumWcan4XPeRoVunCYhFtFTTm3EzozcCSp/p2p-circuit /ip4/93.127.215.160/tcp/4001/p2p/12D3KooWSobLujLpmfyXBx29ipzPwYDseFgeVk6fbjvC6E1KCDcP/p2p-circuit

I received two relayed addresses. However, attempts to download the file resulted in no success:
~$ ipfs get bafybeib75xrttell65kx7yzlfkpqzagxdlelbtqsaxfejr5rdodzvyauqe

I tried multiple times and even waited for an hour.

I also tried creating a peering connection with Alice using the relayed address:
~$ ipfs swarm peering add /ip4/89.38.129.138/tcp/4001/p2p/12D3KooWBaEMaZBRX3VumWcan4XPeRoVunCYhFtFTTm3EzozcCSp/p2p-circuit/p2p/12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ
add 12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ success
~$ ipfs swarm peering ls
12D3KooWDgQNimVrtJyggCUpjamydDL7rtEYpLZ1nyCPkYYuYRLJ /ip4/89.38.129.138/tcp/4001/p2p/12D3KooWBaEMaZBRX3VumWcan4XPeRoVunCYhFtFTTm3EzozcCSp/p2p-circuit

From my experience with peering, the VPS node can immediately access this content.

There are config files from Alice and Bob:
Alice_config.json
Bob_config.json
(notice: I hide IP and ID of VPS)

Let me know if further clarification or adjustments are needed!

@Griss168 Griss168 added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Dec 6, 2024
@hsanjuan
Copy link
Contributor

IIRC: Since libp2p relay v2 were introduced, relays cannot be used to download content. The amount of data they relay is very limited and serves only to perform hole-punching. So if content cannot be retrieved, it is likely because hole-punching is not working. Assuming this is the issue, I'm not sure we can do much...

@hsanjuan
Copy link
Contributor

The fact that your VPS node runs a super old Kubo version does not help either... probably it does not know how to hole-punch using the new protocols.

@gammazero gammazero added need/author-input Needs input from the original author and removed need/triage Needs initial labeling and prioritization labels Dec 10, 2024
Copy link

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

@lidel
Copy link
Member

lidel commented Dec 17, 2024

Filled libp2p/docs#387 to improve docs about Relays and their limits / self-hosting concerns

Copy link

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

Copy link

github-actions bot commented Jan 1, 2025

This issue was closed because it is missing author input.

@github-actions github-actions bot closed this as completed Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) kind/stale need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

4 participants