# openziti/ziti architecture

> Architecture diagram of the GitHub repository openziti/ziti, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openziti/ziti
- Repository: https://github.com/openziti/ziti

## Overview

##### Main Components Overview

a. Core Components:
- Controller (central management plane)
- Router (data plane)
- Edge Components (identity and security)
- Fabric (networking mesh)

b. Client Integration Methods:
- SDKs
- Tunnelers
- Proxies

##### Detailed Component Breakdown

a. Management Plane (Controller):
- REST API endpoints
- Authentication/Authorization
- Policy Management
- Configuration Store
- PKI/Certificate Management
- Database Layer

b. Data Plane (Router):
- Link Management
- Xgress (Cross-ingress) Handlers
- Forwarder
- Health Monitoring
- Metrics Collection

c. Edge Layer:
- Identity Management
- API Session Management
- Posture Checks
- Authentication Providers
- Policy Enforcement

d. Fabric Layer:
- Smart Routing
- Load Balancing
- Circuit Management
- Link State Management

##### Connection Flows

Key interactions:
- Control Channel (Controller ↔ Router)
- Data Channel (Router ↔ Router)
- Edge Authentication Flow
- Service Access Flow
- Certificate Distribution

##### Component Relationships

Key relationships:
- Controller to Router (control)
- Router to Router (mesh)
- Edge Router to Internal Services
- Client to Edge Router
- Service to Fabric Router

##### Security Layers

Security features:
- Certificate-based authentication
- Zero-trust enforcement points
- Dark service implementation
- End-to-end encryption paths
- Identity verification points

##### Integration Points

Integration options:
- SDK Integration
- Tunneler Connection
- Proxy Implementation
- Service Registration
- Client Authentication

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Management_Plane
        Controller["Controller"]:::controller
        REST["REST API"]:::api
        Auth["Authentication/Authorization"]:::security
        PolicyMgmt["Policy Management"]:::security
        ConfigStore["Configuration Store"]:::config
        PKI["PKI/Certificate Management"]:::security
        DB["Database Layer"]:::database
    end

    subgraph Data_Plane
        Router["Router"]:::router
        LinkMgmt["Link Management"]:::network
        Xgress["Xgress Handlers"]:::network
        Forwarder["Forwarder"]:::network
        Health["Health Monitoring"]:::monitor
        Metrics["Metrics Collection"]:::monitor
    end

    subgraph Edge_Layer
        IdentityMgmt["Identity Management"]:::security
        APISession["API Session Management"]:::api
        PostureChecks["Posture Checks"]:::security
        AuthProviders["Authentication Providers"]:::security
        PolicyEnforce["Policy Enforcement"]:::security
    end

    subgraph Fabric_Layer
        SmartRouting["Smart Routing"]:::network
        LoadBalance["Load Balancing"]:::network
        CircuitMgmt["Circuit Management"]:::network
        LinkState["Link State Management"]:::network
    end

    subgraph Integration_Points
        SDK["SDK Integration"]:::client
        Tunneler["Tunnelers"]:::client
        Proxy["Proxy Implementation"]:::client
    end

    %% Core Component Relationships
    Controller --> Router
    Router --> Router
    Router --> SmartRouting
    Controller --> PolicyMgmt
    PolicyMgmt --> PolicyEnforce
    
    %% Security Flow
    Auth --> IdentityMgmt
    PKI --> AuthProviders
    PostureChecks --> PolicyEnforce
    
    %% Data Flow
    Xgress --> Forwarder
    Forwarder --> LinkMgmt
    LinkMgmt --> LinkState
    
    %% Integration Flow
    SDK --> APISession
    Tunneler --> Router
    Proxy --> Router
    
    %% Management Flow
    REST --> Controller
    Controller --> DB
    ConfigStore --> Controller
    
    %% Monitoring Flow
    Health --> Metrics
    Router --> Health

    %% Component Mappings
    click Controller "https://github.com/openziti/ziti/tree/main/controller/"
    click REST "https://github.com/openziti/ziti/tree/main/controller/rest_server/"
    click DB "https://github.com/openziti/ziti/tree/main/controller/db/"
    click ConfigStore "https://github.com/openziti/ziti/tree/main/controller/config/"
    click PKI "https://github.com/openziti/ziti/tree/main/controller/oidc_auth/"
    click Router "https://github.com/openziti/ziti/tree/main/router/"
    click LinkMgmt "https://github.com/openziti/ziti/tree/main/router/link/"
    click Forwarder "https://github.com/openziti/ziti/tree/main/router/forwarder/"
    click Health "https://github.com/openziti/ziti/tree/main/router/health/"
    click IdentityMgmt "https://github.com/openziti/ziti/blob/main/controller/model/identity_manager.go"
    click Auth "https://github.com/openziti/ziti/blob/main/controller/model/authenticator.go"
    click PostureChecks "https://github.com/openziti/ziti/blob/main/controller/model/posture_check_model.go"
    click PolicyMgmt "https://github.com/openziti/ziti/blob/main/controller/model/service_policy_manager.go"
    click Xgress "https://github.com/openziti/ziti/tree/main/router/xgress/"
    click LinkState "https://github.com/openziti/ziti/tree/main/router/xlink/"
    click CircuitMgmt "https://github.com/openziti/ziti/blob/main/controller/model/circuit.go"
    click PKI "https://github.com/openziti/ziti/tree/main/common/cert/"
    click AuthProviders "https://github.com/openziti/ziti/blob/main/controller/model/auth_policy_model.go"
    click PolicyEnforce "https://github.com/openziti/ziti/blob/main/controller/model/edge_router_policy_model.go"
    click SDK "https://github.com/openziti/ziti/tree/main/ziti/cmd/edge/"
    click Tunneler "https://github.com/openziti/ziti/tree/main/tunnel/"
    click Proxy "https://github.com/openziti/ziti/tree/main/router/xgress_proxy/"

    classDef controller fill:#2374AB
    classDef router fill:#2374AB
    classDef security fill:#FFD700
    classDef network fill:#4CAF50
    classDef monitor fill:#FF7043
    classDef api fill:#9C27B0
    classDef database fill:#607D8B
    classDef config fill:#795548
    classDef client fill:#90A4AE
```
