Scenario: An autonomous vehicle fleet uses edge-fog-cloud architecture for object detection. Calculate the maximum allowable processing latency at each tier to maintain safety.
Given:
- Vehicle speed: 60 mph (26.8 m/s)
- Safe stopping distance: 40 m
- Mechanical braking delay: 200 ms
- Sensor detection time: 30 ms
- Required decision time before braking: Calculate
Step 1: Calculate time available for decision:
Distance = Speed × Time
40m = 26.8 m/s × Time
Time = 40 / 26.8 = 1.49 seconds total budget
Step 2: Subtract fixed delays:
Total budget: 1,490 ms
- Mechanical braking: 200 ms
- Sensor detection: 30 ms
Remaining for processing: 1,260 ms
Step 3: Evaluate each tier against budget:
| Edge (on-vehicle) |
5 ms processing + 5 ms routing = 10 ms |
0.27 m |
✓ Yes (10 << 1,260 ms) |
SAFE |
| Fog (roadside unit) |
20 ms network + 30 ms processing = 50 ms |
1.34 m |
✓ Yes (50 << 1,260 ms) |
SAFE |
| Cloud |
120 ms network + 40 ms processing = 160 ms |
4.29 m |
✓ Yes (160 << 1,260 ms) |
SAFE |
Step 4: Add network jitter and worst-case analysis:
Best-case latencies don’t account for congestion and packet loss. Real-world 95th percentile latencies:
| Edge |
10 ms |
15 ms |
25 ms |
0.40 m |
SAFE |
| Fog |
50 ms |
120 ms |
300 ms |
3.22 m |
MARGINAL |
| Cloud |
160 ms |
450 ms |
1,200 ms |
12.06 m |
UNSAFE |
Step 5: Final tier assignment for safety-critical braking:
Tier: EDGE (on-vehicle processing)
Rationale:
- Worst-case latency (25 ms) << budget (1,260 ms) with 50x safety margin
- No network dependency — functions during connectivity loss
- 95th percentile: vehicle travels only 0.40m during processing (well within 40m budget)
Fog and Cloud roles:
- Fog: Multi-vehicle coordination ("vehicle ahead braking")
- Cloud: ML model training and fleet-wide analytics
- Neither handles life-safety braking decisions
Real-World Validation: In 2019, a major autonomous vehicle developer experienced a near-miss incident when a 450ms cloud API delay during network congestion prevented timely pedestrian detection. Post-incident analysis shifted all safety-critical decisions to edge processing, using fog only for non-critical coordination.
Key Lesson: Always calculate 95th percentile latency, not average latency, for safety decisions. The 95th percentile fog latency (120ms) is 2.4x the best-case (50ms) — this gap can mean the difference between a safe stop and a collision.