# Cache snoopy protocols **Snoopy protocols** implement [[cache-coherence]] over a shared bus: every core's cache controller watches ("snoops") every transaction that appears on the bus, regardless of whether it issued that transaction, and reacts if the address concerns a line it currently holds. There is no central coordinator; coherence emerges from every cache independently applying the same rules to the same broadcast traffic. ## Why a shared bus works A bus has a useful property that makes snooping possible in the first place: it is a **totally ordered broadcast medium**. Every core sees every transaction in the same order, because only one transaction can be on the bus at a time. That total order is what lets each cache controller apply purely local rules (its own state machine, driven by what it snoops) and still end up in a state consistent with every other cache, without any of them talking to each other directly. ## The cost that limits scaling Every write has to be broadcast to every cache, whether or not most of them hold the line in question. This is cheap with a handful of cores, but the bus's fixed bandwidth becomes the bottleneck as core count grows: doubling the cores roughly doubles the snoop traffic each core has to filter, even for cores with no interest in the address. This is the practical reason large many-socket systems move to [[cache-directory-protocols|directory-based]] coherence instead, trading broadcast simplicity for explicit sharer tracking that only messages the cores that actually need to know. ## Protocol family Snoopy protocols are usually described as state machines attached to each cache line, where the states track whether the line is exclusively owned, shared read-only, or dirty relative to memory. The specific protocols differ in which states they support and how they handle write propagation: - [[wti]] — write-through invalidate, the simplest and earliest approach - [[msi]] — Modified/Shared/Invalid, the baseline write-back protocol - [[mesi]] — adds an Exclusive state to avoid a bus transaction on the common case of writing to a line only one core holds - [[moesi]] — adds an Owned state so a dirty line can be shared directly from cache to cache without writing back to memory first - [[dragon]] — an update-based (rather than invalidate-based) protocol - [[firefly]] — another update-based protocol, contemporary with Dragon