18 IoT Edge Models: Cold-Chain Processing
18.1 Start With the Decision
A truck gateway can spot a temperature breach before the cloud replies. It must filter, store, and prove each alert on the move.
18.2 Route Overview
This is part 2 of 2. Review IoT Edge Models: Processing Levels for the preceding evidence.
18.3 Learning Objectives
- Test cold chain edge processing with a concrete scenario and pass criteria.
- Validate three-tier edge design exercise with a concrete scenario and pass criteria.
18.4 Chapter Roadmap
- Cold Chain Edge Processing
- Checkpoint: Cold-Chain Edge Case
- Cold Chain Cost Calculator
- Choose the Processing Level
- Checkpoint: Placement Choice
- Level 4: Data Accumulation (Storage)
- Application Requirements Summary
- Latency vs Bandwidth Matrix
- Interactive Quiz: Match Concepts
- Interactive Quiz: Sequence the Steps
- Common Pitfalls
- Map Edge Patterns to Tiers
- 2. Designing each tier independently
- Map Management Flows
- Tailor IoT Reference Models
- Checkpoint: Model Review
- Label the Diagram
- Code Challenge
- Edge Placement Contracts
- Summary
- Key Takeaway
- Concept Check
- Quick Knowledge Check
- Concept Relationships
- How This Concept Connects
- See Also
- Related Resources
- Try It Yourself
- Three-Tier Edge Design Exercise
- Knowledge Check
- Quiz: IoT Reference Model
- What’s Next
18.5 Cold Chain Edge Processing
With the Level 3 functions named, test whether they still hold up when the network is mobile and compliance-sensitive.
Scenario: A pharmaceutical distributor monitors 50 refrigerated trucks, each carrying 20 temperature sensors that sample at 1 Hz (once per second). The system must detect temperature excursions above 8 degrees Celsius within 30 seconds for regulatory compliance.
Without Edge Processing (Cloud-Only Architecture):
| Metric | Calculation | Value |
|---|---|---|
| Raw data rate per truck | 20 sensors x 1 sample/sec x 16 bytes | 320 bytes/sec |
| Fleet data rate | 50 trucks x 320 bytes/sec | 16,000 bytes/sec (16 kB/s) |
| Daily data volume | 16 kB/s x 86,400 sec | 1.38 GB/day |
| Monthly cellular data cost | 1.38 GB/day x 30 days x $0.10/MB | $4,140/month |
| Cloud ingestion cost | 41.4 GB/month x $0.25/GB (AWS IoT Core) | $10.35/month |
| Excursion detection latency | Cellular RTT (200 ms) + cloud processing (500 ms) | 700 ms |
With Level 3 Edge Processing:
Each truck runs an edge gateway (Raspberry Pi or similar) that performs:
- Evaluation: Discard readings within 2-8 degrees Celsius (normal range). Only escalate outliers.
- Formatting: Convert raw ADC values to Celsius, attach truck ID and GPS coordinates.
- Distillation: Compute 1-minute averages, min/max. Replace 1,200 raw readings with 4 summary values per sensor per minute.
- Assessment: If any sensor exceeds 8 degrees Celsius for 3 consecutive readings (3 seconds), trigger immediate alert to dispatch.
| Metric | Calculation | Value |
|---|---|---|
| Distilled data rate per truck | 20 sensors x 4 values/min x 8 bytes / 60 sec | 10.7 bytes/sec |
| Fleet data rate | 50 trucks x 10.7 bytes/sec | 535 bytes/sec |
| Daily data volume | 535 bytes/sec x 86,400 sec | 46.2 MB/day |
| Monthly cellular data cost | 46.2 MB/day x 30 days x $0.10/MB | $139/month |
| Excursion detection latency | Local processing on gateway | 3 seconds (3 readings) |
Savings Summary:
| Category | Cloud-Only | Edge Processing | Savings |
|---|---|---|---|
| Cellular data cost | $4,140/month | $139/month | 97% reduction |
| Data volume | 1.38 GB/day | 46.2 MB/day | 30x reduction |
| Detection latency | 700 ms (but requires constant connectivity) | 3 seconds (works offline) | Operates during cellular dead zones |
| Gateway hardware cost | $0 | 50 x $35 = $1,750 (one-time) | Pays for itself in 13 days |
The edge gateway investment of $1,750 saves $4,001 per month in cellular costs. More critically, the edge architecture detects temperature excursions even when trucks pass through tunnels or rural areas without cellular coverage — a compliance requirement that cloud-only architectures cannot guarantee.
Checkpoint: Cold-Chain Edge Case
You now know:
- The cloud-only fleet sends 16 kB/s, or 1.38 GB/day, before any filtering.
- Level 3 summaries reduce the flow to 535 bytes/sec and 46.2 MB/day.
- Gateway spending is justified when local alerts still work during cellular dead zones.
18.6 Cold Chain Cost Calculator
Adjust the parameters below to explore how edge processing affects your cold chain monitoring costs.
18.7 Choose the Processing Level
Not all data needs to travel to the cloud. The following decision table helps determine where to process each data stream:
| Decision Factor | Process at Level 3 (Edge) | Process at Level 5-7 (Cloud) |
|---|---|---|
| Latency requirement | Sub-second response needed (safety shutdowns, real-time control) | Minutes to hours acceptable (trend analysis, reporting) |
| Data volume | High-frequency raw data (>1 reading/sec per sensor) | Pre-aggregated summaries (hourly/daily) |
| Connectivity | Intermittent or expensive (cellular, satellite) | Reliable broadband available |
| Privacy | Sensitive data that should not leave premises (medical, industrial IP) | Non-sensitive operational metrics |
| Compute complexity | Simple rules, thresholds, averaging | ML model training, cross-site correlation |
Real-world example — vibration monitoring on rail networks: Deutsche Bahn deploys vibration sensors on approximately 5,400 ICE train wheelsets. Each sensor generates about 50 kB/second at 20 kHz sampling. Uploading everything would require approximately 23 TB/day in cellular bandwidth. Instead, edge gateways on each train run FFT (Fast Fourier Transform) locally, extract the dominant frequency peaks (~200 bytes), and upload only the spectral summary every 10 minutes. Cloud analytics then correlates these summaries across the fleet to predict bearing failures weeks before they occur. The edge processing reduces data volume by over 99.99% while preserving the diagnostic information needed for predictive maintenance.
Checkpoint: Placement Choice
You now know:
- Edge placement is strongest for sub-second response, high-frequency data, intermittent links, privacy, and simple local rules.
- Cloud placement fits minutes-to-hours analysis, stored summaries, broadband links, non-sensitive metrics, and cross-site training.
- The rail example keeps diagnostic features while avoiding roughly 23 TB/day of raw cellular upload.
18.8 Level 4: Data Accumulation (Storage)
After deciding what Level 3 should distill, decide what Level 4 must remember.
Levels 1-3 have data in motion and are event-driven. At Level 4, the data in motion is converted to data at rest. Decisions at Level 4 include:
- Is the data of interest to higher levels?
- Does the data need to be saved or accumulated in memory for short-term use?
- Does persistency require a file system, big data system, or relational database?
- What data transformations are needed for the required storage system?
- Does the data need to be recombined or recomputed?
Storage Decision Matrix:
| Data Characteristic | Storage Type | Example |
|---|---|---|
| Short-term, high-frequency | In-memory buffer | Last 100 sensor readings |
| Time-series, queryable | Time-series DB (InfluxDB, TimescaleDB) | Historical sensor data |
| Relational, structured | SQL database | Device configuration, metadata |
| Unstructured, large | Object storage (S3, blob) | Images, video clips |
| Real-time streaming | Message queue (Kafka, MQTT) | Event streams for processing |
18.9 Application Requirements Summary
Understanding the IoT Reference Model helps match application requirements to appropriate processing levels:
The comparison diagram in Figure 18.1 makes the application constraint visible before a processing level is chosen.
Read Figure 18.1 from the Massive IoT branch to the Critical IoT branch. Massive deployments prioritise fleet scale, unit cost, and efficient batch handling; critical systems prioritise bounded latency and local real-time action because delayed decisions can become unsafe. Neither branch removes the need for cloud history or edge evidence, but it changes which tier may close the immediate loop. This completes the chapter’s running placement narrative by tying reference-model levels to the consequence, scale, and timing of the application decision.
18.10 Latency vs Bandwidth Matrix
This view shows how edge processing decisions balance latency and bandwidth requirements:
The placement cost is easiest to see as elapsed path, not as an abstract cloud label. The path diagram in Figure 18.2 traces a cloud-bound event so the latency discussion can identify where delay is introduced.
In the path diagram Figure 18.2, Event occurs precedes the Sensor, then the route crosses Transmission and Network before reaching Cloud Processing. A Response must traverse the return path before Action can occur. Those labelled stages are additive and variable, so a safety deadline cannot be justified from compute time alone. This completes the reference-model argument: keep an immediate decision at the edge when the full round trip cannot meet its bound, and send history upward when cloud context matters more than response time.
The optimal processing location depends on both latency sensitivity and data volume. Edge processing is essential when either latency is critical or bandwidth is limited.
Massive IoT vs Critical IoT Requirements: Two distinct IoT application categories — Massive IoT prioritizes scale and cost efficiency with delay tolerance (smart metering, agriculture), while Critical IoT demands ultra-low latency and high reliability for safety-critical applications (autonomous vehicles, industrial control). Edge processing strategies differ accordingly.
18.11 Interactive Quiz: Match Concepts
18.12 Interactive Quiz: Sequence the Steps
Common Pitfalls
Edge patterns like ‘filter-at-source’ and ‘aggregate-at-fog’ must be mapped to specific reference model tiers (device tier vs connectivity tier) before implementation decisions about hardware, protocol, and power can be made.
Optimising the device tier for low power and the cloud tier for analytical throughput without considering the connectivity tier in between often produces an architecture where the network is the bottleneck. Design all tiers together.
The data flow (sensor → cloud) is visible and well-designed in most architectures, but the control flow (cloud → device configuration, firmware updates) is often an afterthought. Both flows must be explicit in the reference model mapping.
The reference model for a smart building differs from one for industrial automation or connected health. Apply the reference model as a starting template and adapt tier responsibilities and protocols to the specific domain requirements.
Checkpoint: Model Review
You now know:
- Level 4 is the boundary where event-driven streams become retained records.
- Massive IoT emphasizes scale and cost efficiency, while Critical IoT emphasizes real-time edge response.
- The quizzes that follow check whether you can match, sequence, label, and code the same reference-model flow.
18.13 Label the Diagram
18.14 Code Challenge
18.15 Edge Placement Contracts
The reference-model mapping above still needs a concrete placement and evidence contract for the computation continuum. Continue to Edge Reference Model Placement Contracts for latency, bandwidth, privacy, tier-boundary, data-reduction, and accountability checks across device, edge, fog, storage, cloud, and application layers.
The service split in Figure 18.3 shows why the reference model names stable responsibilities without prescribing one quality-of-service policy.
In Figure 18.3, Many quiet devices lead to Compress and batch, while Few urgent control loops lead to Decide and prove locally. Both occupy physical, connectivity, and acquisition responsibilities, but their capacity, latency, resilience, and evidence contracts are deliberately different.
The four-layer path in Figure 18.4 keeps edge transformation distinct from accumulation while showing how both depend on the lower device and connectivity contracts.
Walk Figure 18.4 upward from LEVEL 1 · PHYSICAL DEVICES through LEVEL 2 · CONNECTIVITY. LEVEL 3 · EDGE COMPUTING changes representation and volume near the source, while LEVEL 4 · DATA ACCUMULATION changes lifetime by turning the stream into durable, queryable records.
18.16 Summary
- The seven-level IoT Reference Model separates operational technology (Levels 1-3, data in motion) from information technology (Levels 5-7, data at rest), with Level 4 as the transition from streaming to stored data
- Level 1 (Physical Devices) includes all sensors, actuators, and controllers that generate or receive data
- Level 2 (Connectivity) provides reliable, timely transmission through appropriate protocols and network topologies
- Level 3 (Edge Computing) transforms raw data through evaluation, formatting, distillation, and assessment before storage
- Level 4 (Data Accumulation) converts data in motion to data at rest, selecting appropriate storage types based on data characteristics
- Massive IoT applications prioritize scale and cost at Levels 1-4 with batch processing
- Critical IoT applications demand real-time processing at Level 3 with cloud for monitoring only
The IoT Reference Model separates edge processing (Levels 1-3, data in motion) from cloud analytics (Levels 5-7, data at rest), with Level 4 as the critical transition point. Level 3 is the edge computing layer that filters, formats, and reduces data before storage. Massive IoT applications prioritize scale and cost efficiency with batch processing, while Critical IoT demands real-time edge processing for safety and reliability.
18.17 Concept Check
18.18 Concept Relationships
Builds on:
- Edge Compute Patterns Overview - Foundation of edge processing concepts
- Edge, Fog, and Cloud Overview - Three-tier architecture context
Enables:
- Edge Processing Patterns - Four primary edge patterns (Filter, Aggregate, Infer, Store-Forward)
- Edge Patterns Practical Guide - Interactive tools for architecture decisions
- Data Storage and Databases - Level 4 storage solutions
Related Concepts:
- Massive IoT vs Critical IoT - Different processing requirements at each level
- Gateway Architecture - Level 3 gateways handle protocol translation for non-IP devices
- Tiered Storage - Level 4 retention policies (hot/warm/cold tiers)
18.19 See Also
Core Edge Computing:
- Edge Data Acquisition - Data collection patterns at the edge
- Edge Cyber-Foraging - Opportunistic compute offloading
- Edge Comprehensive Review - Complete edge computing reference
Architecture Context:
- IoT Reference Models - Full seven-level model
- Cloud Computing Architecture - Levels 5-7 cloud analytics
Real-World Applications:
- smart City Edge Computing{target=“blank”} - Urban-scale edge architectures
18.20 Try It Yourself
Scenario: A pharmaceutical cold chain monitoring system tracks 50 refrigerated trucks, each with 20 temperature sensors sampling at 1 Hz.
Your Task: Design the architecture for Levels 1-4:
-
Level 1 (Devices): What sensors are needed? What’s the data format?
-
Level 2 (Connectivity): Which protocol (Bluetooth, LoRaWAN, cellular)? Why?
-
Level 3 (Edge Gateway): Apply the five functions:
- Evaluation: What threshold values trigger alerts?
- Formatting: Design the standardized data schema
- Distillation: Calculate data reduction ratio (1 Hz raw to what summary?)
- Assessment: What local actions (alarms, door locks)?
- level 4 (Storage): What retention policy (hot/warm/cold tiers)?
What to Observe:
- Compare bandwidth costs: raw 1 Hz data vs edge-processed summaries
- Calculate alert latency: edge detection vs cloud detection
- Consider offline operation: what happens during cellular dead zones?
Starter Code (Python simulation):
import time
import statistics
class ColdChainEdgeGateway:
def __init__(self, truck_id, num_sensors=20):
self.truck_id = truck_id
self.buffer = []
self.alert_threshold_max = 8.0 # degrees C
def evaluate(self, reading):
"""Level 3: Evaluation - check data quality"""
return 2.0 <= reading <= 10.0 # Valid range
def format(self, sensor_id, temp_c):
"""Level 3: Formatting - standardize schema"""
return {
"truck_id": self.truck_id,
"sensor_id": sensor_id,
"temp_celsius": round(temp_c, 1),
"timestamp_utc": time.time()
}
def distill(self, readings_1min):
"""Level 3: Distillation - 60 readings to 4 summary values"""
return {
"min": min(readings_1min),
"max": max(readings_1min),
"avg": statistics.mean(readings_1min),
"stddev": statistics.stdev(readings_1min)
}
def assess(self, temp_c):
"""Level 3: Assessment - trigger local alarm"""
if temp_c > self.alert_threshold_max:
print(f"ALERT: Truck {self.truck_id} temp {temp_c} C exceeds 8 C")
return True
return False
# Test the gateway
gateway = ColdChainEdgeGateway("TRUCK-042")
readings = [5.2, 5.3, 5.1, 8.5, 8.9, 9.2] # Temperature excursion!
for i, temp in enumerate(readings):
if gateway.evaluate(temp):
formatted = gateway.format(sensor_id=1, temp_c=temp)
gateway.assess(temp)
gateway.buffer.append(temp)
summary = gateway.distill(gateway.buffer)
print(f"1-minute summary: {summary}")
print(f"Data reduction: {len(gateway.buffer)} readings to 4 values")
Extension Challenge: Add Level 4 storage with tiered retention (last hour = raw data, last week = hourly summaries, beyond = daily aggregates).
18.21 Knowledge Check
18.22 What’s Next
| Next Topic | Description |
|---|---|
| Edge Reference Model Placement Contracts | Tier placement evidence, data-reduction, and accountability contracts for Level 3 edge decisions |
| Edge Processing Patterns | Four primary patterns: Filter, Aggregate, Infer, Store-Forward |
| Cyber-Foraging and Caching | Opportunistic compute offloading and caching strategies |
| Edge Patterns Practical Guide | Interactive tools and worked examples for architecture decisions |
18.23 Continue Your Route
This final part closes the route from Cold Chain Edge Processing through What’s Next. Return to IoT Edge Models: Processing Levels or continue from the analytics-ml module index.
