LEACH Cluster Head Rotation Animation

Explore how LEACH elects rotating cluster heads, forms clusters, aggregates sensor data, and spreads radio energy cost across a WSN

animation
wsn
leach
clustering
energy
routing
data-aggregation
Interactive LEACH cluster-head rotation workbench showing probabilistic election, eligibility epochs, cluster joining, TDMA-style member uploads, data aggregation, base-station forwarding, and energy-balance consequences.
Wireless sensor networks Cluster routing Energy model

Rotate the expensive cluster-head job before one battery gets stuck doing all the work.

LEACH is a distributed WSN protocol: each eligible sensor makes a local cluster-head decision, members join a nearby head, data is aggregated, and only a few heads make the long transmission to the base station.

Round 0 Current setup or steady-state round
3 of 24 CH Actual heads vs expected p * N
0.0 pts Battery spread across alive nodes
35% raw Sink-bound bytes after aggregation

1. Election is local

Every eligible node rolls a random value against T(n). LEACH does not need a central coordinator for the basic setup phase.

2. Rotation protects batteries

A recent cluster head is removed from the eligible set for roughly 1/p rounds, so the high-energy role moves around the field.

3. Clusters shorten most hops

Members send short-range packets to a nearby head instead of all sensors transmitting directly to a far base station.

4. Heads pay extra cost

Heads receive member packets, aggregate readings, and forward a compressed report to the base station.

Election: each eligible node rolls against T(n)

The round starts with a local probabilistic decision. A node that recently served as cluster head is not eligible during the current epoch.

Setup phase
LEACH wireless sensor field Sensors elect cluster heads, join clusters, send data to heads, and heads forward aggregated data to a base station.
T(n) = 0.120 Eligible nodes compare a random roll with the current threshold.
CH cost 3.4x member Cluster heads receive, aggregate, and transmit farther.
21 members joined Members choose the head with the lowest communication cost.
Member sensor Cluster head Member upload Head to base station
1

Elect

Eligible nodes roll against T(n), producing a small set of heads for this round.

2

Advertise

Heads broadcast a short advertisement so nearby sensors can choose a cluster.

3

Join

Non-head nodes join the head with the best communication cost for this round.

4

Schedule

Each head assigns member slots so radios can sleep outside their transmit time.

5

Upload

Members send sensor readings to the head using short-range transmissions.

6

Aggregate

Heads fuse related readings into a smaller report for the sink.

7

Forward

Heads transmit compressed data to the base station and spend extra energy.

Cluster-head count

3 actual

Expected count is p * N; actual count varies because election is probabilistic.

Eligibility coverage

13%

Share of active nodes that have already served as head in this epoch.

Round energy preview

16.4 pts

Illustrative energy points, scaled by payload and link distance.

Sink traffic

6.1 KB

Aggregated data sent from heads to the base station this round.

Election roll snapshot

First rows from the current round. A node becomes a head when it is eligible and its roll is below T(n).

Round event log

Plain-language trace of what the animation is currently showing.

Plain-language model

Think of each cluster head as a temporary team captain. Members whisper to the captain nearby; the captain summarizes the report and makes the long trip to the base station.

Formula in this tool

T(n) = p / (1 - p * (r mod 1/p)) for nodes in G, otherwise 0. G is the set of nodes that have not recently been cluster head.

What LEACH does not promise

The basic distributed election does not guarantee perfect placement, exact head count, or best lifetime for every topology. It is a useful baseline under specific WSN assumptions.

Technical notes and accuracy guardrails
  • Energy values are normalized teaching points, not calibrated Joules. They preserve the relative idea that longer radio links and larger payloads cost more.
  • The original LEACH model assumes homogeneous, energy-constrained sensor nodes, a fixed base station, and correlated data that can benefit from aggregation.
  • The animation uses nearest-head assignment as a proxy for the minimum communication energy choice described in LEACH. Obstacles, asymmetry, fading, and contention are not modeled.
  • The protocol has setup overhead each round. Static clusters avoid that overhead but can overuse unlucky heads; LEACH trades setup work for role rotation.
  • Residual-energy-aware variants and centralized variants such as LEACH-C change the head-selection process; this page focuses on the basic distributed LEACH idea.

Where to go next

Compare this distributed baseline with centralized clustering, residual-energy weighting, multi-hop routing, and mobile-sink collection when the assumptions change.

Check the epoch

Set p to 10%. Step through rounds and watch how roughly 1/p rounds define the eligibility window.

Stress the sink link

Choose Remote sink and increase payload size. Identify which nodes spend the most energy and why.

Find a bad round

Try Few heads. Notice how probabilistic election can create uneven clusters even when the long-term rotation idea is sound.