docs: created MODULES.md to document Suriconf pipeline and configurat… - #3
Draft
KEIAHNY wants to merge 1 commit into
Draft
docs: created MODULES.md to document Suriconf pipeline and configurat…#3KEIAHNY wants to merge 1 commit into
KEIAHNY wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Documents Suriconf’s static-analysis pipeline and configuration modules.
Changes:
- Explains pipeline stages and module execution order.
- Documents CPU, memory, flow, and thread-sizing calculations.
- Adds operational thresholds and warning counters.
Suppressed comments (4)
MODULES.md:107
- The claimed minimum is not fully enforced:
set_new_cpu_setonly raises estimates< 3to four, so an estimate of exactly three remains three (src/cpu_affinity.rs:453-468). Either change that condition to enforce the documented four-core minimum or describe the current three-core edge case.
> A minimum of 4 logical cores is enforced due to performance degradation observed with fewer cores during testing.
MODULES.md:136
- Hash sizes are not always derived from the observed maxima.
get_set_tablekeeps the fixedACTIVE_LIMITvalue of 512 whenever the maximum is at most 512, and only then switches tonext_power_of_two; defragmentationtrackersis also set to that resulting hash size (src/memory_usage.rs:295-318,414-435), not directly to the observed counter.
The sizes of the hash tables are determined based on the maximum observed values of counters:
- **IPpair** – `ippair_active` (maximum number of active IPpair objects).
- **Host** – `host_active` (maximum number of active host objects).
- **Defragmentation** – `defrag_tracker_active` (maximum number of active defrag trackers). This counter also sets `trackers` parameter in defragmentation section.
MODULES.md:145
- The default path is missing here: for IPpair, Host, and Defragmentation, preallocation is 256 when the active maximum is at most 512, rather than
max_active / 2. Also,max-fragsis calculated from the configured defragmentation hash size, not the raw active counter (src/memory_usage.rs:381-410,414-435,117-118).
Preallocated objects depend on the maximum number of active objects:
- **IPpair / Host** – `ippair_active` / `host_active` → prealloc = max_active / 2
- **Defragmentation** – `defrag_tracker_active` → prealloc = max_active / 2
- **max-frags** – calculated as `defrag_tracker_active` × `defrag_max_fragments`
MODULES.md:95
- These equations do not describe the implemented worker estimate. The code averages packet throughput per one CPU percentage point, includes
decoder.invalid, targets 50% (CPU_USAGE = 50.0), and applies the 1.5 multiplier to the estimated packet load before division (src/cpu_affinity.rs:70-75,170-206,268-319). The current 60% formula therefore gives readers a different core count.
throughput_per_core = (decoder.pkts / cpu_usage) × 0.60
required_cores = ceil((total_kernel_packets / throughput_per_core) × 1.5)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+50
to
+51
| suricata_result.yaml (optimized config) | ||
| nic_setup.sh (network interface setup script) |
| - If there are fewer RSS queues than worker threads, the number of workers is reduced to match the number of RSS queues. | ||
|
|
||
| **Drop rate estimation** | ||
| The module calculates the packet drop rate using the formula: `drop_rate = capture.kernel_drops / (capture.kernel_packets + capture.kernel_drops) * 100`. If the drop rate exceeds 1%, the configuration is marked as unsuccessful. |
| 2. **Load factor** – Monitored during each iteration. If the load factor exceeds a threshold (α > 2), the hash table is expanded. If it falls below 25% of αmax, the table size is reduced | ||
| 3. **Collision analysis** – If the ratio between the maximum and the average number of flows in a bucket exceeds 3, the hash table is considered insufficiently sized | ||
|
|
||
| The resulting value is rounded to the nearest power of two, ensuring an efficient hash distribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ion modules