Bitcoin Forum
May 03, 2024, 04:15:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does a node ensure it sees all other nodes?  (Read 173 times)
FlatPepsi (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
July 16, 2018, 04:01:41 PM
 #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?
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714752944
Hero Member
*
Offline Offline

Posts: 1714752944

View Profile Personal Message (Offline)

Ignore
1714752944
Reply with quote  #2

1714752944
Report to moderator
1714752944
Hero Member
*
Offline Offline

Posts: 1714752944

View Profile Personal Message (Offline)

Ignore
1714752944
Reply with quote  #2

1714752944
Report to moderator
1714752944
Hero Member
*
Offline Offline

Posts: 1714752944

View Profile Personal Message (Offline)

Ignore
1714752944
Reply with quote  #2

1714752944
Report to moderator
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
July 17, 2018, 06:12:35 AM
 #2

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.
FlatPepsi (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
July 17, 2018, 01:05:39 PM
 #3

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.
Evil-Knievel
Legendary
*
Offline Offline

Activity: 1260
Merit: 1168



View Profile
July 17, 2018, 01:10:08 PM
 #4

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?
Evil-Knievel
Legendary
*
Offline Offline

Activity: 1260
Merit: 1168



View Profile
July 17, 2018, 01:12:13 PM
 #5

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!