Majid Al-RaimiRoles of the edge, fog and cloud layers

COE 558Lecture 02Part 02

Roles of the edge, fog and cloud layers

What each layer of the continuum provides, why the fog helps, and two worked architectures (IoT hierarchy and a vehicle platoon).

Concepts
5
Slides
10-14
Reading
30 min
Understood
0/5 concepts

Why this part matters

Part 01 named the layers. This part says what each layer is for.

In the exam, in the system designs of your research, and in real IoT or vehicular deployments, you justify where a task runs by the role of the layer: the edge serves the client, the fog aggregates many edges, the cloud gives scale. Two worked architectures, an IoT tree and a vehicle platoon, close the part. They are the templates you will reuse whenever someone asks you to place a system on the continuum.

By the end you can

  1. Explain the three benefits of a fog layer that serves many edges, and quantify the bandwidth saving in a concrete scenario.
  2. Describe the four roles of the edge layer, including why it hides the fog from clients.
  3. List the cloud's big compute, big storage and big networking, with a real service for each.
  4. Map the devices of an IoT hierarchy and of a vehicle platoon to edge, fog and cloud, and justify each placement with latency.
  5. Recognise how NIST SP 500-325 and this course draw the edge and fog boundary differently.

A city installs 200 traffic cameras, and each one streams video at 4 Mbps. If every stream goes straight to the cloud, 800 Mbps of raw video crosses the wide-area network every second, around the clock, mostly showing empty roads.

Now put one small server room in the district, between the cameras and the cloud. It runs vehicle detection on all 200 streams and forwards only the events: one 2 kB record per camera per second saying what passed and how fast.

Worked example

Camera bandwidth at the fog

  1. Raw traffic without a fog

    200 × 4 Mbps = 800 Mbps into the cloud.
  2. Event traffic after the fog

    Each camera now sends 2 kB × 8 = 16 kbit per second, so the whole district sends 200 × 16 kbit/s = 3.2 Mbps.
  3. 800 Mbps→  200×2 kB/s×8=  3.2 Mbps\begin{aligned} &800\,\text{Mbps} \\ \to\;&200 \times 2\,\text{kB/s} \times 8 \\ =\;&3.2\,\text{Mbps} \end{aligned}
    Uplink to the cloud before and after fog filtering
  4. Result

    About 800 / 3.2 = 250× less traffic leaves the district, and the cloud still learns everything it needs for city-wide planning.

The numbers are not a toy. Satyanarayanan estimates that only 12,000 users streaming 1080p video would already need a 100 Gbps link into the cloud, and a million users would need 8.5 Tbps. His cloudlets exist largely to “reduce ingress bandwidth into the cloud”.

The rule: a shared layer between edges and cloud

The server room is what this course calls the Fog layer: a layer that provides compute, storage and networking at critical points closer to the client on the Edge-to-cloud (E2C) continuum. Physically it is usually a Mini data center, the "cloud close to the ground" that part 01 introduced with Bonomi's definition. Part 01 asked what the fog is; this concept asks what it is for.

The defining fact is that one Fog node serves many edges. Everything useful about the fog follows from that sharing:

  • Less edge-to-cloud transfer. The fog filters, aggregates and answers locally, so less data crosses the long, expensive path. That lowers Latency for the requests it answers and frees bandwidth for everything else, as the camera example showed.
  • Data geo-restriction. Because the fog sits inside a region, personal data can be processed there and never leave. This is Data geo-restriction, and it exists for legal and privacy compliance.
  • Shorter edge-to-edge paths. Two edges under the same fog can talk through it. Their traffic turns around in the district instead of travelling to a distant data center and back.
Many thick edge streams converge on one fog node; only a thin line continues to the cloud, and neighbouring edges talk without it

Why geo-restriction is a legal requirement, not a preference

Data protection laws restrict where personal data may go. The EU GDPR, Chapter V, Article 44, allows a transfer to a third country only under the conditions that chapter lays down. Saudi Arabia's Personal Data Protection Law, Article 29, governs transfer outside the Kingdom, and SDAIA publishes standard contractual clauses for such transfers. A Riyadh hospital can therefore keep raw scans on a fog node inside the Kingdom and send only anonymised aggregates onward to a cloud region elsewhere.

Satyanarayanan adds two related benefits. A cloudlet can enforce its owner's privacy policy before any data is released to the cloud, and it can mask a transient cloud outage by keeping local services running until the link returns.

Recall

Name three benefits the fog gets from serving many edges.

Less edge-to-cloud data, so lower latency and bandwidth use; data geo-restriction for legal or privacy compliance; shorter edge-to-edge paths that do not need the cloud.

Quick check

A Riyadh hospital's raw scans may not leave Saudi Arabia, yet it wants cloud analytics. Which fog benefit makes this possible?

A robot arm on a factory floor must recognise the part in front of it. Its own processor is too weak for the detection model, so it sends each frame to a gateway box on the factory LAN and gets back a label. The robot knows one address. It never learns whether the gateway answered by itself or passed the hard frames to a fog server two buildings away.

The rule: four roles at the boundary

That gateway box is the Edge layer. In this course the edge has four roles:

  1. WAN boundary. It sits on the physical boundary of the wide-area network that extends the cloud, the last stop before the client's own network.
  2. Offload target. The client can hand it compute jobs it cannot or should not run itself, such as the robot's detection model.
  3. Fast small-data processing. It handles small amounts of data at reasonable speed, close enough that the round trip stays short.
  4. Gateway that hides the fog. It is the client's single door into the rest of the continuum, and the fog behind it stays invisible.

The last role has a precise parallel in HTTP. RFC 9110, §3.7, defines a gateway, also called a reverse proxy, as an intermediary that “acts as an origin server for the outbound connection but translates received requests and forwards them inbound to another server or servers”. The client believes it is talking to the server. The edge plays exactly that part for the fog.

The client talks only to the edge; behind the edge's curtain the fog nodes fade from the client's view

Hiding matters because the fog changes. Operators add nodes, fail over to a spare, or move a service to a less loaded server. If clients addressed fog nodes directly, every such change would have to be pushed to every robot, sensor and phone. With the edge in front, only the edge's forwarding changes and the clients never notice.

Real products follow this shape. AWS IoT Greengrass runs on a local gateway and lets devices “act locally on the data that they generate”, “filter and aggregate device data” and “react autonomously to local events”, while staying connected to AWS for the rest.

QuestionThis courseNIST SP 500-325
What “edge” namesThe layer on the physical boundary of the WANThe layer of end devices and their users
Where a gateway sitsIn the edge layer (slide 13)Among the fog nodes
What the client talks toThe edge, which hides the fogA nearby fog node, often a gateway
When to use itExam answers for this coursePapers and standards that cite NIST
Edge in this course vs. edge in NIST SP 500-325

Recall

What does “the edge hides the fog from the client” mean, and why is it useful?

The client talks only to the edge gateway, which forwards work to whichever fog node it chooses, like a reverse proxy in RFC 9110. The fog can change without any change to the client.

A city wants to predict tomorrow's traffic from two years of data from every intersection. Training that model needs thousands of GPUs for days and petabytes of history in one place. No district fog room or edge gateway has either, and no single district has all the data.

The rule: scale in three forms

That job belongs to the Cloud layer, which provides compute, storage and networking at a much bigger scale:

  • Big compute means high-performance computing. AWS advertises that you can “scale HPC applications to thousands of CPUs and GPUs with Elastic Fabric Adapter”.
  • Big storage means big data that lives for a long time. Bonomi describes the cloud as the “repository for data that has a permanence of months and years”, and Amazon S3 is a real service built for that kind of long-lived data at petabyte scale.
  • Big networking means connectivity between clouds. Google Cross-Cloud Interconnect gives dedicated links from Google Cloud to AWS, Azure, OCI and Alibaba Cloud at 10 Gbps, 100 Gbps or 400 Gbps (the 400 Gbps option only to AWS and OCI).

Putting the three layers side by side

With all three roles in hand, the layers line up along two axes at once. Going up from edge to fog to cloud, the area served grows, and so does how long the data is kept and acted on. Bonomi summarises the interplay as “Fog localization, and Cloud globalization”.

LayerPrimary roleScope servedData horizonExample
EdgeImmediate processing near the clientOne client or one siteMilliseconds (act and discard)Wake-word detection on a smart speaker
FogIntermediate layer for a local regionMany edges in a districtSeconds to daysTraffic management over nearby vehicle data
CloudCentralized, large-scale processingEveryone, globallyMonths to years (long-term retention)Training an AI model in a data center
Roles of the three layers
Three nested arcs: the edge covers one client, the fog covers several edges, the cloud covers everyone

The price of the cloud's reach is distance, and distance is Latency. Use the simulator to feel it: switch from the “all edge” preset to the “all cloud” preset, then set single tasks to fog, and watch how much of the response time becomes network rather than computation.

SimulatorMap a pipeline onto the continuum
  1. T1Image resizePT 8 ms
  2. T2Object detectionPT 40 ms
  3. T3Draw boxesPT 8 ms
150 ms
Network40ms
Response time96ms
Within budget RT ≤ 150 ms
τ
network 40 ms · 42%processing 56 ms · 58%

Formula

RT = Σ one-way hops + Σ PT

RT = (5 + 15 + 15 + 5) + (8 + 40 + 8) = 96 ms

Client→Edge 5 · Edge→Fog 15 · Fog→Edge 15 · Edge→Client 5

Each hop costs the difference between the one-way latencies of the two layers: Device 0, Edge 5, Fog 20, Cloud 70 ms from the client.

Recall

Give the cloud's three “bigs” with an example of each.

Big compute: HPC, such as training a model on thousands of GPUs. Big storage: big data kept for months or years, such as Amazon S3. Big networking: multi-cloud connectivity, such as Cross-Cloud Interconnect at up to 400 Gbps.

Quick check

Which task belongs in the cloud layer rather than the fog?

Follow one temperature reading through a cold-storage company. The rule for frozen goods is that the room must stay at or below 8 °C, and one thermometer has just read 9 °C.

Worked example

One reading's journey up the tree

  1. Sense

    The thermometer, an end device, measures 9 °C and sends it to the warehouse gateway.
  2. Process locally

    The Edge gateway compares the reading with the 8 °C threshold and switches on the backup cooler at once. No message has left the building yet.
  3. Coordinate regionally

    The gateway forwards a short alarm, not the raw stream, to the regional fog node. The fog node sees alarms from every warehouse in the region and reroutes today's deliveries away from the warm one.
  4. Analyse globally

    The fog node passes a daily summary to the cloud, which keeps a year of history from every region and learns which compressors are about to fail.
  5. Result

    Each level acted on its own time scale and passed up something smaller than it received: a reading, then an alarm, then a summary.

The rule: sense, process, coordinate, analyse

Slide 13 compresses this into one sentence: edge devices sense, edge gateways provide local processing, fog nodes coordinate regionally, and the cloud analyses globally. In this course's model the devices and gateways belong to the Edge layer, the coordinators to the fog layer, and the analytics to the Cloud layer.

The shape is a tree. Many devices hang off each gateway, several gateways off each fog node, and a few fog nodes off the cloud. NIST describes the same structure when it says fog nodes can be clustered “vertically (to support isolation), horizontally (to support federation)”. Data flows up the tree and shrinks at every level, while decisions are taken at the lowest level that has enough information.

Bonomi's fog tiers from part 01 give the time scales, here in his Smart Grid example. The first fog tier runs control loops “from milliseconds to sub seconds”, and it “filters the data to be consumed locally, and sends the rest to the higher tiers”. Higher fog tiers work on “seconds to minutes”, and even days. The cloud keeps data for months to years.

Recall

State the one-line slogan for what each layer serves, and the four verbs of the IoT hierarchy.

“Edge serves the client, fog serves many edges, cloud serves everyone.” Devices sense, gateways process locally, fog nodes coordinate regionally, the cloud analyses globally.

Quick check

In the slide 13 hierarchy, which element hides the fog nodes from a smart thermostat?

A platoon of trucks drives at 108 km/h, which is 30 m/s, with gaps of about 10 m. The front truck brakes hard. How far does the next truck travel before it even starts to react? That depends on where the brake decision is computed.

d=v⋅td = v \cdot t
Distance covered while waiting for a decision

Worked example

Metres travelled while waiting

  1. Decision in the cloud

    Assume a 60 ms round trip. d = 30 × 0.06 = 1.8 m, almost a fifth of the gap.
  2. Decision through a roadside unit

    Assume a 5 ms round trip. d = 30 × 0.005 = 0.15 m.
  3. Decision on the car or over V2V

    Assume about 1 ms. d = 30 × 0.001 = 0.03 m.
  4. Result

    The roadside unit gives the truck about 1.65 m more margin than the cloud, and the car itself loses only centimetres. If both trucks brake equally hard, this waiting distance is exactly how much of the gap is lost by the time both stop. These latencies are illustrative assumptions, but the ratio is the point: distance in the network becomes distance on the road.

The rule: map each element to a layer by how fast it must act

  • Cars are edge nodes. Each vehicle processes its own sensor data in real time, in the Edge layer. Cars also talk directly to each other over the vehicle-to-vehicle (V2V) network, which skips every piece of infrastructure.
  • Roadside units are fog nodes. An Roadside unit (RSU) along the road sees the vehicles near it and can, for example, warn them about a traffic jam ahead. In the paper behind slide 14's figure, “RSUs are managed by the RSUC which has more resources for computing, storage, and communication through Internet to the cloud.” The RSU controller (RSUC) is therefore the fog aggregator that links the roadside units to the cloud.
  • The cloud coordinates globally. The Cloud layer offers global coordination, long-term storage and HPC, but at a higher Latency.
V2V links between cars light first, roadside links next, and the dashed cloud link last: latency grows with distance

The figure comes from Wang, Guo, Gao, Fang, Li and Sun, “Fog-Based Distributed Networked Control for Connected Autonomous Vehicles” (2020). In their connected cruise control case study the RSU calculates control coefficients and sends them to each vehicle, and the car's on-board controller computes the real-time control signals from them. The split mirrors the time scales: the fog tunes the controller, the car closes the loop.

This is not an exotic case. NIST uses it to illustrate the fog's geographical distribution: “streaming services to moving vehicles, through proxies and access points geographically positioned along highways”. Bonomi lists cars talking to roadside units and smart traffic lights as a core fog use case.

Recall

In the platoon, map each element to a layer and give one job for each.

Car: edge, real-time sensor processing and V2V. RSU: fog, local warnings such as a jam ahead. RSUC: fog aggregator with more compute and storage, linked to the cloud. Cloud: global coordination, long-term storage and HPC, at higher latency.

Quick check

Why does a platoon's emergency brake warning travel car to car instead of through the cloud?

Recap

If you remember nothing else

  • The fog gives compute, storage and networking close to clients, and serves many edges.
  • Fog benefits: less edge-to-cloud traffic, geo-restricted data for compliance, and shorter edge-to-edge paths.
  • The edge sits at the WAN boundary. It takes offloaded jobs, processes small data fast, and is the gateway that hides the fog.
  • The cloud gives big compute (HPC), big storage (big data) and big networking (multi-cloud).
  • Edge serves the client, fog serves many edges, cloud serves everyone.
  • In an IoT tree, devices sense, gateways process locally, fog nodes coordinate regionally, and the cloud analyses globally.
  • In a platoon, cars are edge nodes, RSUs and the RSUC are fog, and the cloud gives global coordination at higher latency.
  • Sources draw the boundary differently: NIST puts gateways in the fog and end devices in the edge.

Sources