Skip to main content
Pipeline Sandbox

How the sandbox calculates your results

This page explains every number the sandbox shows you. Each result in the editor can be opened with Explain, which shows the formula below with your own values substituted. You should be able to check any of them with a calculator.

The engine is analytic: it uses closed-form formulas and a simple queueing approximation. It is not a packet-level network simulator, and it does not model radio energy, packet loss, retransmissions or contention between devices sharing a wireless channel. All hardware, link and price figures are teaching approximations chosen to make the trade-offs visible. They are close enough to reason with, not to buy equipment with.

Engine version: 1.0.0

1. How data flows

Each source (for example 24 ward cameras) produces events at a fixed rate. Every event travels from its source to each sink that needs it, along exactly one route through your nodes and links.

Data form and privacy

Data on a hop is in one of three forms:

FormMeaning
rawNo stage has run yet
derivedOnly preprocessing has run (for example resized frames or FFT features)
resultInference has run (scores, labels, counts)

Every node has a location: on-device (compute inside the sensor unit), on-premises (a separate box on site) or off-premises (the cloud, a hosted dashboard). When a hop goes from an on-device or on-premises node to an off-premises node, the data on it leaves the premises. The privacy result is the most revealing form that leaves, with its data class (public, operational, personal, sensitive personal). Results derived from personal data are still personal data: a fall alert names a patient.

Separately, any network hop carrying personal or sensitive-personal data without TLS is a violation, wherever it is.

Every event (or batch of events) becomes a message.

Encoding multiplier

EncodingStructured data (time series, tables, features, results)Media (images, video frames, audio)
JSON1.01.37 (base64 inflation)
Protobuf0.41.0
Binary0.351.0

Per-message overhead (connection reused)

ProtocolBytes
MQTT, QoS 140
HTTP/1.1, keep-alive600
gRPC over HTTP/265

Message size

messageBytes = eventsPerMessage × payload × encodingMultiplier + protocolOverhead + tlsRecord (+ handshakeBytes)

Streaming, micro-batching and batching

eventsPerMessage = max(1, λ × W ÷ S)

The protocol overhead is paid once per batch, which is how batching saves bandwidth. The price is waiting: an event waits on average W ÷ 2 for its batch to leave, and W at worst.

3. Latency

Transmission (putting the bits on the wire):

tx = messageBytes × 8 ÷ bandwidth

Propagation is the medium's one-way latency, plus handshake round trips if connections are not reused.

Link utilisation ρ is the fraction of time a link is busy. Bandwidth is per sender replica: each of 24 cameras has its own 80 Mbps Wi-Fi in this model (shared-channel contention is not modelled).

ρ = (messages/s per sender × messageBytes × 8) ÷ bandwidth

At ρ ≥ 1 the link cannot keep up and the design is infeasible. Between 0.8 and 1 you get a warning, because queues grow quickly near saturation.

Processing. Each stage needs gopsPerEvent billion operations per event. The node's effective throughput depends on whether the accelerator is used:

effectiveGops = accelPeakTops × 1,000 × accelUtilisation        if the accelerator is used
effectiveGops = cpuGops × cpuUtilisation × (0.5 if fp32 else 1)  otherwise
Ts = gopsPerEvent ÷ effectiveGops

Default utilisation is 0.3 for accelerators and 0.6 for CPUs: real models rarely get close to a vendor's headline TOPS figure. The accelerator is used only if the stage's format has a precision the accelerator supports and can be loaded by a runtime the accelerator uses. Otherwise the stage falls back to the CPU and you get a warning.

Node utilisation:

ρ = Σ over stages on the node (λ per replica × Ts)

ρ ≥ 1 means the node is overloaded.

Queueing (M/M/1 approximation). When work arrives at random, a busy server builds a queue. The engine uses the textbook M/M/1 result for the mean waiting time:

Wq = Ts × ρ ÷ (1 − ρ)

For a link, Ts is the mean transmission time per message. This approximation assumes random (Poisson) arrivals and random service times. Real camera frames arrive at regular intervals, which queue less, so treat Wq as a cautious estimate.

Serverless cold starts. A managed serverless endpoint scales out on demand, so it has no queue and cannot be overloaded, but some requests land on a cold instance. The average adds coldStartMs × pCold; the worst case adds the full coldStartMs.

End-to-end latency to a sink:

average = Σ hops (tx + propagation + W ÷ 2 + Wq) + Σ nodes (processing + Wq) + coldStart × pCold
worst   = Σ hops (tx + propagation + W + Wq)     + Σ nodes (processing + Wq) + coldStart

The worst case is named "worst case (excluding queueing variance)": it takes the full batching window and full cold start, but includes queueing only at its mean, because the engine does not model how long the queue tail can get. A sink fed by several sources reports its slowest route.

4. Bandwidth and cost

Monthly traffic on a link (a 30-day month is 2,592,000 seconds):

GB/month = bytes per second (all senders) × 2,592,000 ÷ 10⁹

The total shown in the summary bar adds up every network link. On-board buses are excluded because they never touch a network.

Monthly cost

ItemFormulaType
LinkGB × RM/GB + fixedMonthlyRM × sender replicasoperating
Cloud instancehourlyRM × 720 × replicas (billed whether busy or idle)operating
Serverless endpointinvocations per month ÷ 1,000 × price per 1,000operating
Edge and fog hardwareunitRM × replicas ÷ 36 monthsamortised capital

A serverless endpoint is invoked once per incoming message, so batching reduces invocations. Fixed link charges are per sender: 24 devices on 4G need 24 SIM plans. Scenario budgets apply to operating plus amortised capital cost. Cloud egress fees are not modelled.

5. Energy

For edge devices (per unit, per day):

Wh/day = (activeW × ρ + idleW × (1 − ρ)) × 24  (+ local training time × (activeW − idleW))

For a battery-powered source, the battery must also run the sensors and any on-device compute fed directly from it:

battery days = batteryWh ÷ (baselinePowerW × 24 + on-device Wh/day)

Radio energy is not modelled. A 4G modem uses far more energy than a LoRaWAN radio, and sending less data saves battery. Treat this as a discussion point in your justification.

6. Model formats and accuracy

FormatPrecisionRuntimes that can load it
tflite-micro-int8int8TFLite Micro
tflite-fp32fp32TFLite
tflite-int8int8TFLite
onnx-fp32fp32ONNX Runtime, OpenVINO
onnx-int8int8ONNX Runtime, OpenVINO
tensorrt-fp16fp16TensorRT
hef-int8int8HailoRT

7. Training (scenario S6)

Model updates can still leak information about the training data (for example through membership-inference attacks). The engine does not model this; it is a discussion point for your justification.

8. Deployment model badge

BadgeWhen
FederatedTraining is federated
CentralisedThe inference stage runs off the premises
EdgeEvery stage runs on-device or on-premises, and nothing on the route to any actuator is off the premises
HybridAnything else, for example on-site inference with a cloud stage

9. Design rule check

RuleSeverity
Every stage is placed exactly onceerror
Every sink is reachable from its sourceserror
Each source has exactly one route to each sinkerror
No loops, no links into a source or out of a sinkerror
Stage order respects the route direction; no route skips a stageerror
Format loadable by a runtime on the nodeerror
Models fit in node memoryerror
Link or node utilisation ≥ 1error
LoRaWAN message above 222 byteserror
Micro-batch or batch link without a windowerror
An all-sources stage on a node with more than one replicaerror
On-board bus used anywhere except source → its own on-device device; cloud network used on siteerror
Hardware or medium not available in the scenarioerror
Training scenario with no training flowerror
Accelerator present but unusedwarning
Utilisation between 0.8 and 1warning
Link on no routewarning
Personal data on a link without TLSviolation

With any error, metrics show as not computable until it is fixed. Violations do not block the metrics but count against the design.


Worked example A: streaming edge pipeline (S1, ward fall detection)

Design. 24 cameras send every frame over Wi-Fi (MQTT, binary encoding, TLS, connection reused, streaming) to one industrial gateway (Intel N100 class). The gateway runs all three stages as onnx-int8 on its integrated GPU through OpenVINO. It sends each alert over Ethernet (MQTT, JSON, TLS) to the nurse-station alarm, and over 4G (MQTT, JSON, TLS, streaming) to the management dashboard.

Arrival rate. λ = 24 cameras × 5 frames/s = 120 events/s.

Hop 1: Wi-Fi, cameras → gateway

QuantityWorkingValue
Message size1 × 61,440 × 1.0 + 40 + 2261,502 bytes
Transmission61,502 × 8 ÷ 80,000,0006.150 ms
Propagationone-way latency3 ms
Utilisation (per camera)5 × 61,502 × 8 ÷ 80,000,0000.03075
Queueing6.1502 × 0.030751 ÷ (1 − 0.030751)0.1951 ms
Traffic120 × 61,502 × 2,592,000 ÷ 10⁹19,130 GB/month

Gateway: three stages on the iGPU

onnx-int8 is int8 (in the iGPU's precisions) and loads in OpenVINO (the iGPU's runtime), so the accelerator is used.

QuantityWorkingValue
Effective throughput1.5 TOPS × 1,000 × 0.3450 GOPS
Resize0.05 ÷ 4500.1111 ms
Pose + fall classifier1.5 ÷ 4503.333 ms
Alert debounce0.001 ÷ 4500.002222 ms
Processing per framesum3.447 ms
Utilisation120 × 0.0034467 s0.4136
Queueing3.4467 × 0.4136 ÷ (1 − 0.4136)2.431 ms
Model memory3.5 × 1 × 1.55.25 MB of 16,384 MB

The gateway is busy 41% of the time, so a frame waits about 2.4 ms on average behind others. That is already most of the processing time: queueing matters long before a node is "full".

Hop 2: Ethernet, gateway → alarm

QuantityWorkingValue
Message size1 × 100 × 1.0 + 40 + 22162 bytes
Transmission162 × 8 ÷ 900,000,0000.00144 ms
Propagation0.5 ms
Utilisation120 × 162 × 8 ÷ 900,000,0000.0001728
Queueing0.00144 × 0.0001728 ÷ 0.99980.0000002489 ms

Latency to the alarm

Segmentms
Wi-Fi transmission + propagation + queueing6.150 + 3 + 0.1951
Gateway processing + queueing3.447 + 2.431
Ethernet transmission + propagation + queueing0.00144 + 0.5 + 0.0000002
Average15.72 ms

There is no batching and no cold start, so the worst case (excluding queueing variance) is also 15.72 ms, far inside the 1,000 ms limit. The same route through 4G to the dashboard averages 50.31 ms.

QuantityWorkingValue
4G message100 × 1.0 + 62162 bytes
4G transmission162 × 8 ÷ 15,000,0000.0864 ms
4G traffic120 × 162 × 2,592,000 ÷ 10⁹50.39 GB/month
4G cost50.39 × 2 + 10 × 1RM 110.78
Gateway, amortised1,500 × 1 ÷ 36RM 41.67
Total110.78 operating + 41.67 capitalRM 152.44 per month
Network traffic, all links19,129.58 Wi-Fi + 50.39 Ethernet + 50.39 4G19,230 GB/month
Accuracy94 + (−1.0) for int893%
Privacyonly results cross to the cloudresult

Every constraint passes. The 4G link streams 120 tiny messages per second to a dashboard that only needs daily statistics. Try batching it hourly and watch the traffic fall.


Worked example B: micro-batched hybrid pipeline (S4, adaptive traffic junction)

Design. Each of the 12 cameras has a Raspberry Pi 5 with a Hailo-8L NPU inside its housing (on-device, 12 replicas), joined by the on-board bus. Vehicle detection runs on the NPU as hef-int8. Detections go over 5G (MQTT, protobuf, TLS) in 200 ms micro-batches to one cloud GPU instance, which runs the per-lane counting as tensorrt-fp16. The cloud streams counts back over 5G to the 4 signal controllers, and sends one-minute batches over the cloud network (HTTP, JSON, TLS) to the city dashboard.

Inference runs on site and a later stage runs in the cloud, so the badge is Hybrid. λ = 12 × 10 = 120 frames/s.

Hop 1: on-board bus, camera → its Pi

QuantityWorkingValue
Message size81,920 (no protocol overhead)81,920 bytes
Transmission81,920 × 8 ÷ 1,000,000,0000.6554 ms
Propagation0.05 ms
Utilisation (per camera)10 × 81,920 × 8 ÷ 10⁹0.006554
Queueing0.65536 × 0.0065536 ÷ 0.993450.004323 ms

Pi + Hailo-8L: detection

QuantityWorkingValue
Effective throughput13 TOPS × 1,000 × 0.33,900 GOPS
Service time6 ÷ 3,9001.538 ms
Utilisation (per unit)10 × 0.0015385 s0.01538
Queueing1.5385 × 0.015385 ÷ 0.984620.02404 ms
Energy per unit(9 × 0.015385 + 3.5 × 0.98462) × 2486.03 Wh/day
QuantityWorkingValue
Events per messagemax(1, 120 × 0.2 ÷ 12)2
Message size2 × 400 × 0.4 + 40 + 22382 bytes
Messages per second, per Pi10 ÷ 25
Transmission382 × 8 ÷ 80,000,0000.0382 ms
Propagation12 ms
Batching waitaverage 200 ÷ 2, worst 200100 ms (worst 200 ms)
Utilisation5 × 382 × 8 ÷ 80,000,0000.000191
Queueing0.0382 × 0.000191 ÷ 0.999810.000007298 ms
Traffic5 × 12 × 382 × 2,592,000 ÷ 10⁹59.41 GB/month
Cost59.41 × 2 + 10 × 12 SIMsRM 238.82

Streaming would send 10 messages of 222 bytes per second per camera (2,220 bytes/s). Batching pairs sends 5 messages of 382 bytes (1,910 bytes/s): 14% less traffic, paid for with 100 ms of average waiting.

Cloud GPU: counting

QuantityWorkingValue
Effective throughput240 × 1,000 × 0.372,000 GOPS
Service time0.001 ÷ 72,0000.00001389 ms
Utilisation120 × 0.00000001389 s0.000001667
QuantityWorkingValue
Message size64 × 0.4 + 6287.6 bytes
Transmission87.6 × 8 ÷ 80,000,0000.00876 ms
Propagation12 ms
Utilisation120 × 87.6 × 8 ÷ 80,000,0000.001051
Traffic and cost27.25 GB × 2 + 10 × 1RM 64.49

Latency to the signal controller

SegmentAverage, msWorst, ms
On-board bus0.6554 + 0.05 + 0.0043same
Detection1.5385 + 0.0240same
5G uplink0.0382 + 12 + 100 + 0.00000730.0382 + 12 + 200 + 0.0000073
Counting0.0000139same
5G downlink0.00876 + 12 + 0.0000092same
Total126.3 ms226.3 ms

The average meets the 200 ms limit. The batching window is 79% of the average latency, which is the first thing to tune.

Dashboard batch, cost and other results

QuantityWorkingValue
Events per messagemax(1, 120 × 60 ÷ 1)7,200
Message size7,200 × 64 × 1.0 + 600 + 22461,422 bytes
Transmission461,422 × 8 ÷ 1,000,000,0003.691 ms
Traffic461,422 ÷ 60 × 2,592,000 ÷ 10⁹19.93 GB/month (cloud network, free)
Pi + Hailo, amortised900 × 12 ÷ 36RM 300
Cloud GPU4.00 × 720 × 1RM 2,880
Total2,880 + 238.82 + 64.49 + 300RM 3,483.31 per month
Accuracy88 + (−1.0) for int887%
Privacyonly results leave the junctionresult

All four constraints pass, but the cloud GPU is 83% of the bill for a job that uses 0.0002% of it. Is the cloud stage worth its cost and its dependence on 5G? That is the kind of trade-off your justification should argue.