← All Use Cases
🛡
Latin Hypercube Design

IDS Signature Tuning

Latin Hypercube exploration of 4 IDS parameters for detection accuracy and packet drop rate

Summary

This experiment investigates ids signature tuning. Latin Hypercube exploration of 4 IDS parameters for detection accuracy and packet drop rate.

The design varies 4 factors: signature pool size (sigs), ranging from 1000 to 50000, pattern match depth (bytes), ranging from 256 to 4096, stream reassembly depth (bytes), ranging from 4096 to 65536, and pcap buffer mb (MB), ranging from 64 to 1024. The goal is to optimize 2 responses: detection accuracy pct (%) (maximize) and packet drop rate (%) (minimize). Fixed conditions held constant across all runs include ids engine = suricata, ruleset = et_open.

Latin Hypercube Sampling was used to space 10 runs across the 4-dimensional factor space with good coverage and minimal gaps, making it ideal for computer experiments where the response surface may be complex.

Key Findings

For detection accuracy pct, the most influential factors were signature pool size (25.0%), pattern match depth (25.0%), stream reassembly depth (25.0%). The best observed value was 88.0 (at signature pool size = 30849.8, pattern match depth = 2741.25, stream reassembly depth = 49408).

For packet drop rate, the most influential factors were signature pool size (25.0%), pattern match depth (25.0%), stream reassembly depth (25.0%). The best observed value was -0.53 (at signature pool size = 24546.1, pattern match depth = 1259.3, stream reassembly depth = 29374.6).

Recommended Next Steps

Experimental Setup

Factors

FactorLowHighUnit
signature_pool_size100050000sigs
pattern_match_depth2564096bytes
stream_reassembly_depth409665536bytes
pcap_buffer_mb641024MB

Fixed: ids_engine = suricata, ruleset = et_open

Responses

ResponseDirectionUnit
detection_accuracy_pct↑ maximize%
packet_drop_rate↓ minimize%

Configuration

use_cases/63_ids_signature_tuning/config.json
{ "metadata": { "name": "IDS Signature Tuning", "description": "Latin Hypercube exploration of 4 IDS parameters for detection accuracy and packet drop rate" }, "factors": [ { "name": "signature_pool_size", "levels": [ "1000", "50000" ], "type": "continuous", "unit": "sigs" }, { "name": "pattern_match_depth", "levels": [ "256", "4096" ], "type": "continuous", "unit": "bytes" }, { "name": "stream_reassembly_depth", "levels": [ "4096", "65536" ], "type": "continuous", "unit": "bytes" }, { "name": "pcap_buffer_mb", "levels": [ "64", "1024" ], "type": "continuous", "unit": "MB" } ], "fixed_factors": { "ids_engine": "suricata", "ruleset": "et_open" }, "responses": [ { "name": "detection_accuracy_pct", "optimize": "maximize", "unit": "%" }, { "name": "packet_drop_rate", "optimize": "minimize", "unit": "%" } ], "settings": { "operation": "latin_hypercube", "test_script": "use_cases/63_ids_signature_tuning/sim.sh" } }

Experimental Matrix

The Latin Hypercube Design produces 10 runs. Each row is one experiment with specific factor settings.

Runsignature_pool_sizepattern_match_depthstream_reassembly_depthpcap_buffer_mb
134621.42790.9320920.8675.961
248884.13802.0337336.4862.441
345096.61453.2160938.9241.455
49426.61100334208611.509
527158.81127.7245358.4256.202
635490.93628.1327442.3153.926
711902.2551.3449044.1527.087
8175363176.5715185.7419.436
924339.72137.8452493.7930.087
105143.482306.7858460.4830.826

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/63_ids_signature_tuning/config.json
2

Generate the runner script

Terminal
$ doe generate --config use_cases/63_ids_signature_tuning/config.json \ --output use_cases/63_ids_signature_tuning/results/run.sh --seed 42
3

Execute the experiments

Terminal
$ bash use_cases/63_ids_signature_tuning/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/63_ids_signature_tuning/config.json
5

Get optimization recommendations

Terminal
$ doe optimize --config use_cases/63_ids_signature_tuning/config.json
6

Multi-objective optimization

With 2 competing responses, use --multi to find the best compromise via Derringer–Suich desirability.

Terminal
$ doe optimize --config use_cases/63_ids_signature_tuning/config.json --multi
7

Generate the HTML report

Terminal
$ doe report --config use_cases/63_ids_signature_tuning/config.json \ --output use_cases/63_ids_signature_tuning/results/report.html

Features Exercised

FeatureValue
Design typelatin_hypercube
Factor typescontinuous (all 4)
Arg styledouble-dash
Responses2 (detection_accuracy_pct ↑, packet_drop_rate ↓)
Total runs10

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: detection_accuracy_pct

Top factors: signature_pool_size (25.0%), pattern_match_depth (25.0%), stream_reassembly_depth (25.0%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
signature_pool_size982.52009.1689
pattern_match_depth982.52009.1689
stream_reassembly_depth982.52009.1689
pcap_buffer_mb982.52009.1689
Error(LenthPSE)00.00000.0000
Total982.52009.1689

Pareto Chart

Pareto chart for detection_accuracy_pct

Main Effects Plot

Main effects plot for detection_accuracy_pct

Normal Probability Plot of Effects

Normal probability plot for detection_accuracy_pct

Half-Normal Plot of Effects

Half-normal plot for detection_accuracy_pct

Model Diagnostics

Model diagnostics for detection_accuracy_pct

Response: packet_drop_rate

Top factors: signature_pool_size (25.0%), pattern_match_depth (25.0%), stream_reassembly_depth (25.0%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
signature_pool_size9117.204013.0227
pattern_match_depth9117.204013.0227
stream_reassembly_depth9117.204013.0227
pcap_buffer_mb9117.204013.0227
Error(LenthPSE)00.00000.0000
Total9117.204013.0227

Pareto Chart

Pareto chart for packet_drop_rate

Main Effects Plot

Main effects plot for packet_drop_rate

Normal Probability Plot of Effects

Normal probability plot for packet_drop_rate

Half-Normal Plot of Effects

Half-normal plot for packet_drop_rate

Model Diagnostics

Model diagnostics for packet_drop_rate

Response Surface Plots

3D surfaces fitted with quadratic RSM. Red dots are observed data points.

detection accuracy pct pattern match depth vs pcap buffer mb

RSM surface: detection accuracy pct pattern match depth vs pcap buffer mb

detection accuracy pct pattern match depth vs stream reassembly depth

RSM surface: detection accuracy pct pattern match depth vs stream reassembly depth

detection accuracy pct signature pool size vs pattern match depth

RSM surface: detection accuracy pct signature pool size vs pattern match depth

detection accuracy pct signature pool size vs pcap buffer mb

RSM surface: detection accuracy pct signature pool size vs pcap buffer mb

detection accuracy pct signature pool size vs stream reassembly depth

RSM surface: detection accuracy pct signature pool size vs stream reassembly depth

detection accuracy pct stream reassembly depth vs pcap buffer mb

RSM surface: detection accuracy pct stream reassembly depth vs pcap buffer mb

packet drop rate pattern match depth vs pcap buffer mb

RSM surface: packet drop rate pattern match depth vs pcap buffer mb

packet drop rate pattern match depth vs stream reassembly depth

RSM surface: packet drop rate pattern match depth vs stream reassembly depth

packet drop rate signature pool size vs pattern match depth

RSM surface: packet drop rate signature pool size vs pattern match depth

packet drop rate signature pool size vs pcap buffer mb

RSM surface: packet drop rate signature pool size vs pcap buffer mb

packet drop rate signature pool size vs stream reassembly depth

RSM surface: packet drop rate signature pool size vs stream reassembly depth

packet drop rate stream reassembly depth vs pcap buffer mb

RSM surface: packet drop rate stream reassembly depth vs pcap buffer mb

Multi-Objective Optimization

When responses compete, Derringer–Suich desirability finds the best compromise. Each response is scaled to a 0–1 desirability, then combined via a weighted geometric mean.

Overall Desirability
D = 0.7505

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
detection_accuracy_pct 1.5
0.9545
88.00 0.9545 88.00 %
packet_drop_rate 1.0
0.5233
4.57 0.5233 4.57 %

Recommended Settings

FactorValue
signature_pool_size25952.7 sigs
pattern_match_depth303.845 bytes
stream_reassembly_depth41224.5 bytes
pcap_buffer_mb950.427 MB

Source: from observed run #2

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
packet_drop_rate4.57-0.53+5.10

Top 3 Runs by Desirability

RunDFactor Settings
#80.5542signature_pool_size=22000, pattern_match_depth=807.183, stream_reassembly_depth=23248.4, pcap_buffer_mb=288.293
#100.5300signature_pool_size=10807.9, pattern_match_depth=4095.97, stream_reassembly_depth=31121.2, pcap_buffer_mb=215.217

Model Quality

ResponseType
packet_drop_rate0.6225linear

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.7505 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- detection_accuracy_pct 1.5 0.9545 88.00 % ↑ packet_drop_rate 1.0 0.5233 4.57 % ↓ Recommended settings: signature_pool_size = 25952.7 sigs pattern_match_depth = 303.845 bytes stream_reassembly_depth = 41224.5 bytes pcap_buffer_mb = 950.427 MB (from observed run #2) Trade-off summary: detection_accuracy_pct: 88.00 (best observed: 88.00, sacrifice: +0.00) packet_drop_rate: 4.57 (best observed: -0.53, sacrifice: +5.10) Model quality: detection_accuracy_pct: R² = 0.4022 (linear) packet_drop_rate: R² = 0.6225 (linear) Top 3 observed runs by overall desirability: 1. Run #2 (D=0.7505): signature_pool_size=25952.7, pattern_match_depth=303.845, stream_reassembly_depth=41224.5, pcap_buffer_mb=950.427 2. Run #8 (D=0.5542): signature_pool_size=22000, pattern_match_depth=807.183, stream_reassembly_depth=23248.4, pcap_buffer_mb=288.293 3. Run #10 (D=0.5300): signature_pool_size=10807.9, pattern_match_depth=4095.97, stream_reassembly_depth=31121.2, pcap_buffer_mb=215.217

Full Analysis Output

doe analyze
=== Main Effects: detection_accuracy_pct === Factor Effect Std Error % Contribution -------------------------------------------------------------- signature_pool_size 8.8000 0.9575 25.0% pattern_match_depth 8.8000 0.9575 25.0% stream_reassembly_depth 8.8000 0.9575 25.0% pcap_buffer_mb 8.8000 0.9575 25.0% === ANOVA Table: detection_accuracy_pct === Source DF SS MS F p-value ----------------------------------------------------------------------------- signature_pool_size 9 82.5200 9.1689 pattern_match_depth 9 82.5200 9.1689 stream_reassembly_depth 9 82.5200 9.1689 pcap_buffer_mb 9 82.5200 9.1689 Error (Lenth PSE) 0 0.0000 0.0000 Total 9 82.5200 9.1689 Note: Error estimated using Lenth's pseudo-standard-error (unreplicated design) === Summary Statistics: detection_accuracy_pct === signature_pool_size: Level N Mean Std Min Max ------------------------------------------------------------ 15594.3 1 87.9000 0.0000 87.9000 87.9000 20428.9 1 81.5000 0.0000 81.5000 81.5000 23218.1 1 88.0000 0.0000 88.0000 88.0000 26523.6 1 84.4000 0.0000 84.4000 84.4000 3005.71 1 80.1000 0.0000 80.1000 80.1000 31721.2 1 85.3000 0.0000 85.3000 85.3000 35406 1 79.2000 0.0000 79.2000 79.2000 41882.7 1 83.1000 0.0000 83.1000 83.1000 45531.6 1 83.5000 0.0000 83.5000 83.5000 7150.12 1 86.0000 0.0000 86.0000 86.0000 pattern_match_depth: Level N Mean Std Min Max ------------------------------------------------------------ 1337.15 1 83.5000 0.0000 83.5000 83.5000 1707.08 1 84.4000 0.0000 84.4000 84.4000 1817.77 1 86.0000 0.0000 86.0000 86.0000 2488.12 1 79.2000 0.0000 79.2000 79.2000 2795.32 1 80.1000 0.0000 80.1000 80.1000 2977.58 1 81.5000 0.0000 81.5000 81.5000 3503.73 1 87.9000 0.0000 87.9000 87.9000 3871.69 1 83.1000 0.0000 83.1000 83.1000 637.14 1 88.0000 0.0000 88.0000 88.0000 755.907 1 85.3000 0.0000 85.3000 85.3000 stream_reassembly_depth: Level N Mean Std Min Max ------------------------------------------------------------ 12645.6 1 86.0000 0.0000 86.0000 86.0000 22502.6 1 80.1000 0.0000 80.1000 80.1000 25674.3 1 88.0000 0.0000 88.0000 88.0000 32083.4 1 83.5000 0.0000 83.5000 83.5000 39813.3 1 85.3000 0.0000 85.3000 85.3000 45457.6 1 83.1000 0.0000 83.1000 83.1000 47129 1 79.2000 0.0000 79.2000 79.2000 4922.71 1 81.5000 0.0000 81.5000 81.5000 55803.1 1 84.4000 0.0000 84.4000 84.4000 61562.7 1 87.9000 0.0000 87.9000 87.9000 pcap_buffer_mb: Level N Mean Std Min Max ------------------------------------------------------------ 111.574 1 81.5000 0.0000 81.5000 81.5000 186.063 1 79.2000 0.0000 79.2000 79.2000 294.705 1 83.5000 0.0000 83.5000 83.5000 429.818 1 86.0000 0.0000 86.0000 86.0000 505.972 1 85.3000 0.0000 85.3000 85.3000 608.405 1 83.1000 0.0000 83.1000 83.1000 731.083 1 87.9000 0.0000 87.9000 87.9000 823.505 1 84.4000 0.0000 84.4000 84.4000 914.542 1 88.0000 0.0000 88.0000 88.0000 946.611 1 80.1000 0.0000 80.1000 80.1000 === Main Effects: packet_drop_rate === Factor Effect Std Error % Contribution -------------------------------------------------------------- signature_pool_size 10.7500 1.1412 25.0% pattern_match_depth 10.7500 1.1412 25.0% stream_reassembly_depth 10.7500 1.1412 25.0% pcap_buffer_mb 10.7500 1.1412 25.0% === ANOVA Table: packet_drop_rate === Source DF SS MS F p-value ----------------------------------------------------------------------------- signature_pool_size 9 117.2040 13.0227 pattern_match_depth 9 117.2040 13.0227 stream_reassembly_depth 9 117.2040 13.0227 pcap_buffer_mb 9 117.2040 13.0227 Error (Lenth PSE) 0 0.0000 0.0000 Total 9 117.2040 13.0227 Note: Error estimated using Lenth's pseudo-standard-error (unreplicated design) === Summary Statistics: packet_drop_rate === signature_pool_size: Level N Mean Std Min Max ------------------------------------------------------------ 15594.3 1 7.8100 0.0000 7.8100 7.8100 20428.9 1 1.7300 0.0000 1.7300 1.7300 23218.1 1 4.5700 0.0000 4.5700 4.5700 26523.6 1 5.3200 0.0000 5.3200 5.3200 3005.71 1 0.7600 0.0000 0.7600 0.7600 31721.2 1 9.3900 0.0000 9.3900 9.3900 35406 1 -0.5300 0.0000 -0.5300 -0.5300 41882.7 1 5.1200 0.0000 5.1200 5.1200 45531.6 1 6.8400 0.0000 6.8400 6.8400 7150.12 1 10.2200 0.0000 10.2200 10.2200 pattern_match_depth: Level N Mean Std Min Max ------------------------------------------------------------ 1337.15 1 6.8400 0.0000 6.8400 6.8400 1707.08 1 5.3200 0.0000 5.3200 5.3200 1817.77 1 10.2200 0.0000 10.2200 10.2200 2488.12 1 -0.5300 0.0000 -0.5300 -0.5300 2795.32 1 0.7600 0.0000 0.7600 0.7600 2977.58 1 1.7300 0.0000 1.7300 1.7300 3503.73 1 7.8100 0.0000 7.8100 7.8100 3871.69 1 5.1200 0.0000 5.1200 5.1200 637.14 1 4.5700 0.0000 4.5700 4.5700 755.907 1 9.3900 0.0000 9.3900 9.3900 stream_reassembly_depth: Level N Mean Std Min Max ------------------------------------------------------------ 12645.6 1 10.2200 0.0000 10.2200 10.2200 22502.6 1 0.7600 0.0000 0.7600 0.7600 25674.3 1 4.5700 0.0000 4.5700 4.5700 32083.4 1 6.8400 0.0000 6.8400 6.8400 39813.3 1 9.3900 0.0000 9.3900 9.3900 45457.6 1 5.1200 0.0000 5.1200 5.1200 47129 1 -0.5300 0.0000 -0.5300 -0.5300 4922.71 1 1.7300 0.0000 1.7300 1.7300 55803.1 1 5.3200 0.0000 5.3200 5.3200 61562.7 1 7.8100 0.0000 7.8100 7.8100 pcap_buffer_mb: Level N Mean Std Min Max ------------------------------------------------------------ 111.574 1 1.7300 0.0000 1.7300 1.7300 186.063 1 -0.5300 0.0000 -0.5300 -0.5300 294.705 1 6.8400 0.0000 6.8400 6.8400 429.818 1 10.2200 0.0000 10.2200 10.2200 505.972 1 9.3900 0.0000 9.3900 9.3900 608.405 1 5.1200 0.0000 5.1200 5.1200 731.083 1 7.8100 0.0000 7.8100 7.8100 823.505 1 5.3200 0.0000 5.3200 5.3200 914.542 1 4.5700 0.0000 4.5700 4.5700 946.611 1 0.7600 0.0000 0.7600 0.7600

Optimization Recommendations

doe optimize
=== Optimization: detection_accuracy_pct === Direction: maximize Best observed run: #2 signature_pool_size = 30849.8 pattern_match_depth = 2741.25 stream_reassembly_depth = 49408 pcap_buffer_mb = 454.169 Value: 88.0 RSM Model (linear, R² = 0.7606, Adj R² = 0.5692): Coefficients: intercept +83.8336 signature_pool_size +1.9948 pattern_match_depth +4.2059 stream_reassembly_depth +1.7280 pcap_buffer_mb -1.8951 Predicted optimum (from linear model, at observed points): signature_pool_size = 30849.8 pattern_match_depth = 2741.25 stream_reassembly_depth = 49408 pcap_buffer_mb = 454.169 Predicted value: 86.6829 Surface optimum (via L-BFGS-B, linear model): signature_pool_size = 50000 pattern_match_depth = 4096 stream_reassembly_depth = 65536 pcap_buffer_mb = 64 Predicted value: 93.6575 Model quality: Good fit — general trends are captured, some noise remains. Factor importance: 1. signature_pool_size (effect: 8.8, contribution: 25.0%) 2. pattern_match_depth (effect: 8.8, contribution: 25.0%) 3. stream_reassembly_depth (effect: 8.8, contribution: 25.0%) 4. pcap_buffer_mb (effect: 8.8, contribution: 25.0%) === Optimization: packet_drop_rate === Direction: minimize Best observed run: #3 signature_pool_size = 24546.1 pattern_match_depth = 1259.3 stream_reassembly_depth = 29374.6 pcap_buffer_mb = 611.674 Value: -0.53 RSM Model (linear, R² = 0.7163, Adj R² = 0.4893): Coefficients: intercept +5.0647 signature_pool_size +1.3291 pattern_match_depth +5.3106 stream_reassembly_depth +1.4200 pcap_buffer_mb -1.4836 Predicted optimum (from linear model, at observed points): signature_pool_size = 1579.76 pattern_match_depth = 3826.27 stream_reassembly_depth = 64577.9 pcap_buffer_mb = 723.168 Predicted value: 9.1536 Surface optimum (via L-BFGS-B, linear model): signature_pool_size = 1000 pattern_match_depth = 256 stream_reassembly_depth = 4096 pcap_buffer_mb = 1024 Predicted value: -4.4786 Model quality: Good fit — general trends are captured, some noise remains. Factor importance: 1. signature_pool_size (effect: 10.8, contribution: 25.0%) 2. pattern_match_depth (effect: 10.8, contribution: 25.0%) 3. stream_reassembly_depth (effect: 10.8, contribution: 25.0%) 4. pcap_buffer_mb (effect: 10.8, contribution: 25.0%)
← Previous: Certificate Rotation Strategy Next: Secrets Vault Performance →