[Cache from http://www.jabber.org/%7Estpeter/editor/cap.html, 2004-02-28. See this canonical source if possible.]

JEP-01xx: Common Alerting Protocol (CAP) over XMPP

WARNING: This Standards-Track JEP is Experimental. Publication as a Jabber Enhancement Proposal DOES NOT imply acceptance or approval of this proposal. Implementation of the protocol described herein is NOT RECOMMENDED except in an exploratory fashion (e.g., in a proof of concept). Production systems SHOULD NOT deploy implementations of this protocol until it advances to a status of Draft.

Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JID: stpeter@jabber.org

Boyd Fletcher

Email: Boyd.Fletcher@je.jfcom.mil
JID: bfletcher@jabber.com

JEP Information

Number: 01xx
Status: Experimental
Type: Standards Track
JIG: Standards JIG
Dependencies: XMPP Core, Common Alerting Protocol
Supersedes: None
Superseded By: None
Short Name: None

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG mailing list: <https://jabberstudio.org/mailman/listinfo/standards-jig>.

Revision History

Version 0.1 (2004-02-23)

Initial version. (psa)


Table of Contents:
1. Introduction
2. Terminology
3. Protocol
3.1. Direct Messages
3.2. PubSub
4. Security Considerations
5. IANA Considerations
6. Jabber Registrar Considerations
7. XML Schema


1. Introduction

The Common Alerting Protocol [1] (CAP) is an open format for alerts and notifications, defined by OASIS [2]. CAP was developed to address the call, published in a (U.S.) National Science and Technology Council report, for "a standard method ... to collect and relay instantaneously and automatically all types of hazard warnings and reports". Given that the Extensible Messaging and Presence Protocol (XMPP) provides a near-real-time transport mechanism for structured information, and that CAP is defined as an XML data format, it makes sense to define a way to transport CAP information over XMPP. Such a method is defined herein.

2. Terminology

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [3].

3. Protocol

Because the alerts and notifications structured via CAP require a "push" medium, they SHOULD be sent via the XML <message/> stanza defined in XMPP Core [4]. The message could be (1) sent directly from the sender to a recipient or list of recipients (which might include a Multi-User Chat [5] room) via standard XMPP messaging or (2) published to a list of subscribers via Publish-Subscribe [6]. Both methods are described below.

3.1 Direct Messages

In the case of direct messages, the message stanza SHOULD have no 'type' attribute, but MAY have any defined type that is appropriate to the communications context (e.g., "groupchat" in a text conference). The <alert/> element SHOULD be the only child element of the message stanza, but other elements MAY be included as necessary (e.g., a <body/> child in the 'jabber:client' namespace providing a natural-language description of the alert). The 'id' attribute of the <message/> stanza MAY be set to the value of the CAP <identifier/> element.

The following example shows Example A.2 from the CAP specification sent as a direct message.

Example 1. An Alert Sent as a Message

<message from='KSTO@NWS.NOAA.GOV' 
         to='weatherbot@jabber.org'
         id='KSTO1055887203'>
  <alert xmlns='http://www.incident.com/cap/1.0'
    <identifier>KSTO1055887203</identifier>
    <sender>KSTO@NWS.NOAA.GOV</sender>
    <sent>2003-06-17T14:57:00-07:00</sent>
    <status>Actual</status>
    <msgType>Alert</msgType>
    <scope>Public</scope>
    <info>
      <category>Met</category>
      <event>SEVERE THUNDERSTORM</event>
      <urgency>Severe</urgency>
      <certainty>Likely</certainty>
      <eventCode>same=SVR</eventCode>
      <senderName>NATIONAL WEATHER SERVICE SACRAMENTO</senderName>
      <headline>SEVERE THUNDERSTORM WARNING</headline>
      <description>
        AT 254 PM PDT... NATIONAL WEATHER SERVICE DOPPLER RADAR 
        INDICATED A SEVERE THUNDERSTORM OVER SOUTH CENTRAL ALPINE 
        COUNTY... OR ABOUT 18 MILES SOUTHEAST OF KIRKWOOD... 
        MOVING SOUTHWEST AT 5 MPH. HAIL... INTENSE RAIN AND STRONG 
        DAMAGING WINDS ARE LIKELY WITH THIS STORM
      </description>
      <instruction>
        TAKE COVER IN A SUBSTANTIAL SHELTER UNTIL THE STORM PASSES
      </instruction>
      <contact>BARUFFALDI/JUSKIE</contact>
      <area>
        <areaDesc>
          EXTREME NORTH CENTRAL TUOLUMNE COUNTY IN CALIFORNIA, 
          EXTREME NORTHEASTERN CALAVERAS COUNTY IN CALIFORNIA,
          SOUTHWESTERN ALPINE COUNTY IN CALIFORNIA
        </areaDesc>
        <polygon>
          38.47,-120.14 38.34,-119.95 38.52,-119.74 
          38.62,-119.89 38.47,-120.14
        </polygon>
        <geocode>fips6=006109</geocode>
        <geocode>fips6=006109</geocode>
        <geocode>fips6=006103</geocode>
      </area>
    </info>
  </alert>
</message>
    

3.2 PubSub

The publish-subscribe protocol defined in JEP-0060 provides a way to send information to a number of subscribers, and to control the list of subscribers.

The following example shows Example A.2 from the CAP specification published to a pubsub node.

Example 2. An Alert Published to a PubSub Node

<iq type='set'
    from='KSTO@NWS.NOAA.GOV'
    to='pubsub.jabber.org'
    id='someID'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='NOAA-ALERTS'>
      <item id='KSTO1055887203'>
        <alert xmlns='http://www.incident.com/cap/1.0'
          <identifier>KSTO1055887203</identifier>
          <sender>KSTO@NWS.NOAA.GOV</sender>
          <sent>2003-06-17T14:57:00-07:00</sent>
          <status>Actual</status>
          <msgType>Alert</msgType>
          <scope>Public</scope>
          <info>
            <category>Met</category>
            <event>SEVERE THUNDERSTORM</event>
            <urgency>Severe</urgency>
            <certainty>Likely</certainty>
            <eventCode>same=SVR</eventCode>
            <senderName>NATIONAL WEATHER SERVICE SACRAMENTO</senderName>
            <headline>SEVERE THUNDERSTORM WARNING</headline>
            <description>
              AT 254 PM PDT... NATIONAL WEATHER SERVICE DOPPLER RADAR 
              INDICATED A SEVERE THUNDERSTORM OVER SOUTH CENTRAL ALPINE 
              COUNTY... OR ABOUT 18 MILES SOUTHEAST OF KIRKWOOD... 
              MOVING SOUTHWEST AT 5 MPH. HAIL... INTENSE RAIN AND STRONG 
              DAMAGING WINDS ARE LIKELY WITH THIS STORM
            </description>
            <instruction>
              TAKE COVER IN A SUBSTANTIAL SHELTER UNTIL THE STORM PASSES
            </instruction>
            <contact>BARUFFALDI/JUSKIE</contact>
            <area>
              <areaDesc>
                EXTREME NORTH CENTRAL TUOLUMNE COUNTY IN CALIFORNIA, 
                EXTREME NORTHEASTERN CALAVERAS COUNTY IN CALIFORNIA,
                SOUTHWESTERN ALPINE COUNTY IN CALIFORNIA
              </areaDesc>
              <polygon>
                38.47,-120.14 38.34,-119.95 38.52,-119.74 
                38.62,-119.89 38.47,-120.14
              </polygon>
              <geocode>fips6=006109</geocode>
              <geocode>fips6=006109</geocode>
              <geocode>fips6=006103</geocode>
            </area>
          </info>
        </alert>
      </item>
    </publish>
  </pubsub>
</iq>
    

If the pubsub node is configured to deliver payloads to all subscribers, the information is then sent to all subscribers.

Example 3. An Alert Sent as a PubSub Payload

<message from='pubsub.jabber.org'
         to='weatherbot@jabber.org'>
  <event xmlns="http://jabber.org/protocol/pubsub#event">
    <items node="NOAA-ALERTS">
      <alert xmlns='http://www.incident.com/cap/1.0'
        <identifier>KSTO1055887203</identifier>
        <sender>KSTO@NWS.NOAA.GOV</sender>
        <sent>2003-06-17T14:57:00-07:00</sent>
        <status>Actual</status>
        <msgType>Alert</msgType>
        <scope>Public</scope>
        <info>
          <category>Met</category>
          <event>SEVERE THUNDERSTORM</event>
          <urgency>Severe</urgency>
          <certainty>Likely</certainty>
          <eventCode>same=SVR</eventCode>
          <senderName>NATIONAL WEATHER SERVICE SACRAMENTO</senderName>
          <headline>SEVERE THUNDERSTORM WARNING</headline>
          <description>
            AT 254 PM PDT... NATIONAL WEATHER SERVICE DOPPLER RADAR 
            INDICATED A SEVERE THUNDERSTORM OVER SOUTH CENTRAL ALPINE 
            COUNTY... OR ABOUT 18 MILES SOUTHEAST OF KIRKWOOD... 
            MOVING SOUTHWEST AT 5 MPH. HAIL... INTENSE RAIN AND STRONG 
            DAMAGING WINDS ARE LIKELY WITH THIS STORM
          </description>
          <instruction>
            TAKE COVER IN A SUBSTANTIAL SHELTER UNTIL THE STORM PASSES
          </instruction>
          <contact>BARUFFALDI/JUSKIE</contact>
          <area>
            <areaDesc>
              EXTREME NORTH CENTRAL TUOLUMNE COUNTY IN CALIFORNIA, 
              EXTREME NORTHEASTERN CALAVERAS COUNTY IN CALIFORNIA,
              SOUTHWESTERN ALPINE COUNTY IN CALIFORNIA
            </areaDesc>
            <polygon>
              38.47,-120.14 38.34,-119.95 38.52,-119.74 
              38.62,-119.89 38.47,-120.14
            </polygon>
            <geocode>fips6=006109</geocode>
            <geocode>fips6=006109</geocode>
            <geocode>fips6=006103</geocode>
          </area>
        </info>
      </alert>
    </items>
  </event>
</message>
.
.
.
    

4. Security Considerations

Security considerations for XMPP are defined in XMPP Core; security considerations for CAP are defined in Common Alerting Protocol, v. 1.0.

5. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].

6. Jabber Registrar Considerations

No namespaces or parameters need to be registered with the Jabber Registrar [8] as a result of this JEP.

7. XML Schema

The CAP information format is defined by an XML schema. The reader is referred to the CAP specification for the relevant schema definition.


Notes

1. Common Alerting Protocol, v. 1.0 <http://www.oasis-open.org/committees/documents.php?wg_abbrev=emergency>.

2. OASIS is a not-for-profit, international consortium that drives the development, convergence and adoption of e-business standards. For further information, see <http://www.oasis-open.org/>.

3. RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <http://www.ietf.org/rfc/rfc2119.txt>.

4. XMPP Core <http://www.jabber.org/ietf/> (Proposed Standard, RFC number to follow).

5. JEP-0045: Multi-User Chat <http://www.jabber.org/jeps/jep-0045.html>.

6. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.

7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols. For further information, see <http://www.iana.org/>.

8. The Jabber Registrar maintains a list of reserved Jabber namespaces as well as a registry of parameters used in the context of JEPs approved by the JSF. For further information, see <http://www.jabber.org/registrar/>.