<!-- Kamailio Pull Request Template -->
<!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -->
#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [ ] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [ ] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description <!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3806
-- Commit Summary --
* pike: fix documentation for reqs_density_per_unit
-- File Changes --
M src/modules/pike/doc/pike_admin.xml (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3806.patch https://github.com/kamailio/kamailio/pull/3806.diff
Thanks for the PR. If I remember correctly the module does some kind of IP prefix aggregation, and therefore the condition was correct. But maybe that changed over the years?
Probably the code has to be checked, it used to be some warming up based on ip address prefix (no longer sure, but something in the direction of: for x.y.z.w, first keep x, then x.y, then x.y.z and then block the traffic), but the it was the merge with SER modules and not sure what ended up to be. Also, maybe it block immediately if it is in the same subnetwork, source code should be authoritative here and should be checked before merging.
@tsearle
After reading the documentation [here](https://www.kamailio.org/docs/modules/devel/modules/pike.html#idm153), specifically Chapter 3. Development Guide, and a bit of code reading regarding this module, it's seems that current documentation is correct.
Internally, pike module uses a tree structure to create nodes with parts of the IPs and if multiple are coming from the same subset they will be blocked faster (minimum reqs_density_per_unit hits though) and others coming from different subnet **_might_** require up to 3x or 9x hits (IPv4/IPv6 respectively).
I will double check that the rest documentation is up to date though.
Then I guess this can be closed without merging, right?
I think in general it shouldn;t be merged.
But I am also not really familiar and might have understood the inner workings of the modules.
Some points though, might need updating like: - [re split between itself and its child--both of them gone have x/2.](https://www.kamailio.org/docs/modules/stable/modules/pike.html#idm153) I can't match this somewhere in the code, and maybe the limits are not what the dev guide suggests. - when doing some debuging/testing and calling `kamcmd pike.list ALL` seems to have list nodes with negative expire (probably shouldn't exist and taken into account) and doesn't refresh the nodes correctly if requests are coming from this subnet.
``` Apr 15 10:11:37 app01 kam5.7.2/sbin/kamailio[358099]: DEBUG: pike [pike_rpc.c:78]: traverse_subtree(): pike:rpc traverse_subtree, not IP leaf, depth: 0, ip: x.0.0.0 hits[0,0], expires: -291 Apr 15 10:11:37 app01 kam5.7.2/sbin/kamailio[358099]: DEBUG: pike [pike_rpc.c:49]: traverse_subtree(): pike:rpc traverse_subtree, depth: 1, byte: 203 Apr 15 10:11:37 app01 kam5.7.2/sbin/kamailio[358099]: DEBUG: pike [pike_rpc.c:78]: traverse_subtree(): pike:rpc traverse_subtree, not IP leaf, depth: 1, ip: x.y.0.0 hits[0,0], expires: -291 Apr 15 10:11:37 app01 kam5.7.2/sbin/kamailio[358099]: DEBUG: pike [pike_rpc.c:49]: traverse_subtree(): pike:rpc traverse_subtree, depth: 2, byte: 64 Apr 15 10:11:37 app01 kam5.7.2/sbin/kamailio[358099]: DEBUG: pike [pike_rpc.c:78]: traverse_subtree(): pike:rpc traverse_subtree, not IP leaf, depth: 2, ip: z.y.z.0 hits[0,0], expires: -171 ```
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks.
Closed #3806.