# openstack/networking-baremetal architecture

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

- Interactive diagram: https://gitdiagram.com/openstack/networking-baremetal
- Repository: https://github.com/openstack/networking-baremetal

## Overview

##### Main Components

a. Core Components:
- ML2 Plugin Layer (networking_baremetal/plugins/ml2)
- Baremetal Mechanism Driver (baremetal_mech.py)
- Ironic Neutron Agent (networking_baremetal/agent)
- Device Drivers Layer (networking_baremetal/drivers)
- OpenConfig Interface (networking_baremetal/openconfig)

b. External Systems to Show:
- OpenStack Neutron
- OpenStack Ironic
- Physical Network Infrastructure
- Bare Metal Servers

##### Component Relationships

- Top Layer: OpenStack Services (Neutron, Ironic)
- Middle Layer: networking-baremetal components
- Bottom Layer: Physical Infrastructure

##### Key Flows

a. Control Flow:
- ML2 Plugin → Baremetal Mechanism Driver
- Mechanism Driver → Ironic Neutron Agent
- Agent → Device Drivers
- Device Drivers → Physical Network Infrastructure

b. Data Flow:
- Network Configuration Updates
- Port Status Changes
- VLAN/LACP Configuration
- OpenConfig Interface Communications

##### Specific Implementation Details

- Rectangle: Core services (Neutron, Ironic)
- Hexagon: Plugin components
- Diamond: Device drivers
- Rounded Rectangle: Physical infrastructure

##### Important Subsystems

a. OpenConfig Implementation:
- Interfaces
- LACP
- VLAN
- Network Instance

b. Device Driver Architecture:
- Base Driver
- NetConf Implementation
- OpenConfig Integration

##### Integration Points

With special connectors:
- Neutron ML2 Plugin Integration
- Ironic API Communication
- Message Queue Connections
- Physical Network Management

##### Additional Elements

Annotations for:
- Configuration Management
- Error Handling Paths
- Monitoring Points
- High Availability Components

Formatting Guidelines:

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef openstack fill:#3498db,stroke:#2980b9,color:white
    classDef plugin fill:#2ecc71,stroke:#27ae60,color:white
    classDef physical fill:#e67e22,stroke:#d35400,color:white
    classDef driver fill:#9b59b6,stroke:#8e44ad,color:white
    classDef interface fill:#1abc9c,stroke:#16a085,color:white

    %% OpenStack Services Layer
    subgraph OpenStack
        Neutron["OpenStack Neutron"]:::openstack
        Ironic["OpenStack Ironic"]:::openstack
    end

    %% Plugin Components Layer
    subgraph PluginComponents
        ML2["ML2 Plugin Layer"]:::plugin
        BMDriver["Baremetal Mechanism Driver"]:::plugin
        IronicAgent["Ironic Neutron Agent"]:::plugin
        IronicClient["Ironic Client"]:::plugin
    end

    %% Device Drivers Layer
    subgraph Drivers
        DevDrivers["Device Drivers Layer"]:::driver
        BaseDriver["Base Driver"]:::driver
        NetConfImpl["NetConf Implementation"]:::driver
    end

    %% OpenConfig Interface Layer
    subgraph OpenConfig
        OCInterface["OpenConfig Interface"]:::interface
        Interfaces["Interfaces"]:::interface
        LACP["LACP"]:::interface
        VLAN["VLAN"]:::interface
        NetworkInstance["Network Instance"]:::interface
    end

    %% Physical Infrastructure Layer
    subgraph Physical
        PhysNetwork["Physical Network Infrastructure"]:::physical
        BareMetalServers["Bare Metal Servers"]:::physical
    end

    %% Relationships
    Neutron --> ML2
    ML2 --> BMDriver
    BMDriver --> IronicAgent
    IronicAgent --> DevDrivers
    IronicAgent --> IronicClient
    IronicClient --> Ironic
    DevDrivers --> BaseDriver
    DevDrivers --> NetConfImpl
    NetConfImpl --> OCInterface
    OCInterface --> Interfaces
    OCInterface --> LACP
    OCInterface --> VLAN
    OCInterface --> NetworkInstance
    DevDrivers --> PhysNetwork
    PhysNetwork --> BareMetalServers

    %% Click events for component mapping
    click ML2 "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/plugins/ml2/"
    click BMDriver "https://github.com/openstack/networking-baremetal/blob/master/networking_baremetal/plugins/ml2/baremetal_mech.py"
    click IronicAgent "https://github.com/openstack/networking-baremetal/blob/master/networking_baremetal/agent/ironic_neutron_agent.py"
    click DevDrivers "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/drivers/"
    click OCInterface "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/openconfig/"
    click Interfaces "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/openconfig/interfaces/"
    click LACP "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/openconfig/lacp/"
    click VLAN "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/openconfig/vlan/"
    click NetworkInstance "https://github.com/openstack/networking-baremetal/tree/master/networking_baremetal/openconfig/network_instance/"
    click NetConfImpl "https://github.com/openstack/networking-baremetal/blob/master/networking_baremetal/drivers/netconf/openconfig.py"
    click BaseDriver "https://github.com/openstack/networking-baremetal/blob/master/networking_baremetal/drivers/base.py"
    click IronicClient "https://github.com/openstack/networking-baremetal/blob/master/networking_baremetal/ironic_client.py"

    %% Legend
    subgraph Legend
        L1["OpenStack Services"]:::openstack
        L2["Plugin Components"]:::plugin
        L3["Physical Infrastructure"]:::physical
        L4["Device Drivers"]:::driver
        L5["OpenConfig Interface"]:::interface
    end
```
