<?xml version="1.0" encoding="UTF-8"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
There has to be one entity for each item to be referenced.
An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
(Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
(using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-petra-path-energy-api-01" ipr="trust200902" consensus="true">
  <!-- category values: std, bcp, info, exp, and historic
  ipr values: full3667, noModification3667, noDerivatives3667
  you can add the attributes updates="NNNN" and obsoletes="NNNN"
  they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
    full title is longer than 39 characters -->

    <title abbrev="Energy-API">Path Energy Traffic Ratio API (PETRA)</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Alberto Rodriguez-Natal" initials="A." surname="Rodriguez-Natal">
      <organization>Cisco</organization>
      <address>
        <postal>
          <street></street>
          <city>Barcelona</city>
          <region></region>
          <code></code>
          <country>Spain</country>
        </postal>
        <phone></phone>
        <email>natal@cisco.com</email>
      </address>
    </author>

    <author fullname="Luis M. Contreras" initials="L. M." surname="Contreras">
      <organization>Telefonica</organization>
      <address>
        <postal>
          <street></street>
          <city>Madrid</city>
          <region></region>
          <code></code>
          <country>Spain</country>
        </postal>
        <phone></phone>
        <email>luismiguel.contrerasmurillo@telefonica.com</email>
      </address>
    </author>

    <author fullname="Alejandro Muniz" initials="A." surname="Muniz">
      <organization>Telefonica</organization>
      <address>
        <postal>
          <street></street>
          <city>Madrid</city>
          <region></region>
          <code></code>
          <country>Spain</country>
        </postal>
        <phone></phone>
        <email>alejandro.muniz@telefonica.com</email>
      </address>
    </author>

    <author fullname="Marisol Palmero" initials="M." surname="Palmero">
      <organization>Cisco</organization>
      <address>
        <postal>
          <street></street>
          <city>Madrid</city>
          <region></region>
          <code></code>
          <country>Spain</country>
        </postal>
        <phone></phone>
        <email>mpalmero@cisco.com</email>
      </address>
    </author>

    <author fullname="Fernando Munoz" initials="F." surname="Munoz">
      <organization>Cisco</organization>
      <address>
        <postal>
          <street></street>
          <city>Madrid</city>
          <region></region>
          <code></code>
          <country>Spain</country>
        </postal>
        <phone></phone>
        <email>fmunozma@cisco.com</email>
      </address>
    </author>

    <date year="2024" />

    <area>IRTF</area>

    <workgroup>PANRG</workgroup>

    <keyword>energy, network, underlay</keyword>

    <abstract>
      <t>This document describes an API to query a network regarding its Energy Traffic Ratio for a given path.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">

      <t>Sustainability is becoming one of the major societal goals for the next decade, and networks are one of the major consumers of energy nowadays. Sustainability of network services is thus one of the forefronts of innovation and action from network service stakeholders, involving manufacturers, operators and customers. In this line, there is a shared goal of achieving better energy awareness.</t>

      <t>As with any other network metric, the energy traffic ratio could be collected from the underlying network infrastructure. However, there is not a common or single definition of energy metrics towards network consumers so that can be uniformly reported, particularly in heterogeneous network scenarios. This document introduces an API to query networks about Energy Traffic Ratio.</t>

    </section>

    <section title="Terminology and Requirements Notation">
      <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> <xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>

      </section>



     <section anchor="api" title="Path Energy Traffic Ratio API (PETRA)">
          <t> This section describes an API to query a network about the Energy Traffic Ratio for a given path. It takes as input the source and destination of a path along with the traffic throughput between and returns the Energy Traffic Ratio in Watts per Gigabit. This is energy computed by the infrastructure that is dynamically part of the traffic path. This document only describes the API, the computation of the Watts per Gigabit to return is out of the scope of this document. The API is modeled following the OpenAPI Specification.  </t>
          <t><figure>
              <artwork><![CDATA[

openapi: 3.0.3
info:
  title: Energy API
  version: 1.0.1
paths:
  /energy:
    get:
      tags:
        - energy
      summary: Query the network for energy consupmtion
      description: ''
      operationId: energyQuery
      parameters:
        - name: src-ip
          in: query
          description: Source IP address
          required: true
          schema:
            type: string
        - name: dst-ip
          in: query
          description: Destination IP address
          required: true
          schema:
            type: string
        - name: throughput
          in: query
          description: Throughput between source and destination (in gigabits per second)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/energy'  
        '400':
          description: Invalid source/destination IP address supplied
components:
  schemas:
    energy:
      type: object
      properties:
        watts-per-gigabit:
          type: number
          format: float
          description: Watts consumed per Gigabit transmitted
        carbon-intensity:
          type: number
          format: integer
          description: Grams of CO2 per kWh

              ]]></artwork>
          </figure></t>
        </section>

        <section anchor="sec" title="Security Considerations">
          <t>TBD</t>

        </section>

        <section anchor="acks" title="Acknowledgments">
          <t>Kudos to Elis Lulja for his help with the OpenAPI specification. Thanks to Fernando Sanz Garcia and Lori Jakab for their help and support on this work. The contribution of Telefonica to this work has been supported by the HORIZON-JU-SNS2022 Research and Innovation Action project 6Green (Grant Agreement no. 101096925).</t>
        </section>

        <section anchor="IANA" title="IANA Considerations">

          <t>This document makes no request to IANA.</t>

        </section>

      </middle>

      <back>

        <references title="Normative References">

          &RFC2119;

          &RFC8174;

        </references>

        <references title="Informative References">

        </references>

      </back>
    </rfc>
