Does Bitcoin limit the number of parallel connections from the same IP?

1

Is there a measure in place to prevent an adversary from connecting to a Bitcoin node many times in parallel, thus saturating its open connection slots?

Sergei Tikhomirov

Posted 2018-04-17T10:08:00.373

Reputation: 1 189

Answers

0

The measure is that the node running bitcoin removes the cap to the number connection slots. The cap for connection slots I have found is set to no limit when running a bitcoin service.

Sorry I stand corrected, back in 2011 looks like a cap of 125 connections was introduced Is there a connections limit on bitcoind?

in the net.cpp file https://bitcointalk.org/index.php?topic=52772.msg629593#msg629593

but this has since been changed and I dont think there is a cap anymore... Looking at the file looks like this is the area you are interested in: https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L1081 and the values set here https://github.com/bitcoin/bitcoin/blob/master/src/net.h

Fuzzybear

Posted 2018-04-17T10:08:00.373

Reputation: 447

How can removing the cap help? Can you point me to the source code?Sergei Tikhomirov 2018-04-17T12:52:11.590

1edited my answerFuzzybear 2018-04-17T13:18:35.590

Ok, I am aware of the 8 outgoing + 117 incoming connections limit, my question is, is there anything that prevents me from connecting to a chosen node up to 117 times from the same IP, if its connection slots are free?Sergei Tikhomirov 2018-04-17T13:57:51.757

I think that one node would see your 117 connections from the same ip and just block your ip on connecting. It would seem there is no limit in the code from the discussion here https://bitcointalk.org/index.php?topic=765157.0

Fuzzybear 2018-04-17T15:05:06.480

But it would have to be done by a firewall or some other software independent of the Bitcoin client, right?Sergei Tikhomirov 2018-04-17T19:12:56.053

Yeh as far as I can see there is nothing in the code to prevent the situation as u describeFuzzybear 2018-04-18T08:40:04.920