L1, L2, L3 and L4 are labels for hierarchical tiers of memory or protocol layers, with each higher tier providing more capacity but higher latency.

CPU cache hierarchy

The processor uses a stack of caches to keep frequently accessed data close to the execution units.

Level 1 cache

Each core contains its own L1 cache, typically 32 KB–64 KB for data and a similar amount for instructions. It runs at the core clock speed and delivers sub‑nanosecond latency, making it the fastest memory on the chip.

Level 2 cache

L2 sits just behind L1. It is usually 512 KB–2 MB per core and is a few nanoseconds slower (around 3–5 ns). It acts as a safety net when data miss the L1 pool.

Level 3 cache

L3 is shared among all cores on the die. Sizes range from 16 MB to 96 MB on consumer CPUs and can be larger on servers. Latency is roughly 10–15 ns, still far faster than main memory.

Level 4 cache

Only a few architectures include an L4 level, often as an off‑die eDRAM chip or integrated graphics buffer. It provides tens of megabytes of fast storage, bridging the gap between L3 and system RAM.

Layered protocols in networking and blockchain

The same numbering scheme is borrowed for abstract stacks that sit above the hardware.

Layer 1 – base infrastructure

In networking, Layer 1 is the physical layer: cables, fiber, radio waves. In blockchain, it is the main settlement chain (e.g., Bitcoin, Ethereum) that records transactions directly.

Layer 2 – scaling and local routing

Layer 2 adds a layer of indirection to increase throughput. For networks, this is the data‑link layer (MAC addresses, switches). For blockchains, Layer 2 solutions such as rollups or state channels batch many transactions off‑chain and settle them on the main chain.

Layer 3 and 4 – higher‑level services

Higher layers handle routing, session management, and application‑specific logic. In the OSI model they correspond to network, transport and application layers; in crypto they can be sidechains or application‑specific protocols built atop Layer 2.

Why the hierarchy matters

Each step up the ladder trades speed for capacity. CPU caches reduce the average memory‑access time dramatically, while protocol layers let engineers isolate concerns, improve scalability, and add features without redesigning the underlying hardware.

  • Fast, tiny caches keep the core fed with instructions.
  • Larger, slower caches catch what the smaller ones miss.
  • Layered network/crypto stacks enable scaling without sacrificing security.