Author

Topic: How does a node ensure it sees all other nodes? (Read 194 times)

legendary
Activity: 1260
Merit: 1168
A related question: what happens when a node gets saturated with connections?  
I can imagine that the first few servers in the known servers list at startup get a ton of requests.

I would assume that the peers are chosen randomly, and not starting with the first entry in the peersDB. The list is also constantly changing (DNS seeds, getaddr messages, pruning of offline peers).

Any excess inbound connections beyond the limit of a (user configurable) "max inbound connections limit" are of course dropped.
legendary
Activity: 1260
Merit: 1168
If I start up a BTC full node, it connects to a small number of other nodes. (is it 8?)  How do I really know that I'm connected to all other bitcoin nodes? It seems that it would be possible that somehow I connected to a small subset of nodes that only know about the subset - like a high school clique that only talks to people at the cool kids table.

For example, with bit torrent, it's not unusual to have lots of little groups that don't know about each other.  Digging up a long list of seeds gets better results than just one seed & what it knows about.

With Bitcoin, that could be a very bad thing.  Are there mechanisms in place to prevent or detect this?

Well, what you typically have is a small world graph - so you can reach anyone in the world by approximately 7 hops (if I recall correctly)? To prevent certain types of attacks that would "isolate" you from the network, the client should prevent you to connect to multiple nodes from the same subnet, which reduces the chance of you getting isolated to an absolute minimum.

Regarding Bittorrent: That is definitely not true. How can such small groups occur when there is a global tracker maintaining a chunks-list of all connected peers?
newbie
Activity: 8
Merit: 1
A related question: what happens when a node gets saturated with connections?  
I can imagine that the first few servers in the known servers list at startup get a ton of requests.
sr. member
Activity: 257
Merit: 343
The bitcoin node has a set of pre-defined names in its initial installation. It would try to connect to one of these systems, and get further systems to connect to from there.
During initial sync you might not see many connections. When initial sync is done, you can see the system getting connected to 15-20 other systems, or even more. So a node does not "ensure", it is connected to all other nodes. Thats not how the system works.

And one more hint: several ports have to be opened on your router, so that incoming connections are allowed. If you haven't configured the router correctly, the system will not connect to more than 8 other systems.
newbie
Activity: 8
Merit: 1
If I start up a BTC full node, it connects to a small number of other nodes. (is it 8?)  How do I really know that I'm connected to all other bitcoin nodes? It seems that it would be possible that somehow I connected to a small subset of nodes that only know about the subset - like a high school clique that only talks to people at the cool kids table.

For example, with bit torrent, it's not unusual to have lots of little groups that don't know about each other.  Digging up a long list of seeds gets better results than just one seed & what it knows about.

With Bitcoin, that could be a very bad thing.  Are there mechanisms in place to prevent or detect this?
Jump to: