Files
projectmycelium/specs/mycelium_gw.md
2025-09-01 21:37:01 -04:00

4.6 KiB

Mycelium Gateways (MGW)

Mycelium Gateways are critical infrastructure components that bridge the Mycelium network with the public internet, functioning as reverse proxies that enable bidirectional connectivity between TF Grid resources and the outside world.

Core Principles

  • Decentralized Access: Distributed gateway network with no single point of failure
  • Low Latency: Optimized routing for minimal connection delays
  • Scalability: Designed to support thousands of interconnected gateways
  • Flexibility: Compatible with both Mycelium Names and traditional DNS
  • Fair Pricing: TFP Points-based billing for actual bandwidth consumed

How It Works

  • Reverse Proxy Functionality:

    • Acts as an intermediary between the public internet and the Mycelium network
    • Routes incoming requests to the appropriate slice or service
    • Forwards outgoing traffic from slices to the internet
    • Provides protocol translation where necessary
  • Connectivity Options:

    • Can be attached to Mycelium Names for seamless integration
    • Works with existing DNS names for compatibility with traditional systems
    • Supports multiple domains and subdomains per gateway
    • Enables both HTTP/HTTPS and TCP/UDP traffic
  • Network Architecture:

    • Thousands of gateways distributed globally
    • Interconnected mesh topology for redundancy
    • Automatic routing to nearest gateway for optimal performance
    • Load balancing across multiple gateways for high-traffic services

TFP Exchange Mechanism

  • Suppliers: Gateway providers offering internet connectivity
  • Consumers: Users requiring internet access for their resources
  • Billing Model:
    • Pay-per-use based on actual bandwidth consumed
    • Measured in both incoming and outgoing traffic
    • Tiered pricing possible based on quality of service
    • TFP Points flow directly from consumers to gateway providers

Technical Specifications

  • Performance:

    • High-throughput connections
    • Low-latency routing
    • Automatic failover between gateways
    • DDoS protection capabilities
  • Security Features:

    • TLS termination
    • Traffic filtering
    • Rate limiting
    • Access control lists
  • Management Interface:

    • Create and delete gateway configurations
    • Monitor traffic and performance
    • Configure routing rules
    • Set up domain mappings

Use Cases

  • Web Applications:

    • Expose web services running on slices to the internet
    • Host websites with custom domains
    • Provide API endpoints for external consumption
  • IoT Connectivity:

    • Connect IoT devices to services running on the TF Grid
    • Aggregate and process data from distributed sensors
    • Provide secure command and control channels
  • Enterprise Connectivity:

    • Secure access to private resources on the TF Grid
    • Extend corporate networks with sovereign infrastructure
    • Create hybrid deployments spanning traditional and TF Grid resources

Benefits

  • Sovereignty: Control over your internet access points
  • Resilience: Multiple gateways ensure continuous connectivity
  • Performance: Low-latency connections through optimal routing
  • Cost-Efficiency: Pay only for bandwidth actually consumed
  • Simplicity: Easy configuration and management

Network Visualization

graph TD
    subgraph Internet
        DNS[DNS System]
        Web[Web Users]
        API[API Clients]
    end
    
    subgraph "Mycelium Gateway Network"
        MGW1[Mycelium Gateway 1]
        MGW2[Mycelium Gateway 2]
        MGW3[Mycelium Gateway 3]
        MGW4[Mycelium Gateway 4]
        MGW5[Mycelium Gateway 5]
        MGW6[Mycelium Gateway 6]
        
        MGW1 --- MGW2
        MGW2 --- MGW3
        MGW3 --- MGW4
        MGW4 --- MGW5
        MGW5 --- MGW6
        MGW6 --- MGW1
        MGW1 --- MGW4
        MGW2 --- MGW5
        MGW3 --- MGW6
    end
    
    subgraph "Mycelium Network (TF Grid)"
        MN[Mycelium Network]
        
        subgraph "Compute Slices"
            S1[Web Server Slice]
            S2[Database Slice]
            S3[Application Slice]
            S4[Storage Slice]
        end
        
        MN --- S1
        MN --- S2
        MN --- S3
        MN --- S4
    end
    
    Web --> MGW1
    API --> MGW3
    DNS --> MGW1
    DNS --> MGW3
    
    MGW1 --> MN
    MGW2 --> MN
    MGW3 --> MN
    MGW4 --> MN
    MGW5 --> MN
    MGW6 --> MN
    
    classDef gateway fill:#f96,stroke:#333,stroke-width:2px;
    classDef slice fill:#9cf,stroke:#333,stroke-width:1px;
    classDef internet fill:#fcf,stroke:#333,stroke-width:1px;
    
    class MGW1,MGW2,MGW3,MGW4,MGW5,MGW6 gateway;
    class S1,S2,S3,S4 slice;
    class Web,API,DNS internet;