<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-geng-grow-bmp-pre-established-diag-00"
     ipr="trust200902">
  <front>
    <title abbrev="BMP Pre-Established Session Diagnostics">Mechanisms for
    Diagnosing Pre-Established BGP Session Failures Using the BGP Monitoring
    Protocol</title>

    <author fullname="Nan Geng" initials="N." surname="Geng">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Campus, No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>gengnan@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Shunwan Zhuang" initials="S." surname="Zhuang">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Campus, No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>zhuangshunwan@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Haibo Wang" initials="H." surname="Wang">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Campus, No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>rainsword.wang@huawei.com</email>

        <uri/>
      </address>
    </author>

    <date day="1" month="December" year="2026"/>

    <area>Ops &amp; Mgmt Area</area>

    <workgroup>GROW</workgroup>

    <abstract>
      <t>The BGP Monitoring Protocol (BMP), defined in RFC 7854, is widely
      used to monitor BGP session states and routing information. However,
      standard BMP implementations restrict reporting to sessions that have
      reached the "Established" state, leaving a complete visibility blind
      spot when BGP sessions encounter initialization failures (such as TCP
      handshake timeouts, ACL drops, or configuration mismatches) while
      lingering in pre-Established states (Connect, Active, OpenSent, or
      OpenConfirm). This document defines three alternative architectural
      options to stream pre-established session failures and transient
      diagnostic contexts via BMP.</t>

      <t/>
    </abstract>

    <note title="Requirements Language">
      <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
      <xref target="RFC2119"/><xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>In large-scale data center and carrier backbone networks, the BGP
      <xref target="RFC4271"/> Monitoring Protocol (BMP) <xref
      target="RFC7854"/> serves as the primary telemetry mechanism for
      monitoring control plane dynamics. Per current standards, routers report
      peer lifecycle events via Peer Down and Peer Up notifications, where
      routing data exchange only occurs after the session achieves the
      Established state.</t>

      <t>Consequently, if a BGP session is trapped or oscillating in pre-
      Established states (e.g., Connect, Active, OpenSent, OpenConfirm) due to
      transport-layer blocks, mismatched AS numbers, or security policy
      failures, the monitoring station remains blind. This document outlines
      three distinct implementation options to bridge this operational
      gap.</t>

      <t/>
    </section>

    <section title="Definitions and Acronyms">
      <t/>

      <section title="Terminology">
        <t>This document defines and uses the following terms:</t>

        <t><list style="symbols">
            <t>Pre-Established BGP Session: A BGP session instance that has
            not yet reached the "Established" state per <xref
            target="RFC4271"/>. It encompasses all transient Finite State
            Machine (FSM) states prior to full session establishment,
            specifically including the Connect, Active, OpenSent, and
            OpenConfirm states. A session in this phase is undergoing
            transport-layer connection establishment (e.g., TCP 179 handshake)
            or BGP control plane parameter negotiation, and is susceptible to
            pre-establishment failures such as transport timeouts, ACL blocks,
            parameter mismatches, or security validation rejections.</t>

            <t>Monitored Router: A router implementing BMP that monitors its
            local BGP sessions and exports telemetry to a BMP Monitoring
            Station.</t>

            <t>BMP Monitoring Station: A central telemetry station or
            collector that receives BMP messages from Monitored Routers per
            [RFC7854].</t>

            <t>Session Abortion: The premature termination or reset of a BGP
            session while lingering in a pre-Established state, prior to
            reaching the Established state.</t>
          </list></t>
      </section>

      <section title="Acronyms">
        <t><list style="symbols">
            <t>FSM: Finite State Machine</t>

            <t>REL: Route Event Logging</t>
          </list></t>
      </section>
    </section>

    <section title="Architectural Options for Pre-Established Diagnostics">
      <t/>

      <section title="Option 1: Dedicated FSM State Tracking Message">
        <t>This option introduces a dedicated BMP message type to stream BGP
        Finite State Machine (FSM) transitions, in-band transport context, and
        timer states prior to session establishment.</t>

        <t/>

        <section title="Operational Overview and Scene">
          <t>In ultra-scale financial WAN backbones or AI Data Center (AIDC)
          networks, a Monitored Router attempts to establish a BGP session
          with a peer. If intermediate security appliances drop traffic (e.g.,
          due to sudden ACL blocks) causing TCP handshakes to fail repeatedly,
          the BGP session oscillates between the Connect and Active
          states.</t>

          <t>Under standard RFC 7854 implementations, the monitoring station
          remains blind to these pre-established state transitions. By
          activating this option, the Monitored Router leverages the existing
          active BMP TCP session to stream real-time FSM transitions and
          in-band transport telemetry to the BMP Monitoring Station.</t>

          <t/>
        </section>

        <section title="New BMP Message Type Definition">
          <t>A new BMP Message Type is defined:</t>

          <t><list style="symbols">
              <t>BMP Message Type: TBD_FSM (e.g., 7, defined as FSM State
              Tracking Message).</t>
            </list></t>
        </section>

        <section title="FSM State Tracking Message Payload Structure">
          <t>The message follows the standard Per-Peer Header defined in RFC
          7854, immediately followed by the FSM State Information Block and
          associated TLVs:</t>

          <t><figure>
              <artwork><![CDATA[
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Old-FSM-State (1 Octet)   |     New-FSM-State (1 Octet)   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Transition-Reason-Code     |         Reserved (1 Octet)    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                        TLVs (Variable)                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
            </figure><list style="symbols">
              <t>Old-FSM-State / New-FSM-State (1 Octet each): Standard states
              encoded per RFC 4271 (1: Idle, 2: Connect, 3: Active, 4:
              OpenSent, 5: OpenConfirm, 6: Established).</t>

              <t>Transition-Reason-Code (1 Octet): Trigger code (e.g., 1:
              ConnectRetryTimer_Expired, 2: TCP_Connection_Open_Failed, 3:
              BGP_Header_Error, 4: HoldTimer_Expired).</t>
            </list></t>
        </section>

        <section title="Mandatory Sub-TLV Designs">
          <t>TLV Type = 0x0001 (TCP Connection Diagnostic Context TLV):<figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x0001        |          Length = 12          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     TCP-Attempt-Source-IP                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      TCP-Attempt-Dest-IP                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TCP-Handshake-Fail-Count   |      Current-TCP-State        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
            </figure><list style="symbols">
              <t>TCP-Handshake-Fail-Count (2 Octets): Cumulative count of TCP
              handshake timeouts or RST receipts within the current BGP peer
              lifecycle.</t>

              <t>Current-TCP-State (1 Octet): Kernel-level TCP state (e.g.,
              SYN_SENT, CLOSED).</t>
            </list>TLV Type = 0x0002 (FSM Timer Status TLV):</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x0002        |          Length = 4           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     ConnectRetryTimer-Value   |     HoldTime-Remaining        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
            </figure></t>
        </section>

        <section title="Detailed Implementation Workflow">
          <t/>

          <t><figure>
              <artwork><![CDATA[+-----------+                  +----------------+
| Monitored |                  | BMP Monitoring |
| Router    |                  | Station        |
+-----+-----+                  +-----------+----+
      |                                    |
      | -- 1. ConnectRetryTimer Expired -->|
      |                                    |
      | -- 2. FSM Jump: Connect -> Idle -->|
      |    Sends BMP Msg Type 7            |
      |    Sub-TLV: SYN_SENT, Fail-Count=14|
      |                                    |
      |                                    | 3. Analyze Event
      |                                    | 4. Root Cause 
      |                                    |    Flagged
      ]]></artwork>
            </figure><list style="symbols">
              <t>Step 1 (Timer Expiry): The Monitored Router attempts
              connection while in the Connect state. Upon ConnectRetryTimer
              expiration, the BGP FSM forces a state transition from Connect
              back to Idle.</t>

              <t>Step 2 (Snapshot Generation): Upon state transition, the
              router queries the network stack: TCP-Handshake-Fail-Count is
              recorded as 14, and the socket is stalled in SYN_SENT. The
              router constructs a BMP message (Type = 7) with Old-State=2,
              New-State=1, Reason=1, and the diagnostic Sub-TLVs, transmitting
              it over the existing BMP session.</t>

              <t>Step 3 &amp; 4 (Analysis &amp; Alerting): The BMP Monitoring
              Station receives the message, processes the in-band TCP context
              without packet sniffing, and flags the precise root cause: "TCP
              SYN packets are not acknowledged, indicating path ACL blocking
              rather than a BGP configuration error."</t>
            </list></t>
        </section>
      </section>

      <section title="Option 2: Active Transient Event Reporting via BMP REL Extensions">
        <t>This option leverages the highly scalable, event-driven framework
        defined in Route Event Logging (REL) <xref
        target="I-D.ietf-grow-bmp-rel"/> to proactively report transient
        session abortion triggers (such as security policy drops or
        configuration rejections) before or during BGP session
        establishment.</t>

        <t/>

        <section title="Operational Overview and Scene">
          <t>Consider a Monitored Router attempting or receiving a BGP
          connection with a peer, monitored by a BMP Monitoring Station over
          an independent out-of-band management connection.</t>

          <t>Transient pre-established failures typically stem from two
          categories:</t>

          <t><list style="symbols">
              <t>Scenario A (Parameter/Configuration Mismatch): The peer
              initiates a TCP session and sends a BGP OPEN message. The
              Monitored Router detects a mismatched Autonomous System number
              (My Autonomous System vs. locally configured Expected-Remote-AS)
              and triggers a session abortion before or upon issuing a BGP
              Notification.</t>

              <t>Scenario B (Security/Access Interception): The Monitored
              Router receives a TCP SYN request from a peer, but local access
              control lists (ACLs) or RPKI/ASPA validation policies reject the
              packet, silently dropping the handshake or tearing down TCP.</t>
            </list>Standard BMP mechanisms lack transient event signaling for
          such aborted attempts. Option 2 addresses this by utilizing BMP REL
          messages to output precise diagnostic telemetry.</t>

          <t/>
        </section>

        <section title="Extension of REL Event Types">
          <t>Per Section 3.2 of <xref target="I-D.ietf-grow-bmp-rel"/>, the
          REL message header includes a 1-octet Event Type Header:</t>

          <t><list style="symbols">
              <t>Code = 1: The event is related to Routing.</t>

              <t>Code = 2: The event is related to the health of the BGP or
              the BMP protocols.</t>
            </list>This option categorizes BGP Session Abortion (BSA) under
          BGP protocol health events (Code = 2) or a newly allocated
          sub-code.</t>

          <t/>
        </section>

        <section title="Informational TLV Definitions">
          <t>TLV Type = 0x0110 (BSA Core Diagnosis TLV): Encapsulates core
          diagnosis metadata when a session abortion is triggered:</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x0110        |          Length = 12          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Abortion-Code |    Reserved   |       Target-Local-Port       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Expected-Remote-AS-Number                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Received-Remote-AS-Number                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure></t>

          <t><list style="symbols">
              <t>Abortion-Code (1 Octet): Root cause classification code for
              session termination:<list style="symbols">
                  <t>0x01: Remote-AS-Mismatch (Mismatched peer AS in OPEN
                  message).</t>

                  <t>0x02: TCP-SYN-ACL-Blocked (TCP handshake dropped by local
                  security/ACL policy).</t>

                  <t>0x03: RPKI-Security-Check-Failed (Origin/ASPA security
                  check failed).</t>
                </list></t>

              <t>Target-Local-Port (2 Octets): Local socket destination port
              (e.g., 179).</t>

              <t>Expected-Remote-AS-Number / Received-Remote-AS-Number (4
              Octets each): The locally configured expected AS and the actual
              AS declared in the received OPEN message.</t>
            </list>TLV Type = 0x0111 (Rejected TCP SYN Meta TLV): Captures
          transport metadata when local security policies silently drop
          incoming SYN requests:</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x0111        |          Length = 8           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Requested-TCP-Seq-Num                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   TCP-Flags   |                  Security-Policy-ID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure><list style="symbols">
              <t>Requested-TCP-Seq-Num (4 Octets): Sequence number of the
              intercepted TCP SYN packet.</t>

              <t>TCP-Flags (1 Octet): TCP header flags.</t>

              <t>Security-Policy-ID (3 Octets): Rule ID of the local ACL or
              security policy triggering the drop.</t>
            </list></t>

          <t/>
        </section>

        <section title="Workflow Example: Peer AS Mismatch Scenario">
          <t/>

          <t><figure>
              <artwork><![CDATA[+----------+                              +----------------+
| Monitored|                              | BMP Monitoring |
| Router   |                              | Station        |
+----+-----+                              +-----------+----+
     |                                                |
     | - 1. TCP 179 Established & Receives OPEN ----->|
     |                                                |
     | - 2. Detect AS Mismatch (Local:65001, Peer:65002)
     |                                                |
     | - 3. Send BMP REL Msg (Type 6, Event Code 2) ->|
     |    BSA Core Diagnosis TLV 0x0110               |
     |                                                |
     | - 4. Send BGP Notification & Tear Down ------->|
     |                                                |
     |                                                | 5. Parse REL 
     |                                                |    TLVs
     |                                                | 6. Root Cause 
     |                                                |    Output]]></artwork>
            </figure><list style="symbols">
              <t>Step 1 &amp; 2 (Event Trigger): The peer successfully
              completes the TCP 179 handshake and sends a BGP OPEN message
              with AS 65002. The Monitored Router (configured with remote-as
              65001) detects the mismatch. Standard procedure dictates sending
              a BGP Notification (OPEN Message Error / Bad Peer AS) and
              closing the TCP session.</t>

              <t>Step 3 (REL Event Emission): Prior to tearing down the
              session, the Monitored Router constructs a BMP REL Message (Type
              = 6, Event Type Code = 2) containing the BSA Core Diagnosis TLV
              (0x0110) with Abortion-Code = 0x01, Expected-AS = 65001, and
              Received-AS = 65002, then sends it to the Monitoring
              Station.</t>

              <t>Step 4 (Session Reset): The Monitored Router transmits the
              standard BGP Notification error to the peer and tears down the
              TCP connection.</t>

              <t>Step 5 &amp; 6 (Diagnosis): Upon receiving the REL message,
              the BMP Monitoring Station parses TLV 0x0110 and immediately
              flags the exact root cause: "BGP Session Abortion: Neighbor
              192.0.2.1 failed due to Peer AS mismatch (Expected: 65001,
              Received: 65002)."</t>
            </list></t>
        </section>
      </section>

      <section title="Option 3: &quot;Virtual Peer Down&quot; Extension Mechanism">
        <t>While RFC 7854 specifies that a Peer Down Notification is emitted
        when a BGP session drops from an Established state, this option
        extends the Peer Down Reason Code semantics. When a BGP session aborts
        or resets while lingering in a pre-Established state (Connect, Active,
        OpenSent, or OpenConfirm), the router triggers a synthetic "Virtual
        Peer Down" message containing structured diagnostic context in its
        Data field.</t>

        <t/>

        <section title="Operational Overview and Scene">
          <t>In large-scale AI Data Center (AIDC) or provider backbone
          networks, BGP neighbors are configured but may fail to reach the
          Established state due to physical, transport, parameter, or security
          issues.</t>

          <t>Under Option 3, the Monitored Router attaches a Pre-Established
          FSM Tracker to the BGP control plane. When the BGP FSM aborts during
          initialization, the tracker captures the in-band error context and
          synthesizes a BMP Peer Down message before resetting the local peer
          instance.</t>
        </section>

        <section title="RFC 7854 Extensions and Reason Code">
          <t>Per RFC 7854 Section 4.9, a standard Peer Down Notification
          includes a 1-octet Reason field followed by a variable-length Data
          field.</t>

          <t><list style="symbols">
              <t>Reason Code Extension:<list style="symbols">
                  <t>Reason = 6: Peer FSM Failed to Establish (Session
                  initialization aborted prior to reaching Established).</t>
                </list></t>
            </list></t>

          <t/>
        </section>

        <section title="Diagnostic Sub-TLVs in Data Area">
          <t>When Reason = 6, the Data field does not encapsulate standard BGP
          Notification messages; instead, it carries structured diagnostic
          Sub-TLVs capturing the failure snapshot:</t>

          <t>Sub-TLV Type = 0x01 (FSM Phase and Timing Context TLV):</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x01          |          Length = 4           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Aborted-FSM-  | Current-FSM-Duration(2 Octets)| Reserved      |
| State(1 Octet)|                               |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure><list style="symbols">
              <t>Aborted-FSM-State (1 Octet): FSM state at abortion (2:
              Connect, 3: Active, 4: OpenSent, 5: OpenConfirm).</t>

              <t>Current-FSM-Duration (2 Octets): Time elapsed (in seconds) in
              non-Established states during the current cycle.</t>
            </list>Sub-TLV Type = 0x02 (Socket Error Context TLV):</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x02          |          Length = 6           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Internal-TCP-State       |        TCP-Error-Code         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TCP-Handshake-Fail-Count   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure><list style="symbols">
              <t>Internal-TCP-State (2 Octets): Kernel-level TCP state
              (0x0002: SYN_SENT, 0x0001: CLOSED).</t>

              <t>TCP-Error-Code (2 Octets): Standard socket error codes:<list
                  style="symbols">
                  <t>0x006E (110): ETIMEDOUT (Connection timed out, e.g., SYN
                  packet dropped).</t>

                  <t>0x006F (111): ECONNREFUSED (Connection refused, port 179
                  closed or unconfigured).</t>

                  <t>0x0065 (101): ENETUNREACH (Network unreachable, missing
                  route/ARP).</t>
                </list></t>

              <t>TCP-Handshake-Fail-Count (2 Octets): Cumulative handshake
              failures in the current cycle.</t>
            </list>Sub-TLV Type = 0x03 (Parameter Mismatch Context TLV):</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x03          |          Length = 12          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mismatch-Type |    Reserved   |       Target-Local-Port       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Expected-Remote-AS-Number                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Received-Remote-AS-Number                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure><list style="symbols">
              <t>Mismatch-Type (1 Octet): 0x01: Remote-AS-Mismatch, 0x02:
              BGP-Version-Not-Supported, 0x03: Bad-BGP-Identifier.</t>

              <t>Expected-Remote-AS-Number / Received-Remote-AS-Number (4
              Octets each): Expected vs. actual received AS numbers.</t>
            </list>Sub-TLV Type = 0x04 (Security and Verification Context
          TLV):</t>

          <t><figure>
              <artwork><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Type = 0x04          |          Length = 4           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Security-Reason|                  Security-Policy-ID          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
            </figure><list style="symbols">
              <t>Security-Reason (1 Octet): 0x01: TCP-MD5-Mismatch, 0x02:
              TCP-AO-Key-Error, 0x03: ASPA-Validation-Invalid.</t>

              <t>Security-Policy-ID (3 Octets): Rule ID of local security/ACL
              policy causing the abortion.</t>
            </list></t>

          <t/>
        </section>

        <section title="Detailed Workflow and Execution Steps">
          <t/>

          <t><figure>
              <artwork><![CDATA[+----------+                     +----------------+
| Monitored|                     | BMP Monitoring |
| Router   |                     | Station        |
+---+------+                     +-----------+----+
    |                                        |
    | - 1. Local BGP Neighbor Configured --->| (FSM Starts)
    |                                        |
    | - 2. Case A (Active): Timeout ---------|
    |   -- Case B (OpenSent): AS Mismatch -->| 
    |                                        |
    | - 3. Generate Virtual Peer Down ------>| 
    |    Reason=6, Sub-TLV 0x01 & (0x02/0x03)|
    |                                        |
    |                                        | 4. Parse Sub-TLVs
    |                                        | 5. Output Root 
    |                                        |    Cause]]></artwork>
            </figure><list style="symbols">
              <t>Step 1 (Tracker Attachment): When neighbor configuration is
              applied, the Monitored Router starts the BGP FSM and attaches a
              Pre-Established FSM Tracker to independently track
              non-Established state durations.</t>

              <t>Step 2 (Event Capture):<list style="symbols">
                  <t>Case A (Active State Timeout): The local router issues
                  TCP SYN, but intermediate firewalls drop traffic. Upon
                  ConnectRetryTimer expiration, the FSM drops back to Active.
                  The tracker logs TCP-Error-Code = ETIMEDOUT.</t>

                  <t>Case B (OpenSent AS Mismatch): The peer sends a BGP OPEN
                  message containing AS 65002 while 65001 is expected. Before
                  sending a BGP Notification and closing the TCP session, the
                  tracker captures the causal mismatch context.</t>
                </list></t>

              <t>Step 3 (Virtual Peer Down Synthesis): The router preserves
              standard Per-Peer Header fields and encodes the Data
              payload:<list style="symbols">
                  <t>Sets Reason = 6.</t>

                  <t>Attaches Sub-TLV 0x01 (Aborted-FSM-State = 3: Active for
                  Case A; 4: OpenSent for Case B).</t>

                  <t>Attaches Sub-TLV 0x02 for Case A (TCP-Error-Code = 0x006E
                  ETIMEDOUT).</t>

                  <t>Attaches Sub-TLV 0x03 for Case B (Mismatch-Type = 0x01,
                  Expected-AS = 65001, Received-AS = 65002).</t>
                </list></t>

              <t>Step 4 &amp; 5 (Telemetry Transmission &amp; Analysis): The
              Monitored Router transmits the synthetic Peer Down message via
              BMP before peer state reset. The Monitoring Station detects
              Reason = 6, decodes the Sub-TLVs, and flags the exact root cause
              directly to operators (e.g., "Case A: SYN traffic dropped by
              firewall" or "Case B: AS configuration mismatch").</t>
            </list></t>

          <t/>
        </section>
      </section>
    </section>

    <section title="Security Considerations">
      <t>This document introduces telemetry mechanisms for pre-established BGP
      sessions. Implementations MUST ensure that diagnostic streaming does not
      expose sensitive router internals or exacerbate denial-of-service (DoS)
      vulnerabilities on the monitoring channel.</t>

      <t/>
    </section>

    <section title="IANA Considerations">
      <t>This document requests IANA to assign new codepoints for BMP Message
      Types, REL Event Types, and associated TLV/Sub-TLV namespaces as
      specified in Sections 3.1, 3.2, and 3.3.</t>

      <t/>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>TBD</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.4271"?>

      <?rfc include="reference.RFC.7854"?>

      <?rfc include="reference.RFC.8174"?>

      <?rfc include='reference.I-D.ietf-grow-bmp-rel'?>
    </references>

    <references title="Informative References"/>
  </back>
</rfc>
