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

granular network control #113

Open
ghost opened this issue Jun 27, 2019 · 12 comments
Open

granular network control #113

ghost opened this issue Jun 27, 2019 · 12 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jun 27, 2019

I've mentioned this on cabal a bit already, but it would be great if the cabal clients had more granular control over their connections. In some situations you might want to turn off all connections to save battery or bandwidth. In others you might only want local MDNS but not the public internet. In others you might not want to broadcast over MDNS for privacy. Making these settings configurable at runtime and showing a prompt when first running about the considerations around each type of connection would be very helpful.

@RangerMauve
Copy link

Sorry to hijack this a little, but do you have any ideas about what the API for something like that should look like?

With regards to the SDK for example.

So far I was thinking something like this:

coreOrArchive.setNetworking('none' || 'local' || 'global')

@ghost
Copy link
Author

ghost commented Jul 14, 2019

There should be modes for setting each networking subsystem independently, so I would add 'all' to that list (for local (mdns) + global (internet)). There are privacy/consent reasons why you might not want to broadcast mdns but would want to connect to a DHT or signalhub tracker. It might be good to enumerate those modes more explicitly too. Something like:

archive.setNetworking(['mdns','dht']) // options: mdns, tracker, dht. use [] for none.

I think it's better to be explicit about the tech because there could be other local options like bluetooth and other global options (different DHTs, trackers, servers) in the future.

@hackergrrl
Copy link
Member

In speaking to the Toronto Mesh folx, they also expressed a desire to specify a list of IPs to peer with.

Another consideration are what bootstrap servers you want to use: right now we use the dat-swarm-defaults module to pick some.

The full data structure for controlling networking might look like this:

{
  mdns: true,
  dht: {
    enabled: true,
    bootstrap: [ 'bootstrap1.datprotocol.com:6881' ]  // DHT bootstrap servers
  },
  peers: [ 'eight45.net', '12.21.123.0' ],   // direct-connect hostnames/IPs
  servers: [ 'discovery1.datprotocol.com', 'discovery.eight45.net' ]   // DNS discovery servers
}

@okdistribute
Copy link
Member

okdistribute commented Jul 24, 2019

great idea

servers -> dns though, it seems a bit more specific?

@RangerMauve
Copy link

One thing I'd like to add to the peers thing is that you might need to specify which key the peers are for.

E.g.

{
  peers: {
   "cabal key 1 here": [ ... etc],
   "cabal key 2 here": [ ... etc],
  }
}

@hackergrrl
Copy link
Member

@Karissa agh I dislike the term "dns" for this case because you could also use an IP for this part: it's not dependent on DNS. It's, like, "public-IP-server-assisted discovery".

@RangerMauve this could actually be true for ALL of the discovery mechanisms! Maybe there's a public cabal you want to use i2p for, and others you don't, or maybe some you feel OK with using mdns for, and others you don't want to broadcast your membership to the whole network. This feels like a thing that could range from super simple configurations ("all networking please!") to highly specific.

@DeltaF1
Copy link

DeltaF1 commented Jul 24, 2019

@noffle The servers are still using DNS as the communication method though, are they not? Maybe dns_servers would be a more descriptive title than either separately.

@RangerMauve
Copy link

Regarding different channels, what about something like this:

{
  default: {
     dht: {
      enabled: true,
      bootstrap: [ 'bootstrap1.datprotocol.com:6881' ]  // DHT bootstrap servers
     },
  },
  "some cabal key": {
     mdns: true
  },
  "some other cabal key": {
    mdns: false
  }
}

@hackergrrl
Copy link
Member

@DeltaF1 Oops, looks like I misunderstood how this works. Please disregard what I said -- dns does make more sense as a key. ^___^

@RangerMauve
Copy link

Didn't have time to look at this today, but I've got the tab open to look into more tomorrow. 💜 I'll also try to bring it up at the consortium meeting.

@RangerMauve
Copy link

Totally forgot to bring it up at the consortium, but I think today was still a "how are we organizing" sort of day rather than a "what technical stuff are we focusing on". :P

@cblgh
Copy link
Member

cblgh commented Oct 30, 2019

definitely the right choice @RangerMauve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants