<?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">
]>
<?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-06" ipr="trust200902">
  <front>
    <title abbrev="Version Capability for BGP">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="Version Capability">
      <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 Version Capability,
        with Capability Code TBD and Capability Length and Capability Value
        as described below.
      </t>
      <t>
        The inclusion of the 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 Version Capability is intended principally more to non-production
        environments where more visibility is needed for troubleshooting
        purposes. It is NOT RECOMMENDED for use outside single Autonomous
        System domain or Autonomous System Confederations, except you have
        a topology with a number of routers each with a separate Autonomous
        Number.
      </t>
      <t>
        An implementation that does not recognize or support the Version
        Capability but which receives one MUST respond as described in
        [RFC5492] by ignoring the option. An implementation that wishes to
        complain that its neighbor does not support the Version Capability
        MAY use the 'Unsupported Capability' Error Subcode of a Notification
        message as described in [RFC5492].
      </t>
      <t>
        The triple for the 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 Version Capability MUST
          be greater than zero. A value of zero SHALL be treated
          as an encoding error and the entire triple 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>
      </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 encoded via UTF-8
        </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 RECOMMENDED to exclude the
          Version Capability.  An implementation may optimally achieve this by
          making the Version Capability the last capability triple to add to the
          Parameter, and only adding it if there is sufficient space to do so.
        </t>
      </section>
    </section>

    <?rfc needLines="8" ?>

    <section title="Operation">
      <t>
        The 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 Version Capability.
      </t>
      <section title="Example Usage">
        <t>
          Below is an example of implementation in <xref target="FRRouting"></xref> how it looks like with version advertised by a BGP sender:
        </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>
        IANA maintains the "Border Gateway Protocol (BGP) Parameters"
        registry with a subregistry called "Capabilities Codes". IANA is
        requested to assign a capability number from the First Come First
        Served range for the Version Capability in this document as follows:
      </t>
      <texttable anchor="table_ex" title="Version Capability">
          <ttcol align='center'>Value</ttcol>
          <ttcol align='center'>Description</ttcol>
          <ttcol align='center'>Reference</ttcol>
          <c>TBD</c>
          <c>Version Capability</c>
          <c>[This.I-D]</c>
      </texttable>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
        The Version Capability should be treated as sensitive information: it could be easier for an attacker to exploit the system if they know the specific version of a BGP speaker.  This information could be
        gathered by inspecting BGP OPEN messages that carry the Version
        Capability defined in this document.  Using encryption to protect the information exchanged in BGP sessions SHOULD, therefore, be carefully considered when this feature is enabled.  Suitable encryption can be achieved by protecting the BGP session using TLS [RFC5246].
      </t>
      <t>
        Furthermore, knowledge of which versions of code is running on a
        given router and from which vendor it comes may facilitate a number of social-engineering attacks.  This further adds to the desire to protect this information through encryption.
      </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.  This can be mitigated by protecting the BGP session using TLS.
      </t>
      <t>
        Many BGP implementations leave TCP port 179 open in order to be able to establish sessions with new neighbors.  This could lead to an attack where a rogue BGP implementation attempts to open a session and learns the version information from the responding peer.
      </t>
      <t>
        The Version Capability MUST be configurable with a vendor-specific
        knob to be able to enable or disable the capability.  The vendor might implement to disable this capability per neighbor.
      </t>
      <t>
        It would be safe to enable this for iBGP or inside the same tenant where you have full control and the BGP speaker is behind the exit points.
      </t>
      <t>
        This capability is NOT RECOMMENDED for eBGP use.
      </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;
    </references>
    <references title="Informative References">
      &RFC3552;
      <reference anchor="FRRouting" target="https://github.com/ton31337/frr/commit/4c566878fd1a7df9f8c84ee03f419c0b00ae444b">
        <front>
          <title>FRRouting - BGP 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>
