Chapters

3 Latency Budgets for Tier Choice

edge-fog
latency

In 60 Seconds

Start the Clock at the Event That Matters

Picture a saw that must stop when a guard opens. The sensor reacts, code checks the state, a command travels, and the brake takes time to act. A fast dashboard update is useful, but it is not the deadline the worker depends on.

Write the whole response budget from physical change to confirmed safe result. Give time to sensing, local queues, transfer, decision, command, motion, and evidence. Name the owner and clock at each step. Keep average, slow-case, and failure timing apart.

Test a busy device, a weak link, a full queue, a cold start, a lost reply, and loss of the remote service. Measure the final physical action, not only a software mark. A small ping time cannot prove the complete loop.

Keep the time-bound stop close enough to work when wide links fail. Nearby and remote systems can coordinate sites, retain history, and improve rules, but they must not become the only path to immediate safety.

This opening does not place every task at one tier. Practitioner assigns work from the measured budget. Under the Hood examines queue tails, retries, clock choice, load, fallback, and the evidence needed to defend each placement.

Edge-fog latency is the time between a physical event and the response that matters. It is not just network ping time. The full path can include sensor sampling, device queueing, local processing, radio transfer, gateway buffering, cloud service time, command delivery, actuator behavior, and evidence capture. Build that response budget first, then assign ownership to the closest tier that can meet it under normal and stressed conditions.

In the motor picture, compare the sensor and nearby box with the longer route through the cloud. The damaged shaft is still turning; where would a stop decision have to act?

  1. Edge Eddie sees a vibration sensor detect a motor fault as damage begins to spread, while local and distant control paths compete and the machine has not stopped.

    Where must the stop decision happen before damage spreads?

CP-0134 pre-concept hook: Where must the stop decision happen before damage spreads?

3.1 Start Simple

This section: Start Simple — The sensor has detected trouble, but the shaft is still turning.

The sensor has detected trouble, but the shaft is still turning. The picture puts a local decision path beside a distant one; neither path is proven safe by the drawing alone. Time the path through a confirmed stop, including the command and machine action, before deciding where the stop decision belongs. Imagine a vibration sensor notices a motor fault and must stop a machine before damage spreads. The first question is not where the code is fashionable; it is how many milliseconds the whole loop can spend from sensing to actuation. Everyday IoT latency work starts by timing that loop, then moving only the responsibilities that miss the budget closer to the device. Start with one event, one deadline, one fallback action, and one owner for the measurement.

Edge Eddie

“Send the decision, not the raw feed — the edge earns its keep in milliseconds and megabytes saved.”

Here Eddie starts the stopwatch at the physical event, not the dashboard, and follows the budget through every segment that can eat it.

Minimum Viable Understanding

Do not choose edge, fog, or cloud from the architecture label alone. Choose the tier that can meet the workload’s timing need and still preserve enough evidence for review. Edge usually fits immediate local action, fog usually fits nearby site coordination, and cloud usually fits history, fleet comparison, training, and governance when delay is acceptable.

3.2 Learning Objectives

This section: Learning Objectives

After this chapter, you should be able to:

  • define a latency budget from physical event to useful response;
  • separate immediate response ownership from later review evidence;
  • identify the path segments that belong in a latency decision record;
  • explain why averages can hide placement failures;
  • state when edge, fog, cloud, or a hybrid split is defensible.

3.3 Start the Clock at the Physical Event

This section: Start the Clock at the Physical Event — A latency budget starts when the physical condition changes, not when the dashboard receives a message.

A latency budget starts when the physical condition changes, not when the dashboard receives a message. A cold-room door sensor may need a local alarm within a site-defined window, while the supervisor dashboard and monthly energy review can wait. If local firmware can alarm reliably during backhaul loss, the edge can own the immediate response. The fog gateway can still coordinate nearby devices and buffer records, while the cloud receives the event later for reporting.

Eddie’s Edge Ledger

  • Decide here: local firmware alarms reliably during backhaul loss — the edge owns the immediate response.
  • Send up: the cloud receives the event later for reporting; the monthly energy review can wait.
  • Clock it: a site-defined window starting at the physical condition change, not at dashboard receipt.

Inspect Figure 3.1 before continuing. Latency starts with the physical condition that demands a response, not with a convenient software timestamp. Figure 3.1 identifies every segment that must fit inside the cold-room alarm’s site-defined window.

A latency budget path showing the timer from physical event through sensing, transfer, queue, processing, command, actuation, and evidence record
Figure 3.1: Latency budget path from event to evidence

In the diagram Figure 3.1, start the timer at Physical Event, then account for Sense + Validate sampling, debounce, and timestamp work. Transfer + Queue adds hops, retries, buffering, and burst load before Process + Decide applies a rule, inference, or site policy. The path ends only after Command + Act sends and confirms the response or invokes local fallback; Evidence Record then separates device, site, and review proof. Record p50 and p95 duration, retry count, queue age, decision time, command acknowledgement, and the owner of each segment so a missed alarm window can be traced to a boundary rather than hidden inside one end-to-end average. This budget supports edge ownership when the local confirmed action must survive backhaul loss.

Build a response budget first, then assign ownership to the closest tier that can meet it and preserve review evidence.

3.4 Tier Ownership From the Budget

This section: Tier Ownership From the Budget

3.4.1 Edge Owns Immediate Response

Use edge ownership when the device must respond locally, such as a safety stop, local lockout, fast warning, or minimum safe fallback during an upstream outage.

3.4.2 Fog Owns Site Coordination

Use fog ownership when the decision needs a gateway, local policy, multiple nearby devices, protocol translation, buffering, or a site-wide view.

3.4.3 Cloud Owns Fleet Review

Use cloud ownership when the response can wait and the value comes from long-term storage, dashboards, model training, governance, or cross-site comparison.

3.5 Measure the Path, Not the Label

This section: Measure the Path, Not the Label — A latency decision record should show the start event, stop event, path segments, measurement method, stressed condition, accepted percentile, owner, and retest trigger.

A latency decision record should show the start event, stop event, path segments, measurement method, stressed condition, accepted percentile, owner, and retest trigger. The record should explain why the chosen tier is acceptable and what evidence must remain visible after deployment.

Path Segment

Evidence to Measure

Common Mistake

Retest Trigger

Sensing

Sampling interval, interrupt behavior, timestamp source, sensor warm-up, debounce, and local queue delay.

The response clock starts at message receipt instead of the physical event.

Sensor, firmware, sampling policy, calibration, timestamp source, or event definition changes.

Network and gateway

Radio delay, retries, queueing, gateway buffering, protocol translation, uplink outage behavior, and replay rules.

One healthy link measurement is treated as proof for congested, weak-signal, or outage conditions.

Topology, gateway, backhaul, antenna, channel, retry policy, protocol, or site load changes.

Processing and command

Rule or model execution time, queue priority, command authorization, actuator command delivery, and fallback behavior.

Model inference is measured alone while preprocessing, postprocessing, and actuation are ignored.

Model, rule, device class, actuator, command policy, security check, or software version changes.

Review evidence

Logs, trace IDs, retained samples, decision version, owner, incident record, and cloud or site upload behavior.

Fast response works, but later reviewers cannot reconstruct what happened or why.

Retention, privacy policy, upload path, dashboard, audit rule, ownership, or incident workflow changes.

Eddie’s Edge Ledger

  • Decide here: the Sensing row — sampling interval, interrupt behavior, timestamp source, sensor warm-up, debounce, and local queue delay.
  • Send up: the Network and gateway row — radio delay, retries, queueing, gateway buffering, protocol translation, and replay rules.
  • Clock it: not at message receipt — the Sensing row's own common mistake is starting the clock there instead of at the physical event.

Prefer percentile evidence over averages when the workload is safety-related, control-related, or user-facing. The relevant percentile depends on the risk and operating agreement; the decision record should state which percentile is accepted and what load condition it represents.

Latency decision record Workload: physical event, required response, and user or equipment impact. Start and stop points: what starts the timer and what counts as successful response. Segment budget: sensing, network, queueing, processing, command, actuation, and evidence upload. Tier owner: edge, fog, cloud, or hybrid ownership with fallback behavior. Measurement evidence: normal load, stressed load, tail latency, jitter, missing records, and failed-path behavior. Retest trigger: sensor, firmware, model, gateway, topology, network, actuator, policy, workload, or ownership change.

3.6 Tail Latency Is Where Placement Fails

This section: Tail Latency Is Where Placement Fails — Many placement failures hide in the slow cases.

Many placement failures hide in the slow cases. A path may look acceptable when a device is idle, a gateway is nearby, a queue is empty, and the cloud service is healthy. The same path may miss its response budget during radio retries, gateway overload, cold starts, model loading, authentication checks, congestion, actuator delay, or an upstream outage.

For a tail-latency review, trace one event through every boundary. A vibration threshold might wait for the next sensor sample, retry on a noisy radio link, sit behind a gateway upload, run a model, request command authorization, and then wait for the actuator to respond. Each segment can be small alone, yet the combined slow path can exceed the budget. Placement is credible only when the measured trace includes those waits and the fallback path.

3.6.1 Queue Boundaries

Queues form at sensors, gateways, brokers, cloud workers, command paths, and actuators. A queue that preserves throughput can still break a response budget.

3.6.2 Clock Boundaries

Mixed clocks can make evidence misleading. Response records should preserve enough timestamps or trace IDs to reconstruct the path.

3.6.3 Fallback Boundaries

When a path misses the budget, the system needs a defined local fallback, degraded mode, retry policy, or human-review route.

Cloud is not wrong for latency-sensitive systems; it is wrong as the sole owner of an immediate physical response unless the measured path proves it. A common hybrid pattern is edge for the minimum safe action, fog for site coordination and buffering, and cloud for history, comparison, governance, and model improvement.

The under-the-hood rule is to review the worst useful path, not the happiest path. If the design depends on an edge model, measure preprocessing, inference, postprocessing, command output, and fallback. If the design depends on a gateway, measure local queueing and outage behavior. If the design depends on cloud, measure the full upstream and downstream path under the relevant operating condition.

3.7 Response Budget Flow

This section: Response Budget Flow — Trace your own path before you commit to a tier.

Immediate action

Site coordination

Delay tolerated

Physical event

Sample and timestamp

Local queue and retries

Who can meet the budget?

Edge owns response

Fog owns response

Cloud owns response

Retain evidence and retest trigger

Define fallback when the path misses

Trace your own path before you commit to a tier. The workbench below breaks end-to-end latency into request transfer, queueing, processing, and response segments across device, edge, fog, and cloud placements, so you can see which segment a given payload size, congestion level, or cloud distance actually costs before you defend a placement decision.

Whole-response latency budgets narrated tour

This section: Whole-response latency budgets narrated tour

Whole-response latency budgets narrated tour

Play silently with captions on provisional storyboard timing; narration audio is pending. Production pacing is not simulated protocol or network time. Choose Reduced motion for a complete still at each beat.

Play the tour to open the workbench. Pause, replay a beat, or read the full transcript below. Some situations cannot be shown by this teaching model; those beats provide captions only.

Full transcript — Whole-response latency budgets (8 beats)

B1 — Saw-stop budget
You are the engineer responsible for a connected saw that must stop when its guard opens. A worker depends on the brake acting in time. Your timing budget begins when the guard opens and ends with the confirmed safe result.

Model caption: Your saw must stop when its guard opens. Time from guard opening to confirmed safe result; the worker depends on the brake acting in time.

B2 — Physical event to response
Latency means the time from a physical event to the response that matters. Sensing and waiting consume time. Sending a command and moving the brake take time too. Edge computing runs near the device; fog uses a site gateway; cloud computing runs remotely.

Model caption: Latency runs from physical event to useful response, including sensing, waiting, command delivery, and brake motion. Edge: near device. Fog: site gateway. Cloud: remote.

B3 — Placement model inputs
Use an illustrative placement model to compare part of that journey. Set a request of one hundred kilobytes, a link of ten megabits per second, and complexity four. Choose no congestion, a twelve millisecond cloud round trip, and a one hundred millisecond target.

Model caption: Illustrative model: 100 KB, 10 Mbps, complexity 4, no congestion, local cloud distance with 12 ms round trip, target 100 ms. These are modeled inputs, not a measured saw-stop deadline.

B4 — Request and response estimates
For request transmission, multiply one hundred by eight, then divide by ten: eighty milliseconds. For the response estimate, multiply eighty by zero point twelve: nine point six milliseconds. The model sets a floor of zero point zero eight milliseconds; nine point six is larger, so keep it.

Model caption: Raw request estimate: 100 × 8 ÷ 10 = 80 ms. Raw response estimate: 80 × 0.12 = 9.6 ms; max(0.08, 9.6) = 9.6 ms. Path terms are added next.

B5 — Network and waiting
For the cloud request path, halve twelve to get six milliseconds. Add eighty to get eighty-six, then multiply by the congestion multiplier of one: still eighty-six. For waiting, zero times one point one gives zero; add five to get five milliseconds.

Model caption: Cloud request/network: (12 ÷ 2 + 80) × 1 = 86 ms. Waiting: 0 × 1.1 = 0, then 5 + 0 = 5 ms. No congestion still leaves the model's base waiting time.

B6 — Processing and return
Cloud processing takes four times one point four: five point six milliseconds. The model caps the return congestion multiplier at three, so our multiplier stays one. Multiply nine point six by one, then add the six milliseconds of return travel: fifteen point six milliseconds.

Model caption: Processing: 4 × 1.4 = 5.6 ms. Return multiplier: min(1, 3) = 1. Response: 9.6 × 1 = 9.6; 12 ÷ 2 = 6; 6 + 9.6 = 15.6 ms.

B7 — Cloud misses target
Add eighty-six and five: ninety-one. Add five point six: ninety-six point six. Add fifteen point six: one hundred twelve point two milliseconds. The cloud path misses the one hundred millisecond target. Those modeled stages cover transfer through return; sensing and brake motion belong to your full response budget.

Model caption: 86 + 5 = 91; + 5.6 = 96.6; + 15.6 = 112.2 ms. Cloud misses 100 ms. Native card rounds to 112 ms. Sensing and brake motion remain part of the full physical response budget.

B8 — Whole response matters
The misconception is that faster processing guarantees a faster response. Edge processing takes four times ten point five: forty-two milliseconds. Cloud processing takes only five point six, yet its request path alone takes eighty-six. Choose where the whole response fits the budget, rather than where the calculation finishes first.

Model caption: Edge processing: 4 × 10.5 = 42 ms. Cloud processing: 4 × 1.4 = 5.6 ms, but cloud request/network alone is 86 ms and total is 112.2 ms, beyond 100 ms. Choose where the whole response fits the budget, rather than where the calculation finishes first.

3.8 Summary

This section: Summary

  • Edge-fog latency is an end-to-end response budget from physical event to useful system response.
  • The path includes sensing, queueing, network transfer, gateway behavior, processing, command delivery, actuation, and retained evidence.
  • Edge ownership fits immediate local action; fog ownership fits site coordination; cloud ownership fits history, governance, training, and fleet review when delay is acceptable.
  • A latency decision record should state start and stop points, segment budgets, measurement conditions, accepted percentile, owner, fallback, and retest trigger.
  • Averages can hide the slow cases that matter; tail latency, jitter, congestion, retries, and outages need explicit review.
  • Retest latency after sensor, firmware, model, gateway, topology, network, actuator, command policy, workload, or ownership changes.
Key Takeaway

Choose edge, fog, or cloud ownership from measured response budgets. The correct tier is the one that meets the workload’s timing need, preserves evidence, and has a defined fallback when the path weakens.

3.9 See Also

This section: See Also

Edge, Fog, and Cloud Architecture

Map response ownership into device, gateway, site, regional, and cloud layers.

Edge Bandwidth Optimization

Review what should cross constrained links after latency ownership is clear.

Edge-Fog Decision Framework

Combine latency with bandwidth, privacy, autonomy, power, operations, and governance evidence.

Edge-Fog Labs

Practice measuring local response, site coordination, evidence retention, and failure behavior.

Find help

3 reviewed answers.

Where should I start in a module?

Open the module page from the sidebar to see its chapters in order. Use the module map to return to a topic you need.

Modules and paths

Reviewed

What can I try when a project does not work?

Check the symptom, then work through the diagnostic steps. Keep the error message and the smallest example that reproduces it.

When you are stuck

Reviewed

How do interactive examples work?

Use the interactive guide to check how examples and simulations work before changing your project.

Interactive examples guide

Reviewed