Skip to content

System Architecture

Marc Sanchis edited this page Jun 5, 2025 · 1 revision

System Architecture

Comprehensive overview of the Hyperloop UPV Control Station architecture, components, and design principles.

πŸ—οΈ High-Level Architecture

The Control Station follows a distributed, real-time architecture designed for safety, reliability, and scalability.

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     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)     β”‚  β”‚                       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚                       β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Design Principles

1. Real-Time Performance

  • 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

2. Safety and Reliability

  • Fail-safe design with automatic fallbacks
  • Comprehensive error handling and recovery
  • Data validation at every layer
  • Redundant communication paths

3. Modularity and Scalability

  • Microservice-like backend components
  • Plugin-based board management
  • Configurable ADJ specifications
  • Horizontal scaling capabilities

4. Cross-Platform Compatibility

  • Native builds for Windows, macOS, and Linux
  • Container support for deployment flexibility
  • Consistent APIs across platforms

πŸ–₯️ Frontend Architecture

Component Structure

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

Technology Stack

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

Data Flow

User Interaction β†’ Component β†’ Hook β†’ Store β†’ WebSocket β†’ Backend
                                 ↓
User Interface ← Component ← Hook ← Store ← WebSocket ← Backend

βš™οΈ Backend Architecture

Core Components

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

Package Responsibilities

Transport Layer (pkg/transport/)

  • TCP/UDP communication with pod boards
  • Packet parsing and validation
  • Protocol abstraction
  • Network error handling

Broker System (pkg/broker/)

  • Message routing between components
  • Topic-based communication
  • WebSocket client management
  • Request/response handling

Vehicle Management (pkg/vehicle/)

  • Pod state coordination
  • Board lifecycle management
  • Safety monitoring
  • Command dispatching

Board Abstractions (pkg/boards/)

  • Individual board handlers
  • BLCU firmware management
  • Board-specific protocols
  • Status monitoring

Concurrency Model

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)

πŸ—„οΈ Data Architecture

Data Flow Pipeline

Pod Sensors β†’ Ethernet β†’ Backend Parser β†’ Data Validation β†’ 
Business Logic β†’ State Updates β†’ WebSocket β†’ Frontend Display
                    ↓
                Data Logger β†’ CSV Files β†’ Analysis Tools

Data Models

Measurement Data

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"`
}

Board Configuration

type Board struct {
    Name        string        `json:"name"`
    ID          uint16        `json:"id"`
    Address     string        `json:"address"`
    Packets     []PacketSpec  `json:"packets"`
    Orders      []OrderSpec   `json:"orders"`
}

Network Packet

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"`
}

🌐 Network Architecture

Physical Network Topology

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)

Protocol Stack

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

Communication Patterns

Real-Time Data Streaming

  • UDP multicast for sensor data
  • WebSocket for frontend updates
  • Binary protocols for efficiency

Command and Control

  • TCP for reliable order delivery
  • Acknowledgment patterns for safety
  • Timeout and retry mechanisms

File Operations

  • TFTP for firmware updates
  • HTTP for configuration files
  • WebSocket for progress updates

πŸ”’ Security Architecture

Multi-Layer Security

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           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                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Features

  • 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

πŸ“Š Performance Characteristics

Latency Requirements

Operation Target Latency Maximum Latency
Sensor Data Display < 100ms 200ms
Emergency Commands < 50ms 100ms
Status Updates < 200ms 500ms
File Operations N/A 30s

Throughput Specifications

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

Scalability Metrics

  • Concurrent Users: 10+ operators
  • Board Support: 20+ boards simultaneously
  • Data Retention: 30+ days of logs
  • Network Nodes: 50+ devices

πŸ”§ Configuration Management

ADJ (Board Specification) System

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

Environment Configuration

# 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

πŸš€ Deployment Architecture

Development Environment

  • Local development with hot reloading
  • Mock data sources for testing
  • Containerized services for consistency

Testing Environment

  • Automated testing with CI/CD
  • Integration testing with real hardware
  • Performance testing under load

Production Environment

  • High availability deployment
  • Load balancing for multiple instances
  • Monitoring and alerting
  • Backup and recovery systems

πŸ”— Integration Points

External Systems

  • Pod Vehicle Networks: Real-time sensor integration
  • Safety Systems: Emergency shutdown integration
  • Timing Systems: Competition timing integration
  • Data Analysis: Post-processing and analytics

APIs and Interfaces

  • REST API: Configuration and status queries
  • WebSocket API: Real-time data streaming
  • TFTP Interface: Firmware management
  • File System: Log and configuration management

πŸ“ˆ Monitoring and Observability

System Metrics

  • Performance metrics: Latency, throughput, error rates
  • Resource utilization: CPU, memory, network, disk
  • Business metrics: Operations completed, data quality
  • Security metrics: Access attempts, anomalies

Logging Strategy

  • Structured logging with consistent formats
  • Log levels: Debug, Info, Warn, Error, Fatal
  • Log aggregation for analysis
  • Real-time monitoring and alerting

πŸ”— Related Documentation


πŸ—οΈ 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.

Clone this wiki locally