← All Use Cases
📡
Full Factorial Design

Firmware OTA Strategy

Full factorial of chunk size, retry count, and delta encoding for update time and success rate

Summary

This experiment investigates firmware ota strategy. Full factorial of chunk size, retry count, and delta encoding for update time and success rate.

The design varies 3 factors: chunk size kb (KB), ranging from 1 to 64, retry count (retries), ranging from 1 to 5, and delta encoding, ranging from off to on. The goal is to optimize 2 responses: update time sec (sec) (minimize) and success rate pct (%) (maximize). Fixed conditions held constant across all runs include transport = coap, compression = lz4.

A full factorial design was used to explore all 8 possible combinations of the 3 factors at two levels. This guarantees that every main effect and interaction can be estimated independently, at the cost of a larger experiment (8 runs).

Key Findings

For update time sec, the most influential factors were chunk size kb (41.5%), delta encoding (38.0%), retry count (20.5%). The best observed value was 30.0 (at chunk size kb = 64, retry count = 1, delta encoding = on).

For success rate pct, the most influential factors were retry count (71.5%), chunk size kb (18.6%), delta encoding (9.9%). The best observed value was 99.7 (at chunk size kb = 64, retry count = 5, delta encoding = off).

Recommended Next Steps

Experimental Setup

Factors

FactorLowHighUnit
chunk_size_kb164KB
retry_count15retries
delta_encodingoffon

Fixed: transport = coap, compression = lz4

Responses

ResponseDirectionUnit
update_time_sec↓ minimizesec
success_rate_pct↑ maximize%

Configuration

use_cases/75_firmware_ota_strategy/config.json
{ "metadata": { "name": "Firmware OTA Strategy", "description": "Full factorial of chunk size, retry count, and delta encoding for update time and success rate" }, "factors": [ { "name": "chunk_size_kb", "levels": [ "1", "64" ], "type": "continuous", "unit": "KB" }, { "name": "retry_count", "levels": [ "1", "5" ], "type": "continuous", "unit": "retries" }, { "name": "delta_encoding", "levels": [ "off", "on" ], "type": "categorical", "unit": "" } ], "fixed_factors": { "transport": "coap", "compression": "lz4" }, "responses": [ { "name": "update_time_sec", "optimize": "minimize", "unit": "sec" }, { "name": "success_rate_pct", "optimize": "maximize", "unit": "%" } ], "settings": { "operation": "full_factorial", "test_script": "use_cases/75_firmware_ota_strategy/sim.sh" } }

Experimental Matrix

The Full Factorial Design produces 8 runs. Each row is one experiment with specific factor settings.

Runchunk_size_kbretry_countdelta_encoding
115on
2641off
3645off
4645on
515off
6641on
711off
811on

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/75_firmware_ota_strategy/config.json
2

Generate the runner script

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

Execute the experiments

Terminal
$ bash use_cases/75_firmware_ota_strategy/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/75_firmware_ota_strategy/config.json
5

Get optimization recommendations

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

Generate the HTML report

Terminal
$ doe report --config use_cases/75_firmware_ota_strategy/config.json \ --output use_cases/75_firmware_ota_strategy/results/report.html

Features Exercised

FeatureValue
Design typefull_factorial
Factor typescontinuous (2), categorical (1)
Arg styledouble-dash
Responses2 (update_time_sec ↓, success_rate_pct ↑)
Total runs8

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: update_time_sec

Top factors: chunk_size_kb (41.5%), delta_encoding (38.0%), retry_count (20.5%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
chunk_size_kb13444.50003444.500021.2620.1360
retry_count1840.5000840.50005.1880.2634
delta_encoding12888.00002888.000017.8270.1481
chunk_size_kb*retry_count11568.00001568.00009.6790.1980
chunk_size_kb*delta_encoding114964.500014964.500092.3730.0660
retry_count*delta_encoding11624.50001624.500010.0280.1947
Error1162.0000162.0000
Total725492.00003641.7143

Pareto Chart

Pareto chart for update_time_sec

Main Effects Plot

Main effects plot for update_time_sec

Normal Probability Plot of Effects

Normal probability plot for update_time_sec

Half-Normal Plot of Effects

Half-normal plot for update_time_sec

Model Diagnostics

Model diagnostics for update_time_sec

Response: success_rate_pct

Top factors: retry_count (71.5%), chunk_size_kb (18.6%), delta_encoding (9.9%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
chunk_size_kb112.251212.25120.1170.7899
retry_count1181.4513181.45131.7380.4131
delta_encoding13.51133.51130.0340.8845
chunk_size_kb*retry_count12.31132.31130.0220.9060
chunk_size_kb*delta_encoding11.90131.90130.0180.9146
retry_count*delta_encoding11.20131.20130.0120.9320
Error1104.4012104.4012
Total7307.028843.8613

Pareto Chart

Pareto chart for success_rate_pct

Main Effects Plot

Main effects plot for success_rate_pct

Normal Probability Plot of Effects

Normal probability plot for success_rate_pct

Half-Normal Plot of Effects

Half-normal plot for success_rate_pct

Model Diagnostics

Model diagnostics for success_rate_pct

Response Surface Plots

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

success rate pct chunk size kb vs retry count

RSM surface: success rate pct chunk size kb vs retry count

update time sec chunk size kb vs retry count

RSM surface: update time sec chunk size kb vs retry count

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

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
update_time_sec 1.0
0.8022
59.00 0.8022 59.00 sec
success_rate_pct 1.5
0.9203
99.00 0.9203 99.00 %

Recommended Settings

FactorValue
chunk_size_kb64 KB
retry_count1 retries
delta_encodingon

Source: from observed run #4

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
success_rate_pct99.0099.70+0.70

Top 3 Runs by Desirability

RunDFactor Settings
#10.6616chunk_size_kb=1, retry_count=5, delta_encoding=on
#80.4719chunk_size_kb=64, retry_count=5, delta_encoding=on

Model Quality

ResponseType
success_rate_pct0.5136linear

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.8711 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- update_time_sec 1.0 0.8022 59.00 sec ↓ success_rate_pct 1.5 0.9203 99.00 % ↑ Recommended settings: chunk_size_kb = 64 KB retry_count = 1 retries delta_encoding = on (from observed run #4) Trade-off summary: update_time_sec: 59.00 (best observed: 30.00, sacrifice: +29.00) success_rate_pct: 99.00 (best observed: 99.70, sacrifice: +0.70) Model quality: update_time_sec: R² = 0.1518 (linear) success_rate_pct: R² = 0.5136 (linear) Top 3 observed runs by overall desirability: 1. Run #4 (D=0.8711): chunk_size_kb=64, retry_count=1, delta_encoding=on 2. Run #1 (D=0.6616): chunk_size_kb=1, retry_count=5, delta_encoding=on 3. Run #8 (D=0.4719): chunk_size_kb=64, retry_count=5, delta_encoding=on

Full Analysis Output

doe analyze
=== Main Effects: update_time_sec === Factor Effect Std Error % Contribution -------------------------------------------------------------- chunk_size_kb -41.5000 21.3358 41.5% delta_encoding 38.0000 21.3358 38.0% retry_count -20.5000 21.3358 20.5% === ANOVA Table: update_time_sec === Source DF SS MS F p-value ----------------------------------------------------------------------------- chunk_size_kb 1 3444.5000 3444.5000 21.262 0.1360 retry_count 1 840.5000 840.5000 5.188 0.2634 delta_encoding 1 2888.0000 2888.0000 17.827 0.1481 chunk_size_kb*retry_count 1 1568.0000 1568.0000 9.679 0.1980 chunk_size_kb*delta_encoding 1 14964.5000 14964.5000 92.373 0.0660 retry_count*delta_encoding 1 1624.5000 1624.5000 10.028 0.1947 Error 1 162.0000 162.0000 Total 7 25492.0000 3641.7143 === Interaction Effects: update_time_sec === Factor A Factor B Interaction % Contribution ------------------------------------------------------------------------ chunk_size_kb delta_encoding 86.5000 60.5% retry_count delta_encoding -28.5000 19.9% chunk_size_kb retry_count -28.0000 19.6% === Summary Statistics: update_time_sec === chunk_size_kb: Level N Mean Std Min Max ------------------------------------------------------------ 1 4 148.2500 35.6593 109.0000 195.0000 64 4 106.7500 77.9589 30.0000 203.0000 retry_count: Level N Mean Std Min Max ------------------------------------------------------------ 1 4 137.7500 59.4720 59.0000 203.0000 5 4 117.2500 68.4124 30.0000 195.0000 delta_encoding: Level N Mean Std Min Max ------------------------------------------------------------ off 4 108.5000 77.0649 30.0000 195.0000 on 4 146.5000 39.9458 109.0000 203.0000 === Main Effects: success_rate_pct === Factor Effect Std Error % Contribution -------------------------------------------------------------- retry_count -9.5250 2.3415 71.5% chunk_size_kb 2.4750 2.3415 18.6% delta_encoding 1.3250 2.3415 9.9% === ANOVA Table: success_rate_pct === Source DF SS MS F p-value ----------------------------------------------------------------------------- chunk_size_kb 1 12.2512 12.2512 0.117 0.7899 retry_count 1 181.4513 181.4513 1.738 0.4131 delta_encoding 1 3.5113 3.5113 0.034 0.8845 chunk_size_kb*retry_count 1 2.3113 2.3113 0.022 0.9060 chunk_size_kb*delta_encoding 1 1.9013 1.9013 0.018 0.9146 retry_count*delta_encoding 1 1.2013 1.2013 0.012 0.9320 Error 1 104.4012 104.4012 Total 7 307.0288 43.8613 === Interaction Effects: success_rate_pct === Factor A Factor B Interaction % Contribution ------------------------------------------------------------------------ chunk_size_kb retry_count 1.0750 38.1% chunk_size_kb delta_encoding -0.9750 34.5% retry_count delta_encoding -0.7750 27.4% === Summary Statistics: success_rate_pct === chunk_size_kb: Level N Mean Std Min Max ------------------------------------------------------------ 1 4 89.2500 7.7814 81.1000 99.7000 64 4 91.7250 6.1408 84.1000 99.0000 retry_count: Level N Mean Std Min Max ------------------------------------------------------------ 1 4 95.2500 4.9534 89.4000 99.7000 5 4 85.7250 4.1620 81.1000 90.9000 delta_encoding: Level N Mean Std Min Max ------------------------------------------------------------ off 4 89.8250 6.4881 84.1000 99.0000 on 4 91.1500 7.6861 81.1000 99.7000

Optimization Recommendations

doe optimize
=== Optimization: update_time_sec === Direction: minimize Best observed run: #6 chunk_size_kb = 64 retry_count = 1 delta_encoding = on Value: 30.0 RSM Model (linear, R² = 0.2979, Adj R² = -0.2287): Coefficients: intercept +127.5000 chunk_size_kb -21.7500 retry_count -6.7500 delta_encoding -20.7500 Predicted optimum (from linear model, at observed points): chunk_size_kb = 1 retry_count = 1 delta_encoding = off Predicted value: 176.7500 Surface optimum (via L-BFGS-B, linear model): chunk_size_kb = 64 retry_count = 5 delta_encoding = on Predicted value: 78.2500 Model quality: Weak fit — consider adding center points or using a different design. Factor importance: 1. chunk_size_kb (effect: -43.5, contribution: 44.2%) 2. delta_encoding (effect: -41.5, contribution: 42.1%) 3. retry_count (effect: -13.5, contribution: 13.7%) === Optimization: success_rate_pct === Direction: maximize Best observed run: #1 chunk_size_kb = 64 retry_count = 5 delta_encoding = off Value: 99.7 RSM Model (linear, R² = 0.6086, Adj R² = 0.3151): Coefficients: intercept +90.4875 chunk_size_kb +1.9125 retry_count +4.2625 delta_encoding +1.2375 Predicted optimum (from linear model, at observed points): chunk_size_kb = 64 retry_count = 5 delta_encoding = on Predicted value: 97.9000 Surface optimum (via L-BFGS-B, linear model): chunk_size_kb = 64 retry_count = 5 delta_encoding = on Predicted value: 97.9000 Model quality: Moderate fit — use predictions directionally, not precisely. Factor importance: 1. retry_count (effect: 8.5, contribution: 57.5%) 2. chunk_size_kb (effect: 3.8, contribution: 25.8%) 3. delta_encoding (effect: 2.5, contribution: 16.7%)
← Previous: Zigbee Network Formation Next: Battery Management Charging →