<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp "&#160;">
  <!ENTITY zwsp "&#8203;">
  <!ENTITY nbhy "&#8209;">
  <!ENTITY wj   "&#8288;">
]>
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-aldana-stsp-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="independent"
  xml:lang="en"
  tocInclude="true"
  tocDepth="3"
  symRefs="true"
  sortRefs="true"
  version="3">

  <front>
    <title abbrev="STSP">
      Smart Traffic Synchronization Protocol (STSP) Version 1.0
    </title>

    <seriesInfo name="Internet-Draft" value="draft-aldana-stsp-00"/>

    <author fullname="Gustavo Angel Aldana Flores" initials="G.A." surname="Aldana Flores">
      <organization>Aldana Innovations</organization>
      <address>
        <postal>
          <city>Peachtree City</city>
          <region>Georgia</region>
          <country>United States of America</country>
        </postal>
        <email>g.aldana@aldanainnovations.com</email>
        <uri>https://github.com/smartflow-stsp</uri>
      </address>
    </author>

    <date year="2026" month="May" day="1"/>

    <area>General</area>
    <workgroup>Independent Submission</workgroup>

    <keyword>traffic</keyword>
    <keyword>signal</keyword>
    <keyword>synchronization</keyword>
    <keyword>smart city</keyword>
    <keyword>green wave</keyword>
    <keyword>adaptive</keyword>
    <keyword>infrastructure</keyword>
    <keyword>I2I</keyword>
    <keyword>protocol</keyword>
    <keyword>open standard</keyword>

    <abstract>
      <t>
        This document defines the Smart Traffic Synchronization Protocol
        (STSP), version 1.0 -- an open, extensible protocol for real-time
        coordination of urban traffic signal infrastructure across distributed
        networks of intersections.
      </t>
      <t>
        STSP defines a standard message format, node state machine,
        synchronization algorithm, and inter-node communication model that
        enables any compliant traffic controller to participate in a federated
        intelligent network -- regardless of manufacturer, city, or country
        of deployment.
      </t>
      <t>
        The key contribution of STSP is the definition of the
        Infrastructure-to-Infrastructure (I2I) coordination layer -- a
        communication model between traffic signal nodes that does not exist
        as an open standard in any currently published specification.
        Existing standards such as SAE J2735 SPaT/MAP and ETSI ITS-G5 address
        Vehicle-to-Infrastructure (V2I) communication. STSP addresses the
        orthogonal problem: how nodes coordinate with each other.
      </t>
      <t>
        This document is placed in the public domain under CC BY 4.0 with
        Open Implementation Clause. Any city, government, company, or
        individual may implement STSP freely, provided that original
        authorship is attributed in all implementations, documentation,
        and derivative works as follows: "Implements STSP, designed by
        Gustavo Angel Aldana Flores (draft-aldana-stsp)."
      </t>
    </abstract>

    <note title="Author's Note on Priority">
      <t>
        This Internet-Draft constitutes the first formal public disclosure
        of the STSP protocol specification. The conceptual foundation was
        developed independently by the author beginning approximately in 2015.
        The first working implementation was completed on 1 May 2026 and
        validated on ARM64 hardware (Raspberry Pi 4, 8GB RAM) running a
        full Docker stack including the STSP engine, TimescaleDB, Apache
        Kafka, Redis, and Grafana. The author asserts perpetual moral rights
        to this work under Mexican copyright law (Ley Federal del Derecho
        de Autor, as a Mexican citizen born 21 July 1992) and under the
        Berne Convention for the Protection of Literary and Artistic Works.
      </t>
    </note>
  </front>

  <middle>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
        Urban traffic congestion represents one of the most pervasive and
        quantifiable quality-of-life challenges in modern cities. According
        to INRIX Global Traffic Scorecard data, the average driver in a
        major metropolitan area loses between 50 and 150 hours per year to
        traffic delays. The aggregate economic cost exceeds hundreds of
        billions of US dollars annually worldwide.
      </t>
      <t>
        The root cause of this problem is not vehicle density alone -- it
        is the absence of coordination between traffic signal controllers.
        The vast majority of traffic signals deployed worldwide operate on
        fixed-cycle timers programmed once and rarely updated. These
        controllers have no knowledge of real-time queue conditions, no
        awareness of neighboring intersections, and no mechanism for
        inter-city coordination.
      </t>
      <t>
        Existing adaptive systems (SCATS, SCOOT, Siemens SiTraffic, Kapsch)
        address portions of this problem but share critical limitations:
        they are proprietary, city-siloed, non-interoperable, and incapable
        of federated coordination across administrative boundaries.
      </t>
      <t>
        This document specifies STSP -- a protocol designed to be for urban
        mobility infrastructure what TCP/IP is for digital communication:
        an open, implementable, universally adoptable standard that enables
        any conforming node to participate in a global intelligent traffic
        network.
      </t>
      <t>
        The key insight motivating STSP is the distinction between two
        communication layers that existing standards conflate or ignore:
      </t>
      <ul spacing="normal">
        <li>
          <strong>V2I (Vehicle-to-Infrastructure):</strong> the layer that
          informs vehicles of the current signal phase. Standards such as
          SAE J2735 SPaT/MAP and ETSI ITS-G5 address this layer.
        </li>
        <li>
          <strong>I2I (Infrastructure-to-Infrastructure):</strong> the layer
          that enables traffic signals to coordinate with each other in real
          time. No open standard exists for this layer. STSP fills this gap.
        </li>
      </ul>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="problem" numbered="true" toc="default">
      <name>Problem Statement</name>

      <section anchor="fragmentation" numbered="true" toc="default">
        <name>Fragmentation of Existing Systems</name>
        <t>
          Current traffic management systems worldwide share the following
          structural deficiencies, each of which STSP is designed to resolve:
        </t>
        <t>
          Proprietary protocols prevent interoperability. A city deploying
          System A cannot coordinate with an adjacent city running System B,
          even when both cities share the same physical corridor.
        </t>
        <t>
          Static timing plans do not respond to real demand. Fixed green
          cycles optimized for average conditions perform poorly during peak
          hours, incidents, special events, or adverse weather.
        </t>
        <t>
          Absence of federation means no city benefits from another city's
          operational data. Cities independently develop solutions that could
          be shared. No equivalent of internet routing exists for urban traffic.
        </t>
      </section>

      <section anchor="opportunity" numbered="true" toc="default">
        <name>The Technical Opportunity</name>
        <t>
          The convergence of edge computing, 5G connectivity, computer vision,
          and reinforcement learning creates the technical conditions for a
          fundamentally different approach. STSP specifies the coordination
          layer -- the protocol -- that allows these technologies to compose
          into a coherent, federated, open system.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="terminology" numbered="true" toc="default">
      <name>Terminology</name>
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY",
        and "OPTIONAL" in this document are to be interpreted as described
        in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when,
        and only when, they appear in all capitals, as shown here.
      </t>
      <dl newline="false" spacing="normal">
        <dt>Node</dt>
        <dd>A single traffic signal controller implementing STSP.</dd>
        <dt>Region</dt>
        <dd>A set of nodes within a single administrative boundary (city, district).</dd>
        <dt>Federation</dt>
        <dd>A collection of Regions participating in the STSP global network.</dd>
        <dt>Phase</dt>
        <dd>The current signal state of a Node. One of: NS_GREEN, NS_YELLOW, EW_GREEN, EW_YELLOW.</dd>
        <dt>Green Wave</dt>
        <dd>A coordinated sequence of phase transitions across adjacent Nodes timed to allow vehicles traveling at design speed to encounter consecutive green signals.</dd>
        <dt>Degraded Mode</dt>
        <dd>The autonomous fixed-cycle operation a Node reverts to when network connectivity is lost.</dd>
        <dt>I2I</dt>
        <dd>Infrastructure-to-Infrastructure. The communication layer between STSP Nodes. Distinct from V2I (Vehicle-to-Infrastructure) as defined in SAE J2735 and ETSI ITS-G5.</dd>
        <dt>STSP/1.0</dt>
        <dd>The wire format and protocol version defined in this document.</dd>
      </dl>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="overview" numbered="true" toc="default">
      <name>Protocol Overview</name>
      <t>
        STSP operates across three hierarchical layers. Each layer functions
        independently. Higher layers augment but do not replace lower layers.
      </t>

      <section anchor="node-layer" numbered="true" toc="default">
        <name>Node Layer</name>
        <t>
          Each STSP Node maintains an autonomous state machine governing its
          phase transitions. The Node broadcasts its current state via the
          STSP message format at a configurable interval (default: 200ms).
          A Node MUST be capable of operating indefinitely in Degraded Mode
          without network connectivity.
        </t>
      </section>

      <section anchor="corridor-layer" numbered="true" toc="default">
        <name>Corridor Layer</name>
        <t>
          Nodes within communication range of one another form a corridor.
          The Green Wave algorithm (Section 7) coordinates phase transitions
          across corridors based on vehicle travel time between Nodes.
        </t>
      </section>

      <section anchor="federation-layer" numbered="true" toc="default">
        <name>Federation Layer</name>
        <t>
          Regions (cities) connect to the STSP federation via a standardized
          gRPC interface. Federation enables cross-city route optimization,
          shared model training via Federated Learning, and global traffic
          event dissemination. Participation in the federation is OPTIONAL
          for Node and Corridor layer functionality.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="message-format" numbered="true" toc="default">
      <name>Message Format (STSP/1.0)</name>
      <t>
        All STSP messages are encoded as JSON objects transmitted over
        WebSocket <xref target="RFC6455"/> or MQTT (ISO/IEC 20922). Future
        versions MAY specify binary encoding for bandwidth-constrained
        deployments.
      </t>

      <section anchor="standard-message" numbered="true" toc="default">
        <name>Standard STSP Message</name>
        <t>
          The following is the normative STSP/1.0 message schema:
        </t>
        <artwork name="" type="json" align="left" alt=""><![CDATA[
{
  "stsp_version":        "1.0",
  "node_id":             "MX-QRO-CONST-042",
  "region_id":           "MX-QRO",
  "grid_row":            2,
  "grid_col":            4,
  "latitude":            20.5928,
  "longitude":           -100.4048,
  "phase":               "NS_GREEN",
  "phase_remaining_ms":  18400,
  "timestamp_utc":       1746123456.789,
  "queue_ns":            3,
  "queue_ew":            0,
  "density_ns":          0.30,
  "density_ew":          0.00,
  "neighbor_ids":        ["MX-QRO-CONST-041",
                          "MX-QRO-CONST-043"],
  "green_wave_offset_ms": 0,
  "emergency_override":  false,
  "uptime_s":            86432.1,
  "firmware_ver":        "0.1.0",
  "degraded_mode":       false
}
        ]]></artwork>
      </section>

      <section anchor="compact-form" numbered="true" toc="default">
        <name>Compact Form</name>
        <t>
          For high-frequency broadcasts (greater than 10Hz), Nodes MAY
          transmit the compact form, which omits static identity fields:
        </t>
        <artwork name="" type="json" align="left" alt=""><![CDATA[
{
  "id":  "MX-QRO-CONST-042",
  "ph":  "NS_GREEN",
  "rm":  18400,
  "qns": 3,
  "qew": 0,
  "ts":  1746123456.789
}
        ]]></artwork>
      </section>

      <section anchor="phase-enum" numbered="true" toc="default">
        <name>Phase Enumeration</name>
        <t>
          STSP defines four canonical phase values. Implementations MUST NOT
          use any other values in the "phase" or "ph" fields:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
NS_GREEN   -- North-South has right of way.
NS_YELLOW  -- Transition from NS_GREEN. Minimum: 3 seconds.
EW_GREEN   -- East-West has right of way.
EW_YELLOW  -- Transition from EW_GREEN. Minimum: 3 seconds.
        ]]></artwork>
        <t>
          Nodes with non-orthogonal street geometry SHOULD map their local
          phase names to the nearest STSP canonical phase and document the
          mapping in their configuration.
        </t>
      </section>

      <section anchor="node-id-format" numbered="true" toc="default">
        <name>Node ID Format</name>
        <t>
          Node IDs MUST follow the hierarchical format:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
{COUNTRY}-{REGION}-{CORRIDOR}-{SEQUENCE}

Example: MX-QRO-CONST-042
  MX    -- ISO 3166-1 alpha-2 country code
  QRO   -- Region/city identifier (max 8 chars, uppercase)
  CONST -- Corridor identifier (max 8 chars, uppercase)
  042   -- Zero-padded sequence number within corridor
        ]]></artwork>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="state-machine" numbered="true" toc="default">
      <name>Node State Machine</name>
      <t>
        Each STSP Node implements a deterministic four-state cyclic machine.
        The transition function f(phase) is defined as:
      </t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
NS_GREEN  --[timer_expired]--> NS_YELLOW
NS_YELLOW --[timer_expired]--> EW_GREEN
EW_GREEN  --[timer_expired]--> EW_YELLOW
EW_YELLOW --[timer_expired]--> NS_GREEN
      ]]></artwork>

      <section anchor="fixed-mode" numbered="true" toc="default">
        <name>Fixed Mode</name>
        <t>
          Phase durations are statically configured. Minimum yellow duration
          MUST be 3 seconds. Maximum green duration SHOULD NOT exceed 90
          seconds. This mode is the mandatory Degraded Mode fallback.
          Default durations: NS_GREEN 26s, NS_YELLOW 4s, EW_GREEN 26s,
          EW_YELLOW 4s.
        </t>
      </section>

      <section anchor="adaptive-mode" numbered="true" toc="default">
        <name>Adaptive Mode</name>
        <t>
          Phase durations are computed dynamically by the Adaptive Controller
          (Section 8). MIN_GREEN default: 10 seconds. MAX_GREEN default:
          45 seconds.
        </t>
      </section>

      <section anchor="emergency-override" numbered="true" toc="default">
        <name>Emergency Override</name>
        <t>
          When emergency_override is set to TRUE by an authenticated and
          authorized source, the Node MUST immediately transition to a
          predefined safe state and hold that state for the override duration.
          The override MUST expire automatically. Manual reset MUST be
          available at all times.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="green-wave" numbered="true" toc="default">
      <name>Green Wave Synchronization Algorithm</name>

      <section anchor="offset-calc" numbered="true" toc="default">
        <name>Offset Calculation</name>
        <t>
          When Node N transitions to a green phase, it SHOULD notify its
          downstream neighbor N+1 to schedule its own green phase transition
          at time T + delta, where:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
delta = D / V_design

D         -- physical distance between N and N+1, in meters
V_design  -- corridor design speed, in meters per second
        ]]></artwork>
        <t>
          The notified Node schedules the transition only if it has already
          served its minimum green duration (MIN_GREEN).
        </t>
      </section>

      <section anchor="bidirectional" numbered="true" toc="default">
        <name>Bidirectional Propagation</name>
        <t>
          Wave propagation is bidirectional. Nodes SHOULD compute offsets
          for both upstream and downstream neighbors to accommodate traffic
          in both directions of a corridor simultaneously.
        </t>
      </section>

      <section anchor="priority-resolution" numbered="true" toc="default">
        <name>Priority Resolution</name>
        <t>
          When a Node receives conflicting wave triggers from two different
          corridors simultaneously, it MUST prioritize the trigger with the
          higher queue density on the requesting direction.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="adaptive-control" numbered="true" toc="default">
      <name>Adaptive Phase Control</name>

      <section anchor="demand-ratio" numbered="true" toc="default">
        <name>Demand Ratio Policy (Normative Baseline)</name>
        <t>
          For each green phase, the controller MUST compute:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
ratio    = queue_active / (queue_active + queue_waiting)
duration = MIN_GREEN + ratio * (MAX_GREEN - MIN_GREEN)

queue_active  -- vehicles queued in the currently green direction
queue_waiting -- vehicles queued in the opposing direction
        ]]></artwork>
      </section>

      <section anchor="early-termination" numbered="true" toc="default">
        <name>Early Termination</name>
        <t>
          A green phase MAY be terminated early (but not before MIN_GREEN)
          if the ratio of queue_waiting to queue_active exceeds
          SWITCH_IMBALANCE (default: 1.8) AND queue_active is zero or
          near-zero (less than 1 vehicle) AND MIN_GREEN has been served.
        </t>
      </section>

      <section anchor="rl-extension" numbered="true" toc="default">
        <name>Reinforcement Learning Extension (Optional)</name>
        <t>
          Implementations MAY replace the demand ratio policy with a full
          reinforcement learning controller, subject to the following
          normative constraints:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
State:   S = (q_ns_bucket, q_ew_bucket, current_phase)
         Bucket size: 3 vehicles. Buckets: {0,1,2,3,4}
Actions: A = {EXTEND_GREEN, SWITCH_NOW}
Reward:  R = alpha * throughput - beta * weighted_wait
         Default: alpha=0.8, beta=1.0
        ]]></artwork>
        <t>
          The RL controller MUST respect all hard bounds defined in
          Sections 6.1 and 6.2. Minimum yellow duration is non-negotiable.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="federation" numbered="true" toc="default">
      <name>Federated Network Architecture</name>

      <section anchor="data-sovereignty" numbered="true" toc="default">
        <name>Data Sovereignty</name>
        <t>
          Individual vehicle trajectories and personally identifiable
          information MUST NOT be transmitted in any STSP message or shared
          across regional boundaries. Only aggregate queue metrics and phase
          states are federated. This requirement is normative and reflects a
          core design principle of STSP.
        </t>
      </section>

      <section anchor="federated-learning" numbered="true" toc="default">
        <name>Federated Learning</name>
        <t>
          Regions participating in the federation MAY share model gradients
          (not training data) for improving adaptive controllers globally.
          This approach follows the Federated Learning paradigm and ensures
          that no city's raw traffic data leaves its administrative boundary.
        </t>
      </section>

      <section anchor="inter-region" numbered="true" toc="default">
        <name>Inter-Region Protocol</name>
        <t>
          Regions communicate via gRPC over TLS 1.3. The inter-region
          message format extends the compact STSP message with additional
          fields for regional routing and model versioning. Full
          specification is deferred to STSP/2.0.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="degraded-mode" numbered="true" toc="default">
      <name>Degraded Mode and Failsafe</name>
      <t>
        This section specifies MANDATORY failsafe behavior. Implementations
        that do not conform to this section MUST NOT be deployed in
        production traffic infrastructure.
      </t>

      <section anchor="triggers" numbered="true" toc="default">
        <name>Degraded Mode Triggers</name>
        <t>
          A Node MUST enter Degraded Mode automatically upon any of the
          following conditions:
        </t>
        <ul spacing="normal">
          <li>Network connectivity loss exceeding 30 seconds</li>
          <li>Regional engine heartbeat timeout</li>
          <li>Hardware sensor failure detected by watchdog</li>
          <li>Watchdog timer expiry</li>
          <li>Explicit authenticated operator command</li>
        </ul>
      </section>

      <section anchor="degraded-behavior" numbered="true" toc="default">
        <name>Degraded Mode Behavior</name>
        <t>In Degraded Mode, the Node MUST:</t>
        <ul spacing="normal">
          <li>Revert to fixed-cycle operation with pre-configured durations</li>
          <li>Continue operating indefinitely without network connectivity</li>
          <li>NOT require operator intervention to enter Degraded Mode</li>
          <li>Log the trigger event with UTC timestamp and cause code</li>
        </ul>
      </section>

      <section anchor="recovery" numbered="true" toc="default">
        <name>Recovery</name>
        <t>
          When connectivity is restored, the Node MAY re-synchronize after
          a mandatory stabilization period of not less than one complete
          phase cycle. Re-synchronization MUST be gradual and MUST NOT
          cause abrupt phase changes visible to road users.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
        Traffic signal infrastructure is critical public safety infrastructure.
        Implementations MUST address all threat vectors described in this
        section.
      </t>

      <section anchor="authentication" numbered="true" toc="default">
        <name>Message Authentication</name>
        <t>
          All STSP messages MUST be authenticated using HMAC-SHA256 or
          equivalent. Unauthenticated messages MUST be silently discarded.
          Message replay attacks MUST be mitigated via timestamp validation
          with a maximum tolerance window of 5 seconds.
        </t>
      </section>

      <section anchor="override-auth" numbered="true" toc="default">
        <name>Emergency Override Authorization</name>
        <t>
          The emergency_override field MUST only be accepted from
          authenticated sources with explicit override authorization.
          Unauthorized override attempts MUST be logged and reported to the
          regional engine immediately.
        </t>
      </section>

      <section anchor="dos" numbered="true" toc="default">
        <name>Denial of Service</name>
        <t>
          Nodes MUST implement rate limiting on incoming STSP messages.
          A Node receiving more than 100 messages per second from a single
          source SHOULD enter protective throttle mode and alert the
          regional engine.
        </t>
      </section>

      <section anchor="physical-security" numbered="true" toc="default">
        <name>Physical Security</name>
        <t>
          Node hardware MUST be deployed in tamper-evident enclosures rated
          minimum IP67. Physical access MUST require multi-factor
          authentication. All tamper events MUST be logged with timestamp
          and reported to the regional engine.
        </t>
      </section>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="iana" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
        This document requests the following IANA registrations:
      </t>
      <ul spacing="normal">
        <li>
          WebSocket Subprotocol "stsp": for STSP/1.0 over WebSocket
          connections per the WebSocket subprotocol registry
          (<xref target="RFC6455"/>).
        </li>
        <li>
          MQTT Topic Namespace "stsp/": reserved for STSP message routing
          per MQTT specification (ISO/IEC 20922).
        </li>
        <li>
          A dedicated TCP port number for STSP engine-to-engine communication
          is requested (specific number pending IANA assignment).
        </li>
      </ul>
      <t>
        The author requests that IANA reserve the "stsp" identifier across
        relevant registries to prevent namespace collision with future
        incompatible uses.
      </t>
    </section>

    <!-- ═══════════════════════════════════════════════════════════ -->
    <section anchor="reference-impl" numbered="true" toc="default">
      <name>Reference Implementation</name>
      <t>
        A complete reference implementation of STSP/1.0 exists and is
        operational as of the date of this document. The implementation
        includes:
      </t>
      <ul spacing="normal">
        <li>Python 3.12 asyncio engine with WebSocket server (RFC 6455)</li>
        <li>Intersection state machine (models/intersection.py)</li>
        <li>Traffic network model -- 5x4 node grid (models/network.py)</li>
        <li>Adaptive controller with demand ratio and Q-Learning derived
            policy (algorithms/adaptive.py)</li>
        <li>Green Wave coordinator with offset calculation
            (algorithms/green_wave.py)</li>
        <li>STSP protocol encoder/decoder (protocol/stsp.py)</li>
        <li>TimescaleDB schema for time-series metrics persistence</li>
        <li>Docker Compose stack: engine + Kafka KRaft + Redis + Grafana</li>
        <li>REST API: /health, /state, /stats, /mode</li>
        <li>Validated on ARM64 (Raspberry Pi 4, 8GB RAM) and Apple M3</li>
      </ul>
      <t>
        Repository: https://github.com/smartflow-stsp/reference
        [Publication pending]
      </t>
    </section>

  </middle>

  <back>

    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner"/>
            <date year="1997" month="March"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba"/>
            <date year="2017" month="May"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
        </reference>
        <reference anchor="RFC6455" target="https://www.rfc-editor.org/info/rfc6455">
          <front>
            <title>The WebSocket Protocol</title>
            <author initials="I." surname="Fette" fullname="I. Fette"/>
            <author initials="A." surname="Melnikov" fullname="A. Melnikov"/>
            <date year="2011" month="December"/>
          </front>
          <seriesInfo name="RFC" value="6455"/>
        </reference>
      </references>

      <references>
        <name>Informative References</name>
        <reference anchor="SAE-J2735">
          <front>
            <title>Dedicated Short Range Communications (DSRC) Message Set Dictionary</title>
            <author><organization>SAE International</organization></author>
            <date year="2020"/>
          </front>
          <seriesInfo name="SAE Standard" value="J2735"/>
        </reference>
        <reference anchor="ETSI-ITS">
          <front>
            <title>Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications</title>
            <author><organization>ETSI</organization></author>
            <date year="2019"/>
          </front>
          <seriesInfo name="ETSI EN" value="302 665"/>
        </reference>
        <reference anchor="McMahan2017">
          <front>
            <title>Communication-Efficient Learning of Deep Networks from Decentralized Data</title>
            <author initials="H.B." surname="McMahan" fullname="H. Brendan McMahan"/>
            <date year="2017"/>
          </front>
          <seriesInfo name="AISTATS" value="2017"/>
        </reference>
      </references>
    </references>

    <section anchor="appendix-rl" numbered="false" toc="default">
      <name>Appendix A: RL State Space (Non-Normative)</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
State:   S = (q_ns_bucket, q_ew_bucket, current_phase)
Actions: A = {EXTEND_GREEN, SWITCH_NOW}
Reward:  R = 0.8 * throughput - 1.0 * weighted_wait

Bucket mapping:
  0 -- 0 vehicles        (empty)
  1 -- 1-3 vehicles      (light)
  2 -- 4-6 vehicles      (moderate)
  3 -- 7-9 vehicles      (heavy)
  4 -- 10+ vehicles      (saturated)
      ]]></artwork>
    </section>

    <section anchor="appendix-glossary" numbered="false" toc="default">
      <name>Appendix B: Glossary</name>
      <dl newline="false" spacing="normal">
        <dt>IETF</dt><dd>Internet Engineering Task Force</dd>
        <dt>I2I</dt><dd>Infrastructure-to-Infrastructure communication</dd>
        <dt>V2I</dt><dd>Vehicle-to-Infrastructure communication</dd>
        <dt>STSP</dt><dd>Smart Traffic Synchronization Protocol</dd>
        <dt>SPaT</dt><dd>Signal Phase and Timing (SAE J2735)</dd>
        <dt>SCATS</dt><dd>Sydney Coordinated Adaptive Traffic System</dd>
        <dt>SCOOT</dt><dd>Split Cycle Offset Optimization Technique</dd>
        <dt>RL</dt><dd>Reinforcement Learning</dd>
        <dt>HMAC</dt><dd>Hash-based Message Authentication Code</dd>
        <dt>gRPC</dt><dd>Google Remote Procedure Call (open protocol)</dd>
        <dt>OT</dt><dd>Operational Technology (industrial control systems)</dd>
        <dt>HSM</dt><dd>Hardware Security Module</dd>
      </dl>
    </section>

    <section anchor="declaration" numbered="false" toc="default">
      <name>Author's Declarations</name>

      <section anchor="decl-priority" numbered="false" toc="default">
        <name>Declaration of Priority</name>
        <t>
          I, Gustavo Angel Aldana Flores, hereby declare that I am the
          sole inventor and author of the Smart Traffic Synchronization
          Protocol (STSP) as specified in this document. The conceptual
          foundation of this protocol was developed independently beginning
          approximately in 2015. The first working implementation was
          completed on 1 May 2026 and validated on physical ARM64 hardware
          (Raspberry Pi 4, 8GB RAM) running a full production stack.
          This Internet-Draft constitutes the first formal public disclosure
          of the STSP protocol specification.
        </t>
      </section>

      <section anchor="decl-open" numbered="false" toc="default">
        <name>Declaration of Open Intent</name>
        <t>
          I hereby irrevocably dedicate the STSP protocol specification to
          the global commons under CC BY 4.0 with Open Implementation Clause.
          My intent is that this protocol serve as open infrastructure for
          the benefit of cities, governments, and citizens worldwide --
          without commercial enclosure -- while preserving permanent
          attribution to its author.
        </t>
      </section>

      <section anchor="decl-independence" numbered="false" toc="default">
        <name>Declaration of Independence</name>
        <t>
          This protocol was developed independently, without funding from
          any government, corporation, or institution. No entity holds
          rights over this specification other than those expressly granted
          in the copyright notice. The author is not affiliated with any
          traffic signal manufacturer, smart city platform provider, or
          standards body at the time of this writing.
        </t>
      </section>
    </section>

    <section anchor="acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>
        The author developed this protocol independently. This document
        was first drafted on 1 May 2026 in Peachtree City, Georgia, USA.
      </t>
    </section>

  </back>
</rfc>
