<?xml version="1.0" encoding="US-ASCII"?>
<rfc category="info"
     docName="draft-pythia-bmwg-programmable-power-profiling-00"
     ipr="trust200902"
     submissionType="IETF"
     version="3">
  <front>
    <title abbrev="Programmable Power Profiling">Power Consumption Profiling for Programmable Network Devices</title>
    <seriesInfo name="Internet-Draft" value="draft-pythia-bmwg-programmable-power-profiling-00"/>
    <author initials="X." surname="Chen" fullname="Xiang Chen">
      <organization>Zhejiang University</organization>
      <address>
        <postal>
          <city>Hangzhou</city>
          <region>Zhejiang</region>
          <country>China</country>
        </postal>
        <email>wasdnsxchen@gmail.com</email>
      </address>
    </author>
    <author initials="L." surname="Zhu" fullname="Longlong Zhu">
      <organization>Zhejiang University</organization>
      <address>
        <postal>
          <city>Hangzhou</city>
          <region>Zhejiang</region>
          <country>China</country>
        </postal>
        <email>pocofo@foxmail.com</email>
      </address>
    </author>
    <author initials="L." surname="Zheng" fullname="Linying Zheng">
      <organization>Zhejiang University</organization>
      <address>
        <postal>
          <city>Hangzhou</city>
          <region>Zhejiang</region>
          <country>China</country>
        </postal>
        <email>zhenglinying0106@gmail.com</email>
      </address>
    </author>
    <date year="2026" month="July" day="27"/>
    <area>Operations and Management</area>
    <workgroup>Benchmarking Methodology Working Group</workgroup>
    <keyword>power profiling</keyword>
    <keyword>programmable data plane</keyword>
    <keyword>in-network computing</keyword>
    <keyword>match-action</keyword>
    <abstract>
      <t>A programmable network device can execute different packet-processing
      programs on the same hardware.  Device-level power measurements show
      the total input power but do not explain the power associated with a
      program's parser, match-action tables, and stateful or stateless
      actions.  Models designed for fixed-function switches do not directly
      describe these program-dependent operations.</t>
      <t>This document describes a power profiling methodology for
      programmable network devices.  The methodology decomposes packet
      processing into functional components, uses controlled calibration
      programs to derive target-specific parameters, and estimates the power
      of a data-plane program from its processing features and traffic.  It
      also specifies validation and reporting requirements that distinguish
      direct measurements from model-derived estimates.  The methodology is
      based on implementation experience with an ASIC programmable switch
      and an FPGA-based programmable switch.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>In-network computing moves functions such as aggregation,
      measurement, caching, classification, and security processing into
      programmable network devices.  The power used by these functions is
      relevant when selecting a program, comparing program versions, or
      estimating the power cost of deploying a function across many
      devices.</t>
      <t>An external power meter can measure the total input power of a
      device.  Repeating that measurement for every program and configuration
      is costly, and a total value does not identify which packet-processing
      operations account for a difference.  Existing models for
      fixed-function switches commonly use external variables such as port
      configuration and traffic load.  Those variables remain important, but
      they do not describe custom parsing, matching, and action logic.</t>
      <t>This document describes a component-oriented profiling methodology.
      It first builds a general functional model of programmable packet
      processing.  It then uses controlled calibration programs and power
      data to derive parameters for a specific target.  Once calibrated and
      validated, the target-specific model can estimate the power of other
      programs within the validated range.</t>
      <t>The methodology does not standardize one device's parameters or
      require disclosure of proprietary pipeline placement.  It standardizes
      the functional decomposition, calibration process, validation
      conditions, and information needed to interpret a result.</t>
    </section>

    <section anchor="requirements">
      <name>Requirements Language</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>
    </section>

    <section anchor="scope">
      <name>Scope and Non-Goals</name>
      <t>This document applies to devices whose packet-processing behavior is
      defined in whole or in part by a loadable or compiled data-plane
      program.  The primary model is a reconfigurable match-action pipeline
      <xref target="RMT"/>, but the procedure can be adapted to another
      architecture when its processing functions can be mapped to the
      components in <xref target="model"/>.</t>
      <t>The methodology supports:</t>
      <ul>
        <li>profiling one program on one target;</li>
        <li>comparing programs or program versions on the same target;</li>
        <li>identifying packet-processing features associated with a power
        difference; and</li>
        <li>estimating program-level power after target-specific
        calibration.</li>
      </ul>
      <t>This document does not prescribe an energy-efficiency target, an
      acceptance threshold, a data-plane language, a compiler, or a single
      regression model.  It does not assert that parameters obtained from one
      device, compiler, or firmware version apply to another.  It also does
      not replace a direct measurement when a benchmark requires directly
      measured input power.</t>
    </section>

    <section anchor="terminology">
      <name>Terminology</name>
      <dl>
        <dt>Target:</dt>
        <dd>The programmable device, architecture, and toolchain combination
        for which a power model is calibrated.</dd>
        <dt>Data-plane program:</dt>
        <dd>The source, intermediate, or compiled artifact that defines the
        packet-processing behavior loaded on the target.</dd>
        <dt>Calibration program:</dt>
        <dd>A controlled data-plane program constructed to expose the power
        behavior of one processing component or candidate factor.</dd>
        <dt>Reference program:</dt>
        <dd>A documented program that provides the baseline packet-processing
        behavior for a calibration or comparison.</dd>
        <dt>Direct measurement:</dt>
        <dd>A power value measured for the target under the stated program and
        traffic condition using an external power meter.</dd>
        <dt>Tool-derived power value:</dt>
        <dd>A power value produced by an implementation or design tool, such
        as an FPGA post-implementation power report, rather than by an
        external meter.</dd>
        <dt>Model-derived estimate:</dt>
        <dd>A value calculated by a calibrated power model for a program and
        traffic condition.</dd>
      </dl>
    </section>

    <section anchor="framework">
      <name>Profiling Framework</name>
      <t>The profiling workflow has three stages:</t>
      <ol>
        <li>Construct a general functional power model by decomposing the
        target's packet-processing path.</li>
        <li>Run calibration programs, collect power data, identify influential
        factors, and derive parameters for the target.</li>
        <li>Extract the corresponding features of a query program and use the
        target-specific model to estimate its power.</li>
      </ol>
      <t>The first stage is architecture-oriented.  It identifies functions
      that are common across a class of programmable devices.  The second
      stage is device-specific because the contribution of a function depends
      on the hardware, compiler, firmware, and implementation.  The third
      stage is valid only inside the range covered by calibration and
      validation.</t>
      <t>Calibration requires power data for a limited set of programs.  A
      query does not require a new direct measurement unless the estimate is
      being validated or the program lies outside the validated range.  This
      distinction is the source of the method's lower measurement cost, but
      it also makes accurate reporting of the model boundary necessary.</t>
    </section>

    <section anchor="model">
      <name>Functional Power Model</name>
      <t>The total power of a target under a program and traffic condition is
      represented as:</t>
      <artwork><![CDATA[
             P_total = P_basic + P_operation
      ]]></artwork>
      <t>P_basic represents the power needed for the device's basic operation.
      P_operation represents the additional packet-processing activity of the
      loaded program.  This is a functional decomposition.  It does not imply
      that the physical hardware blocks are isolated or that every term is
      independently additive.</t>

      <section anchor="basic-power">
        <name>Basic Power</name>
        <t>Basic power can be decomposed as:</t>
        <artwork><![CDATA[
             P_basic = P_idle + P_port + P_forwarding
      ]]></artwork>
        <t>P_idle is the target's baseline power after startup.  P_port
        represents the contribution associated with connected and enabled
        ports.  P_forwarding represents basic packet forwarding under the
        stated traffic condition.  The report MUST identify the chassis,
        enabled and connected ports, interface types, and basic forwarding
        program used to derive these terms.</t>
      </section>

      <section anchor="operation-power">
        <name>Packet-Processing Power</name>
        <t>For a match-action pipeline, operational power is organized as:</t>
        <artwork><![CDATA[
             P_operation = P_parser + P_match + P_action
      ]]></artwork>
        <t>P_parser includes parsing and deparsing.  Candidate explanatory
        variables include parsed header widths, the number and sequence of
        headers, and packet rate.</t>
        <t>P_match represents the execution of match-action tables.  Candidate
        variables include match kind, key fields or key width, configured
        rule capacity, populated rule count, number of tables, and packet
        rate.</t>
        <t>P_action represents operations executed after a match.  The model
        distinguishes stateful operations, such as register access, from
        stateless operations, such as field assignment or arithmetic.
        Candidate variables include operation category, operation count,
        operand width, number of tables executing the operation, and packet
        rate.</t>
        <t>A calibration experiment MUST determine which candidate factors
        have a measurable effect on its target.  A factor MUST NOT be retained
        in the target-specific model solely because it appears in the general
        functional model.</t>
      </section>

      <section anchor="traffic-context">
        <name>Traffic, Packet Size, and Repeated Processing</name>
        <t>Packet-processing work depends on the number of packets as well as
        the number of bits.  A profile MUST report both packet rate and bit
        rate, together with the packet-size distribution.  At a fixed bit
        rate, smaller packets increase the packet rate and can therefore
        increase the number of parser, table, and action executions.</t>
        <t>Recirculation causes a packet to traverse the pipeline again.  If
        each recirculated pass performs processing equivalent to an external
        packet, an effective packet rate can be expressed as:</t>
        <artwork><![CDATA[
             r_effective = r_external * (1 + k)
      ]]></artwork>
        <t>Here, k is the number of recirculations per packet or a
        traffic-weighted average when packets have different recirculation
        counts.  If later passes execute a different path, the passes MUST be
        described separately rather than represented only by r_effective.
        Resubmit, cloning, and multicast SHOULD be reported when they change
        the amount of packet processing.</t>
      </section>
    </section>

    <section anchor="calibration">
      <name>Parameter Profiling and Calibration</name>
      <section anchor="program-design">
        <name>Calibration Program Design</name>
        <t>A calibration program SHOULD isolate one candidate factor while
        holding unrelated factors constant.  A calibration set begins with a
        reference program and adds a series of programs or configurations
        that vary a controlled parameter.</t>
        <t>Examples include varying:</t>
        <ul>
          <li>connected and enabled ports;</li>
          <li>packet rate at fixed packet size and processing behavior;</li>
          <li>parsed header width or header count;</li>
          <li>match kind, rule count, or table count;</li>
          <li>stateful reads and writes;</li>
          <li>stateless assignment or arithmetic operations; and</li>
          <li>the number of recirculations or processing passes.</li>
        </ul>
        <t>A generated program MUST be checked to confirm that the compiler
        did not remove the operation under test.  The report SHOULD record
        compiler resource output when it is available.  If varying one source
        construct changes placement or other resources, that interaction MUST
        be reported.</t>
      </section>

      <section anchor="data-collection">
        <name>Power Data Collection</name>
        <t>For a deployed hardware target, each calibration point MUST use an
        external power meter.  The report MUST state the meter type and
        accuracy, target and toolchain versions, environmental condition,
        stabilization interval, measurement interval, averaging method, and
        number of repetitions.</t>
        <t>For a target that is not available as a measurable hardware
        implementation, a design-tool power report MAY be used for model
        development.  Such a value MUST be labeled tool-derived and MUST NOT
        be presented as an external input-power measurement.</t>
        <t>The calibration program, port state, table population, state
        initialization, traffic, and any control-plane updates during the
        measurement MUST be recorded.  The packet-processing result SHOULD be
        checked so that a low-power value caused by unintended drops or a
        failed program is not accepted as a valid calibration point.</t>
      </section>

      <section anchor="parameter-derivation">
        <name>Parameter Derivation</name>
        <t>For each candidate factor, the profiler compares the power values
        obtained while that factor is varied.  A target-specific relationship
        can be linear, range-based, logarithmic, or another form supported by
        the calibration data.  This document does not prescribe the fitting
        method.</t>
        <t>When a factor produces no stable measurable difference over the
        calibrated range, the target-specific model SHOULD omit that factor
        or represent it as an uncertainty term.  When the effect of two
        factors cannot be separated, the model SHOULD use a joint term rather
        than claiming independent component contributions.</t>
        <t>Every parameter set MUST be versioned and bound to the target,
        toolchain, calibration programs, traffic range, and measurement or
        tool-derived power-data source used to obtain it.</t>
      </section>
    </section>

    <section anchor="estimation">
      <name>Program Profiling and Power Estimation</name>
      <t>To profile a query program, the profiler extracts the program
      features used by the target-specific model.  These features can come
      from program analysis, compiler output, run-time configuration, or a
      combination of them.</t>
      <t>The query record MUST include:</t>
      <ul>
        <li>program identifier and version;</li>
        <li>compiler, target, options, SDK, firmware, and runtime versions;</li>
        <li>parser, match-table, stateful-action, and stateless-action features
        required by the model;</li>
        <li>configured and populated table state;</li>
        <li>packet rate, bit rate, packet-size distribution, and repeated
        processing; and</li>
        <li>the parameter-set version used for the estimate.</li>
      </ul>
      <t>The estimated total power MUST be labeled model-derived.  A profiler
      MAY additionally report a basic-power term and operational terms, but
      it MUST state whether those terms are measured, independently
      calibrated, or inferred from a combined model.</t>
      <t>If the query program contains a feature or traffic condition outside
      the calibration range, the result MUST be labeled an extrapolation.  A
      new calibration or direct measurement is RECOMMENDED instead of
      extrapolation when the omitted feature can activate a different
      hardware resource or execution path.</t>
    </section>

    <section anchor="validation">
      <name>Model Validation</name>
      <t>A target-specific model MUST be validated using programs or
      configurations that were not used to derive its parameters.  Validation
      programs SHOULD cover different combinations of parser, table,
      register, action, and traffic features within the intended operating
      range.</t>
      <t>The validation report MUST provide:</t>
      <ul>
        <li>the calibration and validation program sets;</li>
        <li>the directly measured or tool-derived value and the estimate for
        each validation case;</li>
        <li>the error definition;</li>
        <li>a central error value and the worst observed error;</li>
        <li>the validated ranges for traffic and program features; and</li>
        <li>known interactions or target limitations.</li>
      </ul>
      <t>A model MUST be revalidated after a change to the hardware target,
      compiler behavior, firmware, or another part of the toolchain that can
      alter pipeline mapping or power behavior.</t>
    </section>

    <section anchor="comparison">
      <name>Comparing Data-Plane Programs</name>
      <t>Two programs can be compared directly on the same target by keeping
      the chassis, ports, toolchain, environment, traffic, table state,
      stabilization interval, and measurement method unchanged.  If P_A and
      P_B are direct power measurements, the program-associated difference
      is:</t>
      <artwork><![CDATA[
             Delta_P(A,B) = P_B - P_A
      ]]></artwork>
      <t>The report MUST include P_A and P_B as well as Delta_P(A,B).  If the
      programs implement different functions or produce different forwarding
      results, the report MUST describe the difference and MUST NOT present
      Delta_P(A,B) as an efficiency comparison for equivalent behavior.</t>
      <t>A component model can help explain the difference, but a
      model-derived attribution MUST be reported separately from the direct
      difference.</t>
    </section>

    <section anchor="network-scope">
      <name>From One Device to a Network</name>
      <t>For a single device, the program and the local traffic condition are
      sufficient inputs to a target-specific model.  For a network of
      programmable devices, traffic distribution and forwarding paths also
      affect power because they determine the packet rate processed by each
      device.</t>
      <t>A network-level estimate MUST identify the program and traffic rate
      at each device.  It MUST also state whether links, transceivers, and
      other devices outside the programmable targets are included.  Applying
      one device's model to every device is valid only when their targets,
      toolchains, configurations, and validated operating ranges are
      equivalent.</t>
      <t>This document does not specify a routing or traffic-engineering
      algorithm.  It only records that network-level profiling requires the
      traffic distribution and forwarding strategy in addition to the
      per-device program model.</t>
    </section>

    <section anchor="reporting">
      <name>Reporting Summary</name>
      <table anchor="reporting-table">
        <name>Power Profiling Report</name>
        <thead>
          <tr>
            <th>Group</th>
            <th>Required information</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Target</td>
            <td>Device, architecture, compiler, SDK, firmware, runtime</td>
          </tr>
          <tr>
            <td>Program</td>
            <td>Identifier, version, function, compiled artifact</td>
          </tr>
          <tr>
            <td>Basic state</td>
            <td>Idle state, ports, interfaces, basic forwarding</td>
          </tr>
          <tr>
            <td>Parser</td>
            <td>Headers, widths, count or depth used by the model</td>
          </tr>
          <tr>
            <td>Match</td>
            <td>Match kinds, keys, rules, tables, populated state</td>
          </tr>
          <tr>
            <td>Action</td>
            <td>Stateful and stateless operations used by the model</td>
          </tr>
          <tr>
            <td>Traffic</td>
            <td>Packet rate, bit rate, sizes, recirculation or other passes</td>
          </tr>
          <tr>
            <td>Power data</td>
            <td>Direct measurement or tool-derived source and procedure</td>
          </tr>
          <tr>
            <td>Model</td>
            <td>Parameter version, calibration set and range</td>
          </tr>
          <tr>
            <td>Validation</td>
            <td>Cases, measured or tool-derived values, estimates, errors</td>
          </tr>
          <tr>
            <td>Result</td>
            <td>Direct, tool-derived, estimated, or extrapolated label</td>
          </tr>
        </tbody>
      </table>
    </section>

    <section anchor="experience">
      <name>Implementation Experience</name>
      <t>The methodology is based on an implementation named Pythia.  Pythia
      constructs an RMT-oriented power model and uses calibration programs to
      derive parameters for a target.</t>
      <t>On an Intel Tofino programmable switch, Pythia used an external
      wattmeter for calibration.  It examined the effects of port state,
      basic forwarding, parser configuration, match-action tables, stateful
      and stateless actions, traffic rate, packet size, and recirculation.
      In that implementation, packet rate was the dominant run-time factor;
      several program-structure factors had only a small measurable effect on
      the evaluated target.</t>
      <t>The Tofino model was evaluated with 14 real-world data-plane programs
      covering different numbers of headers, match-action tables, registers,
      and action executions.  For those experiments, the power range estimated
      by the model was reported to be within five percent of the direct
      measurement.</t>
      <t>Pythia was also adapted to an FPGA-based programmable switch.  That
      evaluation focused on matching because of the available implementation
      resources and considered match kind, rule count, and table count.  Its
      power values came from post-implementation reports generated by the
      FPGA design tool, not from an external power meter.</t>
      <t>These results support the feasibility of target-specific,
      component-oriented profiling.  They do not establish a universal model
      form or accuracy guarantee.  In particular, the Tofino findings about
      traffic rate and the FPGA findings about matching MUST NOT be assumed
      for another target without calibration and validation.</t>
    </section>

    <section anchor="applicability">
      <name>Applicability and Limitations</name>
      <t>The functional model maps directly to RMT-like pipelines.  A
      non-RMT target requires a justified mapping between its execution model
      and the components in <xref target="model"/>.  If such a mapping is not
      available, the profiler SHOULD define a target-specific decomposition
      rather than forcing the target into parser, match, and action terms.</t>
      <t>Compiler placement, shared resources, standby power, memory
      technology, clocking, and thermal control can hide or couple component
      effects.  A functional term is therefore an explanatory model term, not
      necessarily the power of a physically isolated block.</t>
      <t>A model can reduce repeated measurement cost only after the target
      has been calibrated.  It does not eliminate the need for direct
      measurements during calibration and validation, and it does not make
      unlike targets automatically comparable.</t>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>Profiling SHOULD be performed in an isolated laboratory environment.
      Calibration programs can exhaust table or stateful memory, create high
      packet-processing load, or introduce a recirculation loop.  A tester
      SHOULD validate each program at a limited rate before applying the full
      traffic condition and SHOULD retain a way to stop traffic or unload the
      program.</t>
      <t>Program source, compiler output, resource reports, and pipeline
      placement can contain proprietary information.  A report MAY use coarse
      feature categories, but it MUST state which information is withheld so
      that readers can assess the limit on reproducibility.</t>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>

  <back>
    <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="Scott Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </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="Barry Leiba"/>
          <date month="May" year="2017"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>

    <references>
      <name>Informative References</name>
      <reference anchor="RMT" target="https://doi.org/10.1145/2486001.2486011">
        <front>
          <title>Forwarding Metamorphosis: Fast Programmable Match-Action Processing in Hardware for SDN</title>
          <author initials="P." surname="Bosshart" fullname="Pat Bosshart"/>
          <author initials="G." surname="Gibb" fullname="Glen Gibb"/>
          <author initials="H." surname="Kim" fullname="Hun-Seok Kim"/>
          <author initials="G." surname="Varghese" fullname="George Varghese"/>
          <author initials="N." surname="McKeown" fullname="Nick McKeown"/>
          <author initials="M." surname="Izzard" fullname="Martin Izzard"/>
          <author initials="F." surname="Mujica" fullname="Fernando Mujica"/>
          <author initials="M." surname="Horowitz" fullname="Mark Horowitz"/>
          <date month="August" year="2013"/>
        </front>
        <seriesInfo name="DOI" value="10.1145/2486001.2486011"/>
      </reference>
    </references>
  </back>
</rfc>
