Skip to main content
Definition Website Computer and Technology

Gossip Protocol

Subject: Computer and Technology noun /ˈɡɑː.sɪp ˈproʊ.tə.kɑːl/ 1 definition

  1. Definition (noun)

    Entry #354 · Updated

    A Gossip Protocol (also known as an epidemic protocol) is a decentralized peer-to-peer communication mechanism in which nodes in a distributed system periodically exchange state with randomly selected peers. Modeled on the exponential spread of epidemics, each participant chooses a small fanout of neighbors at fixed intervals to transmit, request, or reconcile membership tables, heartbeat counters, or data versions until updates reach every reachable node in O(log N) rounds. Because it requires no central coordinator or static routing tree, gossip dissemination tolerates node crashes, packet loss, and cluster churn while keeping per-node bandwidth bounded and predictable. Unlike strongly consistent consensus protocols such as Raft or Paxos, a gossip protocol provides probabilistic convergence and eventual consistency rather than atomic agreement, making it well suited for cluster membership, failure detection, and metadata replication.

    Common Forms

    • Anti-Entropy: Periodically compares state digests or Merkle trees with random peers and transfers differing records via push, pull, or push-pull exchanges to repair divergence and converge replicas over time.

    • Rumor Mongering: Rapidly spreads newly created updates across the network while peers treat the item as active, stopping retransmission probabilistically or once a peer observes that neighboring nodes already hold the update.

    • Membership and Failure Detection: Disseminates node join, leave, and failure events—often via protocols such as SWIM—by piggybacking cluster state updates onto randomized health checks and indirect peer probes.

    • Gossip Aggregation: Computes decentralized cluster-wide metrics—such as node counts, averages, or load totals—by having pairs of peers repeatedly combine and normalize their local summary values across successive rounds.

    Example

    In a 24-node Apache Cassandra cluster, each node initiates a three-way GossipDigestSyn, GossipDigestAck, and GossipDigestAck2 exchange over TCP port 7000 every second with randomly selected peers to compare endpoint (generation, version) metadata. When node 10.0.2.18 goes offline and stops incrementing its heartbeat version, the resulting failure-detector update propagates across the cluster within seconds so surviving coordinators stop routing requests to 10.0.2.18 without consulting a central master.