Crates.io | phaseblade |
lib.rs | phaseblade |
version | 0.1.0 |
source | src |
created_at | 2024-11-19 14:44:28.934753 |
updated_at | 2024-11-19 14:44:28.934753 |
description | A deterministic real-time network simulator with cycle-accurate RTOS-like task scheduling for protocol evaluation |
homepage | |
repository | |
max_upload_size | |
id | 1453352 |
size | 609,331 |
A deterministic real-time network simulator built around a cycle-accurate time-triggered execution model. The simulation engine orchestrates network nodes through precise cycle counts, with each node implementing an RTOS-like preemptive task scheduler that maps configurable cycle counts to local ticks. Nodes maintain independent local time with configurable drift factors, enabling precise evaluation of TDMA protocols and time synchronization algorithms through reproducible network experiments. The platform includes real-time visualization via a React/Electron UI.
Cycles: The fundamental timing unit broadcasted by the simulation engine
Ticks: Node-level scheduling unit that drives the RTOS task scheduler
Local Clock: Node-level time representation that simulates real clock
The core RTOS functionality is implemented through a set of composable traits:
Engine: Central orchestrator that manages network simulation
Node: Network node with RTOS capabilities
Task: Preemptable execution unit
Message: Inter-task communication
Packet: Network communication
Node 1 Node 2
+-----------+ +-----------+
| Tasks | | Tasks |
| App (L) | | App (L) |
| Net (N) | | Net (N) |
| MAC (H) | | MAC (H) |
| TDMA (C) | | TDMA (C) |
+-----------+ +-----------+
↑↓ ↑↓
+-----------+ +-----------+
| Mailboxes | | Mailboxes |
+-----------+ +-----------+
↑↓ ↑↓
+-----------+ +-----------+
| Packet | | Packet |
| I/O Queue | | I/O Queue |
+-----------+ +-----------+
| |
| +------------------+ |
| | Engine | |
| | - Cycle Counter | |
| | - Packet Transit | |
| | - Timing Control | |
| +------------------+ |
| ↑↓ |
+--------------------------+
Node Internal (Detail)
+-----------------------+
| Task Management |
| - Task Registry |
| - Priority Scheduling |
| - Message Routing |
+-----------------------+
↑↓
+-----------------------+
| Tick Scheduler |
| - Cycle to Tick Map |
| - Execution Schedule |
| - Preemption Control |
+-----------------------+
↑↓
+-----------------------+
| System Time & I/O |
| - Local Clock w/Drift |
| - Packet Queues |
| - Resource Control |
+-----------------------+
Phaseblade aims to be a modern network simulation platform that enables:
Core Platform [WIP]:
Time-Sensitive Networking:
Protocol Development:
Security & Reliability:
Network Research: