-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
limit the frequency of findnode messages #91
Comments
It is indeed necessary to do a strict check of the message. How to implement this function? |
@jakamobiii Add a field to record the time when the
If the next request time is less than the threshold (which can be set to
|
Good, which version will support this feature? |
@jakamobiii The next version |
Background
Currently, the neighbor discovery algorithm runs once every 7.2 seconds (KademliaOptions.DISCOVER_CYCLE), and each time it sends a findnode message to 24 different nodes. So theoretically, a findnode message can be sent to the same node at most once within 7.2s. However, there is no frequency limit when processing findnode messages. The code is as follows:
To avoid unnecessary network bandwidth consumption, the frequency of findnode messages needs to be limited.
Rationale
To avoid network bandwidth consumption caused by high-frequency neighbor requests, it is necessary to limit the frequency of neighbor requests. The minimum time request interval for each channel can be set to KademliaOptions.DISCOVER_CYCLE / 2. The findnode message is replied to at most once within the minimum time interval.
The text was updated successfully, but these errors were encountered: