-
Notifications
You must be signed in to change notification settings - Fork 0
System Architecture
Marc Sanchis edited this page Jun 5, 2025
·
1 revision
Comprehensive overview of the Hyperloop UPV Control Station architecture, components, and design principles.
The Control Station follows a distributed, real-time architecture designed for safety, reliability, and scalability.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Hyperloop UPV Control Station β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββ¬ββββββββββββββββββββββ€
β Frontend Layer β Backend Layer β Hardware Layer β
β β β β
β βββββββββββββββββ β βββββββββββββββββββ β βββββββββββββββββ β
β β Control β β β β β β Pod Sensors β β
β β Station ββββΌββΊβ Go Backend ββββΌββΊβ & Boards β β
β β (React) β β β Server β β β β β
β βββββββββββββββββ β β β β βββββββββββββββββ β
β β β βββββββββββββββ β β β
β βββββββββββββββββ β β β WebSocket β β β βββββββββββββββββ β
β β Ethernet β β β β Server β β β β Network β β
β β View ββββΌββΊβ βββββββββββββββ ββββΌββΊβ Infrastructureβ β
β β (React) β β β β β β β β
β βββββββββββββββββ β β βββββββββββββββ β β βββββββββββββββββ β
β β β β Data Logger β β β β
β βββββββββββββββββ β β β & Storage β β β βββββββββββββββββ β
β β Common β β β βββββββββββββββ β β β TFTP Servers β β
β β Components β β βββββββββββββββββββ β β (Firmware) β β
β β (Library) β β β βββββββββββββββββ β
β βββββββββββββββββ β β β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββ΄ββββββββββββββββββββββ
- Sub-millisecond response for critical operations
- Concurrent processing using Go goroutines
- Efficient data structures for high-throughput scenarios
- Memory-mapped I/O for optimal performance
- Fail-safe design with automatic fallbacks
- Comprehensive error handling and recovery
- Data validation at every layer
- Redundant communication paths
- Microservice-like backend components
- Plugin-based board management
- Configurable ADJ specifications
- Horizontal scaling capabilities
- Native builds for Windows, macOS, and Linux
- Container support for deployment flexibility
- Consistent APIs across platforms
Frontend Applications
βββ common-front/ # Shared component library
β βββ components/ # Reusable UI components
β βββ hooks/ # Custom React hooks
β βββ stores/ # State management
β βββ adapters/ # Data transformation
β βββ services/ # Business logic
β
βββ control-station/ # Main operational interface
β βββ pages/ # Route components
β βββ components/ # App-specific components
β βββ assets/ # Static resources
β
βββ ethernet-view/ # Network debugging interface
βββ components/ # Network monitoring UI
βββ services/ # Network analysis logic
βββ utils/ # Utility functions
Layer | Technology | Purpose |
---|---|---|
Framework | React 18 | Component-based UI |
Language | TypeScript | Type safety and developer experience |
Build Tool | Vite | Fast development and building |
State Management | Redux Toolkit, Zustand | Global and local state |
Styling | SCSS Modules | Component-scoped styling |
Communication | WebSocket, Fetch API | Real-time and HTTP communication |
User Interaction β Component β Hook β Store β WebSocket β Backend
β
User Interface β Component β Hook β Store β WebSocket β Backend
Backend Server (Go)
βββ cmd/ # Application entry point
β βββ main.go # Server initialization
β βββ config.go # Configuration management
β βββ adj/ # ADJ specifications
β
βββ pkg/ # Core packages
β βββ transport/ # Network communication
β βββ broker/ # Message routing
β βββ vehicle/ # Pod management
β βββ boards/ # Board abstractions
β βββ logger/ # Data logging
β βββ websocket/ # WebSocket handling
β
βββ internal/ # Internal utilities
βββ common/ # Shared utilities
βββ pod_data/ # Pod data models
βββ update_factory/ # Update management
- TCP/UDP communication with pod boards
- Packet parsing and validation
- Protocol abstraction
- Network error handling
- Message routing between components
- Topic-based communication
- WebSocket client management
- Request/response handling
- Pod state coordination
- Board lifecycle management
- Safety monitoring
- Command dispatching
- Individual board handlers
- BLCU firmware management
- Board-specific protocols
- Status monitoring
Main Goroutine
βββ HTTP Server Goroutine
βββ WebSocket Pool Goroutine
βββ Transport Handlers
β βββ TCP Client Goroutines (per board)
β βββ TCP Server Goroutine
β βββ Packet Sniffer Goroutine
βββ Broker Workers
β βββ Topic Handlers (per topic)
β βββ Message Router Goroutine
βββ Logger Goroutines (per log type)
Pod Sensors β Ethernet β Backend Parser β Data Validation β
Business Logic β State Updates β WebSocket β Frontend Display
β
Data Logger β CSV Files β Analysis Tools
type Measurement struct {
ID uint16 `json:"id"`
Name string `json:"name"`
Value float64 `json:"value"`
Unit string `json:"unit"`
Timestamp time.Time `json:"timestamp"`
BoardID string `json:"board_id"`
}
type Board struct {
Name string `json:"name"`
ID uint16 `json:"id"`
Address string `json:"address"`
Packets []PacketSpec `json:"packets"`
Orders []OrderSpec `json:"orders"`
}
type Packet struct {
ID uint16 `json:"id"`
Timestamp time.Time `json:"timestamp"`
Data []byte `json:"data"`
Source string `json:"source"`
BoardID string `json:"board_id"`
}
Control Station (192.168.0.0/24)
β (Ethernet + WiFi backup)
Router/Switch
β (NAP Wireless Bridge)
Vehicle Network (192.168.1.0/24)
β (NAP Wireless Bridge)
Booster Network (192.168.2.0/24)
Layer | Protocol | Purpose |
---|---|---|
Application | WebSocket, HTTP, TFTP | User interface and file transfer |
Transport | TCP, UDP | Reliable and fast communication |
Network | IPv4 | Internet protocol |
Data Link | Ethernet, WiFi | Physical connectivity |
Physical | Cat6, 5GHz Radio | Hardware layer |
- UDP multicast for sensor data
- WebSocket for frontend updates
- Binary protocols for efficiency
- TCP for reliable order delivery
- Acknowledgment patterns for safety
- Timeout and retry mechanisms
- TFTP for firmware updates
- HTTP for configuration files
- WebSocket for progress updates
βββββββββββββββββββββββββββββββββββββββββββ
β Security Layers β
βββββββββββββββββββββββββββββββββββββββββββ€
β 7. Application Security β
β β’ Input validation β
β β’ Authentication & authorization β
βββββββββββββββββββββββββββββββββββββββββββ€
β 6. Data Security β
β β’ Encryption at rest β
β β’ Secure data transmission β
βββββββββββββββββββββββββββββββββββββββββββ€
β 5. Network Security β
β β’ WPA2 encryption β
β β’ Network segmentation β
βββββββββββββββββββββββββββββββββββββββββββ€
β 4. System Security β
β β’ OS hardening β
β β’ Service isolation β
βββββββββββββββββββββββββββββββββββββββββββ€
β 3. Physical Security β
β β’ Secure hardware access β
β β’ Cable management β
βββββββββββββββββββββββββββββββββββββββββββ
- Network Isolation: Separate VLANs for different systems
- Access Control: Role-based permissions
- Data Validation: Input sanitization and validation
- Secure Communication: TLS/SSL for sensitive data
- Audit Logging: Comprehensive security event logging
Operation | Target Latency | Maximum Latency |
---|---|---|
Sensor Data Display | < 100ms | 200ms |
Emergency Commands | < 50ms | 100ms |
Status Updates | < 200ms | 500ms |
File Operations | N/A | 30s |
Data Type | Rate | Bandwidth |
---|---|---|
Sensor Data | 1000 measurements/sec | ~100 KB/s |
Video Streams | 30 FPS | ~5 MB/s |
Command Traffic | 10 commands/sec | ~1 KB/s |
Log Data | 100 entries/sec | ~10 KB/s |
- Concurrent Users: 10+ operators
- Board Support: 20+ boards simultaneously
- Data Retention: 30+ days of logs
- Network Nodes: 50+ devices
The ADJ system provides dynamic configuration for:
# Example ADJ Structure
boards:
VCU:
id: 0x01
address: "192.168.1.101"
packets:
- id: 0x100
name: "speed_measurement"
fields: ["speed", "acceleration"]
orders:
- id: 0x200
name: "emergency_brake"
fields: ["force_level"]
measurements:
speed:
unit: "m/s"
range: [0, 150]
precision: 0.1
# config.toml
[network]
backend_ip = "192.168.0.9"
backend_port = 8080
[vehicle.boards]
VCU = true
PCU = true
TCU = true
BLCU = true
[adj]
branch = "main"
auto_update = true
- Local development with hot reloading
- Mock data sources for testing
- Containerized services for consistency
- Automated testing with CI/CD
- Integration testing with real hardware
- Performance testing under load
- High availability deployment
- Load balancing for multiple instances
- Monitoring and alerting
- Backup and recovery systems
- Pod Vehicle Networks: Real-time sensor integration
- Safety Systems: Emergency shutdown integration
- Timing Systems: Competition timing integration
- Data Analysis: Post-processing and analytics
- REST API: Configuration and status queries
- WebSocket API: Real-time data streaming
- TFTP Interface: Firmware management
- File System: Log and configuration management
- Performance metrics: Latency, throughput, error rates
- Resource utilization: CPU, memory, network, disk
- Business metrics: Operations completed, data quality
- Security metrics: Access attempts, anomalies
- Structured logging with consistent formats
- Log levels: Debug, Info, Warn, Error, Fatal
- Log aggregation for analysis
- Real-time monitoring and alerting
- Backend Architecture - Detailed Go backend design
- Frontend Architecture - React application structure
- Network Overview - Complete network design
- Development Environment Setup - Getting started
ποΈ Architecture Overview Complete
This system architecture provides the foundation for safe, reliable, and high-performance hyperloop pod operations. For detailed implementation guides, explore the related documentation links above.