Security: Track the number of open connections in Zebra #2903
Labels
A-network
Area: Network protocol updates or fixes
C-security
Category: Security issues
I-remote-node-overload
Zebra can overload other nodes on the network
Milestone
Motivation
To limit the number of connections in Zebra, we need to be able to track how many open connections there are.
Suggested Design
In
zebra_network::init
, create:mpsc
channel that gets a signal when aConnection
is droppedGet the channel from
zebra_network::init
to eachConnection
In
Connection
, send a signal on the channel when each connection is dropped.Edge Cases
Zebra should check and increase the connection limit as early as possible, before it uses any resources for the connection.
Zebra should send the drop signal as late as possible, after it has dropped everything else that's used by the connection.
Rejected Alternatives
We could limit the number of
AddressBook
peers in theResponded
state. But this doesn't work for inbound connections, because somePeerSet
addresses aren't stored in the address book. (Including the null address, and addresses from peers that don't advertise theNODE
service bit.)We could limit the number of
PeerSet
inbound and outbound peers peers in theResponded
state. But there could be a significant delay betweenPeerSet
peers getting dropped, and the correspondingConnection
getting dropped. (We can't be sure that the generic is an ownedConnection
. And the tasks and channels might be slow under load.)The text was updated successfully, but these errors were encountered: