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

Prep work to pass config down to broadcast for ipv6 #525

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jedahan
Copy link

@jedahan jedahan commented Aug 19, 2018

Mostly just passing config along, broadcast does the hard work :)

@christianbundy
Copy link
Contributor

Hey @jedahan, sorry this hasn't been reviewed yet.

Could you give some further context on what this change is and why it's beneficial? It looks like it now takes a new environment variable, ssb_host, plus an IPv6 change, but I don't think I understand why this is necessary (or where it's documented). Thanks a lot, looking forward to getting this resolved!

@christianbundy
Copy link
Contributor

Is this something that's important to get merged? It looks like there are some merge conflicts and I haven't seen an update in a while. Looking forward to updates!

process.env.ssb_appname,
Object.assign(
minimist(conf),
{ host: process.env.ssb_host }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't put a hack like this here... this should already work in ssb-config. are you sure it's needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may no longer be needed, at the time I think this was a side-effect of how ssb_host was being read / overwritten.

@@ -34,7 +34,7 @@ module.exports = {
}
}

var local = broadcast(config.port)
var local = broadcast(config.port, config.loopback, config.family)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh https://github.com/dominictarr/broadcast-stream/blob/master/index.js#L6 loopback makes the broadcast detectable on the same computer (needed for testing)

Was there a problem with this on ipv6? to OP mentions ipv6 but doesn't state it clearly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it will be a little bit of time before I can get a testing setup up and running again. The motivation for this PR was to allow for nodes who are on the same physical network, but only have link-local (self-assigned) IPV6 addresses, to discover each other using another plugin I had written, using ipv6 multicast (similar to ipv4 broadcast).

I need to look into it again, but I think I had to enable loopback to not filter messages from other hosts, not just self-broadcasts.

I opted to pass in the family so the code I was submitting didn't disrupt the normal code path, though it may be better for both to behave the same was, as seen below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should have said something like this in the original post! I think the main reason this PR has languished is because it wasn't clear what you where trying to accomplish, so it wasn't clear how important this was, and so we soon got distracted by other things.

The biggest problem with this code is that it's really hard to test. To really cover all the sorts of network configurations we'd need a much more complicated testing set up than we have currently, like spinning up virtual networks running in VMs. This stuff is currently mainly QA'd by people with unusual network set ups complaining that it's not working.

can you give more context about how/why you are using ipv6? is ipv6 mission critical for you or nice to have?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to be able to allow nodes to join a network without relying on a dhcp server. The 'easiest' way I've found for this is with self-assigned ipv6 addresses, since they won't really collide. I am open to figuring out other ways, but my knowledge is limited.

This is for mainly for two projects:

  1. https://baculus.co - an experiment in disaster response infrastructure
  2. An art project with a friend related to 'the distributed web of care' where we have participants connecting ad-hoc, though I think I can work around this by only having one node in the room act as a dhcp server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, because dhcd is completely different on ipv6 because you can just choose your own ip address. I've also managed to figure out that the reason it takes so long to connect to a wifi is because DHCP spec mandates multisecond delays

I'm definitely keen to support ssb on adhoc networks! another idea we've kicked around it a public open wifi, that lets you download and install an ssb client on the captive portal page

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I wonder if I should setup a video demo of baculus, it totally can do this. Right now it just serves up mvd since that requires zero installation from an end-user, but I should also expose Manyverse if it detects and android phone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is MVD? video demo is always good!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/evbogue/mvd - its a web client for scuttlebutt, that hosts identity keypairs in the browser. I'll make a video this week :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right now I remember

@@ -54,6 +54,7 @@ module.exports = {
var data = buf.toString()
var peer = ref.parseAddress(data)
if (peer && peer.key !== sbot.id) {
if (config.family === 'IPv6') peer.host = buf.address
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the crux of things - if a node is saying 'I am a node' it feels weird to me to use the contents of their message as the IP - why not use the address the packet came from? (From what I understand, its so my node can forward publicly routeable advertisements, which makes sense). With ipv6 link local, addresses are unique to the interface, so you cannot share another nodes address and it be able to connect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don’t get it..

#640 (comment)

@stale
Copy link

stale bot commented Aug 11, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Aug 11, 2019
@staltz
Copy link
Member

staltz commented Aug 11, 2019

@jedahan I recently worked on fixing multiserver to support link-local IPv6 addresses: ssbc/multiserver#52

Would that be sufficient to support the use cases you want, or does this PR still stand as necessary?

@stale stale bot removed the stale label Aug 11, 2019
@stale
Copy link

stale bot commented Nov 9, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Nov 9, 2019
@jedahan
Copy link
Author

jedahan commented Nov 16, 2019

@staltz I think that is enough. I will test it now. Is there a ssb dev setup guide somewhere? It would be nice to see a checklist, something along the lines of:

  • grab this container image
  • setup a mini-network between nodes
  • create a few ids
  • put a test network in caps (or whatever its called now)
  • mount a volume in some node_modules folder
  • hack hack hack

@stale stale bot removed the stale label Nov 16, 2019
@christianbundy
Copy link
Contributor

FWIW, I'm not familiar with a guide like that. However, you may be interested in: https://github.com/ssbc/ssb-integration-tests

@stale
Copy link

stale bot commented Apr 7, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Apr 7, 2020
@staltz staltz removed the stale label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants