← All Use Cases
🌐
Box-Behnken Design

VPN Tunnel MTU

Box-Behnken design for MTU, fragmentation, and keepalive to optimize throughput and reconnect time

Summary

This experiment investigates vpn tunnel mtu. Box-Behnken design for MTU, fragmentation, and keepalive to optimize throughput and reconnect time.

The design varies 3 factors: tunnel mtu (bytes), ranging from 1200 to 1500, fragment size (bytes), ranging from 0 to 1400, and keepalive interval (s), ranging from 10 to 120. The goal is to optimize 2 responses: throughput mbps (Mbps) (maximize) and reconnect time s (s) (minimize). Fixed conditions held constant across all runs include protocol = wireguard, encryption = chacha20.

A Box-Behnken design was chosen because it efficiently fits quadratic models with 3 continuous factors while avoiding extreme corner combinations — requiring only 15 runs instead of the 8 needed for a full factorial at two levels.

Quadratic response surface models were fitted to capture potential curvature and factor interactions. The RSM contour plots below visualize how pairs of factors jointly affect each response.

Key Findings

For throughput mbps, the most influential factors were keepalive interval (37.6%), tunnel mtu (35.0%), fragment size (27.4%). The best observed value was 927.0 (at tunnel mtu = 1350, fragment size = 1400, keepalive interval = 10).

For reconnect time s, the most influential factors were tunnel mtu (60.4%), fragment size (32.5%), keepalive interval (7.1%). The best observed value was 2.7 (at tunnel mtu = 1350, fragment size = 1400, keepalive interval = 120).

Recommended Next Steps

Experimental Setup

Factors

FactorLowHighUnit
tunnel_mtu12001500bytes
fragment_size01400bytes
keepalive_interval10120s

Fixed: protocol = wireguard, encryption = chacha20

Responses

ResponseDirectionUnit
throughput_mbps↑ maximizeMbps
reconnect_time_s↓ minimizes

Configuration

use_cases/52_vpn_tunnel_mtu/config.json
{ "metadata": { "name": "VPN Tunnel MTU", "description": "Box-Behnken design for MTU, fragmentation, and keepalive to optimize throughput and reconnect time" }, "factors": [ { "name": "tunnel_mtu", "levels": [ "1200", "1500" ], "type": "continuous", "unit": "bytes" }, { "name": "fragment_size", "levels": [ "0", "1400" ], "type": "continuous", "unit": "bytes" }, { "name": "keepalive_interval", "levels": [ "10", "120" ], "type": "continuous", "unit": "s" } ], "fixed_factors": { "protocol": "wireguard", "encryption": "chacha20" }, "responses": [ { "name": "throughput_mbps", "optimize": "maximize", "unit": "Mbps" }, { "name": "reconnect_time_s", "optimize": "minimize", "unit": "s" } ], "settings": { "operation": "box_behnken", "test_script": "use_cases/52_vpn_tunnel_mtu/sim.sh" } }

Experimental Matrix

The Box-Behnken Design produces 15 runs. Each row is one experiment with specific factor settings.

Runtunnel_mtufragment_sizekeepalive_interval
11350010
2135070065
31500700120
4150070010
5135070065
6135070065
71200700120
81500065
913500120
101500140065
11120070010
1213501400120
131200065
141200140065
151350140010

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/52_vpn_tunnel_mtu/config.json
2

Generate the runner script

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

Execute the experiments

Terminal
$ bash use_cases/52_vpn_tunnel_mtu/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/52_vpn_tunnel_mtu/config.json
5

Get optimization recommendations

Terminal
$ doe optimize --config use_cases/52_vpn_tunnel_mtu/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/52_vpn_tunnel_mtu/config.json --multi
7

Generate the HTML report

Terminal
$ doe report --config use_cases/52_vpn_tunnel_mtu/config.json \ --output use_cases/52_vpn_tunnel_mtu/results/report.html

Features Exercised

FeatureValue
Design typebox_behnken
Factor typescontinuous (all 3)
Arg styledouble-dash
Responses2 (throughput_mbps ↑, reconnect_time_s ↓)
Total runs15

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: throughput_mbps

Top factors: keepalive_interval (37.6%), tunnel_mtu (35.0%), fragment_size (27.4%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
tunnel_mtu27737.24293868.62140.3350.7251
fragment_size26451.85003225.92500.2790.7636
keepalive_interval211112.99295556.49640.4810.6351
LackofFit623554.84763925.8079
PureError223120.6667
Error846675.514311560.3333
Total1471977.60005141.2571

Pareto Chart

Pareto chart for throughput_mbps

Main Effects Plot

Main effects plot for throughput_mbps

Normal Probability Plot of Effects

Normal probability plot for throughput_mbps

Half-Normal Plot of Effects

Half-normal plot for throughput_mbps

Model Diagnostics

Model diagnostics for throughput_mbps

Response: reconnect_time_s

Top factors: tunnel_mtu (60.4%), fragment_size (32.5%), keepalive_interval (7.1%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
tunnel_mtu2136.099868.049920.6630.0007
fragment_size255.259827.62998.3900.0109
keepalive_interval22.45301.22650.3720.7004
LackofFit653.65808.9430
PureError26.5867
Error860.24463.2933
Total14254.057318.1470

Pareto Chart

Pareto chart for reconnect_time_s

Main Effects Plot

Main effects plot for reconnect_time_s

Normal Probability Plot of Effects

Normal probability plot for reconnect_time_s

Half-Normal Plot of Effects

Half-normal plot for reconnect_time_s

Model Diagnostics

Model diagnostics for reconnect_time_s

Response Surface Plots

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

reconnect time s fragment size vs keepalive interval

RSM surface: reconnect time s fragment size vs keepalive interval

reconnect time s tunnel mtu vs fragment size

RSM surface: reconnect time s tunnel mtu vs fragment size

reconnect time s tunnel mtu vs keepalive interval

RSM surface: reconnect time s tunnel mtu vs keepalive interval

throughput mbps fragment size vs keepalive interval

RSM surface: throughput mbps fragment size vs keepalive interval

throughput mbps tunnel mtu vs fragment size

RSM surface: throughput mbps tunnel mtu vs fragment size

throughput mbps tunnel mtu vs keepalive interval

RSM surface: throughput mbps tunnel mtu vs keepalive interval

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.9284

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
throughput_mbps 1.5
0.9114
916.00 0.9114 916.00 Mbps
reconnect_time_s 1.0
0.9545
2.70 0.9545 2.70 s

Recommended Settings

FactorValue
tunnel_mtu1350 bytes
fragment_size0 bytes
keepalive_interval120 s

Source: from observed run #1

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
reconnect_time_s2.702.70+0.00

Top 3 Runs by Desirability

RunDFactor Settings
#40.8697tunnel_mtu=1500, fragment_size=1400, keepalive_interval=65
#80.7675tunnel_mtu=1350, fragment_size=0, keepalive_interval=10

Model Quality

ResponseType
reconnect_time_s0.0443linear

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.9284 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- throughput_mbps 1.5 0.9114 916.00 Mbps ↑ reconnect_time_s 1.0 0.9545 2.70 s ↓ Recommended settings: tunnel_mtu = 1350 bytes fragment_size = 0 bytes keepalive_interval = 120 s (from observed run #1) Trade-off summary: throughput_mbps: 916.00 (best observed: 927.00, sacrifice: +11.00) reconnect_time_s: 2.70 (best observed: 2.70, sacrifice: +0.00) Model quality: throughput_mbps: R² = 0.5886 (quadratic) reconnect_time_s: R² = 0.0443 (linear) Top 3 observed runs by overall desirability: 1. Run #1 (D=0.9284): tunnel_mtu=1350, fragment_size=0, keepalive_interval=120 2. Run #4 (D=0.8697): tunnel_mtu=1500, fragment_size=1400, keepalive_interval=65 3. Run #8 (D=0.7675): tunnel_mtu=1350, fragment_size=0, keepalive_interval=10

Full Analysis Output

doe analyze
=== Main Effects: throughput_mbps === Factor Effect Std Error % Contribution -------------------------------------------------------------- keepalive_interval 65.6429 18.5135 37.6% tunnel_mtu 61.0000 18.5135 35.0% fragment_size 47.7500 18.5135 27.4% === ANOVA Table: throughput_mbps === Source DF SS MS F p-value ----------------------------------------------------------------------------- tunnel_mtu 2 7737.2429 3868.6214 0.335 0.7251 fragment_size 2 6451.8500 3225.9250 0.279 0.7636 keepalive_interval 2 11112.9929 5556.4964 0.481 0.6351 Lack of Fit 6 23554.8476 3925.8079 0.340 0.8715 Pure Error 2 23120.6667 11560.3333 Error 8 46675.5143 11560.3333 Total 14 71977.6000 5141.2571 === Summary Statistics: throughput_mbps === tunnel_mtu: Level N Mean Std Min Max ------------------------------------------------------------ 1200 4 812.2500 69.9351 752.0000 913.0000 1350 7 833.8571 65.0677 695.0000 890.0000 1500 4 873.2500 89.7492 739.0000 927.0000 fragment_size: Level N Mean Std Min Max ------------------------------------------------------------ 0 4 849.5000 52.0545 786.0000 911.0000 1400 4 804.2500 50.0025 739.0000 858.0000 700 7 852.0000 91.1921 695.0000 927.0000 keepalive_interval: Level N Mean Std Min Max ------------------------------------------------------------ 10 4 878.5000 44.8293 822.0000 916.0000 120 4 843.7500 72.0758 752.0000 927.0000 65 7 812.8571 80.8815 695.0000 911.0000 === Main Effects: reconnect_time_s === Factor Effect Std Error % Contribution -------------------------------------------------------------- tunnel_mtu 8.2250 1.0999 60.4% fragment_size 4.4250 1.0999 32.5% keepalive_interval 0.9714 1.0999 7.1% === ANOVA Table: reconnect_time_s === Source DF SS MS F p-value ----------------------------------------------------------------------------- tunnel_mtu 2 136.0998 68.0499 20.663 0.0007 fragment_size 2 55.2598 27.6299 8.390 0.0109 keepalive_interval 2 2.4530 1.2265 0.372 0.7004 Lack of Fit 6 53.6580 8.9430 2.715 0.2934 Pure Error 2 6.5867 3.2933 Error 8 60.2446 3.2933 Total 14 254.0573 18.1470 === Summary Statistics: reconnect_time_s === tunnel_mtu: Level N Mean Std Min Max ------------------------------------------------------------ 1200 4 12.9500 5.0030 5.5000 16.0000 1350 7 9.3000 2.0744 7.4000 13.1000 1500 4 4.7250 2.3838 2.7000 7.7000 fragment_size: Level N Mean Std Min Max ------------------------------------------------------------ 0 4 10.0500 3.9921 7.7000 16.0000 1400 4 5.8750 2.2096 2.9000 7.7000 700 7 10.3000 4.7669 2.7000 15.7000 keepalive_interval: Level N Mean Std Min Max ------------------------------------------------------------ 10 4 8.4000 5.3895 2.7000 15.7000 120 4 9.1500 3.8562 5.6000 14.6000 65 7 9.3714 4.4694 2.9000 16.0000

Optimization Recommendations

doe optimize
=== Optimization: throughput_mbps === Direction: maximize Best observed run: #4 tunnel_mtu = 1350 fragment_size = 1400 keepalive_interval = 10 Value: 927.0 RSM Model (linear, R² = 0.2069, Adj R² = -0.0095): Coefficients: intercept +838.6000 tunnel_mtu -17.3750 fragment_size +35.8750 keepalive_interval +16.5000 RSM Model (quadratic, R² = 0.9449, Adj R² = 0.8458): Coefficients: intercept +728.6667 tunnel_mtu -17.3750 fragment_size +35.8750 keepalive_interval +16.5000 tunnel_mtu*fragment_size +13.2500 tunnel_mtu*keepalive_interval +17.5000 fragment_size*keepalive_interval -22.0000 tunnel_mtu^2 +61.7917 fragment_size^2 +50.7917 keepalive_interval^2 +93.5417 Curvature analysis: keepalive_interval coef=+93.5417 convex (has a minimum) tunnel_mtu coef=+61.7917 convex (has a minimum) fragment_size coef=+50.7917 convex (has a minimum) Notable interactions: fragment_size*keepalive_interval coef=-22.0000 (antagonistic) tunnel_mtu*keepalive_interval coef=+17.5000 (synergistic) tunnel_mtu*fragment_size coef=+13.2500 (synergistic) Predicted optimum (from quadratic model, at observed points): tunnel_mtu = 1350 fragment_size = 1400 keepalive_interval = 10 Predicted value: 914.3750 Surface optimum (via L-BFGS-B, quadratic model): tunnel_mtu = 1200 fragment_size = 1400 keepalive_interval = 10 Predicted value: 997.7917 Model quality: Excellent fit — surface predictions are reliable. Factor importance: 1. keepalive_interval (effect: 102.0, contribution: 41.4%) 2. fragment_size (effect: 75.6, contribution: 30.7%) 3. tunnel_mtu (effect: 68.9, contribution: 27.9%) === Optimization: reconnect_time_s === Direction: minimize Best observed run: #1 tunnel_mtu = 1350 fragment_size = 1400 keepalive_interval = 120 Value: 2.7 RSM Model (linear, R² = 0.1628, Adj R² = -0.0655): Coefficients: intercept +9.0533 tunnel_mtu -0.3625 fragment_size -1.1125 keepalive_interval -1.9500 RSM Model (quadratic, R² = 0.4412, Adj R² = -0.5648): Coefficients: intercept +9.0000 tunnel_mtu -0.3625 fragment_size -1.1125 keepalive_interval -1.9500 tunnel_mtu*fragment_size +2.1500 tunnel_mtu*keepalive_interval +2.8750 fragment_size*keepalive_interval +1.3250 tunnel_mtu^2 +1.0750 fragment_size^2 -1.3250 keepalive_interval^2 +0.3500 Curvature analysis: fragment_size coef=-1.3250 concave (has a maximum) tunnel_mtu coef=+1.0750 convex (has a minimum) keepalive_interval coef=+0.3500 convex (has a minimum) Notable interactions: tunnel_mtu*keepalive_interval coef=+2.8750 (synergistic) tunnel_mtu*fragment_size coef=+2.1500 (synergistic) fragment_size*keepalive_interval coef=+1.3250 (synergistic) Predicted optimum (from linear model, at observed points): tunnel_mtu = 1350 fragment_size = 0 keepalive_interval = 10 Predicted value: 12.1158 Surface optimum (via L-BFGS-B, linear model): tunnel_mtu = 1500 fragment_size = 1400 keepalive_interval = 120 Predicted value: 5.6283 Model quality: Weak fit — consider adding center points or using a different design. Factor importance: 1. keepalive_interval (effect: 3.9, contribution: 49.1%) 2. fragment_size (effect: 2.5, contribution: 32.0%) 3. tunnel_mtu (effect: 1.5, contribution: 19.0%)
← Previous: BGP Route Convergence All Use Cases →