Skip to main content
Loading navigation

Build a Sparkplug B Industrial Subnet Outage Diagnosis Sandbox — implementation

Prompt source

implementation93 lines11 sectionsNo variables1 code block
## Build
Analyze simulated Sparkplug B network heartbeat packets and historical broker disconnects to pinpoint subnet failures. Construct isolated recovery scripts for plant automation technicians.

## User
Industrial Network Engineer

## Workflow
1. Process Sparkplug B DDATA metric updates and broker disconnect telemetry logs.
2. Correlate metric latency spikes with switch VLAN mappings to diagnose subnet segmentation.
3. Simulate recovery sequences verifying that DDATA resume flags conform to Sparkplug v3.0 specs.
4. Generate an outage diagnostic report with recommended physical link tests.

## Interface
Interactive network timeline displaying packet drops, affected device groups, and a terminal-style recovery runbook.

## Data
JSON-serialized logs of MQTT Sparkplug payloads containing timestamps, metric names, values, and diagnostic codes.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Eclipse Sparkplug](https://raw.githubusercontent.com/eclipse-sparkplug/sparkplug/master/README.md)
Utilizes Sparkplug specification guidelines for metric properties, DDATA sequence validation, and state recovery.

## Tools
dspy, pydantic, pytest.
DSPy compiles robust prompt pipelines to extract diagnostic indicators from noisy metric drop logs without hallucination.
Fast hosted or local model capable of prompt-compiled logical deductions over network time-series.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Correctly isolates faulty subnets based on clustered DDATA message dropouts.
- Verifies message sequence numbers before declaring network stability.
- Outputs actionable recovery verification steps with zero hallucinated IPs.

## Starter Examples
```json
[
  {
    "input": {
      "subnet": "192.168.10.0/24",
      "devices": [
        "DEV-PLC-101",
        "DEV-RIO-102"
      ],
      "events": [
        {
          "device": "DEV-PLC-101",
          "event": "METRIC_TIMEOUT",
          "last_seq": 140,
          "timestamp": "10:14:22"
        },
        {
          "device": "DEV-RIO-102",
          "event": "METRIC_TIMEOUT",
          "last_seq": 98,
          "timestamp": "10:14:25"
        }
      ],
      "gateway_status": "UNREACHABLE"
    },
    "expected_output": {
      "fault_type": "SUBDOMAIN_GATEWAY_DOWN",
      "isolated_segment": "192.168.10.0/24",
      "affected_devices": [
        "DEV-PLC-101",
        "DEV-RIO-102"
      ],
      "recovery_action": "Cycle VLAN 10 gateway interface and monitor NBIRTH sequence initialization."
    }
  },
  {
    "input": {
      "subnet": "192.168.20.0/24",
      "devices": [
        "DEV-PLC-201"
      ],
      "events": [
        {
          "device": "DEV-PLC-201",
          "event": "METRIC_SPORADIC",
          "last_seq": 501,
          "timestamp": "11:00:10"
        }
      ],
      "gateway_status": "REACHABLE"
    },
    "expected_output": {
      "fault_type": "SINGLE_NODE_CABLE_FAULT",
      "isolated_segment": "DEV-PLC-201 Port 1",
      "affected_devices": [
        "DEV-PLC-201"
      ],
      "recovery_action": "Inspect RJ45 termination on DEV-PLC-201; gateway communication healthy."
    }
  }
]
```

## Safety
Read-only network diagnostic synthesis; all proposed recovery scripts require technician validation.
Use mock external writes. Require human review before any real deployment.