Internet of Things (IoT)

Chapter 6
Edge, Fog and Cloud Computing for IoT

Post Graduate Program in Electronics and Communication Engineering
Internet of Things (IoT)   •   Post Graduate

Edge, Fog and Cloud Computing for IoT

Introduction and Context

The Internet of Things (IoT) connects sensors, actuators, embedded controllers, vehicles, machines, buildings and people to digital services. An IoT system does not merely transport data to a server. It must sense physical conditions, interpret events, make decisions, control equipment and preserve operational continuity. These activities have different requirements for latency, bandwidth, energy, security, privacy, availability and computational capacity.

A purely cloud-centred architecture sends device data to remote data centres for storage and processing. Cloud computing provides elastic resources, sophisticated analytics and centralized management, but network delay, connectivity dependence, bandwidth cost and data-residency requirements can make this model unsuitable for time-critical or privacy-sensitive applications. Edge and fog computing extend computation closer to IoT data sources. They do not replace the cloud; rather, they create a distributed continuum in which workloads are placed at the device, local edge, intermediate fog and centralized cloud according to application requirements.

For postgraduate engineers, the central design problem is not simply identifying the fastest platform. It is deciding which functions should execute where, when computation should move, how systems should degrade during failures, and how performance and governance should be evaluated.

Learning Objectives

After completing this chapter, the learner should be able to:

1. Distinguish device, edge, fog and cloud computing layers.

2. Explain architectural models for distributed IoT computing.

3. Allocate sensing, control, analytics, storage and learning workloads across the computing continuum.

4. Quantitatively evaluate latency, bandwidth consumption, availability and resource requirements.

5. Compare centralized, edge, fog, cloud and hybrid architectures.

6. Assess containerized and serverless deployment for IoT workloads.

7. Design resilient, secure and governable distributed IoT solutions.

8. Critically evaluate contemporary developments such as federated learning and AI at the edge.

1. The IoT Computing Continuum

1.1 Device layer

The device layer contains sensors, actuators, microcontrollers, programmable logic controllers, cameras and gateways with limited memory, energy and processing capability. Device-local computation is valuable when an immediate response is required or connectivity is unreliable. Examples include debouncing a switch, filtering an accelerometer signal, detecting an over-temperature condition and applying a motor emergency stop.

Device computation is constrained by processor capability, battery energy, thermal limits and software maintainability. It is also physically exposed, which increases the risk of tampering.

1.2 Edge layer

Edge computing places general-purpose processing near the data source, commonly in an industrial gateway, access point, base station, vehicle, local server or on-premises appliance. Edge nodes may run Linux, containers, stream processors, databases and machine-learning inference engines. They reduce round-trip delay and upstream traffic while retaining more capability than end devices.

An edge node often performs protocol translation, data normalization, local aggregation, event detection, caching, access control and real-time inference. It may serve one building, factory cell, hospital ward, vehicle fleet or radio access network.

1.3 Fog layer

Fog computing is an intermediate, distributed layer between edge devices and cloud data centres. A fog domain may consist of multiple gateways, local servers, routers, micro-data centres and regional network nodes. The distinctive feature is coordinated, hierarchical and geographically distributed management rather than merely placing one computer beside a sensor.

Fog systems are useful when an application spans several edge sites. A transport authority, for example, may process camera streams at intersections, coordinate traffic models at a metropolitan fog node and conduct historical optimization in the cloud.

1.4 Cloud layer

The cloud provides pooled, virtualized and elastic compute, storage and networking resources, usually in large data centres. It is well suited to long-term storage, fleet-wide analytics, model training, digital-twin management, software distribution, reporting and integration with enterprise systems.

Cloud resources generally offer high capacity and mature operational tooling, but remote execution introduces network dependence. Cloud processing is therefore not automatically appropriate for safety-critical control, high-rate raw video or disconnected operation.

2. Architectural Models and Design Principles

2.1 Centralized cloud model

In the centralized model, devices transmit data to cloud services, which perform processing and return commands or results. The model is simple to manage and supports global visibility. Its weaknesses include high upstream traffic, variable wide-area-network latency, exposure of raw data and impaired operation during disconnection.

2.2 Hierarchical edge–fog–cloud model

A hierarchical model assigns progressively more powerful and less time-critical functions to higher layers. A typical flow is:

sensor → device filter → edge event detector → fog coordinator → cloud analytics and storage.

The hierarchy need not be rigid. A local edge node may temporarily train a model, a fog node may coordinate several sites, and the cloud may send updated models or policies downward.

2.3 Distributed continuum model

The computing continuum treats placement as a scheduling and orchestration problem. A workload can be decomposed into functions, and each function can be placed where its constraints are best satisfied. Placement decisions may consider latency, energy, privacy, cost, capacity, reliability, mobility and data gravity—the tendency for processing to remain near large or sensitive data sets.

2.4 Control-loop perspective

IoT architecture should be designed around control loops rather than data destinations. A fast safety loop may close entirely on a device or edge node. A supervisory loop may use fog processing, while a strategic optimization loop may use cloud analytics. Separating these loops prevents a remote service from becoming a hidden dependency for immediate physical safety.

3. Workload Placement

3.1 Workload classes

Important IoT workloads include:

  • Signal conditioning: filtering, calibration, compression and feature extraction.
  • Event detection: thresholding, anomaly detection and pattern recognition.
  • Real-time control: actuation with strict response deadlines.
  • Stream analytics: windows, joins, aggregation and correlation across devices.
  • Machine-learning inference: classification, prediction and computer vision.
  • Model training: usually computationally intensive and data-hungry.
  • Persistent storage: time-series, images, logs and audit records.
  • Fleet management: configuration, identity, monitoring and software updates.

3.2 Placement criteria

A workload should be placed after identifying its service-level requirements:

1. Latency: maximum acceptable sensing-to-decision delay.

2. Jitter: variation in delay, especially important for control.

3. Bandwidth: volume and frequency of data transmitted.

4. Availability: ability to operate during link or service failure.

5. Confidentiality and privacy: sensitivity and regulatory restrictions.

6. Energy: communication and computation cost at constrained devices.

7. Capacity: processor, memory, accelerator and storage requirements.

8. Mobility: whether the workload must follow a moving device.

9. Cost: network egress, infrastructure, licensing and operations.

10. Manageability: observability, patching and lifecycle complexity.

A useful decision rule is to keep a function local when it has stringent deadline, privacy or disconnection requirements, and to move it upward when it needs global data, substantial resources or long-term analysis.

4. Quantitative Evaluation

4.1 End-to-end latency

For a request that is processed remotely, a simplified latency model is

\[

T_{total}=T_{sense}+T_{up}+T_{queue}+T_{proc}+T_{down}+T_{act}

\]

where the terms represent sensing, upstream transmission, queueing, processing, downstream transmission and actuation time. The model assumes a sequential path and excludes parallel execution. If multiple network segments exist, their transmission, propagation and queueing times should be added separately.

For a message of size \(S\) bits sent over a link with effective throughput \(R\) bits per second, transmission time is

\[

T_{tx}=S/R.

\]

This is only the serialization time; protocol overhead, propagation, contention and retransmission may increase actual delay.

Worked example. A 20-kilobyte message is sent over a 10-Mbit/s link. Taking 1 kilobyte as 1024 bytes, \(S=20\times1024\times8=163,840\) bits. Thus,

\[

T_{tx}=163,840/10,000,000=0.016384\text{ s}=16.384\text{ ms}.

\]

If a cloud path adds 35 ms upstream propagation and queueing, 35 ms downstream delay, 8 ms processing and 4 ms sensing/actuation, the approximate total is 98.384 ms. Local edge processing that avoids the two wide-area segments may reduce latency substantially, although local queueing and processing still remain.

4.2 Bandwidth reduction through aggregation

If \(N\) devices each generate \(r\) bits per second, unprocessed traffic is

\[

B_{raw}=Nr.

\]

If local processing transmits only a fraction \(\alpha\), where \(0\leq\alpha\leq1\), then

\[

B_{processed}=\alpha Nr.

\]

The reduction is \((1-\alpha)\times100\%\). This expression assumes steady rates and ignores protocol headers; in a real deployment, headers and event bursts must be included.

Worked example. One hundred sensors produce 64 kbit/s each. Raw traffic is 6.4 Mbit/s. If edge extraction sends 5% of the original volume, traffic becomes 0.32 Mbit/s, a 95% reduction. The design must still verify that discarded information is not needed for forensic analysis or future model development.

4.3 Availability of serial dependencies

If a service requires two independent components in series, with availabilities \(A_1\) and \(A_2\), service availability is

\[

A_{series}=A_1A_2.

\]

For parallel redundant components that operate independently and either can provide service,

\[

A_{parallel}=1-(1-A_1)(1-A_2).

\]

These equations assume statistical independence and a clearly defined service boundary. Real failures may be correlated—for example, a shared power supply or common software defect—so the calculated value can be optimistic.

Suppose a cloud connection has availability 0.99 and a local edge controller has availability 0.995. A safety function dependent on both has availability \(0.99\times0.995=0.98505\), or 98.505%. An autonomous local fallback avoids making the cloud a serial dependency for that function.

4.4 Cost and multi-objective placement

Placement rarely has one optimum. A conceptual objective function can be written as

\[

J=w_LT+w_BB+w_CC+w_EE+w_R(1-A),

\]

where \(T\) is latency, \(B\) bandwidth, \(C\) monetary cost, \(E\) energy, \(A\) availability, and the \(w\) values express normalized design priorities. The variables must be normalized before combination because they have different units. Hard constraints—such as a safety deadline or data-residency rule—should be enforced separately rather than hidden inside weights.

5. Processing Technologies

5.1 Virtual machines, containers and orchestration

Virtual machines provide strong isolation by virtualizing complete operating systems, but they have greater image size and startup overhead. Containers share the host kernel, start quickly and package application dependencies efficiently. Kubernetes and related orchestrators manage containers, placement, service discovery, scaling and rolling updates, although operating them at constrained edge sites can be complex.

Edge orchestration must account for intermittent links, heterogeneous hardware, limited storage, local autonomy and secure update mechanisms. A disconnected edge site should continue essential functions rather than waiting indefinitely for a central control plane.

5.2 Serverless computing

Function-as-a-Service (FaaS) executes short-lived functions in response to events. It offers automatic scaling, pay-per-use billing and reduced server administration. IoT uses include event transformation, alert processing, metadata enrichment and intermittent analytics.

Serverless limitations include cold-start delay, execution-duration limits, statelessness, provider coupling, unpredictable tail latency and difficulty supporting continuous control loops. A practical pattern is to use serverless cloud functions for non-critical event processing while keeping deterministic control and buffering at the edge. Edge serverless platforms can reduce network dependence, but they inherit the resource and lifecycle challenges of edge infrastructure.

5.3 Stream and batch processing

Stream processing analyzes data as it arrives, using windows and event time to handle out-of-order messages. It is appropriate for alarms and operational dashboards. Batch processing analyzes accumulated data and is appropriate for historical trends, model training and regulatory reports. A robust IoT platform commonly uses both: edge streams for immediate response and cloud batches for strategic analysis.

6. Resilience, Security and Governance

6.1 Resilience patterns

Important patterns include local buffering during disconnection, store-and-forward delivery, replicated state, graceful degradation, watchdog timers, health checks, circuit breakers and idempotent command handling. Commands should carry unique identifiers or sequence numbers so that retries do not cause unsafe duplicate actions.

Time synchronization is important for event correlation. Systems should monitor clock quality and distinguish device time, gateway receipt time and cloud ingestion time. Observability should include metrics, logs, traces, model versions, configuration versions and data-quality indicators.

6.2 Security architecture

The distributed continuum enlarges the attack surface. Controls should include hardware-backed device identity where feasible, mutual authentication, encryption in transit and at rest, least privilege, secure boot, signed firmware, protected keys, vulnerability management, network segmentation and tamper-aware operation.

Zero-trust principles are relevant: no device, workload or network location should be trusted solely because it is inside a factory or local network. Edge nodes require especially careful physical and remote security because they combine valuable data with exposed deployment locations.

6.3 Privacy and governance

Data minimization, purpose limitation, retention control and access auditing should guide placement. Edge inference can transmit a detected event rather than raw personal video, but derived data may still identify individuals. Organizations must define ownership, permitted secondary use, deletion procedures, cross-border transfer rules and responsibility for automated decisions. Sector-specific obligations may apply in healthcare, transportation, energy and industrial control.

AI models introduce additional governance concerns: biased training data, model drift, explainability, adversarial inputs and uncertainty. A model should report confidence and be monitored after deployment; an edge model that silently degrades can create physical risk.

7. Applied Case: Illustrative Smart Manufacturing Line

Background

Consider an illustrative automotive assembly line with vibration sensors, cameras, programmable controllers and robotic actuators. The plant wants to detect bearing faults, stop unsafe operations and optimize maintenance across five production cells.

Problem

Raw camera streams are too large to send continuously to a remote cloud. Emergency stopping must occur within a strict local deadline. At the same time, maintenance planners need plant-wide trends and historical model training.

Analysis

The emergency stop is a safety control loop and cannot depend on a wide-area connection. Camera inference requires accelerators and is best performed near the cells. Correlating faults across cells needs more capacity than one gateway, while fleet-wide training benefits from cloud storage and elastic compute.

Approach and solution

Each controller performs interlocks and immediate limit checks. An edge server in each cell filters vibration data and runs camera inference. It sends fault events, selected features and low-rate summaries to a plant fog cluster. The fog cluster correlates events across cells, maintains a local operational database and continues operating during cloud disconnection. The cloud receives approved summaries and selected evidence, stores long-term history, trains models and distributes signed model versions.

Containerized services are used for inference and protocol adapters. A local message broker buffers data. Model deployment uses staged rollout: a new model runs in shadow mode, its false-alarm and missed-detection rates are compared with the current model, and only then is it activated. Cloud functions generate maintenance notifications and update enterprise work orders; they are not used for emergency control.

Outcome

The architecture reduces wide-area traffic, keeps safety decisions local and provides plant-level coordination. It also introduces operational complexity: edge hardware must be patched, models must be monitored, and local and cloud data must be reconciled after outages.

Learning points

1. Safety and latency determine the lowest acceptable placement layer.

2. Data reduction should preserve evidence needed for diagnosis and audit.

3. Fog coordination is useful when several edge sites share context.

4. Cloud elasticity is valuable for training and historical analysis.

5. Resilience requires explicit offline behavior, not merely redundant servers.

8. Contemporary Developments and Research Directions

Federated learning trains models across sites while sharing parameters or updates rather than raw data. It can improve privacy and reduce data movement, but non-identical data distributions, communication cost, poisoning attacks and model aggregation remain research challenges.

TinyML places highly optimized inference on microcontrollers. Quantization, pruning and specialized accelerators reduce memory and energy requirements, but may reduce accuracy and make model updates more difficult.

Digital twins combine live IoT data, engineering models and simulation. Edge and fog resources support operational synchronization, while cloud resources support large-scale simulation and optimization. A twin is only useful when its data quality, assumptions and model validity are explicit.

6G, integrated sensing and communication, and AI-native networks may provide more capable distributed execution, but advertised connectivity improvements do not remove the need for local autonomy. Research increasingly addresses joint communication–compute optimization, semantic communication, trustworthy AI, confidential computing and carbon-aware placement.

9. Best-Practice Design Method

A disciplined design process is:

1. Define physical objectives, safety boundaries and service-level targets.

2. Decompose the application into sensing, control, inference, storage and management functions.

3. Characterize data rates, burst behavior, deadlines, privacy and energy limits.

4. Place hard real-time and safety functions locally.

5. Use edge processing for filtering, inference and low-latency decisions.

6. Use fog resources for cross-site coordination and local autonomy.

7. Use cloud resources for elastic analytics, training, archival storage and enterprise integration.

8. Model normal, degraded and recovery modes.

9. Measure tail latency, not only average latency; measure data loss, false alarms, energy and operational cost.

10. Test security, failover, clock behavior, model drift and update rollback before production.

Architectures should be evaluated experimentally with representative workloads. Average latency can conceal queue buildup, and laboratory connectivity can conceal field failures. Pilot deployments should include fault injection, disconnection tests and capacity headroom.

Chapter Summary

Edge, fog and cloud computing form a distributed IoT continuum rather than mutually exclusive alternatives. Devices provide immediate sensing and control; edge nodes deliver local processing and inference; fog nodes coordinate multiple edge sites; and cloud platforms provide elastic, global and long-term computation and storage. Workload placement should be driven by latency, jitter, bandwidth, availability, privacy, energy, capacity, mobility and cost.

Latency can be estimated by decomposing sensing, transmission, queueing, processing and actuation. Local aggregation can substantially reduce bandwidth, while availability analysis reveals when a remote cloud becomes a serial dependency. Containers support portable deployment, whereas serverless computing is useful for event-driven, non-critical workloads but can be unsuitable for deterministic control.

Resilient architectures provide buffering, local fallback, safe retries, observability and recovery procedures. Security requires identity, encryption, least privilege, secure boot and lifecycle management across exposed edge nodes. Governance must address privacy, retention, data ownership and AI risks. Effective designs therefore combine technical placement models with safety engineering, operational discipline and explicit degraded-mode behavior.

Multiple Choice Questions with Answers

Question 1

Which layer is generally most appropriate for an emergency industrial stop that must operate during cloud disconnection?

A. Cloud data centre

B. Local device or edge controller

C. Remote fog region

D. Batch analytics platform

Correct Answer: B. Local device or edge controller

Question 2

A 20-kilobyte message is transmitted over a 10-Mbit/s link. Ignoring overhead, what is its serialization time using 1 kilobyte = 1024 bytes?

A. 1.6384 ms

B. 16.384 ms

C. 163.84 ms

D. 0.016384 ms

Correct Answer: B. 16.384 ms

Question 3

If 100 sensors each generate 64 kbit/s, what is the aggregate raw rate?

A. 0.64 Mbit/s

B. 6.4 Mbit/s

C. 64 Mbit/s

D. 640 Mbit/s

Correct Answer: B. 6.4 Mbit/s

Question 4

What is a principal role of a fog layer?

A. Replacing every sensor battery

B. Providing only long-term archival storage

C. Coordinating processing across multiple edge sites

D. Eliminating the need for device authentication

Correct Answer: C. Coordinating processing across multiple edge sites

Question 5

Which workload is usually best suited to cloud computing?

A. Immediate motor interlock

B. Emergency local shutdown

C. Historical fleet-wide model training

D. Sensor debounce at the device

Correct Answer: C. Historical fleet-wide model training

Question 6

For two independent components in series with availabilities 0.99 and 0.995, what is the combined availability?

A. 0.98505

B. 0.99500

C. 0.99995

D. 0.00505

Correct Answer: A. 0.98505

Question 7

Which statement best describes serverless FaaS in IoT?

A. It is always suitable for deterministic safety control

B. It executes event-triggered functions while abstracting server management

C. It requires every function to run permanently on a dedicated machine

D. It eliminates cold-start and provider-dependence concerns

Correct Answer: B. It executes event-triggered functions while abstracting server management

Question 8

Why can local aggregation reduce IoT network bandwidth?

A. It increases the number of raw samples transmitted

B. It converts every message into a larger video stream

C. It transmits summaries or events instead of all raw data

D. It disables all sensing functions

Correct Answer: C. It transmits summaries or events instead of all raw data

Question 9

Which security practice most directly supports trustworthy software updates at edge nodes?

A. Unsigned firmware installation

B. Shared administrator passwords

C. Signed firmware and verified update packages

D. Disabling device identity checks

Correct Answer: C. Signed firmware and verified update packages

Question 10

Why should IoT architectures evaluate tail latency rather than only average latency?

A. Safety and control failures can occur during rare high-delay events

B. Average latency is always measured in bytes

C. Tail latency applies only to archival storage

D. Tail latency removes the need for capacity planning

Correct Answer: A. Safety and control failures can occur during rare high-delay events

Internet of Things (IoT)
Chapter 6 of 14