<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5357 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5357.xml">
<!ENTITY RFC4656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4656.xml">
<!ENTITY RFC6038 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6038.xml">
<!ENTITY RFC5938 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5938.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc5357.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="4"?>
<!-- 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="std" docName="draft-spv-ippm-monitor-implementation-services-kpi-01">

  <front>
    <title abbrev="Service KPIs using TWAMP implementation">Monitoring Service KPIs using TWAMP - Implementation</title>

    <author fullname="Srivathsa Sarangapani" initials="Srivathsa" surname="Sarangapani">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>89, Asthagrama Layout 2nd Stage, Basavehwaranagar</street>
          <city>Bangalore</city>
          <region></region>
          <code>560079</code>
          <country>INDIA</country>
        </postal>
        <phone>+91 9845052354</phone>
        <email>srivathsas@juniper.net</email>
      </address>
    </author>

    <author fullname="Peyush Gupta" initials="Peyush" surname="Gupta">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>Flat #206, Keerti Royal Apartment, Outer Ring Road</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560043</code>
          <country>INDIA</country>
        </postal>
        <phone>+91 9449251927</phone>
        <email>peyushg@juniper.net</email>
      </address>
    </author>

    <author fullname="Vinayak Hegde" initials="V." surname="Hegde">
      <organization>Consultant</organization>
      <address>
        <postal>
          <street>Brahma Sun City, Wadgaon-Sheri</street>
          <city>Pune</city>
          <region>Maharashtra</region>
          <code>411014</code>
          <country>INDIA</country>
        </postal>
        <phone>+91 944984401</phone>
        <email>vinayakh@gmail.com</email>
        <uri>http://www.vinayakhegde.com</uri>
      </address>
    </author>

    <date year="2016" />

    <area>General</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>template</keyword>

    <abstract>
     <t>We are using a new method to calculate services KPIs and metrics in the network using TWAMP protocol. This draft outlines the implementation of the service KPIs and there use cases in the service plane in the network. The KPIs discussed in this draft include Service Latency and Application Liveliness detection.</t>

    <t>Service latency is defined as the time spent by the packet when it is injected in the service module or service card till the time, serviced packet is received back by the TWAMP server. TWAMP server records the timestamp of the packet when it is injected into the service module and then again record the timestamp when it receives the packet afer service is applied in the data plane.</t>
 
    <t>Application Liveliness detection means whether the application is up and running in the network. In case you want to monitor the http application or the dns server and verify if they are up and running, this method is applicable. The implementation can be used for liveliness detection of any service in the network.</t>
    </abstract>

    </front>
  <middle>
    <section title="Introduction">
      <t> The TWAMP-Test runs between a Session-Sender and a Session-Reflector <xref target="RFC5357">RFC&nbsp;5357</xref>. The existing TWAMP-Test packet format has existing padding octets that are currently not used (either set to zero or pseudo-random values). These octets can be used to carry additional information between the Session-Sender and the Session-Reflector. The proposed extension uses these padding octets and provide a method to monitor services KPIs in the network. This feature is termed as Services KPI Monitoring using TWAMP.</t>

      <t>TWAMP server is used to inject the packet in the service plane for calculating the latency and liveliness. This is done as part of TWAMP data connection. The packets being sent out of TWAMP server is a UDP packet carrying the payload for the service for which we are interested in calculating the KPIs. The timestamping is done at the TWAMP server. Based on the service model, TWAMP server may be runnig on the same box where the service is hosted or in a remote server.</t>

      <t>The Interface between the TWAMP server and the service plane is implementation specific. the underlying transport is UDP since this is in data path. In this draft, the use cases presented are service latency and keep alive monitoring. Service latency for services like DPI, TDF, Video Caching is calculated. Similarly liveliness for http server, dns application is calculated in the implementation part.</t> 
   
      <t>As per the proposed extension, both the TWAMP-Control and the TWAMP-Test packet formats are modified. One TWAMP-Test session SHALL be used to monitor KPIs for a specific service. But there can be multiple KPIs monitored using a single test session for a specific service. A single TWAMP-Control connection MAY establish multiple TWAMP-Test sessions that measure KPIs for multiple services in the network.</t>

      <t>This extension can be used to monitor KPIs for standalone service or a set of services.</t>
       <section title="Conventions used in this document">
          <section title="Requirements Language">
            <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
            "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
            document are to be interpreted as described in <xref
            target="RFC2119">RFC 2119</xref>.</t>
          </section>
       </section>

       <section title="Terminology">
          <t>TWAMP: Two-Way Active Measurement Protocol</t>
          <t>KPI: Key Performance Indicator</t>
          <t>DPI: Deep Packet Inspection</t>
          <t>CGNAT: Carrier Grade Network Address Translation</t>
          <t>SFW: Stateful Firewall</t>
          <t>TDF: Traffic Detection Function</t>
          <t>DNS: Domain Name Server</t>
          <t>HTTP: Hyper Text Transfer Protocol</t>
          <t>FTP: File Transfer Protocol</t>
          <t>SKMC: Services KPI Monitoring Command</t>
          <t>PDU: Protocol Data Unit</t>
       </section>
    </section>

    <section title="Services KPIs" anchor="SKPI">
       <section title="Services Keepalive Monitoring" anchor="SKM">
          <t>Metric Name: Services Keepalive Monitoring</t> 

	  <t>Metric Description:  This indicates whether the service is running or not at any point of time.</t> 
	  <t>Method of Measurement or Calculation: The Session-Reflector SHALL inject the Service PDU to the Service Block for service processing.  Based on whether the Session-Reflector received the response, the Session-Reflector SHALL decide whether the Service is alive or not.</t> 

	  <t>Units of Measurement:  This metric is expressed as a single bit boolean value. If this bit is set then it indicates that the Service Block is functional. If this bit is NOT set then it indicates that the Service Block is not functional.</t> 

	  <t>Measurement Point(s) with Potential Measurement Domain:  This metric is calculated at the Session-Reflector.</t> 

	  <t>Measurement Timing:  This metric is an instantaneous value. Based on the kind of service it MAY be a good idea to store the history of this value. It can be stored as an average of last one hour for 24 hours, then average of all values over previous day, week, month, year etc. These data MAY be used for some analytics.</t> 

	  <t>Implementation:  The Session-Sender SHALL send the Service PDU as part of the TWAMP-Test Packet Padding. When Session-Reflector receives the TWAMP-Test packet, it SHALL extract the Service PDU. The Session-Reflector SHALL extract the service PDU from the TWAMP Payload and inject it to the service module. For ex, incase of http server, the service PDU can just be a http req. The service module will apply services on this PDU and once service processing is done, it would send the response(http resp) back to Session Reflector. The Session Reflector SHALL now reply back to the TWAMP client/session sender with the actual TWAMP data packet with payload being the boolean flag and response service PDU(http resp).</t> 

	  <t>Verification:  The metric value is a boolean which SHOULD be either 0(Service NOT Alive) or 1(Service is Alive).</t>

	  <t>The Session-Reflector MUST start the Packet Padding with the below 4 octets as indicated below. This is followed by the Service PDU (which MAY be same as whatever was sent by Session-Sender or can be the reply/response packet of the Service Block).</t>

	  <t>Setting Bit 0(X) indicates that the Session-Reflector successfully sent the Service Request to the Service Block and received the response from the Service Block.  If this bit is NOT set then it indicates that the Service Block is not functional.</t>

          <figure align="left" anchor="skm" title="Services Keepalive Monitoring">
              <artwork align="center"><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|X| Reserved    |          MBZ (3 octets)                       |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              ]]></artwork>
          </figure>

	  <t>Use and Applications:  This metric is useful for monitoring the liveliness of a service. Normally the liveliness of the Server or a Network Element is not enough to know whether the Service is really Alive or NOT. Say for example if there is a Web Server Application, then just monitoring whether the Server(where the web server) is alive or not by using ping is just not enough to say whether the application is really Alive or not. There could be instances where in the Server is up and running, while the Web Server Application is not running because of some software bug. These kinds of scenarios can be caught only by probing the application and not just the Server where Applicaton is running.</t> 
	  <t>Reporting Model:  This metric needs to be associated with a defined time interval, which could be defined by fixed intervals. Based on need, the TWAMP client can negotiate to check the liveliness of a service during connection establishment. If so, then for each of the data packet, the liveliness of the service is measured and reported back to session-sender/client for the entire session.</t>
       </section>

       <section title="Service Latency" anchor="SL">
       <t>Metric Name: Service Latency</t> 
       
       <t>Metric Description:  This indicates the total latency introduced by the service for a data packet which is undergoing that service.  Please note that the latency calculation in service agnostic.</t> 
       <t>Method of Measurement or Calculation: The Session-Reflector SHALL notedown the time: Service latency measurement Sender Timestamp and inject the Service PDU to the Service Block for service processing. When the Session-Reflector receives the response, the Session-Reflector SHALL notedown the time: Service latency measurement Receiver Timestamp.</t> 

       <t>Units of Measurement:  This metric is expressed as a timestamp which is 64 bit value. The format of the timestamp is the same as in [RFC1305] and is as follows: the first 32 bits represent the unsigned integer number of seconds elapsed since 0h on 1 January 1900; the next 32 bits represent the fractional part of a second that has elapsed since then.</t>

       <t>So, Timestamp is represented as follows:</t>
          <figure align="left" anchor="tsf" title="Timestamp Format">
              <artwork align="center"><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Integer part of seconds                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Fractional part of seconds                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              ]]></artwork>
          </figure>

       <t>Measurement Point(s) with Potential Measurement Domain:  This metric is calculated at the Session-Reflector.</t> 
       
       <t>Measurement Timing:  This metric is an instantaneous value.  Based on the kind of service it MAY be a good idea to store the history of this value. It can be stored as an average of last one hour for 24 hours, then average of all values over previous day, week, month, year etc. These data MAY be used for some analytics.</t>

       <t>Implementation:  The Session-Reflector SHALL extract the service PDU from the TWAMP Payload and inject it to the service module. For ex, incase of http server, the service PDU can just be a http req. The injecting of service module can be broken into below steps: </t>
       <t>- Session Reflector should note down the time(say T5) at which this service PDU(http req) is injected to service module.</t>
       <t>- The service module will apply services on this PDU and once service processing is done, it would send the response(http resp) back to Session Reflector.</t> 
       <t>- Once this response serviced PDU is received at Session Reflector, the time(say T6) SHOULD be noted.</t> 
       <t>- The Session Reflector SHALL now reply back to the TWAMP client/session sender with the actual TWAMP data packet with payload being the 2 timestamps and the response service PDU(http resp).</t>
       <t>- Now the TWAMP client/session sender after receiving the packet back can calculate the service latency, which would be T6-T5.</t>
       <t>Verification:  This metric value is a pair of timestamps. Service Latency will be calculated by subtracting the "Service latency measurement Sender Timestamp" from the "Service latency measurement Receiver Timestamp"</t>
       <t>The Session-Reflector MUST start the Packet Padding with the 16 octets indicated below.  This SHALL be followed by the Service PDU(which MAY be same as whatever was sent by Session-Sender or can be the reply/response packet of the Service Block).</t>
          <figure align="left" anchor="sl" title="Services Keepalive Monitoring">
              <artwork align="center"><![CDATA[
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |      Service latency measurement Sender Timestamp             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |      Service latency measurement Receiver Timestamp           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              ]]></artwork>
          </figure>
       </section>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>We would like to thank Perceival A Monteiro for their comments, suggestions, reviews, helpful discussion, and proof-reading</t>
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
      <t>TWAMP Services KPIs Registry</t>
      <t>IANA is requested to reserve and maintain the below Services KPIs:</t> 

      <texttable anchor="SKreg" title="TWAMP Services KPIs Registry">
        <ttcol align="left">Value</ttcol>
        <ttcol align="left">Description</ttcol>
        <ttcol align="left">Explanation</ttcol>

        <c>0</c>
        <c>None</c>
        <c></c>
        <c>1</c>
        <c>Keepalive</c>
        <c>Whether the respective service is running or not</c>
        <c>2</c>
        <c>Service Latency</c>
        <c>Service Latency which SHALL include the transit time and actual service time</c>
      </texttable>

      <t>Request-TW-Session message defined in <xref target="RFC6038"></xref>.IANA is requested to reserve 2 octets for Service ID as follows:</t>
      <texttable anchor="NSKMCap" title="New Services KPIs Monitoring Capability">
        <ttcol align="left">Value</ttcol>
        <ttcol align="left">Description</ttcol>
        <ttcol align="left">Semantics</ttcol>
        <ttcol align="left">Reference</ttcol>

        <c>X </c>
        <c>Service ID</c>
        <c>2 Octets starting from offset 92th Octet</c>
        <c>This document</c>
      </texttable>
    </section>

    <section anchor="Security" title="Security Considerations">
            <t>The TWAMP protocol (RFC 5357) supports anthenticated and encrypted mode for TWAMP session and data. The implementation discussed in the proposed extension supports the authenticated and encrypted mode and is therefore provides a secure mechanism to monitor services KPIs in the network.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>

    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;
      &RFC5357;
      &RFC6038;

    </references>
  </back>
</rfc>

