Skip to main content

TRIAGE/4 core scheduling package for priority-aware IoT message serving

Project description

TRIAGE/4

LES2 Banner

PyPI version Python versions Jupyter Notebook License: MIT

TRIAGE/4 (Tiered Resource Allocation for IoT Alarm and Geographic-priority Emergency) is a four-band message scheduler designed for distributed IoT emergency monitoring networks.

It resolves the classic priority inversion conflict between geographic zone priorities (e.g., routine telemetry from high-priority zones delaying critical emergency alarms from low-priority zones) while preventing channel monopolization by malicious or malfunctioning devices.


Key Features

  1. Semantic & Geographic Prioritization: Divides message traffic into 4 hierarchical bands:
    • Band 0 (ALARM): Critical emergency alarms. Served with strict priority.
    • Band 1 (HIGH): High-priority zone telemetry (token-constrained).
    • Band 2 (STANDARD): Standard zone telemetry (token-constrained).
    • Band 3 (BACKGROUND): Low-priority zone telemetry (token-constrained).
  2. Adaptive Alarm Protection: Uses rate monitoring and token buckets to detect and mitigate alarm floods (DoS attacks or sensor failures) by dropping excessive traffic in Band 0 while maintaining clean service for legitimate alarms.
  3. Per-Device Fair Queuing: Employs round-robin queueing inside bands to prevent a single high-frequency device from starving other sensors in the same band.

Installation

Install the core runtime package from PyPI:

pip install triage4

To run the research benchmarks or test suites locally, install with development dependencies:

pip install "triage4[dev,research]"

Quick Start

from triage4 import TRIAGE4Scheduler, TRIAGE4Config

# Configure the scheduler
config = TRIAGE4Config(
    service_rate=20.0,            # Mean service rate (messages/second)
    high_zone_max=1,              # Zone priority threshold for HIGH band (0-1)
    standard_zone_max=3,          # Zone priority threshold for STANDARD band (2-3)
    high_token_budget=10,         # Maximum tokens per refill window for HIGH band
    enable_alarm_protection=True, # Protect against alarm storms
)

# Initialize the scheduler
scheduler = TRIAGE4Scheduler(config, scheduler_seed=42)

# Define a message workload
arrival_times = [0.0, 0.1, 0.15, 0.2]
device_ids = ["sensor_1", "sensor_2", "sensor_1", "sensor_3"]
zone_priorities = [0, 5, 0, 2]  # Lower number = higher priority
is_alarm = [False, True, False, False]

# Execute discrete-event simulation
result = scheduler.schedule(
    arrival_times=arrival_times,
    device_ids=device_ids,
    zone_priorities=zone_priorities,
    is_alarm=is_alarm
)

# Inspect outcomes
print("Waiting times:", result.waiting_times)
print("E2E latency:", result.e2e_times)
print("Assigned bands:", result.priorities)  # Mapped to Band 0, 1, 2, or 3
print("Alarms dropped:", result.metadata.get("alarm_dropped", 0))

Project Structure

  • src/triage4/: Contains the core scheduling logic and algorithms (packaged for distribution).
  • assessment/: Contains baselines, scenarios, workloads, and performance benchmarking scripts (excluded from wheel packaging).
  • tests/: Integration and unit tests.

Development and Testing

Run the test suite using pytest:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

triage4-1.2.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

triage4-1.2.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file triage4-1.2.0.tar.gz.

File metadata

  • Download URL: triage4-1.2.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for triage4-1.2.0.tar.gz
Algorithm Hash digest
SHA256 138f3d3e6c9c424b82ab86f800a5122aca30a64cb6204d481db204cee6a45488
MD5 f82c7e35a761d9122553ef1b52f1a077
BLAKE2b-256 2bf2be904d846572b655efadc3dbfdc736d8f0fd55d9fe2f49a95b4040a836d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for triage4-1.2.0.tar.gz:

Publisher: publish.yml on les2feup/triage4

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file triage4-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: triage4-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for triage4-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbb749dca5c21a892e7b562b60b93792dd2f2071aa65792be57bafbbef15ed8e
MD5 52c0047005eee851ff8e4d316a88d52e
BLAKE2b-256 fca623dff1959a00e7955bff22fefbb1bbdcd9fc89ec7b6c0369a9226ffd5a12

See more details on using hashes here.

Provenance

The following attestation bundles were made for triage4-1.2.0-py3-none-any.whl:

Publisher: publish.yml on les2feup/triage4

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page