XEP-xxxx: PubSub Server Information

Abstract
This document defines a data format whereby basic information of an XMPP domain can be expressed and exposed over pub-sub.
Author
Guus der Kinderen
Copyright
© 2023 – 2023 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

ProtoXEP

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <https://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.
Type
Standards Track
Version
0.0.1 (2023-12-19)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

To facilitate discovery of information of individual domains in an XMPP-based network, this specification defines a data format to define basic information for individual XMPP domains. By leveraging Publish-Subscribe (XEP-0060) [1] this information can efficiently be shared with applications that compose an overview of the larger XMPP network.

2. Requirements

3. Discovering Support

Domains supporting the publication of Server Information data, as described in this document, MUST advertise the fact by announcing a Service Discovery (XEP-0030) [3] feature of 'urn:xmpp:serverinfo:0'. This signifies that an administrative entity approved the publication of data, which is important for the opt-in mechanism described in Privacy Considerations section of this document.

The pub-sub service address and node in which Server Information data is advertised SHOULD be specified using a Service Discovery Extensions (XEP-0128) [4], using an URI as specified in section 12.22 of XEP-0060. These pub-sub coordinates MUST be scoped using a FORM_TYPE of "http://jabber.org/network/serverinfo" (as specified in XEP-0157) and data form field registered for this purpose as defined in the XMPP Registrar Considerations section of this document.

When the 'urn:xmpp:serverinfo:0' feature but no corresponding Service Discovery Extension is advertised, the node that is used will be a first-level leaf node using the name 'serverinfo' on the first pub-sub service advertised through service discovery.

Example 1. Service Discovery information request
<iq type='get'
    from='francisco@denmark.lit/barracks'
    to='shakespeare.lit'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 2. Service Discovery information response
<iq type='result'
  from='shakespeare.lit'
  to='francisco@denmark.lit/barracks'
  id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='urn:xmpp:serverinfo:0'/>
    ...
    <x xmlns='jabber:x:data' type='result'>
      <field var='FORM_TYPE' type='hidden'>
        <value>http://jabber.org/network/serverinfo</value>
      </field>
      <field var='serverinfo-pubsub-node'>
        <value>xmpp:pubsub.shakespeare.lit?;node=serverinfo</value>
      </field>      
    </x>
  </query>
</iq>

The node MUST reference a first-level leaf node on a pub-sub service.

Example 3. Entity queries root node for information
<iq type='get'
    from='francisco@denmark.lit/barracks'
    to='pubsub.shakespeare.lit'
    id='info1'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='serverinfo'/>
</iq>
Example 4. Service responds with identity of pubsub/leaf
<iq type='result'
    from='pubsub.shakespeare.lit'
    to='francisco@denmark.lit/barracks'
    id='info1'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='serverinfo'>
    ...
    <identity category='pubsub' type='leaf'/>
    ...
  </query>
</iq>

4. Data Format

The data format uses an element named 'serverinfo' in the namespace 'urn:xmpp:serverinfo:0'. In its minimal form, it defines each XMPP domain name served by the local server in an attribute named 'name'.

Example 5. Minimal Data Format
<serverinfo xmlns='urn:xmpp:serverinfo:0'>
  <domain name='shakespeare.lit'/>
</serverinfo>

The optional 'federation' child element is used to denote remote XMPP domains with which the local domain is federating. Each of them are represented by an element named 'remote-domain'. The domain name of the peer in an optional attribute named 'name'. Optionally, each actual (e.g. TCP) connection from the local server to the peer is added as a 'connection' child-element to the 'remote-domain' element, that has an optional 'type' attribute, defining the directionality of the connection (one of 'incoming', 'outgoing' and 'bidi').

The name of a remote domain MUST only be included if the remote server advertises support for this XEP. This acts as an opt-in mechanism, to address the privacy concern defined in the Privacy Considerations section of this document.

Example 6. Data Format with Federated Domains
<serverinfo xmlns="urn:xmpp:serverinfo:0">
  <domain name="shakespeare.lit">
    <federation>
      <remote-domain name='denmark.lit'>
        <connection type="incoming"/>
        <connection type="outgoing"/>
      </remote-domain>
      <remote-domain name='montague.net'>
        <connection type="bidi"/>
      </remote-domain>
    </federation>
  </domain>
</serverinfo>

Additional data MAY be included as child-elements of the 'serverinfo' element or any of the 'domain' elements. Such data MUST be namespaced appropriately. The example below uses the 'query' element defined in Software Version (XEP-0092) [2] to include information about the software application associated with the local server.

Example 7. Data Format with Software Version
<serverinfo xmlns="urn:xmpp:serverinfo:0">
  <domain name="shakespeare.lit">
    <federation>
      <remote-domain name='montague.net'>
        <connection type="bidi"/>
      </remote-domain>
    </federation>
  </domain>
  <query xmlns='jabber:iq:version'>
    <name>Openfire</name>
    <version>4.8.0</version>
    <os>Windows 11</os>
  </query>
</serverinfo>

5. Publication

The data is to be published using a pub-sub node named 'serverinfo' that MUST be a first-level leaf node of a pub-sub service for the domain. It is RECOMMENDED that the leaf-node is configured to have an open access model and contain a maximum of 1 item.

Example 8. Publish ServerInfo Item
  <iq type='set'
      from='william@shakespeare.lit/atwork'
      to='pubsub.shakespeare.lit'
      id='publish1'>
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
      <publish node='serverinfo'>
        <item id='current'>
          <serverinfo xmlns="urn:xmpp:serverinfo:0">
            <domain name="shakespeare.lit">
              <federation>
                <remote-domain name='denmark.lit'>
                  <connection type="incoming"/>
                  <connection type="outgoing"/>
                </remote-domain>
                <remote-domain name='montague.net'>
                  <connection type="bidi"/>
                </remote-domain>
              </federation>
            </domain>
          </serverinfo>
        </item>
      </publish>
    </pubsub>
  </iq>

6. Implementation Notes

As certain information can be expected to be updated continuously and frequently, the server MAY choose to reduce the frequency of updates of the 'serverinfo' pub-sub node.

7. Privacy Considerations

When multiple domains publish their connections to named remote domains, an information leak occurs: by collecting these public statistics, behavioral data of those remote domains can be deduced. To prevent undesired privacy-sensitive information leaks, a domain MUST NOT publish the name of a remote domain, unless that domain advertises support for this XEP, as defined in the Discovering Support section of this document.

This way, the service discovery mechanism doubles as an opt-in mechanism. Domains that advertise support for this XEP allow other domains to reference them by domain-name in the data that they publish. The mere presence of an applicable pub-sub node MUST NOT be used for Service Discovery purposes, as under common service configuration, non-administrative users are allowed to create such nodes.

8. XMPP Registrar Considerations

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [5] shall include the following information in its registries.

8.1 Protocol Namespaces

This specification defines the following XML namespaces:

The XMPP Registrar [5] shall add the foregoing namespace to the registry located at <https://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [6].

8.2 Field Standardization

Field Standardization for Data Forms (XEP-0068) [7] defines a process for standardizing the fields used within Data Forms qualified by a particular namespace, and XEP-0128 describes how to use field standardization in the context of service discovery. This section registers fields for server information scoped by the "http://jabber.org/network/serverinfo" FORM_TYPE.

Registry Submission
<form_type>
  <name>http://jabber.org/network/serverinfo</name>
  <doc>XEP-0XXX</doc>
  <desc>
    Forms advertising the coordinates of a pub-sub service and node for publication of Server Information data.
  </desc>
  <field
      var='serverinfo-pubsub-node'
      type='text-single'
      label='An URI (per XEP-0060 section 12.22) identifying the pub-sub node on which Server Information data is published.'/>
</form_type>

Note that the FORM_TYPE used by Contact Addresses for XMPP Services (XEP-0157) [8] is purposefully re-used by this XEP, to circumvent the restriction of having at most one XMPP Standards Foundation defined FORM_TYPE for a service discovery identity, as defined in Service Discovery Extensions (XEP-0128) [4]. When a service supports both features, the data in both forms SHOULD be merged into one form.

9. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:serverinfo:0'
    xmlns='urn:xmpp:serverinfo:0'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0XXX: http://www.xmpp.org/extensions/xep-0XXX.html
    </xs:documentation>
  </xs:annotation>
  
  <xs:element name="serverinfo" type="urn:serverinfoType" xmlns:urn="urn:xmpp:serverinfo:0"/>

  <xs:simpleType name="directionType" final="restriction" >
    <xs:restriction base="xs:string">
      <xs:enumeration value="incoming" />
      <xs:enumeration value="outgoing" />
      <xs:enumeration value="bidi" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:complexType name="connectionType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute type="directionType" name="type" use="optional"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="remote-domainType">
    <xs:sequence>
      <xs:element type="urn:connectionType" name="connection" maxOccurs="unbounded" minOccurs="0" xmlns:urn="urn:xmpp:serverinfo:0"/>
    </xs:sequence>
    <xs:attribute type="xs:string" name="name" use="optional"/>
  </xs:complexType>

  <xs:complexType name="federationType">
    <xs:sequence>
      <xs:element type="urn:remote-domainType" name="remote-domain" maxOccurs="unbounded" minOccurs="0" xmlns:urn="urn:xmpp:serverinfo:0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="domainType">
    <xs:sequence>
      <xs:element type="urn:federationType" name="federation" xmlns:urn="urn:xmpp:serverinfo:0"/>
    </xs:sequence>
    <xs:attribute type="xs:string" name="name"/>
  </xs:complexType>

  <xs:complexType name="serverinfoType">
    <xs:sequence>
      <xs:element type="urn:domainType" name="domain" xmlns:urn="urn:xmpp:serverinfo:0"/>
    </xs:sequence>
  </xs:complexType>

</xs:schema>

10. Acknowledgements

Inspiration was taken from the (now defunct) 'server info' crawler by Thomas Leister. Many thanks to Dave Cridland, as well as 'zoidberg' and 'chewie' from the Ignite Realtime community for helping to test the initial implementation of a graphing implementation based on this XEP and to Florian Schmaus, Matthew Wild, Jonas Schäfer and Kevin Smith for their feedback on the earliest drafts of this document.


Appendices

Appendix A: Document Information

Series
XEP
Number
xxxx
Publisher
XMPP Standards Foundation
Status
ProtoXEP
Type
Standards Track
Version
0.0.1
Last Updated
2023-12-19
Approving Body
XMPP Council
Dependencies
None
Supersedes
None
Superseded By
None
Short Name
serverinfo

This document in other formats: XML  PDF

Appendix B: Author Information

Guus der Kinderen
Email
guus.der.kinderen@gmail.com
JabberID
guus.der.kinderen@igniterealtime.org

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.

2. XEP-0092: Software Version <https://xmpp.org/extensions/xep-0092.html>.

3. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

4. XEP-0128: Service Discovery Extensions <https://xmpp.org/extensions/xep-0128.html>.

5. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

6. XEP-0053: XMPP Registrar Function <https://xmpp.org/extensions/xep-0053.html>.

7. XEP-0068: Field Data Standardization for Data Forms <https://xmpp.org/extensions/xep-0068.html>.

8. XEP-0157: Contact Addresses for XMPP Services <https://xmpp.org/extensions/xep-0157.html>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.0.1 (2023-12-19)
    gdk

Appendix I: Bib(La)TeX Entry

@report{der kinderen2023serverinfo,
  title = {PubSub Server Information},
  author = {der Kinderen, Guus},
  type = {XEP},
  number = {xxxx},
  version = {0.0.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-xxxx.html},
  date = {2023-12-19/2023-12-19},
}

END