# sonic-net/sonic-buildimage architecture

> Architecture diagram of the GitHub repository sonic-net/sonic-buildimage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sonic-net/sonic-buildimage
- Repository: https://github.com/sonic-net/sonic-buildimage

## Overview

SONiC is a network operating system with control-plane services and vendor-specific platform support for switch hardware. The sampled runtime illustrates health checks, platform thermal and reboot management, BGP allow-list configuration, authentication, and MLAG link handling. Source excerpts and the index support some internal calls, but do not establish a single end-to-end operator workflow; several capability links are therefore omitted or marked unverified.

Main entry points: [`platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py`](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py) (Reboot Causes), [`src/iccpd/src/mlacp_link_handler.c`](https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/src/mlacp_link_handler.c) (MLACP Link Handler), [`src/system-health/health_checker/manager.py`](https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/manager.py) (Health Manager), [`device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py`](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py) (E1031 Thermal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform Hardware"]
  node_platform_common["Platform Helpers<br/>[common.py]"]
  node_e1031_thermal["E1031 Thermal<br/>[thermal_manager.py]"]
  node_e1031_thermal_data["E1031 Thermal Data<br/>[thermal_infos.py]"]
  node_seastone_thermal["Seastone Thermal<br/>[thermal_manager.py]"]
  node_seastone_thermal_data["Seastone Thermal Data<br/>[thermal_infos.py]"]
  node_dell_thermal_data["Dell Thermal Data<br/>[thermal_info.py]"]
  node_reboot_manager["Reboot Causes"]
  node_adm1266["ADM1266 Driver<br/>[adm1266.py]"]
  node_dpm_base["DPM Base<br/>[dpm_base.py]"]
  node_dpm_syslog["DPM Syslog<br/>[syslog.py]"]
  node_mellanox_chassis["Mellanox Chassis<br/>[chassis.py]"]
end

subgraph group_control["Network Control"]
  node_bgp_allow["BGP Allow-list"]
  node_auth_client["Auth Client Mapping<br/>[auth_mgr_client.c]"]
  node_auth_header["Auth Client API<br/>[auth_mgr_client.h]"]
  node_comm_mask["Auth Comm Mask<br/>[comm_mask.h]"]
  node_mlacp_handler["MLACP Link Handler"]
  node_mlacp_header["MLACP API"]
  node_mlacp_csm["ICCP State Types<br/>[iccp_csm.h]"]
  node_mlacp_tlv["MLACP TLV Types<br/>[mlacp_tlv.h]"]
  node_wol["Wake-on-LAN<br/>[wol.rs]"]
end

subgraph group_health["System Health"]
  node_health_manager["Health Manager<br/>[manager.py]"]
  node_service_checker["Service Checker<br/>[service_checker.py]"]
  node_health_checker["Health Checker Base<br/>[health_checker.py]"]
end

subgraph group_shared["Shared Services"]
  node_device_info["Device Info<br/>[device_info.py]"]
  node_py_logger["Python Logger<br/>[logger.py]"]
  node_syslogger["System Logger<br/>[syslogger.py]"]
end

node_runtime(("SONiC Runtime"))

node_runtime -.->|"requests checks"| node_health_manager
node_health_manager -->|"runs check"| node_service_checker
node_health_manager -->|"uses base"| node_health_checker
node_platform_common -->|"reads device info"| node_device_info
node_e1031_thermal -->|"runs commands"| node_platform_common
node_e1031_thermal -->|"registers thermal data"| node_e1031_thermal_data
node_seastone_thermal -->|"registers thermal data"| node_seastone_thermal_data
node_reboot_manager -->|"creates driver"| node_adm1266
node_reboot_manager -->|"uses DPM interface"| node_dpm_base
node_reboot_manager -->|"logs warnings"| node_syslogger
node_auth_client -->|"implements API"| node_auth_header
node_auth_header -->|"includes definitions"| node_comm_mask
node_mlacp_handler -->|"implements API"| node_mlacp_header
node_mlacp_handler -->|"uses state types"| node_mlacp_csm
node_mlacp_handler -->|"uses TLV types"| node_mlacp_tlv
node_py_logger -->|"references syslog"| node_dpm_syslog

click node_platform_common "https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py"
click node_device_info "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/device_info.py"
click node_e1031_thermal "https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py"
click node_e1031_thermal_data "https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py"
click node_seastone_thermal "https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py"
click node_seastone_thermal_data "https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py"
click node_dell_thermal_data "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal_info.py"
click node_reboot_manager "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py"
click node_adm1266 "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/adm1266.py"
click node_dpm_base "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/dpm_base.py"
click node_dpm_syslog "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/syslog.py"
click node_mellanox_chassis "https://github.com/sonic-net/sonic-buildimage/blob/master/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py"
click node_bgp_allow "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py"
click node_auth_client "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/mapping/auth_mgr_client.c"
click node_auth_header "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/mapping/include/auth_mgr_client.h"
click node_comm_mask "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/common/comm_mask.h"
click node_mlacp_handler "https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/src/mlacp_link_handler.c"
click node_mlacp_header "https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/mlacp_link_handler.h"
click node_mlacp_csm "https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/iccp_csm.h"
click node_mlacp_tlv "https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/mlacp_tlv.h"
click node_health_manager "https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/manager.py"
click node_service_checker "https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/service_checker.py"
click node_health_checker "https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/health_checker.py"
click node_py_logger "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/logger.py"
click node_syslogger "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/syslogger.py"
click node_wol "https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-nettools/wol/src/wol.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_platform_common,node_e1031_thermal,node_e1031_thermal_data,node_seastone_thermal,node_seastone_thermal_data,node_dell_thermal_data,node_reboot_manager,node_adm1266,node_dpm_base,node_dpm_syslog,node_mellanox_chassis toneBlue
class node_bgp_allow,node_auth_client,node_auth_header,node_comm_mask,node_mlacp_handler,node_mlacp_header,node_mlacp_csm,node_mlacp_tlv,node_wol toneAmber
class node_health_manager,node_service_checker,node_health_checker toneMint
class node_device_info,node_py_logger,node_syslogger toneRose
class node_runtime toneIndigo
```

## Components

### Platform Hardware

- [Platform Helpers](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py): `device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py`
- [E1031 Thermal](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py): `device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py`
- [E1031 Thermal Data](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py): `device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py`
- [Seastone Thermal](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py): `device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py`
- [Seastone Thermal Data](https://github.com/sonic-net/sonic-buildimage/blob/master/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py): `device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py`
- [Dell Thermal Data](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal_info.py): `platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal_info.py`
- [Reboot Causes](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py): `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py`
- [ADM1266 Driver](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/adm1266.py): `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/adm1266.py`
- [DPM Base](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/dpm_base.py): `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/dpm_base.py`
- [DPM Syslog](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/syslog.py): `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/syslog.py`
- [Mellanox Chassis](https://github.com/sonic-net/sonic-buildimage/blob/master/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py): `platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py`

### Network Control

- [BGP Allow-list](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py): `src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py`
- [Auth Client Mapping](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/mapping/auth_mgr_client.c): `src/sonic-pac/authmgr/mapping/auth_mgr_client.c`
- [Auth Client API](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/mapping/include/auth_mgr_client.h): `src/sonic-pac/authmgr/mapping/include/auth_mgr_client.h`
- [Auth Comm Mask](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-pac/authmgr/common/comm_mask.h): `src/sonic-pac/authmgr/common/comm_mask.h`
- [MLACP Link Handler](https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/src/mlacp_link_handler.c): `src/iccpd/src/mlacp_link_handler.c`
- [MLACP API](https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/mlacp_link_handler.h): `src/iccpd/include/mlacp_link_handler.h`
- [ICCP State Types](https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/iccp_csm.h): `src/iccpd/include/iccp_csm.h`
- [MLACP TLV Types](https://github.com/sonic-net/sonic-buildimage/blob/master/src/iccpd/include/mlacp_tlv.h): `src/iccpd/include/mlacp_tlv.h`
- [Wake-on-LAN](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-nettools/wol/src/wol.rs): `src/sonic-nettools/wol/src/wol.rs`

### System Health

- [Health Manager](https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/manager.py): `src/system-health/health_checker/manager.py`
- [Service Checker](https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/service_checker.py): `src/system-health/health_checker/service_checker.py`
- [Health Checker Base](https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/health_checker/health_checker.py): `src/system-health/health_checker/health_checker.py`

### Shared Services

- [Device Info](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/device_info.py): `src/sonic-py-common/sonic_py_common/device_info.py`
- [Python Logger](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/logger.py): `src/sonic-py-common/sonic_py_common/logger.py`
- [System Logger](https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-py-common/sonic_py_common/syslogger.py): `src/sonic-py-common/sonic_py_common/syslogger.py`

### Other components

- **SONiC Runtime**

## Connections

- SONiC Runtime → Health Manager: requests checks
- Health Manager → Service Checker: runs check (evidence: `src/system-health/health_checker/manager.py`)
- Health Manager → Health Checker Base: uses base (evidence: `src/system-health/health_checker/manager.py`)
- Platform Helpers → Device Info: reads device info (evidence: `device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py`)
- E1031 Thermal → Platform Helpers: runs commands (evidence: `device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py`)
- E1031 Thermal → E1031 Thermal Data: registers thermal data (evidence: `device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py`)
- Seastone Thermal → Seastone Thermal Data: registers thermal data (evidence: `device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py`)
- Reboot Causes → ADM1266 Driver: creates driver (evidence: `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py`)
- Reboot Causes → DPM Base: uses DPM interface (evidence: `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py`)
- Reboot Causes → System Logger: logs warnings (evidence: `platform/broadcom/sonic-platform-modules-nexthop/common/sonic_platform/reboot_cause_manager.py`)
- Auth Client Mapping → Auth Client API: implements API (evidence: `src/sonic-pac/authmgr/mapping/auth_mgr_client.c`)
- Auth Client API → Auth Comm Mask: includes definitions (evidence: `src/sonic-pac/authmgr/mapping/include/auth_mgr_client.h`)
- MLACP Link Handler → MLACP API: implements API (evidence: `src/iccpd/src/mlacp_link_handler.c`)
- MLACP Link Handler → ICCP State Types: uses state types (evidence: `src/iccpd/src/mlacp_link_handler.c`)
- MLACP Link Handler → MLACP TLV Types: uses TLV types (evidence: `src/iccpd/src/mlacp_link_handler.c`)
- Python Logger → DPM Syslog: references syslog (evidence: `src/sonic-py-common/sonic_py_common/logger.py`)
