6.3.11 · D2Interconnects, Buses & SoC

Visual walkthrough — Infinity Fabric - mesh interconnects

3,012 words14 min readBack to topic

This page builds ONE result from nothing: why a 2D mesh of cores beats a ring of cores as core counts grow. We will not assume you know what a "hop" is, what "average distance" means, or where the number comes from. Every symbol is earned. By the end you will be able to draw the whole story on a napkin.

Parent: Infinity Fabric & mesh interconnects (see the Hinglish version too).


Step 1 — What is a "hop"? (the atom of the whole story)

WHAT. A chip is a set of nodes. A node is one stop on the network: think "a core plus its little router". A router is the tiny traffic-cop circuit that receives a data packet and pushes it toward the next node. Every time a packet passes through one router and moves to the next node, we count one hop.

WHY define this first. Latency — the delay before data arrives — is dominated by how many routers the packet must pass through. So if we can count hops, we can compare designs before any chip is built. Hops are the ruler.

PICTURE. Below, a packet leaves node A and reaches node D by passing B and C. Three arrows = three hops.

Figure — Infinity Fabric  -  mesh interconnects
Fewer hops on average?
lower latency, because is directly proportional to .

Step 2 — The ring, and why we take the shorter way around

WHAT. Arrange nodes in a circle. Here ==== is simply "how many nodes (cores) there are". Each node has a link to its left and right neighbour — that is the whole ring.

WHY the shorter way. A real ring is bidirectional (two counter-rotating lanes). From node 0, node 5 is either 5 hops clockwise or hops the other way. A router always picks the smaller. This is the key rule that makes the average come out to roughly a quarter, not a half, of the ring.

PICTURE. From the red node, the green destination is reached the short way (solid) not the long way (dashed).

Figure — Infinity Fabric  -  mesh interconnects

The exact discrete count, built term by term. Fix one node as source (every node is identical by symmetry, so one source stands for all). Now list its shortest distance to every node including itself. Take even for concreteness:

  • distance : itself — 1 node
  • distance : one neighbour clockwise, one counter-clockwise — 2 nodes (that is the "")
  • distance : 2 nodes (the "")
  • … this pattern of two nodes at each distance continues up to distance
  • distance : the node exactly opposite — reachable equally either way, so it is 1 node, counted once, not twice. This lone far-side node is the reason the two branches don't split it evenly.

So the sum of all shortest distances from the source is

  • ::: two nodes at each distance , using with
  • ::: the single far-side node, added once
  • ::: the neat total after the algebra collapses

Now average. We divide by all destinations (self included, per our page rule):

  • dividing by ::: because there are possible destinations for the fixed source, and we count "go nowhere" () as one of them
  • ::: the exact even- result — clean, with no correction needed once the self-pair is included

For : exactly. (Earlier hand-wavy "excluding self" counts gave ; including the self-pair — our fair rule — gives the clean .)


Step 3 — The mesh, and why we measure distance as

WHAT. Now lay the same nodes on a square grid, rows by columns, so and . Here ==== is the side length of the grid. Each node links to its North, South, East, West neighbour. (Real chips often use rectangular grids — we cover that in Step 7.)

WHY this distance. On a grid you cannot move diagonally — packets go along links only. So to get from column to you make horizontal hops, and from row to you make vertical hops. The bars mean "absolute value" — the size of the gap, ignoring whether you go left or right (distance is never negative). Adding them gives the total hops. This grid-distance is called Manhattan distance (like walking city blocks).

PICTURE. From to : three East hops, then two North hops.

Figure — Infinity Fabric  -  mesh interconnects

Step 4 — The average gap on one axis: the exact discrete sum

WHAT. We want the typical Manhattan distance over all random source–destination pairs (self-pairs included, per our page rule). By symmetry the X-average and Y-average are equal, so we only need one axis: — the average column-gap when and are each equally likely to be any position .

WHY split into axes. Because is a sum, and the average of a sum is the sum of the averages, we can split a hard 2D average into two easy 1D averages. That is the whole trick — it is why the grid is tractable.

PICTURE. Every ordered pair of columns and the gap between them; we literally add up all the gaps and divide.

Figure — Infinity Fabric  -  mesh interconnects

Why exactly pairs have gap . An ordered pair is — start column then end column, and counts as different from . Fix a gap size . How many ordered pairs sit exactly apart?

  • Count the pairs going right, . The start can be (any further right and falls off the grid). That is starting positions → pairs.
  • Count the pairs going left, . By the mirror argument, another pairs.
  • Total: ordered pairs with gap .

The picture above shows this as two staircases (rightward and leftward), each of length , shrinking as grows (big gaps are rare — only a few positions leave room for them). For (self-pairs) there are exactly of them (), contributing to the sum but still counted in the denominator. Now sum and divide by all ordered pairs:

  • ::: add over every possible gap size (the term is , so it drops out of the numerator but stays in the denominator)
  • ::: the count just derived — two directions, fewer starting spots as grows
  • ::: the exact answer after the algebra — the number that is truly correct

For : exact , versus the tidy — a 6% overestimate, shrinking as grows.


Step 5 — Add the two axes: mesh average hops

WHAT. Combine the X-average and Y-average.

WHY addition works. The average of a sum equals the sum of the averages — always, even if X and Y were related (they're not here). So we simply add the two per-axis averages.

PICTURE. The two per-axis averages stack into one L-shaped path length.

Figure — Infinity Fabric  -  mesh interconnects
  • (twice) ::: the exact per-axis average from Step 4
  • ::: their exact sum
  • ::: the clean approximation, using so we can compare directly against the ring's

Step 6 — Plug in and see the win

WHAT. Put real numbers in. Use (a mesh vs a 16-node ring) and cycles.

WHY . It is the smallest size where the gap is obvious and it matches the parent note, so you can cross-check.

PICTURE. Two bars: ring latency towering over mesh latency.

Figure — Infinity Fabric  -  mesh interconnects

(The exact discrete mesh value, , gives the mesh an even bigger edge — the approximation is conservative.)


Step 7 — Edge, non-square & degenerate cases (never let the reader fall off the map)

WHAT. Check the corners of the argument where the neat formulas might lie.

WHY. A formula that only works "on average, for big square grids" must be tested at its extremes, or you will trust it where it breaks.

PICTURE. Four tiny scenarios.

Figure — Infinity Fabric  -  mesh interconnects
  • Single node () — both networks: there is only one node, so the only pair is (self, self) with distance . Ring: from the tidy form, but the exact self-included sum is , average ✓ — the formula's tidy version distorts here, the exact one is correct. Mesh: exact at gives ✓; the tidy over-states it. Both networks correctly give for one node — nobody to send to.
  • Same node in a big network (source = dest): . No hops, latency is just the local access. This pair is the one we deliberately include in every average (Step 0 rule).
  • ( mesh vs 4-ring), exact self-included forms: ring with ; mesh . A tie at — the mesh has not yet pulled ahead this small, which is exactly why rings ruled at low core counts.
  • Non-square (rectangular) mesh : the axes just use their own lengths — X-average , Y-average , added. A long thin grid () has a larger average distance than a square of the same node count, because one axis is stretched — so square is the optimal aspect ratio, and that is why chip designers push mesh layouts toward square.
  • Neighbours (adjacent nodes): on both. The best case is identical; the mesh's advantage is entirely about far pairs.
  • Bandwidth, not just latency: cut the network in half. A ring has only 2 links crossing the cut; a mesh has (for , that's 4) — 2× the bisection bandwidth. So the mesh wins on throughput and delay.
Solve (approximate forms) for the crossover
, so — beyond this the mesh's average hops win.

The one-picture summary

Figure — Infinity Fabric  -  mesh interconnects

Everything above collapses into one chart: ring latency () rising as a straight ramp, mesh latency () crawling along a gentle curve, crossing near , and separating forever after. That gap is why chiplet fabrics and meshes exist.

Recall Feynman retelling — say it back in plain words

Data inside a chip has to walk from one core to another, and every step through a router costs time. We measure "typical distance" by averaging over every source-and-destination pair — including the boring pair that goes nowhere (distance ) — so both shapes are judged on the same footing. On a ring, cores sit on a loop; adding up the distances (two nodes at each step, plus one lone node on the far side) gives a total of , and dividing by all destinations gives exactly — pile on cores and the loop just gets longer. On a grid (mesh), you can only walk along blocks, so distance is "columns apart plus rows apart" (Manhattan). Counting how many pairs sit a gap apart — going right, going left, so — and averaging gives per axis, roughly a third of the side length; two axes make about . Because grows much slower than , the grid keeps latency low as chips get huge. For tiny chips () they tie, and at both give , which is why rings ruled until ~10 cores and meshes/fabrics took over above that. Keep the grid square — stretch it into a long rectangle and the average distance grows. And the grid carries more lanes across its middle too, so it wins on bandwidth as well as speed.

Recall Related vault threads
  • Coherency traffic riding this fabric: 6.3.5-Cache-Coherency-Protocols
  • Why distant nodes = slower memory: 6.2.8-NUMA-Architecture
  • Turning bytes/cycle into GB/s: 5.1.7-Memory-BandwidthCalculation
  • Where buses came from: 6.3.1-Bus-ArchitectureBasics
  • Off-chip cousins: 6.4.3-PCIe-Topology, 7.2.4-Network-Topologies