Information Entropy and Channel Capacity: Shannon’s Lessons for Engineers
Shannon’s information theory provides a practical framework for balancing compression, reliability, throughput, and latency. This article explains entropy, redundancy, and channel capacity, then applies those concepts to protocol design, storage, messaging, and observability. It also offers a design-review checklist and explains where theoretical limits meet real-world constraints.
Claude Elwood Shannon was born on April 30, 1916, in Petoskey, Michigan. For engineers, however, his most important legacy is not his biography. It is the way he transformed communication from an empirical craft into a problem that could be analyzed mathematically: What is information? How does noise limit reliable transmission? Where are the boundaries of compression and error correction?
Rather than recounting anecdotes, this article turns those ideas into practical judgments that engineers can reuse in system design.
1. Distinguish Information, Entropy, and Redundancy
Information is not the length of a text or the number of fields in a business record. In Shannon’s sense, information measures how much uncertainty an observation removes. Reporting an almost certain event adds little information. Confirming a rare, unpredictable event adds much more.
This is why a repeated log prefix or an unchanging protocol magic number may look lengthy to a person but be inexpensive for an encoder to represent.
Entropy quantifies average uncertainty. For a discrete source, it describes the lower bound on the average number of bits needed per symbol under ideal lossless coding. It is a theoretical bound, not the measured output of a particular compression algorithm.
Redundancy is the portion of a representation that exceeds that lower bound. Not all redundancy is waste. Protocol version fields, checksums, and retransmission sequence numbers deliberately add structure to handle errors, loss of synchronization, and system evolution.
The engineering question is therefore not simply, “Can we compress this to the limit?” It is, “Which redundancy pays for reliability, and which is merely a legacy burden?”
2. Model the Source, Channel, and Noise Separately
Represent the system as a chain:
Source → Encoder → Channel → Decoder → Destination
The source generates symbols, the encoder changes their representation, the channel introduces disturbances, the decoder recovers a usable result, and the destination consumes it.
Disturbances are not limited to electromagnetic noise. They can include packet loss, clock drift, bad disk blocks, truncation, out-of-order delivery, and deliberately injected anomalous values. The model can be approximate, but its layers must remain distinct. Otherwise, an optimization may target the wrong part of the system.
Source coding removes redundancy and approaches the entropy limit. Channel coding adds structure to resist noise. Their objectives point in opposite directions, but both must be balanced along the same communication path.
Compression without protection can make large amounts of data unreadable when the channel becomes unstable. Protection without compression can waste bandwidth and storage on fixed headers and repeated fields.
A mature design generally removes information that can be inferred from business semantics first, then adds structures that can detect, correct, or at least expose failures under the expected error model.
3. Channel Capacity Is a Limit, Not a Throughput Guarantee
Shannon showed that a channel with specified statistical properties has a capacity. Below that capacity, codes exist that can make the probability of error arbitrarily small. Above it, arbitrarily reliable transmission is not possible.
This is an existence theorem. It does not automatically supply a practical code, and channel capacity is not the same as measured production throughput.
Three engineering implications follow.
First, reliability and transmission rate can improve together, but approaching the theoretical limit often requires longer code blocks, more latency, and greater computational effort. Better coding does not remove physical constraints.
Second, “zero errors forever, zero latency, and full rate” is not a valid target for a noisy channel. A design must specify acceptable residual errors, latency, and retransmissions.
Third, capacity changes with signal-to-noise ratio and available resources. Congestion, interference, and poor connectivity are not necessarily signs of inadequate implementation; they change the effective communication conditions. Strategies should change accordingly: reduce the rate, add redundancy, shorten packets, or switch to store-and-forward operation.
4. Use Entropy for Estimates, Not as a Compression Benchmark to Worship
For discrete events with known or estimated probabilities, entropy is the negative sum of each probability multiplied by its logarithm. With base-2 logarithms, the unit is bits.
Three cautions matter in practice:
- Probabilities usually come from samples, and small samples can produce substantial estimation bias.
- Business distributions often drift over time. Yesterday’s model may not describe today’s traffic.
- Entropy is an average. Rare events can still be expensive to represent.
The following illustrative code expresses the definition; it is not a platform API:
def shannon_entropy(probs):total = 0.0for p in probs:if p > 0.0:total -= p * log2(p)return total
Use entropy primarily for comparison, not as an absolute benchmark.
For example, logs with heavily concentrated status codes have low uncertainty and may suit dictionary or differential encoding. Nearly random user input has higher entropy, so general-purpose compression may offer limited savings. The more important question may be whether the full input needs to be stored at all.
Actual compressed size normally remains above the entropy bound. Finite windows, finite dictionaries, and format constraints prevent practical encoders from reaching the ideal.
If compression makes data larger, first check whether the input is already encrypted or compressed. Both often look close to random to a general-purpose compressor, so another compression pass may add overhead without meaningful savings.
5. Translate Coding Theory into Architectural Discipline
1. Define what an error means
Detection and correction can have very different costs. Financial reconciliation and control commands generally need errors to be detected and rejected; they cannot proceed because a result “looks approximately right.” Monitoring samples and preview images may tolerate approximation.
Only after defining these semantics can a team assign a meaningful redundancy budget.
2. Treat block length, latency, and burst errors together
Longer codewords can approach theoretical limits more closely, but a single failure may affect more data, and decoding latency can increase.
Real-time control favors short packets, quick checks, and explicit retransmission behavior. Bulk archiving can accommodate longer blocks, stronger compression, and background verification. One frame length should not serve every workload.
3. Make predictable structure explicit
Timestamp deltas, small enumeration sets, and repeated field names should be expressed in the schema rather than left for a general-purpose algorithm to discover.
A stable schema makes entropy estimates more dependable and compatibility easier to manage as the system evolves.
4. Do not treat compression, encryption, and integrity checks as interchangeable steps
Encrypted data generally appears high-entropy, so compression should ordinarily precede encryption.
Integrity checks must cover the bytes the receiver actually relies on. Checking a header while leaving the body unchecked creates a gap in protection.
Key-related data and checksums also consume channel resources and must be included in the capacity budget.
5. Account for the feedback channel
If a low-rate reverse link exists, the forward path may use less error-correction redundancy and rely more on selective retransmission.
If the reverse path is unreliable or has very high latency, more forward redundancy may be necessary, at the cost of a lower payload rate.
This is a joint capacity-and-latency constraint, not merely an implementation preference.
6. Apply the Same Accounting to Storage, Messaging, and Observability
Cold data in object storage that is written frequently but read infrequently can justify stronger compression and integrity checks, with longer recovery times. Hot indexes need random access; excessive compression can make CPU usage the next bottleneck.
In messaging, repeated delivery is redundancy across time. At-least-once delivery introduces duplicates, while at-most-once delivery carries a risk of loss. Exactly-once behavior usually depends on idempotency and deduplication state rather than a label alone.
That state consumes storage. In effect, part of the communication problem becomes a memory problem.
Observability data is particularly prone to poor information accounting. High-cardinality labels can make sequences difficult to compress, while an explosion in dimensions drives query cost. Retaining every low-value debugging field does not necessarily buy reliability; it may only increase the bill.
A better approach is to classify data by its decision value:
- Events needed for accountability should remain verifiable and traceable.
- Metrics used to identify trends can permit sampling and aggregation, with the resulting statistical error documented.
Sampling deliberately discards information. Sampling rates and alert thresholds should therefore be designed together, so that a healthy-looking dashboard does not simply reflect a failure that was sampled away.
7. Questions for a Design Review
A useful review does not require everyone to memorize formulas, but it should answer these questions:
- Which fields contain most of the source’s uncertainty?
- Which fields can be inferred from others?
- Are the channel’s main failures loss, corruption, reordering, or delay?
- What residual errors can the application tolerate?
- In what order are compression and protection applied?
- Does block-length-related latency exceed the interaction deadline?
- How will the model be updated when the distribution changes?
- On failure, should the system reject, degrade, or retry?
- Can retries amplify congestion?
Systems without clear answers often become unstable near their effective capacity. Symptoms include intermittent timeouts, inconsistent compression gains, and frequent integrity-check failures.
8. The Limits: Theory Is Clean; Systems Are Not
Many familiar Shannon models assume stationary noise with no memory or limited memory. Real systems also contain feedback loops, operator actions, version mismatches, and correlated failures.
Correlated failures are not independent bit flips. An entire machine, network, or batch of data may fail together. Bit-level error correction alone is insufficient; isolation, replica placement, and diversity also matter.
A theorem that guarantees the existence of a good code does not guarantee that the code fits a system’s latency, power, or implementation-complexity budget.
Engineering goals should therefore be written as testable acceptance criteria. Under a declared error model, specify the required payload rate, end-to-end latency, and undetected-error rate. Also prepare a degradation path for declining capacity.
Conclusion
Shannon’s contribution to engineering is a clear sense of boundaries. Entropy sets a lower bound on lossless compression; channel capacity sets an upper bound on reliable transmission. Between them, redundancy should pay for risks that can be explained.
Placing logs, protocols, storage, and messaging back into the source–encoder–channel–decoder model turns architectural trade-offs from slogans into decisions that can be measured, reviewed, and revisited.
