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

Question regarding peer count #8

Open
AlexanderParker opened this issue Nov 20, 2013 · 2 comments
Open

Question regarding peer count #8

AlexanderParker opened this issue Nov 20, 2013 · 2 comments
Labels

Comments

@AlexanderParker
Copy link

I am assuming smokesignal doesn't simply connect peers directly to each other, so a single peer will not be aware of every other peer on the network.

Given this assumption, how easy / difficult would it be to obtain a peer count for the whole network? Is this a tractable problem, or are my assumptions about the topology of a smokesignal network incorrect?

Thanks!

@marcelklehr
Copy link
Owner

Ah. No, only immediate neighbors are called peers here. Counting all
connected nodes is possible, though.

You could, for example, tell all nodes to connect to a specific port of
your node (e.g. where a simple tcp server is listening), so you can
count them.

You could also take a graph tracing approach: Send a message
COUNT(messageId) to all your peers. Nodes that already got the message
return a COUNTED(0). A node that has not got the message yet, forwards
it to all it's peers, adds the returned numbers and returns a
COUNTED(returnedTotal + 1).
If you're the node that started it, returnedTotal+1 is the total number
of nodes in the network.

@AlexanderParker
Copy link
Author

Thanks for the clarification.

Personally I'd like to avoid having a central server acting as a network overseer. Ideally I'd like it to be as decentralized as possible, so the graph tracing approach you mentioned might be the best way to go. Thanks for the information, hopefully I can put it to good use!

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

No branches or pull requests

2 participants