<?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 rfc3261 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3261.xml">
<!ENTITY rfc5039 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5039.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc rfcprocack="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc sortrefs="no" ?>
<?rfc colonspace='yes' ?>
<?rfc tocindent='yes' ?>
<rfc category="exp" docName="draft-wing-sipping-spam-score-01" ipr="full3978">
  <front>
    <title abbrev="SIP Spam Score">Spam Score for SIP</title>

    <author fullname="Dan Wing" initials="D." surname="Wing">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street>170 West Tasman Drive</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>dwing@cisco.com</email>
      </address>
    </author>

    <author fullname="Saverio Niccolini" initials="S." surname="Niccolini">
      <organization abbrev="NEC">Network Laboratories, NEC Europe Ltd.</organization>

      <address>
        <postal>
          <street>Kurfuersten-Anlage 36</street>

          <city>Heidelberg</city>

          <code>69115</code>

          <country>Germany</country>
        </postal>

        <phone>+49 (0) 6221 4342 118</phone>

        <email>saverio.niccolini@netlab.nec.de</email>

        <uri>http://www.netlab.nec.de</uri>
      </address>
    </author>

    <author fullname="Martin Stiemerling" initials="M." surname="Stiemerling">
      <organization abbrev="NEC">Network Laboratories, NEC Europe Ltd.</organization>

      <address>
        <postal>
          <street>Kurfuersten-Anlage 36</street>

          <city>Heidelberg</city>

          <code>69115</code>

          <country>Germany</country>
        </postal>

        <phone>+49 (0) 6221 4342 113</phone>

        <email>stiemerling@netlab.nec.de</email>

        <uri>http://www.netlab.nec.de</uri>
      </address>
    </author>

    <author initials="H." surname="Tschofenig" fullname="Hannes Tschofenig">
      <organization>Nokia Siemens Networks</organization>
      <address>
        <postal>
          <street>Linnoitustie 6</street>
          <city>Espoo</city>
          <code>02600</code>
          <country>Finland</country>
        </postal>
        <phone>+358 (50) 4871445</phone>
        <email>Hannes.Tschofenig@nsn.com</email>
        <uri>http://www.tschofenig.com</uri>
      </address>
    </author>


    <date year="2008"/>
    <workgroup>RUCUS Exploratory Working Group</workgroup>
    <abstract>
      <t>This document defines a mechanism for SIP proxies to communicate a spam score to downstream
        SIP proxies and to SIP user agents. This information can then be used as input to other
        decision making engines, for example, to provide alternate call routing or call
      handling.</t>
    </abstract>

  </front>

  <middle>
    <section title="Introduction">
      <t>It is desirable for SIP proxies to insert a spam score so that downstream SIP proxies and
        downstream SIP user agents can use a high score to decide that special handling is required.
        For example, a score above 20 might cause one of the spam avoidance techniques described in
          <xref target="RFC5039"/> to be triggered for this call.</t>

      <t>This specification allows each SIP proxy to contribute spam scoring information that can be
        useful to downstream SIP proxies and the SIP user agent (UA). The downstream SIP proxies or
        SIP UA might ignore that information (e.g., it doesn't trust the SIP proxy that generated
        the spam score) or might use it.</t>

      <t>Note that this document does not make the attempt to define how the spam score was derived
        nor to distribute information that could be used to verify the spam score generation.
        Furthermore, this document does not attempt to cryptographically bind the identity of the
        entity generating the score to the value itself. Hence, its usage is likely to be useful
        only between neighboring administrative domains communicating such a score. </t>
    </section>

    <section title="Terminology">
      <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"/>.</t>
    </section>

    <section title="Operation of Spam-Scoring Proxy">
      <t>A SIP proxy evaluates an incoming SIP request and generates a spam score using a local
        mechanism. This score is between 0 (indicating the message is not spam) and 100 (indicating
        the message is spam). Values between 0 and 100 indicate the 'likelihood' that the SIP
        request is spam, with higher values indicating a higher likelihood the message is spam.</t>

      <t>This spam score is inserted into the new "Spam-Score" header. This header field contains a
        summary spam score and optionally contains detail information. The detail information is
        implementation dependent. The detail information is valuable for debugging and to provide
        the SIP user agent or SIP proxy with additional information regarding how the spam-scoring
        SIP proxy's local mechanism arrived at the summary spam score.</t>
    </section>

    <section title="Operation of Proxy or User Agent">
      <t>A downstream proxy or the SIP user agent MAY use the spam score or spam-detail information
        to change call routing or call handling. It is envisioned that some form of policies
        indicate the trusted proxies in order to decide which spam scores to consider for special
        call treatment. <list>
          <t>In some jurisdictions, the end user needs to authorize call handling, including
            rejection of a call based on a spam score. Mechanisms to allow users to influence such
            policies are, however, out of scope of this document.</t>
        </list></t>

      <t>The behavior of the SIP proxy or user agent when the spam score is above a certain value is
        a local policy matter. Examples of behavior include: <list style="symbols">
          <t>a SIP request with a high spam score might cause a proxy or user agent to redirect the
            SIP request to company's main telephone extension or to the user's voicemail</t>

          <t>a user agent might alert the user by flashing the phone (without audible ringing)</t>

          <t>a user agent might allow calls with a spam score below a certain value during daylight
            hours, but deny such calls at night.</t>

          <t>a proxy might challenge the caller to complete a Turing test.</t>
        </list></t>
    </section>

    <section title="Grammar">
      <figure anchor="ABNF" title="ABNF">
        <preamble>ABNF using the ABNF syntax of <xref target="RFC3261"/>:</preamble>

        <artwork align="left"><![CDATA[
  extension-header   = spam-score [ SP ";" spam-detail ]

  spam-score         = score SP "by" SP hostname   
  score              = 1*3DIGIT [ "." 0*3DIGIT ]

  spam-detail        = "detail" EQUAL detail
  detail             = QUOTE mech SEMI rule-score 
                       *(COMMA rule-score) QUOTE   
                       ; mathematical average of the rule-scores 
                       ; MUST be same as spam-score

  rule-score         = rule [ "=" score ]
  mech               = token
  rule               = token
]]></artwork>

        <postamble/>
      </figure>
    </section>

    <section anchor="examples" title="Examples">
      <figure anchor="example" title="Example with spam scores">
        <preamble>The following example shows a SIP score generated and inserted by two SIP proxies,
          sip.example.com and sip.example.net. In this example, sip.example.com is owned by a
          spammer who is trying to fool downstream systems with their low spam score (0). However,
          the example.net proxies and user agents only pay attention to spam scores from Spam-Score
          headers generated by example.net proxies, so example.com's attempts to fool the downstream
          proxies (with its low spam score) are in vain.</preamble>

        <artwork align="left"><![CDATA[
  INVITE sip:bob@example.net SIP/2.0
  Via: SIP/2.0/UDP sip.example.net;branch=z9hG4bKnashds8
    ;received=192.0.2.1
  Spam-Score: 75 by sip.example.net 
    ;detail="SIPfilter-1.0;call_volume=75"
  Via: SIP/2.0/UDP sip.example.com;branch=z9hG4bKfjzc
    ;received=192.0.2.127
  Max-Forwards: 70
  To: Bob <sip:bob@example.net>
  From: Alice <sip:alice@example.com>;tag=1928301774
  Call-ID: a84b4c76e66710@pc33.example.com
  CSeq: 314159 INVITE
  Contact: <sip:alice@pc33.example.com>
  Content-Type: application/sdp
  Content-Length: 142

  [... SDP elided from this example...]
]]></artwork>

        <postamble/>
      </figure>
    </section>

    <section anchor="security_considerations" title="Security Considerations">
      <t>SIP proxies and SIP user agents need to ignore spam scores generated by proxies that aren't
        trusted. </t>
      <t>[[This section will be completed in a later version of this document.]]</t>
    </section>

    <section title="Acknowledgements">
      <t>Thanks to Joachim Charzinski, Daniel Quinlan, and S. Moonesamy for their suggestions to
        improve this document.</t>
    </section>

    <section title="IANA Considerations">
      <t>[[This section will be completed in a later version of this document.]]</t>
    </section>
  </middle>

  <back>
    <references title="Normative References"> &rfc2119; &rfc3261; </references>

    <references title="Informational References"> &rfc5039; </references>
    <section title="Changes">
      <t>Note to RFC Editor: please remove this section prior to publication.</t>
      <section title="Changes from -00 to -01">
        <t>
          <list style="symbols">
            <t>Changed scoring from positive/negative to 0-100 range.</t>
            <t>Moved score from a "Via:" extension to a new header "Spam-Score:".</t>
            <t>Changed from Standards Track to Experimental.</t>
          </list>
        </t>
      </section>
    </section>
  </back>
</rfc>
