# ripe-ncc/ripe-atlas-software-probe architecture

> Architecture diagram of the GitHub repository ripe-ncc/ripe-atlas-software-probe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ripe-ncc/ripe-atlas-software-probe
- Repository: https://github.com/ripe-ncc/ripe-atlas-software-probe

## Overview

Overview:
This project is the RIPE Atlas Software Probe—a network measurement agent whose purpose is to be built and deployed in multiple formats: RPM packages (for Oracle EL8/EL9 and Rocky Linux 9), DEB packages (for Debian 11/12), and OpenWRT packages (for OpenWRT 22.03). The probe’s role is to run on target systems, gather measurements (and optionally send interface traffic statistics), and communicate over TCP ports 2023 and 8080. It also integrates with an external registration service via its public key at /etc/ripe-atlas/probe_key.pub.

##### Build & Packaging Infrastructure
- Docker Containers: Represent the role of the .gitlab-docker directory, which includes Dockerfiles for different base distributions (debian11, debian12, ol8, etc.). These containers provide a controlled build environment for generating packages.
- Build Scripts & Makefiles: Include components like Makefile.am at the project root, bin/Makefile.am, config/Makefile.am, and various custom shell scripts within bin/arch/* that drive the build and customization of the probe.

##### Probe Core and Supporting Modules
- Core Probe Logic: Indicate the main execution and probe scripts such as bin/ripe-atlas.in, along with the several shell scripts in bin/arch/* that encapsulate the probe’s platform-specific functions (e.g., debian-sw-probe and openwrt versions).
- Library and Configuration Files: It is useful to show where shared scripts and libraries reside. For example, files like atlas_log.lib.sh, class.lib.sh, json.lib.sh, and reginit.sh.in provide core functionalities and initialization routines.
- Busybox Integration: Note the "probe-busybox" directory. It contains modifications and additions to the busybox source tree, including core utilities, networking components, and additional tooling that are used on constrained environments (for example, on OpenWRT).

##### Configuration & Deployment
- Runtime Configuration: Include the config directory, where configuration files (and templates with .in suffixes) are stored. Emphasize that runtime options (like enabling traffic statistics via /etc/ripe-atlas/config.txt) are part of the probe’s operational behavior.
- Security & Registration: Mark the usage of the public key (/etc/ripe-atlas/probe_key.pub) and indicate the probe registration process via the external URL.

##### Relationships and Data Flow
- Runtime Flow: Indicate that once the package is deployed, the probe reads its configuration (located in /etc/ripe-atlas) and then operates using its network ports 2023 and 8080 to perform measurements and communicate with the central Atlas service.

- Branch out into two main sections: (a) Build & Packaging Infrastructure and (b) Probe Core Execution.
- Under Build & Packaging:
– List Docker Build Environments (.gitlab-docker) targeting multiple OS distributions.
– Show the packaging branches (debian, rhel, openwrt, and .repo configuration) and their relationships to the build scripts (Makefiles, shell scripts in bin, config templates).
- Under Probe Core Execution:
– Illustrate core probe components (located in bin/, along with shared libraries such as atlas_log.lib.sh and others).
– Include a sub-node representing Busybox Customizations (probe-busybox), highlighting that these modifications are used to tailor the probe for certain platforms.
– Sketch out the configuration files (config/) and indicate the external aspects like key registration and runtime configurations.

Summary and Best Practices:
- To show both the offline build processes (Docker-based environments, packaging configuration) and the runtime operations (probe configuration, network communications, registration with RIPE Atlas).

## Diagram (Mermaid)

```mermaid
flowchart TD
    root["RIPE Atlas Software Probe Project"]:::project

    subgraph "Build & Packaging Infrastructure"
        direction TB
        docker["Docker Build Environments"]:::build
        subgraph "Packaging Configurations"
            direction TB
            repo[".repo Directory"]:::build
            deb["Debian Packaging (debian)"]:::build
            rhel["RPM Packaging (rhel)"]:::build
            openwrt_pc["OpenWRT Packaging (openwrt)"]:::build
        end
        subgraph "Build Scripts & Makefiles"
            direction TB
            mf_root["Makefile.am (Root)"]:::build
            mf_bin["bin/Makefile.am"]:::build
            mf_config["config/Makefile.am"]:::build
            arch_debian["bin/arch/debian-sw-probe"]:::build
            arch_openwrt["bin/arch/openwrt"]:::build
        end
    end

    subgraph "Probe Core Execution"
        direction TB
        coreLogic["Core Probe Logic (bin/ripe-atlas.in)"]:::runtime
        subgraph "Shared Libraries"
            direction TB
            lib_log["atlas_log.lib.sh"]:::runtime
            lib_class["class.lib.sh"]:::runtime
            lib_json["json.lib.sh"]:::runtime
            lib_reginit["reginit.sh.in"]:::runtime
        end
        busybox["Busybox Customizations"]:::runtime
        config_runtime["Runtime Configuration (config/)"]:::config
        registration["Registration & Security (Public Key)"]:::config
        network["Network Communication (TCP:2023,8080)"]:::runtime
    end

    root --> docker
    root --> repo
    root --> mf_root
    root --> coreLogic
    docker --> repo
    repo --> deb
    repo --> rhel
    repo --> openwrt_pc
    mf_root --> mf_bin
    mf_bin --> mf_config
    mf_config --> arch_debian
    mf_config --> arch_openwrt
    coreLogic --> lib_log
    coreLogic --> lib_class
    coreLogic --> lib_json
    coreLogic --> lib_reginit
    coreLogic --> busybox
    busybox --> config_runtime
    config_runtime --> registration
    registration --> network

    %% Click Events for Build & Packaging Infrastructure
    click docker "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/.gitlab-docker"
    click repo "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/.repo"
    click deb "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/debian"
    click rhel "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/rhel"
    click openwrt_pc "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/openwrt"
    click mf_root "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/Makefile.am"
    click mf_bin "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/Makefile.am"
    click mf_config "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/config/Makefile.am"
    click arch_debian "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/bin/arch/debian-sw-probe"
    click arch_openwrt "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/bin/arch/openwrt"

    %% Click Events for Probe Core and Supporting Modules
    click coreLogic "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/ripe-atlas.in"
    click lib_log "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/atlas_log.lib.sh"
    click lib_class "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/class.lib.sh"
    click lib_json "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/json.lib.sh"
    click lib_reginit "https://github.com/ripe-ncc/ripe-atlas-software-probe/blob/master/bin/reginit.sh.in"
    click busybox "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/probe-busybox"
    click config_runtime "https://github.com/ripe-ncc/ripe-atlas-software-probe/tree/master/config"

    %% Styles
    classDef project fill:#f9c,stroke:#333,stroke-width:2px;
    classDef build fill:#ccf,stroke:#333,stroke-width:2px;
    classDef runtime fill:#cfc,stroke:#333,stroke-width:2px;
    classDef config fill:#ffc,stroke:#333,stroke-width:2px;
```
