<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd"[
<!ENTITY RFC2119 SYSTEM "reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "reference.RFC.8174.xml">
<!ENTITY RFC2629 SYSTEM "reference.RFC.2629.xml">
<!ENTITY RFC4656 SYSTEM "reference.RFC.4656.xml">
<!ENTITY RFC5618 SYSTEM "reference.RFC.5618.xml">
<!ENTITY RFC5357 SYSTEM "reference.RFC.5357.xml">
<!ENTITY RFC5905 SYSTEM "reference.RFC.5905.xml">
<!ENTITY RFC6038 SYSTEM "reference.RFC.6038.xml">
<!ENTITY RFC5226 SYSTEM "reference.RFC.5226.xml">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>


<rfc number="8186" category="std" submissionType="IETF" consensus="yes"
  ipr="trust200902">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>
	<title abbrev='1588 Timestamp Format in TWAMP'>Support of the IEEE-1588
	Timestamp Format in a Two&nbhy;Way&nbsp;Active&nbsp;Measurement&nbsp;Protocol
	(TWAMP)</title> 

	<author initials='G.' surname="Mirsky" fullname='Greg Mirsky'>
		<organization>ZTE Corp.</organization>
		<address>
			<email>gregimirsky@gmail.com</email>
		</address> 
	</author>

   <author fullname="Israel Meilik" initials="I" surname="Meilik">
      <organization>Broadcom</organization>
      <address>
        <postal>
          <street></street>

          <city></city>
          <region></region>
          <code></code>
          <country></country>
        </postal>
        <phone></phone>
        <email>israel@broadcom.com</email>

      </address>
    </author>

    <date month="June" year="2017" />

    <area>Transport</area>

   <keyword>TWAMP </keyword>
   
   <keyword>IEEE-1588</keyword>

	<abstract>
	<t>
	This document describes an OPTIONAL feature for active performance measurement protocols
	that allows use of the Precision Time Protocol timestamp format defined in IEEE-1588v2-2008,
	as an alternative to the Network Time Protocol that is currently used.
	 </t>
	</abstract>
</front>

<middle>
  <section anchor="intro" title="Introduction">
        <t>
        The One-Way Active Measurement Protocol (OWAMP) <xref target="RFC4656"/> defines that only the NTP format <xref target="RFC5905"/>
        of a timestamp can be used in the OWAMP-Test protocol.
        The Two-Way Active Measurement Protocol (TWAMP) <xref target="RFC5357"/> adopted the OWAMP-Test packet format and extended it
        by adding a format for a reflected test packet. Both the sender's and
	reflector's packets timestamps are expected to follow the 64-bit-long  
        NTP format <xref target="RFC5905"/>. 
   NTP, when used over the Internet, typically
   achieves clock accuracy within 5 ms to 100 ms.  Surveys conducted
   recently suggest that 90% of devices achieve accuracy better than 100
   ms and 99% of devices achieve accuracy better than 1 sec.
   It should be noted 
        that NTP synchronizes clocks on the control plane, not on data
	plane.  Distribution of clock within a node may be supported by
	an independent NTP 
        domain or via interprocess communication in a multiprocessor distributed system. 
        Any of the mentioned solutions will be subject to additional queuing
        delays that negatively affect data-plane clock accuracy.
        </t>
        <t>
        The Precision Time Protocol (PTP) <xref target="IEEE-1588"/>
has gained wide support since the development of OWAMP and TWAMP. PTP, using
        on-path support and other mechanisms, allows sub-microsecond clock accuracy.
        PTP is now supported in multiple implementations of fast-forwarding
	engines; thus, accuracy achieved by PTP is the accuracy of the clock
	in the data plane.
        Having an option to use a more accurate clock as a source of timestamps for
	IP performance measurements is one of the advantages of this specification.
        Another advantage is realized by simplification of hardware in the data plane. To support OWAMP or TWAMP, test protocol
        timestamps must be converted from PTP to NTP. That requires resources, use of microcode or additional processing elements,
        that are always limited. To address this, this document proposes
	optional extensions to Control and Test protocols to support use of
	the IEEE-1588v2 timestamp format as an optional alternative to the NTP timestamp format.
       </t>
       <t>
       One of the goals of this specification is not only to allow endpoints
       of a test session to use a timestamp format other than NTP, but to support
       backwards compatibility with nodes that do not yet support this extension.
       </t>
         
     <section title="Conventions Used in This Document">
         <section title="Terminology">
            <t>NTP:  Network Time Protocol</t>
            <t>PTP:  Precision Time Protocol</t>
           <t>TWAMP:  Two-Way Active Measurement Protocol</t>
           <t>OWAMP:  One-Way Active Measurement Protocol</t>
 
         </section>    
         
        <section title="Requirements Language">
        <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&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
          </section>
      </section>
     </section>
      
         <section anchor="owamp-twamp-extensions" title="OWAMP and TWAMP Extensions">
          <t>
           OWAMP connection establishment follows the procedure defined in
           Section 3.1 of <xref target="RFC4656"/> and additional steps in TWAMP described
           in Section 3.1 of <xref target="RFC5357"/>. In these procedures,  the Modes field has
           been used to identify and select specific communication capabilities. At the same time,
           the Modes field has been recognized and used as an extension
	   mechanism <xref target="RFC6038"/>. 
           The new feature requires one bit position for the Server and Control-Client to negotiate which timestamp
           format can be used in some or all test sessions invoked with this control connection.
           The endpoint of the test session, Session-Sender and
	   Session-Receiver (for OWAMP) or Session-Reflector (for TWAMP),
           that supports this extension MUST be capable of interpreting the NTP and
           PTPv2 timestamp formats. If the endpoint does not support this extension, then the value of
           the PTPv2 Timestamp flag MUST be 0 because it is in Must Be Zero field. If the value of
           the PTPv2 Timestamp flag is 0, then the advertising node can use
	   and interpret only the NTP
           timestamp format. Implementations of OWAMP and/or TWAMP MAY provide a configuration knob
           to bypass the timestamp format negotiation process and use the locally configured values instead.
           </t>
           <t>
           Use of PTPv2 Timestamp flags is discussed in the following subsections. For details on the
           assigned values and bit positions, see the <xref target="iana-consider"/>.
          </t>
          
         <section anchor="owamp-conn-setup" title="Timestamp Format Negotiation in OWAMP Connection Setup"> 
             <t>
               In OWAMP-Test <xref target="RFC4656"/>, the Session-Receiver and/or Fetch-Client interpret collected
               timestamps. Thus, the Server uses the Modes field timestamp format to indicate which formats 
               the Session-Receiver is capable of interpreting. The Control-Client inspects values set by the Server for timestamp
               formats and sets values in the Modes field of the
	       Set-Up-Response message according to the timestamp formats
               the Session-Sender can use. The rules for setting timestamp
	       flags in the Modes field in Server Greeting and 
               Set-Up-Response messages and interpreting them are as follows:

              <list style="symbols">                   
               <t>
               If the Session-Receiver supports this extension, then the Server that establishes test sessions on its behalf
               MUST set the PTPv2 Timestamp flag to 1 in the Server Greeting message per the requirement
               listed in <xref target="owamp-twamp-extensions"/>. Otherwise, the PTPv2 Timestamp flag will be set to 0
               to indicate that the Session-Receiver interprets only the NTP format.
                </t>
                <t>
                If the Control-Client receives a greeting message with the
		PTPv2 Timestamp flag set to 0,  
                then the Session-Sender MUST use the NTP format for the timestamp in the test session, and
                the Control-Client SHOULD set the PTPv2 Timestamp flag to 0 in accordance with
                <xref target="RFC4656"/>. If the Session-Sender cannot use NTP timestamps, then the Control-Client
                SHOULD close the TCP connection associated with the OWAMP-Control session.
                </t>
                <t>
                 If the Control-Client receives a greeting message with the
		 PTPv2 Timestamp flag set to 1 and 
                 the Session-Sender can set the timestamp in PTPv2 format,
		 then the Control-Client MUST set the PTPv2 
                Timestamp flag to 1 in the Modes field in the Set-Up-Response
		message and the Session-Sender MUST 
                use PTPv2 timestamp format. 
                </t>
                <t>
      If the Session-Sender doesn't support this extension and can set
      the timestamp in NTP format only, then the PTPv2 Timestamp flag in
      the Modes field in the Set-Up-Response message will be set to 0 as
      part of the Must Be Zero field and the Session-Sender will use the NTP
      format. 
                </t>
           </list>
           </t>
             <t>
                If OWAMP-Control uses Fetch-Session commands, then selection
		and use of one timestamp format or another is a local
                decision for both Session-Sender and Session-Receiver.
             </t>
          </section>
          
          <section anchor="twamp-conn-setup" title="Timestamp Format Negotiation in TWAMP Connection Setup">      
<t>
             In TWAMP-Test <xref target="RFC5357"/>, the Session-Sender interprets collected 
             timestamps. Hence, in the Modes field, a Server advertises timestamp formats that the
             Session-Reflector can use in the TWAMP-Test message. The choice of the timestamp format  to be
             used by the Session-Sender is a local decision. The Control-Client inspects the Modes field and sets
             timestamp flag values to indicate the format that will be used by the Session-Reflector.
             The rules of setting and interpreting flag values are as follows:

<list  style="symbols">

<t>
      The Server MUST set the PTPv2 Timestamp flag value to 1 in its greeting
      message if the Session-Reflector can set the timestamp in the PTPv2
      format. Otherwise, the PTPv2 Timestamp flag MUST be set to 0.
</t>
<t>
          If the value of the PTPv2 Timestamp flag in the received Server Greeting message is 0,
          then the Session-Reflector does not support this extension and will
	  use the NTP timestamp format. The Control-Client SHOULD 
          set the PTPv2 Timestamp flag to 0 in the Set-Up-Response message in
	  accordance with <xref target="RFC4656"/>. 
</t>
<t>
         The Control-Client MUST set the PTPv2 Timestamp flag value to 1 in
	 the Modes field in the Set-Up-Response message
         if the Server advertised that the Session-Reflector has the ability
	 to use the PTPv2 format for timestamps. Otherwise, the flag MUST be
         set to 0.
</t>

<t>
         If the value of the PTPv2 Timestamp flag in the Set-Up-Response message 
         is 0, then that means that the Session-Sender can only interpret the
	 NTP timestamp format. Therefore, the Session-Reflector MUST 
         use the NTP timestamp format. If the Session-Reflector does not
	 support the NTP format, then the Server MUST close the TCP connection
	 associated with the TWAMP-Control session. 
</t>
</list>
</t>
          </section>
                    
           <section anchor="test-update" title="OWAMP-Test and TWAMP-Test Updates">
             <t>
   Participants of a test session need to indicate which timestamp
   format is being used.  Currently, the Z field in the Error
   Estimate defined in Section 4.1.2 of <xref target="RFC4656"/> is used for this purpose.  
   However, this document extends the Error Estimate to indicate the
   format of a collected timestamp, in addition to the estimate of error and
   synchronization.  This specification also changes the semantics of the Z
   bit field (the field between S and Scale fields) to be referred to as
   the Timestamp format; the value MUST be set as follows:

             <list style="symbols">
             <t>0 - NTP 64-bit format of a timestamp.</t>
             <t>1 - PTPv2-truncated format of a timestamp.</t>
             </list>
             </t>
             <t>
             As a result of this value of the Z field from the Error Estimate,
	     the Sender Error Estimate (in TWAMP) or Send Error Estimate (in OWAMP) and 
             Receive Error Estimate SHOULD NOT be ignored and MUST be used
	     when calculating delay and delay-variation metrics based on
	     collected timestamps.  
             </t>
             
            <section anchor="twamp-light-aspect" title="Consideration for TWAMP Light Mode">
             <t>
             This document does not specify how the Session-Sender and
	     Session-Reflector in TWAMP Light mode are informed 
             of the timestamp format to be used. It is assumed that, for
	     example, configuration could be used to direct the
             Session-Sender and Session-Reflector to use the
	     timestamp format per their capabilities 
             and rules listed in <xref target="twamp-conn-setup"/>.
             </t>

            </section>             
 
           </section>
 
 
         </section>
 
         
     <section anchor="iana-consider" title="IANA Considerations">

     <t>
     IANA has registered a new PTPv2 Timestamp in the "TWAMP-Modes" registry
     <xref target="RFC5618"/> as follows:
     </t>

  <texttable anchor="timestamp-table" title="New Timestamp Capability">
    <ttcol align='left'>Bit Pos</ttcol>
    <ttcol align='left'>Description</ttcol>
    <ttcol align='left'>Semantics</ttcol>
    <ttcol align='left'>Reference</ttcol>
    <c>9</c>
    <c>PTPv2&nbsp;Timestamp&nbsp;Capability&nbsp;</c>
    <c>Section 2</c>
    <c>RFC 8186 (this&nbsp;document)</c>
    </texttable>

     </section>
     
     <section anchor="security" title="Security Considerations">
     <t>
     Use of a particular timestamp format in a test session does not appear to introduce any additional security threat to hosts that
     communicate with OWAMP and/or TWAMP as defined in <xref
     target="RFC4656"/> and <xref target="RFC5357"/>, 
 respectively.
     The security considerations that apply to any active measurement of live networks are
     relevant here as well.  See the Security Considerations sections in <xref target="RFC4656"/> and
     <xref target="RFC5357"/>.
     </t>
     </section>
      
     

  </middle>
  
    <back>
    <references title="Normative References">
     
     &RFC2119;
     &RFC8174;
 
     &RFC4656;
     
     &RFC5618;
     
     &RFC5357;

     &RFC5905;
     
     &RFC6038;
     
      <reference anchor="IEEE-1588">
<front>
<title>IEEE Standard for a Precision Clock Synchronization Protocol for
Networked Measurement and Control Systems</title>
<author>
<organization>IEEE</organization>
</author>
<date />
</front>
<seriesInfo name="IEEE" value="Std 1588-2008"/>
<seriesInfo name="DOI" value="10.1109/IEEESTD.2008.4579760"/>
</reference> 

    </references>

<!-- [rfced] Terminology: Note that we used "Server Greeting" where the term
was followed by message.  This is consistent with capitalization in RFC 6038.
However, please review instances of "greeting" and let us know if any updates
are needed. 

-->

      <section title="Acknowledgements" numbered="no">
         <t>
The authors would like to thank Ramanathan Lakshmikanthan and Suchit Bansal
for their insightful suggestions. The authors would also like to thank David
Allan for his thorough review and thoughtful comments. 
         </t>  
      </section>

 </back>
 </rfc>
