Neo: Send the peers before close a connection if MaxConnections is reached. ('Endpoint isn't able to be connected if all seed nodes' peer number up to MAX(40 for now)')

Created on 9 Aug 2019  路  10Comments  路  Source: neo-project/neo

I've met a situation that all seed nodes have the connected number of 40 which is the max. Then I start a clear node to connect to mainnet, however, endpoint isn't able to be connected since there's no free endpoint anymore. Although finally, after two minutes, the node find a free endpont to connect and the block grows successfully, I think this issue may cause besiege-source-attack since it's very easy to achieve. Now we have to make a solution to handle more nodes. The external nodes' number is truely growing up more and more and we mustn't reject them.
@shargon @vncoelho @igormcoelho @erikzhang

design enhancement p2p

Most helpful comment

https://github.com/neo-project/neo-cli/blob/100a443a1690d77b8923ef39a66c315dd380afda/neo-cli/Settings.cs#L68

We can change the settings of MaxConnections in config.json.

I know this operation, but its not a final solution since it will push more and more pressure on seed nodes and seed nodes need to upgrade its hardware or bandwidth more often in the future. Maybe we should make a more smart solution, for example, when a seed node is full on connection, make it still be able to recommand its peers to new nodes which would like to join for connection. If its peers are all full too, they could recommend their peers to it and so on, like a tree structure.

All 10 comments

100 instead of 40?

But we should implement an ACL for ban or disconnect bad nodes, acording the response time, the expected messages, etc

https://github.com/neo-project/neo-cli/blob/100a443a1690d77b8923ef39a66c315dd380afda/neo-cli/Settings.cs#L68

We can change the settings of MaxConnections in config.json.

I know this operation, but its not a final solution since it will push more and more pressure on seed nodes and seed nodes need to upgrade its hardware or bandwidth more often in the future. Maybe we should make a more smart solution, for example, when a seed node is full on connection, make it still be able to recommand its peers to new nodes which would like to join for connection. If its peers are all full too, they could recommend their peers to it and so on, like a tree structure.

I like your idea @superboyiii

For me is ready-to-implement:

  • Send the peers before close a connection because MaxConnections was raised.

@shargon let's give the team at least 2 days to review it. If someone else approves I think we are good to go

Good insight, @superboyiii!

Sounds an informative and good decision.

When implementing it let's consider the design of a flexible message of information.

In the future nodes could even share statistics between what they think about their peers.

@vncoelho That's great!

fixed in #1154, plz review it

Was this page helpful?
0 / 5 - 0 ratings