A high-performance, visually immersive simulator for the Leaky Bucket algorithm, featuring a premium analysis suite and real-time 3D packet physics.
- Dynamic Controls: Real-time manipulation of Inflow Rate, Leak Rate, and Buffer Capacity.
- 3D Visualization: High-fidelity 3D packet flow rendering powered by React Three Fiber.
- Real-time Analysis: A premium dashboard featuring glassmorphism widgets for deep simulation diagnostics.
- Session Spline: Lightweight, high-resolution session tracking from start to stop using Recharts.
- Intelligence Metrics: Real-time calculation of Estimated Latency (Queuing Delay) and Peak Load.
- Feedback: A "Bucket Mood" indicator that provides descriptive, personality-driven status updates.
- Performance First: State management optimized with
useReffor 60FPS simulation loops.
- Framework: React 19 + Vite 8
- 3D Engine: Three.js via React Three Fiber
- Data Viz: Recharts (for Analysis suite)
- Animations: GSAP & Framer Motion
- Styling: Vanilla CSS
-
Clone the repository:
git clone <repository-url> cd cn-project
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The Leaky Bucket algorithm acts as a buffer. Regardless of how bursty or irregular the incoming traffic is, it exits the bucket at a constant, steady rate.
- Inflow: New "packets" arrive at the bucket based on the user-defined
Inflow Rate. - Buffer: If the bucket has space, the packet is queued (adding to Latency).
- Leak: Packets are removed from the bucket and "transmitted" at the fixed
Leak Rate. - Analysis: The Analysis Dashboard monitors success rates, dropped packets, and theoretical queuing delay in real-time.
├── src/
│ ├── components/
│ │ ├── Visualizer.jsx # 3D Scene (Three.js)
│ │ ├── ChartPanel.jsx # MacBook-Style Analysis Suite
│ │ ├── InfoPanel.jsx # Algorithm Documentation
│ │ └── ...
│ ├── hooks/
│ │ └── useLeakyBucket.js # Core Algorithm Logic
│ ├── App.jsx # Dashboard Entry & State
│ └── main.jsx
└── vite.config.js # Vite Configuration
Calculates the theoretical time a packet spends waiting in the buffer using the formula: Latency = Queue Size / Leak Rate. This provides critical insight into the "lag" introduced by traffic shaping.
A lightweight Recharts implementation that captures the full history of the propagation session from the moment it starts until it stops, providing a high-fidelity visual trace of queue behavior.
Developed for Computer Networking project by Saksham Hans and group.