<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC2119 SYSTEM "reference.RFC.2119.xml">
<!ENTITY RFC6873 SYSTEM "reference.RFC.6873.xml">
<!ENTITY RFC3261 SYSTEM "reference.RFC.3261.xml">
<!ENTITY RFC7206 SYSTEM "reference.RFC.7206.xml">
<!ENTITY RFC5853 SYSTEM "reference.RFC.5853.xml">
<!ENTITY RFC7092 SYSTEM "reference.RFC.7092.xml">
<!ENTITY RFC7989 SYSTEM "reference.RFC.7989.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc number="8123" submissionType="IETF" consensus="yes" category="info" ipr="trust200902">
  <front>

    <title abbrev="&quot;Log Me&quot; Marker">Requirements for Marking SIP Messages to be Logged</title>

    <author fullname="Peter Dawes" initials="P." surname="Dawes">
      <organization>Vodafone Group
	     
	  </organization>

      <address>
        <postal>
          <street>The Connection</street>

          <city>Newbury</city>

          <region>Berkshire</region>

          <code>RG14 2FN</code>

          <country>United Kingdom</country>
        </postal>

        <phone></phone>

        <email>peter.dawes@vodafone.com</email>


      </address>
    </author>
	
	<author fullname="Chidambaram Arunachalam" initials="C." surname="Arunachalam">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>7200-12 Kit Creek Road</street>


          <city>Research Triangle Park</city>

          <region>NC</region>

          <code>27709</code>

          <country>United States of America</country>
        </postal>

        <phone></phone>

        <email>carunach@cisco.com</email>

      </address>
    </author>
	
    <date month="March" year="2017" />

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>logme</keyword>
    <keyword>troubleshooting</keyword>
    <keyword>debug</keyword>
    <keyword>logging</keyword>
    
    <abstract>
      <t>SIP networks use signaling monitoring tools to debug
      customer-reported problems and for regression testing if network
      or client software is upgraded. As networks grow and become
      interconnected, including connection via transit networks, it
      becomes impractical to predict the path that SIP signaling will
      take between clients and, therefore, impractical to monitor SIP
      signaling end-to-end.</t>

<t>This document describes the requirements for adding an indicator to
the SIP Protocol Data Unit (PDU) or a SIP message that marks the PDU
as a candidate for logging. Such a marking will typically be applied as
part of network testing controlled by the network operator and not
used in regular client signaling. However, such a marking can be carried
end-to-end, including the SIP terminals, even if a session originates
and terminates in different networks.</t>
    </abstract>
  </front>

<middle>
   <section title="Introduction">
	<t>Service providers, enterprises, and others who operate
	networks that use SIP (see <xref target="RFC3261"/>) need the
	ability to debug problems reported by end users and also to run
	regression tests if SIP client software/hardware is
	upgraded. Such debugging and testing might be confined to a
	single service provider or network, or they may occur between the
	administrative domains of different network operators,
	including domains in different countries that are
	interconnected through networks belonging to one or more third
	parties.
	</t>

	<t>A mechanism is needed to mark particular SIP sessions,
	i.e., those related to debugging or regression testing, as
	candidates for logging; this marking must be carried within
	the candidate SIP messages as they are routed across networks
	(and geographies) to enable logging at each SIP entity without
	having to know in advance the list of SIP entities through
	which the SIP signaling messages will traverse. Such marking
	must take into account that SIP messages might traverse
	different network operators, different countries, regions with
	different privacy requirements, and different trust
	domains. This document describes the requirements for such a
	"log me" marker for SIP signaling.</t>
   </section>
   <section title="Conventions Used in This Document">
     <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"/>,
     except that rather than describing interoperability requirements, they
     are used to describe requirements to be satisfied by the "log me" marker solution.</t>
   </section>
   
	<section title="Terminology">
		<section title="Network Boundary">
			<t>A network boundary is the part of a signaling path
			where messages pass between entities that are under
			different administrative control. Figure 2 in <xref
			target="RFC5853"/> shows a network boundary  between
			the originating gateway GW-A1 in operator A's network and the Session Border Controller (SBC) in operator B's network. A network boundary is significant in this document because manipulation of signaling at the boundary could prevent end-to-end testing or troubleshooting.
			</t>
			<t>Topology hiding and protocol repair (see <xref target="RFC5853"/>) are two common functions that manipulate signaling at the network boundary. These functions are performed by SIP device types  (see <xref target="RFC7092"/>) such as a Session Border Controller and Interconnection Border Control Function (IBCF).</t>
		</section>
		<section title="Trust Domain">



			<t>In this document, a trust domain is the set of
			entities that have been identified by prior
			agreement as the participating elements in logging,
			typically for the purpose of debugging or regression
			testing. A trust domain contains all SIP entities
			under configuration control of the network operator
			who is performing regression testing plus all SIP
			entities that are under configuration control of peer
			network operators who have agreed to participate in
			that regression testing. The purpose of trust domain
			requirements is to prevent network operators from inadvertently triggering logging in networks that are not part of any testing or troubleshooting.</t>
		</section>
		<section title="Intermediary">
			<t>The term "intermediary" is defined in Section 2 of <xref target="RFC7989"/>; it refers to any entity along the call signaling path.</t>
		</section>
	</section>
   
   <section title="Motivating Scenario">
	<section title="Introduction">
     <t>Signaling for SIP session setup can cross several networks;
     these networks may not have common ownership and may also be
     in different countries. If a single operator wishes to perform
     regression testing or fault debugging end-to-end, the separate
     ownership of networks that carry the signaling and the explosion
     in the number of possible signaling paths through SIP entities
     from the originating to the terminating user make it impractical
     to preconfigure logging end-to-end SIP signaling of a session
     of interest.</t>
	</section>
	<section title="Example Network Arrangement">
	   <t>The figure below gives an example of a signaling path through multiple networks.
	   </t>
<figure align="center" anchor="re-registration" title="Example Signaling Path through Multiple Networks">
     <artwork align="left"><![CDATA[

   +------------------+          +------------------+
   | COUNTRY W        |          | COUNTRY X        |
   | Operator A       |          | Operator A       |
   |                  |          |                  |
   | SIP Phones       |          | SIP Phones       |
   |                  |        //|                  |
   +------------------+       // +------------------+
          |                  //
          |                 //           
       ,'```',             //    +------------------+
   .`',.'      `..'``',<==//     | COUNTRY X        |
   ,'  Operator A         `',    | Operator A       |
   ;    Backbone Network    ..'--|                  |
   ',            ,.,    .'`      | PSTN phones      |
   '.,.`'.,,,.`   `''`           |                  |
          ||                     +------------------+
          ||
          \/
   +------------------+
   |                  |
   |  Transit Network |
   |                  |
   |                  |\\
   +------------------+ \\
           |             \\
           |              \\  
   +------------------+    \\    +------------------+
   | COUNTRY Z        |     \\   | COUNTRY Y        |
   | Operator C       |      \\=>| Operator B       |
   |                  |          |                  |
   | SIP Phones       |          | SIP Phones       |
   |                  |          |                  |
   +------------------+          +------------------+
                                                                    
   ]]></artwork>
	   </figure>
	</section>
	<section title="Example Debugging Procedure">
	   <t>One possible set of steps is outlined below to illustrate the debugging procedure.</t>
		 <t><list style="symbols">
		   <t>The user's terminal is placed in debug mode. The terminal logs its own signaling and inserts a "log me" marker into SIP requests for session setup.</t>
		   <t>All SIP entities that the signaling traverses, from the
		   first proxy the terminal connects to at the edge of the
		   network to the destination client terminal, detect that the
		   "log me" marker is present and then log SIP requests and responses that contain the marker if configured to do so.</t>
		   <t>Subsequent responses and requests in the same dialog are
		   also marked with a "log me" marker. For some scenarios,
		   such as call transfer, related dialogs may also be marked
		   with "log me" marker.</t>

		   <t>Logging stops, either because the dialog has ended or
		   because a "stop event", typically expiry of a certain amount of time, occurred.</t>
		   <t>Logs are retrieved, for example, by logging on to the SIP entity or entities that contain the logs.</t>
		 </list></t>
	</section>
   </section>

   <section title='"Log Me" Marking Requirements'>
   <section title="Message Logs">
      <t><list style="format REQ%d" counter="my_count">
         <t>If a SIP message is logged, then the entire SIP message (SIP
	 headers and message body) MUST be logged using a standard logging
	 format such as SIP Common Log Format (CLF) defined in <xref target="RFC6873"/>.</t>
         <t>Header fields SHOULD be logged in the form in which they
	 appear in the message; they SHOULD NOT be converted between long and
	 compact forms as described in <xref target="RFC3261"/>, Section 7.3.3.</t>
      </list></t>
	  <t>When and how signaling logs are retrieved is out of scope of this
	  document. Logs might be retrieved by logging on to the SIP entity
	  that contains the logs, by sending logs to a central server that is
	  coordinating debugging, by storing them on removable media for
	  later manual collection, or by some other method. All log retrieval
	  mechanisms MUST adhere to the authorization and privacy protection policies set forth by the network administrator.</t>
	</section>

	<section title="&quot;Log Me&quot; Marking">

      <t><list style="format REQ%d:" counter="my_count">



         <t>It MUST be possible to mark a SIP request or
         response to be considered for logging by inserting a "log me"
         marker. This is known as "log me" marking.</t>
         <t>It MUST be possible for a "log me" marker to cross network boundaries.</t>
         <t>A "log me" marker MAY include an identifier that
         indicates the test case that caused it to be inserted, known
         as a "test case identifier". The test case identifier does
         not have any impact on session setup; it is used to collate
         all logged SIP requests and responses to the initial SIP request in a dialog or 
         standalone transaction. The local Universally Unique 
         Identifier (UUID) portion of the Session-ID described in 
         <xref target="RFC7206"/> and <xref target="RFC7989"/> could be used as a random test case identifier.</t>
      </list></t>
	</section>
	
	<section title="Processing the &quot;Log Me&quot; Marker">

      <t><list style="format REQ%d:" counter="my_count">
         
         <t>A "log me" marker is most effective if all networks
         on the signaling path agree to pass it end-to-end. However,
         source networks should behave responsibly and not leave it to
         a downstream network to detect and remove a marker that it is
         not expecting.</t>
         <t>The presence of a "log me" marker indicates that a
         request or response is part of debugging or regression
         testing.</t>
         <t>It MUST be possible to insert a "log me" marker in SIP
	 responses that correspond to SIP requests with a "log me" marker in
	 order to ensure that the complete SIP transaction is logged. This
	 requirement applies to endpoints, SIP/Public Switched Telephone
	 Network (PSTN) gateways, and back-to-back user agents (B2BUAs).</t>
         <t>The "log me" marker mechanism SHOULD allow a SIP
	 intermediary to request logging SIP requests and responses on behalf
	 of the originating endpoint. The typical use case for this
	 requirement is for compatibility with User Agents (UAs) that have not
	 implemented "log me" marking, i.e., when a UA has not marked a
	 request or when responses received on a dialog of interest for
	 logging do not contain an echoed "log me" marker. Another use case is
	 when the session origination UA that inserted the "log me" marker is no
	 longer participating in the session (e.g., call transfer scenarios)
	 and the intermediary adds a "log me" marker in related sessions to enable end-to-end signaling analysis.</t>
         <t>The mechanism MUST allow stateless processing of SIP requests that contain a "log me" marker by SIP intermediaries. This requirement enables the SIP intermediaries to base the decision to log a SIP request or response solely on the presence of the "log me" marker.</t>
		 <t>The scope of a SIP message logging request includes all requests and responses within a given dialog. The scope can be extended to related dialogs that correspond to an end-to-end session for scenarios discussed in REQ9. The "log me" request MUST be indicated at the beginning of the dialog of interest and SHOULD continue to the dialog end without any stop and restart during the duration of the dialog.</t>
       <t>The presence of a "log me" marker might cause some SIP entities to log signaling. Therefore, this marker MUST be removed at the earliest opportunity if it has been incorrectly inserted (e.g., mid-dialog or outside the configured start and stop of "log me" marking).</t>
      </list></t>
	  <t>The definition of types of events that cause logging to stop and
	  the configuration of SIP entities to detect such "stop events" is outside the scope of this document.</t>
	</section>
	</section>

   <section anchor="Security" title="Security Considerations">
      <t>In order to prevent any security implications of a "log me" marker, the marker itself MUST NOT contain any sensitive information, detecting its presence or absence MUST NOT reveal sensitive information, and maliciously adding a "log me" marker MUST NOT adversely affect a network. This section analyzes how to meet these requirements.</t>
      <section title="Trust Domain">
         <t>Since a "log me" marker may cause a SIP entity to log the SIP header and body of a request or response, the "log me" marker MUST be removed at a trust domain boundary. If a prior agreement to log sessions exists with the next hop network, then the "log me" marker SHOULD NOT be removed.</t>
      </section>
      <section title="Security Threats">
         <section title="&quot;Log Me&quot; Marking">
            <t>The "log me" marker MUST NOT convey any sensitive information, although the "log me" marker will sometimes be inserted because a particular device is experiencing problems. The "log me" marker MUST NOT reveal any information related to any SIP user or device.</t>
            <t>The insertion of the "log me" marker at the endpoint MUST be approved by the end user or by the network administrator. Similarly, network administrator authorization is required for a SIP intermediary to insert a "log me" marker on behalf of a UA that does not support "log me" marking.</t>
            <t>Activating a debug mode affects the operation of a terminal;
	    therefore, the debugging configuration MUST be supplied by an
	    authorized party to an authorized terminal through a secure
	    communication channel.</t>

         </section>
         <section title="Logged Information">
            <t>Logged signaling is privacy-sensitive data; therefore, signaling logs MUST NOT be readable by an unauthorized third party.</t>
         </section>         
      </section>
  </section> 

  <section anchor="IANA" title="IANA Considerations">
    <t>This document does not require any IANA actions.</t>
  </section>
  

  
</middle>


<back>

  <references title="Normative References">

      &RFC2119;
	  
	  &RFC6873;
  </references>

  <references title="Informative References">
      
      &RFC3261;
	  
	  &RFC5853;
   
	  &RFC7206;
	  
	  &RFC7092;
      
      &RFC7989;
      
  </references>
  <section anchor="acknowledgments" title="Acknowledgments" numbered="no">
    <t>The authors wish to thank Jorgen Axell, Ben Campbell, Keith Drage, Vijay Gurbani, Christer Holmberg, Hadriel Kaplan, Paul Kyzivat, James Polk, Gonzalo Salgueiro, Alberto Llamas, Brett Tate, Paul Giralt, Stewart Bryant, Sean Turner, and Dan Romascanu for their constructive comments and guidance while developing this document.</t>
  </section>

<!-- [rfced] Throughout the text, the following terminology appears to be used 
inconsistently.  

"Logme" vs. "log me" vs. "log-me" 

We have updated to use "log me" in general text and "Log Me" in titles.  Please let us know any objections.

-->


</back>
</rfc>
