kubo icon indicating copy to clipboard operation
kubo copied to clipboard

A (false?) public multiaddress appears and disappears

Open Winterhuman opened this issue 3 years ago • 3 comments

Checklist

Installation method

ipfs-update or dist.ipfs.io

Version

Kubo version: 0.14.0 (also occurred on 0.13.1)
Repo version: 12
System version: amd64/linux
Golang version: go1.18.3

Config

{
  "API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [],
    "Gateway": "/ip4/127.0.0.1/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip6/::/udp/4001/quic"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": false,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "12D3KooWGPcnZf7aVrXfkT85so2C9Zmstqfv3KEndL7JiaBfWd72"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {}
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Routing": {
    "Routers": null,
    "Type": "dht"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {},
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

Sometimes, ipfs daemon will state Swarm announcing /ip4/PUBLIC_IP/udp/4001/quic, however:

  1. I'm behind a NAT; I shouldn't be able to have a public multiaddress.
  2. The public multiaddress doesn't consistently show up in the output of ipfs daemon, but, it always shows up in ipfs id at least briefly.
  3. Doing watch ipfs id reveals that the public multiaddress actually disappears a few seconds after Daemon is ready, then later on the CircuitV2 multiaddresses appear.

I don't know if this is actually doing anything negative, I still get CircuitV2 multiaddresses afterwards as expected, but, I thought the behaviour looked weird.

Winterhuman avatar Jul 21 '22 14:07 Winterhuman

2022-07-22 conversation: we're not exactly sure what this is. We believe AutoNAT or UPnP is the culprit.

It would be helpful also to get your network topology (e.g., ISP, how many routers you have at play, etc.)

This isn't a high priority at the moment though.

BigLep avatar Jul 22 '22 15:07 BigLep

Here's some more information:

  • I have one router/modem.
  • I believe UPnP is disabled on my router.
  • It's definitely not CGNAT, or at the very least CircuitV2 is working (also meaning it's not a Symmetric NAT).

Something to clarify is that the "false" public multiaddress is my actual public IP, I'm calling it a false multiaddress since it appears only briefly and likely isn't usable for nodes outside the local network.

Winterhuman avatar Jul 22 '22 18:07 Winterhuman

As a guess, I think what's happening is the daemon's usual process is to assume the node is public at the beginning no matter what, thus triggering the swarm announce initially, but later on, AutoRelay determines the node isn't public and redacts the public multiaddress that was announced before.

It might be that delaying the public multiaddress announcements until after AutoRelay has given a verdict (when enabled) is all that's required to prevent giving a false public multiaddress too early.

Alternatively, the logic above is already the case, but, some nodes are falsely saying the multiaddress is reachable, and then later on another node contradicts this which causes the redaction. (In which case, maybe multiple AutoRelay responses are needed before the result is trusted?)

Winterhuman avatar Jul 22 '22 18:07 Winterhuman

This is mostly cosmetic, I've never had any significant issues because of the brief moment where AutoNAT's doing it's thing. Closing issue

Winterhuman avatar Oct 21 '22 19:10 Winterhuman