Analytics & ML · Study deck

Edge Cyber-Foraging: Cost and Energy Calculations

A 4K transcode can move heat and delay from a phone to a nearby server.

Data Dora is your guide for this deck.

edgepatternscyber
Data Dora, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Test putting numbers to it with a concrete scenario and pass criteria.
  • Validate test your understanding with a concrete scenario and pass criteria.
  • Explain when a nearby cloudlet is a better target than local execution or a distant cloud.
  • Compare local and offloaded execution using input size, result size, remote compute, radio energy, and latency.
iotclass.org

Major section

Start With the Decision · Putting Numbers to It

A 4K transcode can move heat and delay from a phone to a nearby server.

  • This justifies the What/Where/When framework: offload CPU-heavy tasks to capable nearby devices when the network is fast.
  • An available surrogate is not automatically a safe offload target.
  • The framework diagram in Figure: Edge caching framework diagram showing three decision dimensions separates the three decisions that must be recorded before computation or data leaves the device.

Why it matters

This order prevents a nearby node from winning merely because it is present.

One Cyber-Foraging Offload Decision. AR navigation: compute fit + 4 ms latency + 8-minute battery cost.
Edge caching framework diagram showing three decision dimensions: WHAT (what data or computation to cache or offload), WHERE (which edge nodes to use), and WHEN (timing and triggers).
iotclass.org

Major section

Mobile Figure Summary: Scavenger Flow · Network Topology and Device Mix

Scavenger Library: Profiles tasks (CPU, memory, network requirements), discovers surrogates, selects optimal target.

  • RPC Interface: Serializes tasks, transmits to surrogate, receives results.
  • Execution Environment: Sandboxed environment for running client tasks with resource limits.
  • The topology diagram in Figure: Heterogeneous device network topology showing mobile client surrounded makes that heterogeneity visible before a task is matched to a surrogate.
Heterogeneous device network topology showing mobile client surrounded by diverse surrogates with capability-aware task assignment.
Heterogeneous device network topology showing mobile client surrounded by diverse surrogates with capability-aware task assignment.
iotclass.org

Major section

Edge Caching Strategies

The hierarchy diagram in Figure: A cache miss moves from device to gateway shows why cache placement and freshness must be considered together before choosing a replacement policy.

  • In Figure: A cache miss moves from device to gateway, a request checks the device cache first because it is nearest to demand.
  • A miss moves to the gateway, and another miss reaches the broader cloud catalogue.
  • The marked hit rates rise from 80% to 95% to 100%, but those percentages describe where an object is found, not whether it is fit to reuse.
A cache miss moves from device to gateway to cloud, but every hit still needs version, lifetime, privacy, and invalidation checks before reuse.
A cache miss moves from device to gateway to cloud, but every hit still needs version, lifetime, privacy, and invalidation checks before reuse.
iotclass.org

Major section

Edge Caching Strategies (continued)

Version, time to live, privacy scope, and invalidation state still have to match the current request.

  • The useful design is therefore the nearest valid result, not simply the first stored copy returned by the hierarchy.
  • The nearest tier offers the lowest latency but the smallest, most local working set; the middle tier can share neighbourhood results; the cloud tier holds the broadest catalogue at the highest path cost.
  • This connects caching to the running cyber-foraging narrative: place reusable work near demand, but carry version, TTL, privacy, and invalidation evidence with every cached result.
iotclass.org

Major section

Task Profiling · Illustrative Station AR Wayfinding

Scenario: An illustrative station AR wayfinding app for visually impaired pedestrians renders 3D audio-visual overlays in real time, requiring GPU resources that exceed typical smartphone capabilities.

  • The SGD 48,000 cloudlet investment pays for itself in about 8 months through eliminated cloud GPU costs, plus additional savings from reduced 5G data usage.
  • Key Insight: Cyber-foraging excels when the offloading environment is predictable.
  • Train stations, airports, and hospitals have fixed infrastructure where cloudlets can be pre-positioned.
  • The What/Where/When framework collapses to "always offload to the local cloudlet" when latency requirements are strict and surrogate availability is guaranteed.
Cyber-foraging Scavenger architecture showing a mobile client preparing a task, discovering and selecting a nearby surrogate, then sending it across a network for sandboxed execution.
Cyber-foraging Scavenger architecture showing a mobile client preparing a task, discovering and selecting a nearby surrogate, then sending it across a network for sandboxed execution.
iotclass.org

Major section

Cyber-Foraging Offload Contracts

Cyber-foraging only works when the offload decision is measured instead of assumed.

  • Running it on the glasses may drain the battery.
  • Sending every image to a distant service may be too slow or fail when the outside link drops.
  • Offloading means sending a computing job to another machine.
  • The safe choice depends on the repair task.
Offloading wins only when its measured transfer, idle, and tail energy is below local compute energy and the remote route still meets the other service constraints.
Offloading wins only when its measured transfer, idle, and tail energy is below local compute energy and the remote route still meets the other service constraints.

Key terms

Nearby
Nearby is not always faster or safer.

Why it matters

The offload decision can change minute by minute because Wi-Fi, cellular, battery state, and cloudlet load change.

iotclass.org

Major section

Test Your Understanding

Question 1:: A mobile AR navigation app needs continuous rendering for a 30-minute campus tour.

  • The user's phone has limited GPU capability.
  • The VM startup cost (30--60 seconds) is amortized over the long session, and cloudlets provide strong isolation and dedicated resources for consistent AR rendering.
  • With those assumed cache hit rates, only 30% of requests reach the cloud CDN for long-tail content.
iotclass.org

Major section

Concept Relationships · Continue Your Route

Edge Compute Patterns -- Cyber-foraging is an advanced offloading pattern beyond basic filter/aggregate/infer.

  • IoT Reference Model -- Cyber-foraging operates at Level 3 (edge compute) leveraging nearby Level 4 (fog) resources.
  • Edge Fog Computing -- Cloudlets are pre-positioned fog nodes; cyber-foraging discovers opportunistic fog resources.
  • Edge Patterns Practical Guide -- Latency calculator helps decide when offloading saves time vs network overhead.
  • Edge Data Acquisition -- Cyber-foraging offloads processing but still requires edge data collection.
iotclass.org

Deck summary

Key takeaways

A 4K transcode can move heat and delay from a phone to a nearby server.

  • Scavenger Library: Profiles tasks (CPU, memory, network requirements), discovers surrogates, selects optimal target.
  • The hierarchy diagram in Figure: A cache miss moves from device to gateway shows why cache placement and freshness must be considered together before choosing a replacement policy.
  • Version, time to live, privacy scope, and invalidation state still have to match the current request.
  • Scenario: An illustrative station AR wayfinding app for visually impaired pedestrians renders 3D audio-visual overlays in real time, requiring GPU resources that exceed typical smartphone capabilities.
iotclass.org

Retrieval practice

Recall check 1 of 6

Data Dora says: answer from memory, then check your reasoning.

Q1A task takes 4 s and 2 J locally. Offload sends 4 MB at 1 MB/s, returns 0.1 MB at 1 MB/s, uses 0.5 s remote compute and 0.1 s round trip, and costs 3 J of radio energy. Which path is better for both time and device energy?

AOffload, because remote compute alone is 0.5 s.
BOffload, because sending a small result cancels input-upload energy.
CEither path is equal because the result is only 0.1 MB.
DRun locally: 4 s and 2 J beat offload's 4.7 s and 3 J.
Show answer

Answer: D Upload 4 MB / 1 MB/s = 4 s; return 0.1 MB / 1 MB/s = 0.1 s; add 0.5 s compute and 0.1 s round trip for 4.7 s. Local also uses 1 J less.

iotclass.org

Retrieval practice

Recall check 2 of 6

Data Dora says: answer from memory, then check your reasoning.

Q2Complete the edge computing data aggregation function:

Aself.buffer = deque(maxlen=window_size)
Bself.buffer = list()
Cself.buffer = np.zeros(window_size)
Dself.buffer = deque()
Show answer

Answer: A Edge aggregation uses a fixed-size deque buffer to maintain a sliding window of readings.

iotclass.org

Retrieval practice

Recall check 3 of 6

Data Dora says: answer from memory, then check your reasoning.

Q3Which task is the BEST candidate to offload from a constrained device to a nearby cloudlet?

AAverage the multi-gigabyte local file on the cloudlet because the tiny answer makes the upload cost negligible.
BA threshold comparison on one local sensor sample, because its tiny input and output minimize transfer cost while the cloudlet has a faster processor than the device.
CA compute-heavy task with small input and output, such as running a large model on one small image, because little data ships but much computation is saved.
DA task that produces a huge annotated video result from a tiny input, because upload size alone determines whether offloading is profitable.
Show answer

Answer: C Heavy compute plus small data is the classic profitable offload case.

iotclass.org

Retrieval practice

Recall check 4 of 6

Data Dora says: answer from memory, then check your reasoning.

Q4Why can offloading a task actually INCREASE a battery device's energy use under a weak network?

AOffloading always saves battery because the cloudlet performs the computation.
BA weak link can spend more radio energy sending input than local computation would use.
CA cloudlet fee drains the battery whenever the device uses a remote surrogate.
DWeak networks prevent local computation, so the device must retry the task remotely.
Show answer

Answer: B Transmission energy on a poor link can outweigh the compute energy saved, flipping the trade-off.

iotclass.org

Retrieval practice

Recall check 5 of 6

Data Dora says: answer from memory, then check your reasoning.

Q5In this chapter’s example, what percentage of requests reaches the cloud CDN after the device and nearby access-point caches?

AAbout 30%, because approximately 70% of traffic is served from edge tiers combined
BAbout 80%, because most video requests bypass the device and access-point caches entirely
CAbout 50%, treating local replays and cloud archive requests as equally common request groups
DAbout 5%, because the edge caches mostly serve a small, repeatedly watched video set.
Show answer

Answer: A In this chapter’s example, about 30% of requests hit the device cache (recently accessed content), 40% hit the nearby access point cache (locally popular content), and about 30% reach the cloud CDN for long-tail or rarely accessed content.

iotclass.org

Retrieval practice

Recall check 6 of 6

Data Dora says: answer from memory, then check your reasoning.

Q6In this chapter’s example, what percentage of requests is served by the device and nearby access-point caches combined?

AAbout 20%
BAbout 50%
CAbout 70%
DAbout 95%
Show answer

Answer: C The chapter's assumed shares are 30% served by the device cache, 40% by the nearby access-point cache, and 30% by the cloud CDN.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. D · Upload 4 MB / 1 MB/s = 4 s; return 0.1 MB / 1 MB/s = 0.1 s; add 0.5 s compute and 0.1 s round trip for 4.7 s. Local also uses 1 J less.
  2. A · Edge aggregation uses a fixed-size deque buffer to maintain a sliding window of readings.
  3. C · Heavy compute plus small data is the classic profitable offload case.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. B · Transmission energy on a poor link can outweigh the compute energy saved, flipping the trade-off.
  2. A · In this chapter’s example, about 30% of requests hit the device cache (recently accessed content), 40% hit the nearby access point cache (locally popular content), and about 30% reach the cloud CDN for long-tail or rarely accessed content.
  3. C · The chapter's assumed shares are 30% served by the device cache, 40% by the nearby access-point cache, and 30% by the cloud CDN.
iotclass.org