âš”ī¸ Byzantine Failures Simulation

Interactive Distributed Consensus Visualization

Network Configuration

7
1

Actions & Controls

1x

Node Types

Leader Node
Honest Node
Byzantine Node
Ready

Activity Logs

[System] Byzantine Failures Simulation initialized
[Info] Click 'Start Consensus' to begin Byzantine agreement protocol

System Status

Ready
Network Status
Current system state
0
Consensus Round
Number of consensus attempts
0
Messages Sent
Total network messages
Idle
Current Phase
Consensus protocol phase
f=1 < 2 (Safe)
Byzantine Tolerance
Fault tolerance check
đŸ“ąâ†”ī¸

Screen Too Small

Please use a device with a larger screen or rotate to portrait mode for a better viewing experience.

âš”ī¸ Byzantine Failures Feature Guide

🔧 Network Configuration

  • Number of Nodes: Total nodes in the network (4-12). More nodes demonstrate scalability but increase complexity.
  • Byzantine Nodes: Number of malicious/faulty nodes. Automatically limited to maintain fault tolerance (f < n/3).
  • Byzantine Fault Tolerance Rule: For n nodes, maximum faulty nodes f ≤ ⌊(n-1)/3⌋. This ensures honest majority.
  • Recommended: Start with 7 nodes and 1-2 Byzantine nodes to see clear behavior differences.

🎮 Actions & Controls

  • Animation Speed: Controls how fast messages move and phases transition (0.5x to 3x speed).
  • Simulation Mode:
    • Step-by-step (Manual): Click "Next Step" to manually progress through each consensus phase
    • Automatic: Watch the full consensus process run automatically
  • Reassign Nodes: Randomly shuffles which nodes are Byzantine, honest, or leader without changing total counts.
  • Reset Network: Stops current consensus and reinitializes the entire network.

🔍 Understanding Node Types

  • īŋŊ Leader Node (Gold): Initiates consensus by proposing a value (Pre-Prepare phase). Must be an honest node.
  • īŋŊ Honest Node (Green): Follows the PBFT protocol correctly, validates messages, and helps achieve consensus.
  • īŋŊ Byzantine Node (Red): Malicious node that may send conflicting messages, lie, or remain silent to disrupt consensus.
  • Node Values: Each node starts with a random binary value (0 or 1) that they want the network to agree on.
  • Message Types: Pre-Prepare (leader proposal), Prepare (replica validation), Commit (final agreement).

📋 PBFT Consensus Protocol

This simulation implements the Practical Byzantine Fault Tolerance (PBFT) consensus algorithm with three distinct phases:

  1. Phase 1 - Pre-Prepare:
    • Leader broadcasts a pre-prepare message with the proposed value to all replica nodes
    • All replicas receive the same proposal from the leader
    • This establishes the initial proposal for this consensus round
  2. Phase 2 - Prepare:
    • Each replica broadcasts prepare messages to all other nodes (including the leader)
    • Honest replicas send prepare messages with the leader's proposed value
    • Byzantine replicas may send conflicting prepare messages or stay silent
    • Nodes collect prepare messages to verify network agreement on the proposal
  3. Phase 3 - Commit:
    • Nodes that received â‰Ĩ 2f+1 prepare messages (including leader's implicit prepare) enter commit phase
    • These nodes broadcast commit messages for the agreed value
    • Byzantine nodes may send conflicting commits or remain silent
    • Final consensus is reached when nodes receive â‰Ĩ 2f+1 commit messages

Safety Guarantee: All honest nodes that commit will commit the same value, even with up to f Byzantine nodes (where f < n/3).

đŸŽ¯ Simulation Modes Explained

  • Manual Mode Benefits:
    • Step through each phase at your own pace
    • Read detailed logs for each action
    • Perfect for learning the protocol step-by-step
    • Watch message animations carefully
  • Automatic Mode Benefits:
    • See the full consensus process flow
    • Observe timing and synchronization
    • Good for demonstrating the complete algorithm
    • Useful for testing multiple consensus rounds quickly

📊 Understanding the Visualization

  • Node Circles: Color indicates node type, size shows activity level
  • Node Labels: Show node ID and current value (0 or 1)
  • Message Lines: Blue lines show messages traveling between nodes
  • Node Connections: Thin gray lines show network topology (all nodes can communicate)
  • Pulsing Effect: Active nodes pulse during message sending/receiving
  • Phase Indicator: Top-left shows current consensus phase

📈 Statistics Panel Explained

  • Network Status: Current state (Ready, Running, Consensus Reached, etc.)
  • Consensus Round: How many consensus attempts have been made
  • Messages Sent: Total network communication overhead
  • Current Phase: Which step of the consensus protocol is active
  • Byzantine Tolerance: Shows the fault tolerance formula and safety status

đŸŽ¯ Recommended Experiments

  1. Basic Consensus:
    • Start with 7 nodes, 1 Byzantine node
    • Use manual mode to step through one complete consensus
    • Observe how Byzantine node behaves differently
  2. Fault Tolerance Testing:
    • Gradually increase Byzantine nodes until f = ⌊(n-1)/3⌋
    • Observe how consensus becomes harder with more faults
    • Try to exceed the fault tolerance limit
  3. Network Size Scaling:
    • Compare consensus with 4 vs 12 nodes
    • Observe message count and consensus time
    • See how fault tolerance scales with network size
  4. Byzantine Behavior Analysis:
    • Use "Reassign Nodes" to change which nodes are Byzantine
    • Run multiple rounds to see varying Byzantine tactics
    • Compare outcomes with different Byzantine node configurations
  5. Manual vs Automatic:
    • First run in manual mode to understand each step
    • Then switch to automatic to see full flow
    • Adjust animation speed to match your learning pace

🔍 What to Watch For

  • Message Patterns: Notice how Byzantine nodes may send different messages to different recipients
  • Consensus Success: Despite Byzantine interference, honest majority should reach agreement
  • Fault Tolerance Limits: Consensus fails when f â‰Ĩ n/3 (too many Byzantine nodes)
  • Leader Behavior: Leader must be honest - observe what happens during leader proposal
  • Vote Counting: Final decision based on majority of honest nodes, not all nodes
  • Network Resilience: System continues working despite presence of malicious actors

âš ī¸ Common Misconceptions

  • ❌ "More nodes = more security": Security depends on the ratio f < n/3, not absolute numbers
  • ❌ "Byzantine nodes are just offline": Byzantine faults are worse - they actively mislead
  • ❌ "Majority of all nodes needed": Only majority of honest nodes needed for consensus
  • ❌ "Leader can be Byzantine": Leader is always chosen from honest nodes in this simulation
  • ✅ Understanding: This simulation demonstrates the fundamental challenge of reaching agreement in the presence of malicious actors