Foundations to Frontier
Tests

Fault Tolerance

Hardware wears out, cosmic rays flip bits and software has bugs, so systems that must keep working are designed to tolerate faults rather than only to avoid them. This page covers the core techniques and the models used to judge them: redundancy with voting or standby spares, error-correcting codes, checkpointing, and design diversity. The exercises compute reliability and mean time to failure analytically and with Markov models, check them by Monte Carlo simulation, and show the classic surprises: triple modular redundancy is worse than a single unit for long missions, a spare is only as good as the detection that switches it in, and independently developed versions fail together more often than independence predicts.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Keep working when parts fail

No part is perfect, so critical systems carry spares and checks. Three computers can vote, so that one wrong answer is outvoted. A spare can wait and take over when the main unit fails, if the failure is noticed in time. Extra bits stored with data let the memory repair a flipped bit. Long calculations save their progress now and then, so a crash loses only the last stretch. Each trick has a cost and a catch, and simple probability models show which trick pays off for a given mission.

🎮 Reliability lab
ln 2λt
one unitR = 0.6065, MTTF = 1.000/λ
TMRR = 0.6574, MTTF = 0.833/λ
cold standby, c = 0.95R = 0.8946, MTTF = 1.950/λ
TMR, repair rate 10λR = 0.8377, MTTF = 2.500/λ

TMR beats one unit only for missions shorter than ln 2/λ, and its mean time to failure (5/6 of a unit's) is shorter. A standby spare helps if failures are detected and switched over (coverage c); repair keeps TMR near full strength. Mean times are in units of 1/λ.

Why engineers care

Spacecraft computers, fly-by-wire flight controls and nuclear reactor protection systems all use triple or quadruple redundancy with voting.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Voting among three units masks…
  2. 2. A standby spare only helps if…
  3. 3. Checkpointing limits…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Fault, error, failure: a fault (a defect or physical event) can cause an error (a wrong internal state), which can cause a failure (wrong service); fault tolerance stops errors from becoming failures (Avižienis, Laprie, Randell and Landwehr, 2004).
  • Reliability R(t): probability of working without failure up to time t; with a constant failure rate λ, R(t) = e^(−λt) and the mean time to failure (MTTF) is 1/λ.
  • k-out-of-n redundancy: the system works while at least k of n units work; triple modular redundancy (TMR) is 2-out-of-3 with a majority voter.
  • Standby redundancy and coverage: a spare replaces a failed unit if the failure is detected and the switch-over succeeds, with probability c (coverage).
  • Markov models: states for the number of working units, transitions for failures and repairs; MTTF and R(t) follow from the generator matrix.
  • Error-correcting codes: a Hamming code with an extra parity bit (SECDED) corrects any single-bit error and detects any double-bit error in a word.
  • Design diversity: N-version programming runs independently developed versions and votes; checkpoint and restart recovers long computations.
📝 Quick check (Level 1)
0/3 answered
  1. 1. With constant failure rate λ, the MTTF is…
  2. 2. TMR is a…
  3. 3. SECDED codes…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Modelling redundancy

Exercise 1.

  • Reliability of k-out-of-n systems, TMR with an imperfect voter, and a hot duplex with coverage.
  • Mean time to failure by numerical integration and, for TMR with repair, from a Markov generator matrix.
  • Monte Carlo lifetimes of k-out-of-n systems from exponential unit lifetimes.
  • A Hamming SECDED code on 4 data bits, tested on every single and double error.

Practice.

  • Match the architecture to the mission: voting suits short missions or repairable systems; long unattended missions need spares and detection.
  • Demonstrate coverage: the probability that a failure is detected and handled often limits reliability more than the number of spares.
  • Protect memories with ECC and scrubbing, and use watchdogs, range checks and control-flow monitoring to detect errors in computation.
  • Avoid common causes: shared power, clocks, software or design errors defeat identical redundant units; use diversity where it matters and do not assume independence (Practice 5).
  • Check models by simulation and against field data; analytic models rest on assumptions such as constant failure rates.
def k_of_n(R, k, n):
    return sum(comb(n, j) * R**j * (1 - R)**(n - j) for j in range(k, n + 1))

def tmr(R, Rv=1): return Rv * k_of_n(R, 2, 3)          # 3R^2 - 2R^3 with a perfect voter

def markov_mttf(Q, start=0):                            # Q: generator over working states
    return solve(-Q, ones)[start]

def secded_decode(w):
    s = XOR of positions of set bits; overall = parity of all 8 bits
    if s == 0 and overall == 0: ok
    elif overall == 1: flip bit s (or the parity bit) -> corrected
    else: detected (double error)
🐍 Exercise 1: reliability models and an error-correcting code
Implement k-out-of-n and TMR reliability, MTTF by integration and by a Markov model, Monte Carlo lifetimes, and a SECDED code.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Voting architectures suit…
  2. 2. Coverage is the probability that…
  3. 3. Identical redundant units are defeated by…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Why TMR loses for long missions. With unit reliability R, TMR works with probability 3R² − 2R³. The difference from a single unit is 3R² − 2R³ − R = −R(2R − 1)(R − 1), which is positive exactly when R > 1/2. With R = e^(−λt), TMR is better only for t < ln 2/λ. Integrating, MTTF_TMR = 3/(2λ) − 2/(3λ) = 5/(6λ), less than the 1/λ of one unit: TMR buys reliability early in the mission by spending it later.

Why repair changes everything. With repair at rate μ, the Markov chain returns from ‘two working’ to ‘three working’ before a second failure most of the time. Solving the generator equations gives MTTF = (5λ + μ)/(6λ²); for μ much larger than λ this grows like μ/(6λ²), far beyond 1/λ. The same holds for spares replaced during maintenance.

Why coverage and independence dominate. For a hot duplex with coverage c, reliability divided by a single unit’s is 1 + (2c − 1)(1 − R): below c = 0.5 the extra unit makes things worse. For N-version programming, Eckhardt and Lee modelled each input’s difficulty θ: versions fail independently given the input, but averaging over inputs gives E[3θ² − 2θ³], which exceeds 3p² − 2p³ (p = E[θ]) because hard inputs make all versions fail together. Fault tolerance arguments therefore have to show coverage and independence, not assume them.

📝 Quick check (Level 3)
0/3 answered
  1. 1. TMR beats a single unit when unit reliability is…
  2. 2. The MTTF of TMR without repair is…
  3. 3. Correlated version failures arise because…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How do one unit, a cold-standby pair, TMR, TMR with an imperfect voter and TMR with repair compare over missions of different lengths, and do the analytic models agree with simulation?

History.

  • J. von Neumann (1956) showed how reliable computation can be built from unreliable components; R. Hamming (1950) introduced error-correcting codes.
  • R. Lyons and W. Vanderkulk (1962) analysed triple modular redundancy; the Saturn V launch vehicle computer used TMR.
  • A. Avižienis (1967 onwards) developed fault-tolerant computing and N-version programming; D. Eckhardt and L. Lee (1985) modelled coincident failures, and J. Knight and N. Leveson (1986) found them experimentally.
  • J. Young (1974) derived the optimal checkpoint interval; the Space Shuttle flew four identical computers and a fifth with independently written software.

Exercise 2.

  • Units with failure rate λ; missions of λt = 0.05, 0.2, 0.5, ln 2, 1 and 2.
  • Designs: one unit; a cold-standby pair with coverage 0.95; TMR; TMR with a voter of failure rate 0.001λ; TMR with repair at μ = 10λ (Markov model).
  • Each analytic reliability and MTTF is checked against 100,000 simulated systems.

Seed 0, analytic reliability (simulated):

design λt = 0.05 0.5 ln 2 1 2 MTTF (×1/λ)
one unit 0.9512 (0.9506) 0.6065 (0.6037) 0.5000 (0.4965) 0.3679 (0.3670) 0.1353 (0.1353) 1.000 (0.997)
cold standby, c = 0.95 0.9964 (0.9965) 0.8946 (0.8950) 0.8292 (0.8283) 0.7174 (0.7158) 0.3925 (0.3919) 1.950 (1.955)
TMR 0.9931 (0.9930) 0.6574 (0.6581) 0.5000 (0.5002) 0.3064 (0.3071) 0.0500 (0.0496) 0.833 (0.833)
TMR, imperfect voter 0.9930 (0.9930) 0.6570 (0.6579) 0.4997 (0.4999) 0.3061 (0.3069) 0.0499 (0.0495) 0.833 (0.832)
TMR with repair 0.9941 (0.9938) 0.8377 (0.8371) 0.7738 (0.7727) 0.6820 (0.6815) 0.4521 (0.4532) 2.500 (2.511)

Seeds 1 and 2: simulated MTTF 0.996 and 0.999 (one unit), 1.938 and 1.953 (cold standby), 0.833 and 0.834 (TMR), 2.507 and 2.496 (TMR with repair); every simulated reliability within 0.01 of the analytic value.

Findings.

  • TMR was better than one unit only for short missions: 0.9931 against 0.9512 at λt = 0.05, equal at ln 2, and 0.0500 against 0.1353 at λt = 2; its MTTF was 5/6 of a unit’s.
  • Repair turned TMR into the best design for long missions: with μ = 10λ its MTTF was 2.5/λ and its reliability at λt = 2 was 0.452.
  • A cold spare with 95% coverage nearly doubled the MTTF (1.95/λ) and beat TMR at every mission length here, because the idle spare does not age; but it needs failure detection, while TMR masks wrong outputs immediately.
  • A voter 1,000 times more reliable than a unit barely mattered (at most 0.0004 lower reliability).
  • The models agreed with simulation to within 0.01 in every seed, confirming the formulas but only under their assumptions: constant failure rates, independent units and perfect repair.
🐍 Exercise 2 (research): how do one unit, a cold-standby pair, TMR, TMR with an imperfect voter and TMR with repair compare over missions of different lengths, and do the analytic models agree with simulation?
Compare redundancy designs over missions of different lengths, analytically and by Monte Carlo simulation.

Fault tolerance in practice

  • Aviation and space: fly-by-wire computers use dissimilar hardware and software lanes with cross-monitoring; spacecraft use radiation-hardened processors, TMR in FPGAs, watchdogs and safe modes (topics M3-2 and M3-3).
  • Data centres: replication and erasure codes for storage, checkpointing for large training runs, and automatic failover for services.
  • Machine learning: ensembles and redundant models give some protection, but share training data and failure modes; hardware faults in accelerators are covered in topic M3-2, and graceful degradation in M3-3.

References

  1. A. Avižienis, J.-C. Laprie, B. Randell and C. Landwehr (2004). “Basic concepts and taxonomy of dependable and secure computing.” IEEE Transactions on Dependable and Secure Computing.
  2. R. Lyons and W. Vanderkulk (1962). “The use of triple-modular redundancy to improve computer reliability.” IBM Journal of Research and Development.
  3. D. Eckhardt and L. Lee (1985). “A theoretical basis for the analysis of multiversion software subject to coincident errors.” IEEE Transactions on Software Engineering.
  4. J. Knight and N. Leveson (1986). “An experimental evaluation of the assumption of independence in multiversion programming.” IEEE Transactions on Software Engineering.
  5. J. Young (1974). “A first order approximation to the optimum checkpoint interval.” Communications of the ACM.
  6. R. Hamming (1950). “Error detecting and error correcting codes.” Bell System Technical Journal.