Majid Al-RaimiWhy layering: the continuum idea

COE 558Lecture 01Part 06

Why layering: the continuum idea

What a continuum is, and how networks and the memory hierarchy already use layers to trade distance and speed.

Concepts
4
Slides
46-50
Reading
24 min
Understood
0/4 concepts

Why this part matters

Every design decision in COE 558 is a placement decision. Does this task run on the device, at the edge, on a fog node or in the cloud? Before the physics of latency (Part 07) and the named tiers (Part 08), you need the pattern underneath all of them.

Computing has already solved this problem twice. Networks split a long path into segments, each built for its own span. Processors stack registers, caches and RAM so that urgent data sits close to the CPU. Edge computing applies the same trade, nearness against capacity, to the whole Internet. For your research project, this analogy is the cleanest way to justify putting a component at the edge.

By the end you can

  1. Explain why the space between client and server is a continuum of candidate locations, and why edge and cloud are regions of one range rather than separate worlds.
  2. Explain why a user-to-printer path is split into LAN switching and WAN routing tiers, and never confuse tier positions with protocol stack layers.
  3. Explain the memory hierarchy as a placement policy driven by urgency and locality, and say why a small fast layer is enough.
  4. Use T = S/B + L with measured bandwidth and latency to say when latency dominates, and justify the analogy that CPU cache is to RAM as edge is to cloud.

A continuum of places between client and server

Part 05 ended with a simple picture: a web app is a Client talking to a Server. The natural next question is where that server should actually sit, and the answer turns out to be "not in one place, but anywhere along a range".

The path is not an empty wire

Picture a student in Dhahran opening a web app whose only server is in a data center on another continent. Every click travels the full distance out as a request and the full distance back as a response. Now add three stops along the way: one in the campus building, one in the city, one in the region. Each stop is closer to the client than the far server is, so any work that can run at a nearer stop comes back sooner.

Seen this way, the space between client and server is a range of places where compute and storage can live. Latency grows as you move away from the client, and so does capacity, because far sites are larger. Placing layers along that range lets each request be answered by the nearest layer that is powerful enough to handle it.

Client
Dhahran

Starts every request

few ms
Layer 1
building

Nearest, smallest

Layer 2
city

Farther, larger

Layer 3
region

Farther still

highest total latency
Server
distant data center

Largest capacity

Three layers placed between a client and a distant server

This is not an invented teaching device. NIST describes fog computing as a layered model for accessing a shared continuum of computing resources, with nodes organized by their latency and distance to the end devices, and with different layers providing different services while working together as a continuum (NIST SP 500-325).

What makes a range a continuum

The word Continuum is doing real work here, so pin it down with the clearest example there is: visible light. Walk along the spectrum from 400 nm to 700 nm. Move one nanometer and the color does not visibly change. There is no single nanometer where blue stops and green starts. Yet 400 nm (violet) and 700 nm (red) are obviously different colors. That is the whole definition in one picture: neighboring points barely differ, while the two ends differ a lot. The Britannica Dictionary and Wiktionary put it the same way: a continuous series where no part is noticeably different from its neighbors, although the ends are very different from each other.

The familiar names on the wider electromagnetic spectrum (gamma, X-ray, UV, infrared, microwaves, radio) are labels people put on that smooth range because labels are useful. They are not walls that nature built.

One smooth range from device to cloud. The band names are soft labels, not walls.

Now map it back to computing. In the Edge-to-cloud (E2C) continuum, the two endpoints are "computing on the device itself" and "computing in a hyperscale cloud region". Everything between them is a candidate location for the layers above. The names you will meet in Part 08, Mist, Edge, Fog and Cloud, work exactly like UV and infrared: convenient labels on one range, where latency to the client and available capacity both grow as you move away from the device.

Recall

As you move from the client toward a distant server, what grows, and why would you add layers in between?

Latency grows with distance from the client, and so does capacity, since far sites are larger. Adding layers puts resources closer to the client, so requests that a smaller site can handle are answered sooner.

Recall

In your own words, what makes something a continuum rather than a set of separate categories?

Neighboring points differ only slightly and there is no sharp boundary, yet the two ends are very different. Names like UV and infrared, or edge and fog, are labels on the range, not walls.

Quick check

What best describes a continuum, as used for the edge-to-cloud continuum?

Layering along a distance is not new. The network you use every day already splits one long path into segments, each built with the technology that suits its span.

Make it concrete. A student sits in a KFUPM lab and sends a print job to a partner office in Riyadh. The first hop is the lab's Ethernet switch. The middle of the journey crosses routers in a wide area network. The last hop is the office's own switch, which delivers the job to the printer. Three segments, three tiers along the distance.

A job travels user to printer, switching technology at each segment: switch, router, switch.

Why one technology cannot run end to end

A switch works at the Data link layer and forwards frames by MAC address. It fills its forwarding table by flooding and learning, which is cheap and automatic inside one building but does not scale to the whole world: flooding every unknown frame to every port of every network on Earth would be absurd. A router works at the Network layer and forwards by IP address, using tables computed by routing algorithms over hierarchical address blocks, which is exactly what scales across many networks (Kurose and Ross, Chapter 6). Each technology is excellent inside its own range and poor outside it, so the path is built from pieces that each fit a stretch of it.

SegmentSpanDeviceAddresses usedStack layer
LAN 1 (tier 1)One building or campusSwitchMACLink
WAN (tier 2)Between citiesRouterIPNetwork
LAN 2 (tier 3)One building or officeSwitchMACLink
The three segments of the user-to-printer path

This is the networking Continuum: distance grows along the path, and connectivity is assembled from tiers that each serve one stretch. Keep the shape in mind, because the edge-to-cloud continuum does the same with compute instead of connectivity, and the memory hierarchy, next, does it with time instead of distance.

Recall

In the user-to-printer example, which device handles each segment, and why doesn't one technology run end to end?

Switches handle the two LANs, and routers handle the WAN in the middle. Switches learn MAC addresses by flooding, which only suits a local network. Routers compute tables over IP addresses with routing algorithms, which scales across networks.

Quick check

In the user-to-printer path, which standard stack layer does the first LAN's switching operate at?

The second place layering already exists is inside every computer. Here the axis is not kilometers but time: how long it takes the CPU to reach a piece of data.

Imagine a loop that sums a large array. The running total is touched on every instruction, so it lives in a register, right inside the processor. The chunk of the array being read right now is touched thousands of times a second, so it lives in cache. The rest of the dataset sits in RAM, and the file it came from sits on disk. Each step outward is slower to reach, but holds more.

This arrangement is the Memory hierarchy, a Continuum of access times. The rule is simple: the more urgently and frequently data is needed, the closer to the CPU it lives. Hennessy and Patterson describe the same picture: as you move away from the processor, each level is slower and larger, with times ranging from picoseconds up to milliseconds for magnetic disks. Notice the match with the network path: near tiers are small and fast, far tiers are large and slow.

Why a small fast layer is enough

If fast memory holds only a tiny fraction of the data, why does it help at all? Because of locality. Programs tend to reuse data they touched recently (temporal locality) and data stored near it (spatial locality). So a small, fast layer that keeps those items can answer most requests. Denning notes that this one principle shapes processor caches, disk caches, storage hierarchies and edge caches for the Web. That last item is the bridge to this course: an edge site works for the same reason a CPU cache does.

Recall

What decides which level of the memory hierarchy a piece of data lives in, and why can a small cache serve most reads?

How urgently and how often it is needed: data for the current instruction sits in registers, frequently used data in cache. Locality means programs keep reusing recent and nearby data, so a small fast layer answers most reads.

Quick check

Why can a small CPU cache serve most of the memory reads a program makes?

A ranking tells you the order of the levels; measurements tell you how much each step costs. To measure a level you need two quantities: bandwidth (how much data per second it can move) and latency (the fixed access delay paid on every fetch). Storage is simply the size of each level.

Start with a video editing workstation. The frame on screen right now sits in cache or registers, because it is touched constantly. Today's raw clips are pulled from the SSD into RAM so they can be processed quickly. Last year's projects stay on slow archive storage and are fetched only when you open them. That is the Memory hierarchy used as a placement policy, and the question is how big the gaps between levels really are.

The measured hierarchy

The Cornell Virtual Workshop publishes figures measured on Intel Skylake server processors. Reading outward, bandwidth is roughly cut in half at each level while latency roughly quadruples. The real steps vary, so read this as a rule of thumb.

LevelSize per socketRead bandwidthLatency
L1 cache768 KB~84 GB/s2 ns
L2 cache24 MB~60 GB/s7 ns
L3 cache (shared by cores)33 MB~30 GB/s26 ns
Main memory96 GB~10 GB/s90 ns
Measured levels on an Intel Skylake server (Cornell Virtual Workshop)
Rungs widen away from the CPU while read bandwidth falls and latency grows.

The bandwidth figures come from a Sandia National Laboratories evaluation of Skylake (Hammond, Vaughan and Hughes, 2018), and the latencies were measured on a closely related Xeon model. Latency is also quoted in clock cycles, such as "4 cyc." and "14 cyc.". 2 ns in 4 cycles implies about 0.5 ns per cycle, a clock of roughly 2 GHz (our own arithmetic, not a published figure).

Turning two resources into one time

Bandwidth and latency only become useful for decisions once you combine them into the time a fetch actually takes. Cornell gives a simple model for any level:

T=SB+LT = \frac{S}{B} + L
Retrieval time: size over bandwidth, plus latency (Cornell Virtual Workshop)

Here T is time, S is the size of the data, B is bandwidth and L is latency. For a tiny fetch, S/B is close to zero, so latency decides everything. For a huge transfer, the S/B term dominates and bandwidth decides.

Worked example

Fetching from L1 cache vs main memory

  1. A 16 KB fetch from L1

    Treat 16 KB as 1.6 × 10⁻⁵ GB. S/B = 1.6 × 10⁻⁵ / 84 s ≈ 190 ns, plus 2 ns latency, so about 192 ns. Latency is about 1 percent.
  2. The same 16 KB from main memory

    S/B = 1.6 × 10⁻⁵ / 10 s = 1.6 µs, plus 90 ns, so about 1.69 µs. Bandwidth sets the cost.
  3. A 64-byte fetch

    64 bytes ≈ 6.4 × 10⁻⁸ GB. From L1: S/B ≈ 0.76 ns against 2 ns latency. From main memory: S/B = 6.4 ns against 90 ns latency. Now latency is most of the time.
  4. Result

    Small fetches are latency-bound; large ones are bandwidth-bound. (Our arithmetic from the Cornell figures.)

The analogy the course is built on

Now every piece is in place. CPU cache is to RAM as Edge is to Cloud. Both put a small, fast, nearby tier in front of a large, slower, distant one. Both answer most requests from the near tier because of locality, and both fall back to the far tier on a miss. Interactive requests are small, so by T = S/B + L they are latency-bound and benefit most from a nearer tier. Bulk analytics is not interactive, so a few extra milliseconds of latency cost it little, and it needs far more compute than an edge site has. That is why Offloading it to the cloud, where capacity is, makes sense, as long as the data can be moved there or already lives there.

The same shape twice: a near tier answers hits, and misses fall back to the far tier.

Recall

From the Cornell Skylake measurements, how do bandwidth and latency change from L1 out to main memory, and what are the end values?

Cornell summarizes it as bandwidth roughly halving and latency roughly quadrupling at each step (the real steps vary: 84 to 60 to 30 to 10 GB/s, and 2 to 7 to 26 to 90 ns). L1 is about 84 GB/s and 2 ns; main memory is about 10 GB/s and 90 ns.

Recall

Using T = S/B + L, why does latency matter more than bandwidth for a small interactive request?

When S is tiny, S/B is close to zero, so T is roughly L. Only the fixed per-fetch delay is left, and that delay is lower on nearer, faster tiers (cache in a CPU, an edge site in a network).

Recall

Complete and justify: CPU cache is to RAM as ___ is to ___.

Edge is to cloud. In both, a small, fast, nearby tier sits in front of a large, slow, distant one. Locality lets the near tier answer most requests, and misses fall back to the far tier.

Quick check

Per the Cornell Skylake data, what happens at each step outward from L1 cache toward main memory?

Quick check

Using T = S/B + L, what dominates retrieval time for a tiny, interactive request?

Quick check

In the cache and edge analogy, what does a cache miss correspond to?

Recap

If you remember nothing else

  • A continuum is a range whose neighbors barely differ but whose ends differ greatly. Device, mist, edge, fog and cloud are labels on one range.
  • Layering places resources at points along the path, so each request is served by the nearest layer with enough capacity.
  • Networks already do this: switches serve LANs by MAC address, routers serve the WAN by IP address. Tier positions 1, 2, 3 are not stack layers.
  • The memory hierarchy trades capacity for nearness, and locality lets a small fast layer serve most reads.
  • On Skylake: L1 about 84 GB/s and 2 ns, L2 60 GB/s and 7 ns, L3 30 GB/s and 26 ns, RAM 10 GB/s and 90 ns.
  • Retrieval time is about S/B + L. Small interactive fetches are latency-bound, so nearness matters most.
  • CPU cache is to RAM as edge is to cloud: a small, fast, near tier in front of a large, slow, far one, justified by locality.

Sources