How NetPulse AI Works

A deep dive into the architecture, algorithms, and real-time simulation engine powering intelligent 5G network optimization

Project Overview

NetPulse AI is a real-time 5G network bandwidth allocation simulator that demonstrates how AI can optimize network resources better than traditional methods. The system compares three allocation strategies simultaneously:

Baseline
Equal-split allocation (25 Mbps each)
AI Weighted
Priority-based smart allocation
RL Multi-Armed Bandit
Learns optimal strategy over time

System Architecture

Backend (Python/FastAPI)

  • Simulation Engine: Executes network ticks every 100ms with precise timing control
  • Traffic Generators: Creates realistic demand patterns for 4 user types (Video, Gaming, IoT, VoIP)
  • Allocators: Three strategies run in parallel on same demand snapshot
  • Metrics Collector: Calculates QoS scores using weighted formula (25-25-15-35)
  • WebSocket Server: Broadcasts network state to all connected clients in real-time
  • SQLite Database: Stores simulation runs, snapshots, and historical data

Frontend (Next.js/React)

  • WebSocket Client: Maintains persistent connection for real-time updates
  • Dashboard: Displays live comparison panels, charts, and statistics
  • Charts (Recharts): Visualizes allocation, throughput, and QoS trends
  • Statistics Table: Shows rolling averages over last 50 ticks

Simulation Flow (Every 100ms)

1

Traffic Generation

Generate random but realistic bandwidth demands for all 4 user types based on their characteristics

2

Baseline Allocation

Equal-split: Divide 100 Mbps equally (25 Mbps each) regardless of demand

3

AI Allocation

Weighted priority: Allocate based on demand × priority × latency sensitivity

4

RL Allocation

Multi-armed bandit: Explore strategies (first 100 ticks) then exploit learned optimal

5

Calculate Metrics

For each allocation: compute latency, throughput, packet loss, and allocation efficiency

6

Calculate QoS Scores

Aggregate score using formula: (throughput×25%) + (latency×25%) + (packet_retention×15%) + (efficiency×35%)

7

Broadcast State

Send complete network state to all connected clients via WebSocket

Four User Types

🎥

Video Streaming

Demand: 5-25 Mbps
Latency Sensitivity: Medium (0.4-0.6)
Examples: Netflix, YouTube
🎮

Online Gaming

Demand: 1-5 Mbps
Latency Sensitivity: Very High (0.85-0.95)
Examples: PUBG, Call of Duty
📡

IoT Devices

Demand: 0.1-1 Mbps
Latency Sensitivity: Low (0.1-0.3)
Examples: Smart home, sensors
💬

VoIP/Messaging

Demand: 0.5-2 Mbps
Latency Sensitivity: High (0.7-0.85)
Examples: WhatsApp, Zoom

Key Metrics Explained

Allocation Efficiency

35% weight

Most important metric! Measures how smartly bandwidth is allocated. Baseline wastes bandwidth (over-allocates IoT/VoIP), AI allocates optimally.

Higher is better

Throughput

25% weight

Actual data transfer rate (Mbps). Capped by min(allocation, demand). Shows how much data users can actually send/receive.

Higher is better

Latency

25% weight

Network delay in milliseconds. Critical for gaming and VoIP. Increases with congestion and under-allocation.

Lower is better

Packet Retention

15% weight

Percentage of packets successfully delivered (100% - packet_loss). Affected by congestion and under-allocation.

Higher is better

What is a Tick?

A tick is one simulation cycle (100 milliseconds). Think of it as the heartbeat of the network - every tick, new demands are generated, allocations are made, metrics are calculated, and results are broadcast to the dashboard.

10 ticks
= 1 second
100 ticks
= 10 seconds
1000 ticks
= 100 seconds