# github/glb-director architecture

> Architecture diagram of the GitHub repository github/glb-director, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github/glb-director
- Repository: https://github.com/github/glb-director

## Overview

##### Project Type and Core Components

a. Core Components (from src/):
- glb-director: Main DPDK-based L4 load balancer
- glb-director-xdp: XDP-based implementation
- glb-healthcheck: Health monitoring system
- glb-redirect: Kernel module for packet redirection
- glb-hashing: Shared hashing implementation
- Supporting tools (wireshark-dissector, scapy-glb-gue)

##### Key Flows

- Incoming traffic flow (client → ECMP → GLB Director)
- GUE encapsulated traffic (GLB Director → L7 proxies)
- Health check communication (GLB Healthcheck ↔ L7 proxies)
- Return traffic (L7 proxies → client via DSR)

##### Specific Implementation Details

Technical elements specific to GLB:
- DPDK packet processing
- XDP processing alternative
- Rendezvous hashing mechanism
- Second chance forwarding
- GUE encapsulation

##### Component Relationships

Interactions between:
- GLB Director and routing infrastructure
- Health check system and proxy servers
- Director nodes and proxy servers
- Control plane configuration system

##### Additional Details

Annotations for:
- BGP announcement paths
- Configuration distribution
- Monitoring/metrics flow
- Health check paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Network Layer"
        CLIENT[Client Traffic]
        ECMP[ECMP Routing]:::router
        GLB1[GLB Director Node 1]:::director
        GLB2[GLB Director Node 2]:::director
    end

    subgraph "Processing Layer"
        DPDK[DPDK Processing]:::processing
        XDP[XDP Processing]:::processing
        HASH[Rendezvous Hashing]:::processing
        GUE[GUE Encapsulation]:::processing
        REDIRECT[GLB Redirect]:::processing
    end

    subgraph "Backend Layer"
        PROXY1[L7 Proxy 1]:::proxy
        PROXY2[L7 Proxy 2]:::proxy
        HEALTH[Health Check System]:::health
        DSR[Direct Server Return]:::processing
    end

    subgraph "Configuration & Tools"
        CONFIG[Configuration Store]:::config
        WIRESHARK[Wireshark Dissector]:::tools
        SCAPY[Scapy GLB GUE]:::tools
    end

    %% Flow Connections
    CLIENT --> ECMP
    ECMP --> GLB1 & GLB2
    GLB1 & GLB2 --> DPDK
    GLB1 & GLB2 --> XDP
    DPDK & XDP --> HASH
    HASH --> GUE
    GUE --> PROXY1 & PROXY2
    PROXY1 & PROXY2 --> DSR
    DSR -.-> CLIENT
    HEALTH <--> PROXY1 & PROXY2
    REDIRECT --> DSR
    CONFIG --> GLB1 & GLB2
    CONFIG --> HEALTH

    %% Click Events
    click GLB1 "https://github.com/github/glb-director/tree/master/src/glb-director/"
    click GLB2 "https://github.com/github/glb-director/tree/master/src/glb-director/"
    click XDP "https://github.com/github/glb-director/tree/master/src/glb-director-xdp/"
    click HEALTH "https://github.com/github/glb-director/tree/master/src/glb-healthcheck/"
    click REDIRECT "https://github.com/github/glb-director/tree/master/src/glb-redirect/"
    click HASH "https://github.com/github/glb-director/tree/master/src/glb-hashing/"
    click WIRESHARK "https://github.com/github/glb-director/tree/master/src/glb-wireshark-dissector/"
    click SCAPY "https://github.com/github/glb-director/tree/master/src/scapy-glb-gue/"
    click GUE "https://github.com/github/glb-director/blob/master/src/glb-hashing/glb_gue.h"
    click DPDK "https://github.com/github/glb-director/blob/master/src/glb-director/main.c"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef router fill:#ff9999,stroke:#333
    classDef director fill:#99ff99,stroke:#333
    classDef processing fill:#9999ff,stroke:#333
    classDef proxy fill:#ffff99,stroke:#333
    classDef health fill:#ff99ff,stroke:#333
    classDef config fill:#99ffff,stroke:#333
    classDef tools fill:#cccccc,stroke:#333

    %% Legend
    subgraph Legend
        L1[Router]:::router
        L2[Director Node]:::director
        L3[Processing Component]:::processing
        L4[Proxy Server]:::proxy
        L5[Health Check]:::health
        L6[Configuration]:::config
        L7[Tools]:::tools
    end
```
