<?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 RFC3629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3629.xml">
<!ENTITY RFC5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC5492 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5492.xml">
<!ENTITY RFC5082 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5082.xml">
<!ENTITY RFC4272 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4272.xml">
<!ENTITY RFC4271 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC6973 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6973.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 category="info" docName="draft-abraitis-bgp-version-capability-08" ipr="trust200902">
  <front>
    <title abbrev="Software Version Capability for BGP">Software Version Capability for BGP</title>
    <author fullname="Donatas Abraitis" initials="D.Abraitis" surname="Abraitis">
      <organization>Hostinger</organization>
      <address>
        <postal>
          <street>Jonavos g. 60C</street>
          <city>Kaunas</city>
          <region></region>
          <code>44192</code>
          <country>LT</country>
        </postal>
        <phone>+370 614 18958</phone>
        <email>donatas.abraitis@hostinger.com</email>
      </address>
    </author>
    <date month="August" year="2020" />
    <area>General</area>
    <keyword>template</keyword>
    <abstract>
      <t>
        In this document, we introduce a new BGP capability that allows the
        advertisement of a BGP speaker's routing daemon version.
      </t>
      <t>
        This BGP capability is an optional advertisement. Implementations are
        not required to advertise the version nor to process received
        advertisements.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>
        In modern data center designs, we tend to have conventional routers participating in the routing process. And the fleet of routers has different versions of routing daemon. This means that knowing which versions of the routing daemons are running the various routers in the network can be a crucial factor in quickly identifying the root cause of any protocol or network problems.
      </t>
      <t>
        This BGP capability is an optional advertisement. Implementations are not required to advertise the version nor to process received advertisements.
      </t>
      <t>
        Information about the version of the routing daemon could also be exchanged in protocols such as LLDP and CDP. However, in containerized environments, it is very hard and not recommended to exchange this information between background processes. Therefore, and to help minimize operational costs, it is helpful to exchange the routing daemon information between BGP peers directly.
      </t>
    </section>

    <section anchor="simple_list" title="Specification of Requirements">
      <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
        14 [RFC2119] [RFC8174] when, and only when, they appear in all
        capitals, as shown here.
      </t>
    </section>

    <section title="Software Version Capability">
      <t>
        Although this document is not an IETF Standards Track document, it
        makes use of the terminology from BCP 14 in order to clearly state
        the implementation behaviors.
      </t>
      <t>
        Capabilities advertisements with BGP are defined in [RFC5492].
        They utilize the BGP Capabilities Optional Parameter that contains
        one or more triples &lt;Capability Code, Capability Length, Capability Value&gt;.
        This document defines a new BGP capability, the Software Version Capability,
        with Capability Code TBD and Capability Length and Capability Value
        as described below.
      </t>
      <t>
        The inclusion of the Software Version Capability is OPTIONAL. If an
        implementation supports the inclusion of the capability, the
        implementation MUST include a configuration switch to enable or
        disable its use, and that switch MUST be off by default.
      </t>
      <t>
        The Software Version Capability is intended for environments where more visibility
        is needed for troubleshooting purposes. It is NOT RECOMMENDED for use
        outside a single Autonomous System, or a set of Autonomous Systems under
        a common administration.
      </t>
      <t>
        An implementation that does not recognize or support the Software Version
        Capability but receives one must ignore it, as described in [RFC5492].
      </t>
      <t>
        The triple for the Software Version Capability is as follows:
      </t>
      <t>
        Capability Code
      </t>
      <t>
      <list>
        <t>
          TBD by IANA
        </t>
      </list>
      </t>
      <t>Capability Length</t>
      <t>
      <list>
        <t>
          The Capability Length for the Software Version Capability MUST
          be greater than zero. A value of zero SHALL be treated
          as an encoding error and the Capability MUST be ignored.
        </t>
        <t>
          The Capability Length SHOULD be no greater than 64. This is the
          limit to allow other capabilities as much space as they require.
        </t>
        <t>
          Capability Length is a one-octet unsigned binary integer that
          contains the length of the Capability Value field in octets.
        </t>
      </list>
      </t>
      <t>Capability Value</t>
      <t>
      <list>
        <t>
          The Capability Value field is encoded in UTF-8 [RFC3629]. It is
          unstructured data and can be formatted in any way that the
          implementor decides.
        </t>
      </list>
      </t>
      <figure align="center" anchor="version_capability">
        <artwork align="left"><![CDATA[
                +--------------------------------+
                |    Version Length (1 octet)    |
                +--------------------------------+
                |      Version (variable)        |
                +--------------------------------+
            ]]></artwork>
      </figure>
      <t>
        Version Length:
        <list><t>
          The number of characters in the Version
        </t></list></t><t>
        Version:
        <list><t>
          The Version field MUST be encoded using UTF-8. A receiving BGP speaker
          MUST NOT interpret invalid UTF-8 sequences.
        </t></list></t>
      <section title="Capabilities Length Overflow">
        <t>
          As defined in [RFC5492] the total length of capabilities that can be
          carried by the BGP Capabilities Optional Parameter is 255 bytes.  If an
          implementation is constructing a BGP Capabilities Optional Parameter
          and its length exceeds 255 bytes, it is REQUIRED to exclude the
          Software Version Capability. An implementation may optimally achieve this by
          making the Software Version Capability the last capability triple to add to the
          Parameter, and only adding it if there is sufficient space to do so.
        </t>
        <t>
          A rogue node can prevent the proper operation of a BGP session, or the
          advertisement of other Capabilities, by not excluding the Software Version
          Capability as required in Section 3.1. This risk is equivalent to a rogue
          node simply not advertising a specific Capability and is not new to BGP.
        </t>
      </section>
    </section>

    <?rfc needLines="8" ?>

    <section title="Operation">
      <t>
        The Software Version Capability MUST only be used for displaying the version
        of a BGP speaker's router daemon to make troubleshooting easier.
      </t>
      <t>
        Consider a group of routers each with a number of upstream nodes, and
        suppose that each router has a different operating system and
        different routing daemon at a different version installed.  Assuming
        that a specific feature is not working or that there is a bug which
        has not been fixed in a particular version of the code, knowledge of
        the routing daemon versions would allow an operator to quickly
        identify the pattern of which versions are affected.
      </t>
      <t>
        Enabling (i.e., turning on) this capability requires bouncing all
        existing BGP sessions and the feature MUST be explicitly configured
        before an implementation advertizes the Software Version Capability.
      </t>
      <section title="Example Usage">
        <t>
          Below is an example from the <xref target="FRRouting"></xref> implementation showing both the
          received and advertised Software Version Capability:
        </t>
        <figure align="center" anchor="frr_failed">
          <artwork align="left"><![CDATA[
  :~# vtysh -c 'show ip bgp summary failed'
  ...
  Neighbor EstdCnt DropCnt ResetTime Reason
  ens192         3       3  00:00:35 Waiting for peer OPEN (n/a)
  ens224         3       3  00:01:12 Waiting for NHT (FRRouting 7.2)
  eth0           3       3  00:00:14 Neighbor deleted (FRRouting 7.3)
  ...
              ]]></artwork>
        </figure>
        <figure align="center" anchor="frr_version">
          <artwork align="left"><![CDATA[
  :~# vtysh -c 'show ip bgp neighbors 198.51.100.1 json' \
  > | jq '."198.51.100.1".neighborCapabilities.versions'
  {
    "advertisedVersion": "FRRouting 7.2-dev-MyOwnFRRVersion",
    "receivedVersion": "FRRouting 7.2-dev-MyOwnFRRVersion-gc68bb14"
  }
              ]]></artwork>
        </figure>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>
        The Capability Codes registry is a standalone registry. IANA is
        requested to assign a capability number from the First Come First
        Served range for the Software Version Capability in this document as follows:
      </t>
      <texttable anchor="table_ex" title="Software Version Capability">
          <ttcol align='center'>Value</ttcol>
          <ttcol align='center'>Description</ttcol>
          <ttcol align='center'>Reference</ttcol>
          <c>TBD</c>
          <c>Software Version Capability</c>
          <c>[This.I-D]</c>
      </texttable>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
        The Software Version Capability should be treated as sensitive information: it
        could be easier for an attacker to exploit the system if they know the
        specific software version and manufacturer of a BGP speaker. This
        information could be gathered by inspecting BGP OPEN messages that carry
        the Software Version Capability defined in this document. Furthermore, this
        knowledge may facilitate a number of social-engineering attacks.
      </t>
      <t>
        Modifying the information advertised by a router might lead to attacks
        including bogus software upgrades and also might mask the causes of
        faults in the network.
      </t>
      <t>
        Users of this mechanism should be aware that unless a transport that
        provides integrity is used for the BGP session in question, the Software Version
        Capability can be forged. Unless a transport that provides
        confidentiality is used, the Version Capability could be snooped by an
        attacker. These issues are common to any BGP message but may be of
        greater interest in the context of this extension as explained above.
        Refer to the related considerations in [RFC4271] and [RFC4272].
      </t>
      <t>
        Users of this mechanism should consider applying data minimization
        practices as outlined in Section 6.1 of [RFC6973], as appropriate within
        the deployment context.
      </t>
      <t>
        Sensitive information leaks can be minimized by using the [RFC5082]
        mechanism or firewalls to filter out TCP 179 port from untrusted networks.
        This capability can be disabled per neighbor, thus the sensitive information
        can't be disclosed to untrusted neighbors.
      </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC2119;
      &RFC3629;
      &RFC5246;
      &RFC5082;
      &RFC5492;
      &RFC8174;
      &RFC4272;
      &RFC4271;
      &RFC6973;
    </references>
    <references title="Informative References">
      <reference anchor="FRRouting" target="https://github.com/ton31337/frr/commit/4c566878fd1a7df9f8c84ee03f419c0b00ae444b">
        <front>
          <title>FRRouting - BGP Software Version Capability</title>

          <author initials="D.A." surname="Abraitis" fullname="Donatas Abraitis">
            <organization abbrev="Hostinger">Hostinger</organization>
          </author>

          <date year="2019" />
        </front>
      </reference>
    </references>
  </back>
</rfc>
