home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_i / draft-ietf-idr-bgp4-06.txt < prev    next >
Text File  |  1997-06-03  |  135KB  |  3,541 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                      Y. Rekhter
  8. INTERNET DRAFT                                          cisco Systems
  9.                                                                 T. Li
  10.                                                      Juniper Networks
  11.                                                               Editors
  12. <draft-ietf-idr-bgp4-06.txt>                                June 1997
  13.  
  14.  
  15.  
  16.                   A Border Gateway Protocol 4 (BGP-4)
  17.  
  18.  
  19. Status of this Memo
  20.  
  21.    This document, together with its companion document, "Application of
  22.    the Border Gateway Protocol in the Internet", define an inter-
  23.    autonomous system routing protocol for the Internet. This document
  24.    specifies an IAB standards track protocol for the Internet community,
  25.    and requests discussion and suggestions for improvements.  Please
  26.    refer to the current edition of the "IAB Official Protocol Standards"
  27.    for the standardization state and status of this protocol.
  28.    Distribution of this document is unlimited.
  29.  
  30.    This document is an Internet Draft. Internet Drafts are working
  31.    documents of the Internet Engineering Task Force (IETF), its Areas,
  32.    and its Working Groups. Note that other groups may also distribute
  33.    working documents as Internet Drafts.
  34.  
  35.    Internet Drafts are draft documents valid for a maximum of six
  36.    months. Internet Drafts may be updated, replaced, or obsoleted by
  37.    other documents at any time. It is not appropriate to use Internet
  38.    Drafts as reference material or to cite them other than as a "working
  39.    draft" or "work in progress".
  40.  
  41.  
  42. 1. Acknowledgments
  43.  
  44.    This document was originally published as RFC 1267 in October 1991,
  45.    jointly authored by Kirk Lougheed and Yakov Rekhter.
  46.  
  47.    We would like to express our thanks to Guy Almes, Len Bosack, and
  48.    Jeffrey C. Honig for their contributions to the earlier version of
  49.    this document.
  50.  
  51.    We like to explicitly thank Bob Braden for the review of the earlier
  52.    version of this document as well as his constructive and valuable
  53.    comments.
  54.  
  55.  
  56.  
  57.  
  58. Expiration Date July 1997                                        [Page 1]
  59.  
  60.  
  61.  
  62.  
  63.  
  64. RFC DRAFT                                                  December 1997
  65.  
  66.  
  67.    We would also like to thank Bob Hinden, Director for Routing of the
  68.    Internet Engineering Steering Group, and the team of reviewers he
  69.    assembled to review the previous version (BGP-2) of this document.
  70.    This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia
  71.    Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted
  72.    with a strong combination of toughness, professionalism, and
  73.    courtesy.
  74.  
  75.    This updated version of the document is the product of the IETF IDR
  76.    Working Group with Yakov Rekhter and Tony Li as editors. Certain
  77.    sections of the document borrowed heavily from IDRP [7], which is the
  78.    OSI counterpart of BGP. For this credit should be given to the ANSI
  79.    X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was
  80.    the IDRP editor within that group.  We would also like to thank Mike
  81.    Craren, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder,
  82.    John Stewart III, Paul Traina, and Curtis Villamizar for their
  83.    comments.
  84.  
  85.    We would like to specially acknowledge numerous contributions by
  86.    Dennis Ferguson.
  87.  
  88.  
  89. 2.  Introduction
  90.  
  91.    The Border Gateway Protocol (BGP) is an inter-Autonomous System
  92.    routing protocol.  It is built on experience gained with EGP as
  93.    defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as
  94.    described in RFC 1092 [2] and RFC 1093 [3].
  95.  
  96.    The primary function of a BGP speaking system is to exchange network
  97.    reachability information with other BGP systems.  This network
  98.    reachability information includes information on the list of
  99.    Autonomous Systems (ASs) that reachability information traverses.
  100.    This information is sufficient to construct a graph of AS
  101.    connectivity from which routing loops may be pruned and some policy
  102.    decisions at the AS level may be enforced.
  103.  
  104.    BGP-4 provides a new set of mechanisms for supporting classless
  105.    interdomain routing.  These mechanisms include support for
  106.    advertising an IP prefix and eliminates the concept of network
  107.    "class" within BGP.  BGP-4 also introduces mechanisms which allow
  108.    aggregation of routes, including aggregation of AS paths.  These
  109.    changes provide support for the proposed supernetting scheme [8, 9].
  110.  
  111.    To characterize the set of policy decisions that can be enforced
  112.    using BGP, one must focus on the rule that a BGP speaker advertise to
  113.    its peers (other BGP speakers which it communicates with) in
  114.    neighboring ASs only those routes that it itself uses.  This rule
  115.  
  116.  
  117.  
  118. Expiration Date July 1997                                        [Page 2]
  119.  
  120.  
  121.  
  122.  
  123.  
  124. RFC DRAFT                                                  December 1997
  125.  
  126.  
  127.    reflects the "hop-by-hop" routing paradigm generally used throughout
  128.    the current Internet.  Note that some policies cannot be supported by
  129.    the "hop-by-hop" routing paradigm and thus require techniques such as
  130.    source routing to enforce.  For example, BGP does not enable one AS
  131.    to send traffic to a neighboring AS intending that the traffic take a
  132.    different route from that taken by traffic originating in the
  133.    neighboring AS.  On the other hand, BGP can support any policy
  134.    conforming to the "hop-by-hop" routing paradigm.  Since the current
  135.    Internet uses only the "hop-by-hop" routing paradigm and since BGP
  136.    can support any policy that conforms to that paradigm, BGP is highly
  137.    applicable as an inter-AS routing protocol for the current Internet.
  138.  
  139.    A more complete discussion of what policies can and cannot be
  140.    enforced with BGP is outside the scope of this document (but refer to
  141.    the companion document discussing BGP usage [5]).
  142.  
  143.    BGP runs over a reliable transport protocol.  This eliminates the
  144.    need to implement explicit update fragmentation, retransmission,
  145.    acknowledgment, and sequencing.  Any authentication scheme used by
  146.    the transport protocol may be used in addition to BGP's own
  147.    authentication mechanisms.  The error notification mechanism used in
  148.    BGP assumes that the transport protocol supports a "graceful" close,
  149.    i.e., that all outstanding data will be delivered before the
  150.    connection is closed.
  151.  
  152.    BGP uses TCP [4] as its transport protocol.  TCP meets BGP's
  153.    transport requirements and is present in virtually all commercial
  154.    routers and hosts.  In the following descriptions the phrase
  155.    "transport protocol connection" can be understood to refer to a TCP
  156.    connection.  BGP uses TCP port 179 for establishing its connections.
  157.  
  158.    This document uses the term `Autonomous System' (AS) throughout.  The
  159.    classic definition of an Autonomous System is a set of routers under
  160.    a single technical administration, using an interior gateway protocol
  161.    and common metrics to route packets within the AS, and using an
  162.    exterior gateway protocol to route packets to other ASs.  Since this
  163.    classic definition was developed, it has become common for a single
  164.    AS to use several interior gateway protocols and sometimes several
  165.    sets of metrics within an AS.  The use of the term Autonomous System
  166.    here stresses the fact that, even when multiple IGPs and metrics are
  167.    used, the administration of an AS appears to other ASs to have a
  168.    single coherent interior routing plan and presents a consistent
  169.    picture of what destinations are reachable through it.
  170.  
  171.    The planned use of BGP in the Internet environment, including such
  172.    issues as topology, the interaction between BGP and IGPs, and the
  173.    enforcement of routing policy rules is presented in a companion
  174.    document [5].  This document is the first of a series of documents
  175.  
  176.  
  177.  
  178. Expiration Date July 1997                                        [Page 3]
  179.  
  180.  
  181.  
  182.  
  183.  
  184. RFC DRAFT                                                  December 1997
  185.  
  186.  
  187.    planned to explore various aspects of BGP application.  Please send
  188.    comments to the BGP mailing list (bgp@ans.net).
  189.  
  190.  
  191. 3.  Summary of Operation
  192.  
  193.    Two systems form a transport protocol connection between one another.
  194.    They exchange messages to open and confirm the connection parameters.
  195.    The initial data flow is the entire BGP routing table.  Incremental
  196.    updates are sent as the routing tables change.  BGP does not require
  197.    periodic refresh of the entire BGP routing table.  Therefore, a BGP
  198.    speaker must retain the current version of the entire BGP routing
  199.    tables of all of its peers for the duration of the connection.
  200.    KeepAlive messages are sent periodically to ensure the liveness of
  201.    the connection.  Notification messages are sent in response to errors
  202.    or special conditions.  If a connection encounters an error
  203.    condition, a notification message is sent and the connection is
  204.    closed.
  205.  
  206.    The hosts executing the Border Gateway Protocol need not be routers.
  207.    A non-routing host could exchange routing information with routers
  208.    via EGP or even an interior routing protocol.  That non-routing host
  209.    could then use BGP to exchange routing information with a border
  210.    router in another Autonomous System.  The implications and
  211.    applications of this architecture are for further study.
  212.  
  213.    Connections between BGP speakers of different ASs are referred to as
  214.    "external" links.  BGP connections between BGP speakers within the
  215.    same AS are referred to as "internal" links.  Similarly, a peer in a
  216.    different AS is referred to as an external peer, while a peer in the
  217.    same AS may be described as an internal peer.  Internal BGP and
  218.    external BGP are commonly abbreviated IBGP and EBGP.
  219.  
  220.    If a particular AS has multiple BGP speakers and is providing transit
  221.    service for other ASs, then care must be taken to ensure a consistent
  222.    view of routing within the AS.  A consistent view of the interior
  223.    routes of the AS is provided by the interior routing protocol.  A
  224.    consistent view of the routes exterior to the AS can be provided by
  225.    having all BGP speakers within the AS maintain direct IBGP
  226.    connections with each other.  Alternately the interior routing
  227.    protocol can pass BGP information among routers within an AS, taking
  228.    care not to lose BGP attributes that will be needed by EBGP speakers
  229.    if transit connectivity is being provided.  For the purpose of
  230.    discussion, it is assumed that BGP information is passed within an AS
  231.    using IBGP.  Care must be taken to ensure that the interior routers
  232.    have all been updated with transit information before the EBGP
  233.    speakers announce to other ASs that transit service is being
  234.    provided.
  235.  
  236.  
  237.  
  238. Expiration Date July 1997                                        [Page 4]
  239.  
  240.  
  241.  
  242.  
  243.  
  244. RFC DRAFT                                                  December 1997
  245.  
  246.  
  247. 3.1 Routes: Advertisement and Storage
  248.  
  249.    For purposes of this protocol a route is defined as a unit of
  250.    information that pairs a destination with the attributes of a path to
  251.    that destination:
  252.  
  253.       - Routes are advertised between a pair of BGP speakers in UPDATE
  254.       messages: the destination is the systems whose IP addresses are
  255.       reported in the Network Layer Reachability Information (NLRI)
  256.       field, and the the path is the information reported in the path
  257.       attributes fields of the same UPDATE message.
  258.  
  259.  
  260.       - Routes are stored in the Routing Information Bases (RIBs):
  261.       namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes
  262.       that will be advertised to other BGP speakers must be present in
  263.       the Adj-RIB-Out; routes that will be used by the local BGP speaker
  264.       must be present in the Loc-RIB, and the next hop for each of these
  265.       routes must be present in the local BGP speaker's forwarding
  266.       information base; and routes that are received from other BGP
  267.       speakers are present in the Adj-RIBs-In.
  268.  
  269.  
  270.    If a BGP speaker chooses to advertise the route, it may add to or
  271.    modify the path attributes of the route before advertising it to a
  272.    peer.
  273.  
  274.    BGP provides mechanisms by which a BGP speaker can inform its peer
  275.    that a previously advertised route is no longer available for use.
  276.    There are three methods by which a given BGP speaker can indicate
  277.    that a route has been withdrawn from service:
  278.  
  279.  
  280.       a) the IP prefix that expresses destinations for a previously
  281.       advertised route can be advertised in the WITHDRAWN ROUTES field
  282.       in the UPDATE message, thus marking the associated route as being
  283.       no longer available for use
  284.  
  285.       b) a replacement route with the same Network Layer Reachability
  286.       Information can be advertised, or
  287.  
  288.       c) the BGP speaker - BGP speaker connection can be closed, which
  289.       implicitly removes from service all routes which the pair of
  290.       speakers had advertised to each other.
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298. Expiration Date July 1997                                        [Page 5]
  299.  
  300.  
  301.  
  302.  
  303.  
  304. RFC DRAFT                                                  December 1997
  305.  
  306.  
  307. 3.2 Routing Information Bases
  308.  
  309.    The Routing Information Base (RIB) within a BGP speaker consists of
  310.    three distinct parts:
  311.  
  312.       a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has
  313.       been learned from inbound UPDATE messages. Their contents
  314.       represent routes that are available as an input to the Decision
  315.       Process.
  316.  
  317.       b) Loc-RIB: The Loc-RIB contains the local routing information
  318.       that the BGP speaker has selected by applying its local policies
  319.       to the routing information contained in its Adj-RIBs-In.
  320.  
  321.       c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the
  322.       local BGP speaker has selected for advertisement to its peers. The
  323.       routing information stored in the Adj-RIBs-Out will be carried in
  324.       the local BGP speaker's UPDATE messages and advertised to its
  325.       peers.
  326.  
  327.  
  328.    In summary, the Adj-RIBs-In contain unprocessed routing information
  329.    that has been advertised to the local BGP speaker by its peers; the
  330.    Loc-RIB contains the routes that have been selected by the local BGP
  331.    speaker's Decision Process; and the Adj-RIBs-Out organize the routes
  332.    for advertisement to specific peers by means of the local speaker's
  333.    UPDATE messages.
  334.  
  335.    Although the conceptual model distinguishes between Adj-RIBs-In,
  336.    Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an
  337.    implementation must maintain three separate copies of the routing
  338.    information. The choice of implementation (for example, 3 copies of
  339.    the information vs 1 copy with pointers) is not constrained by the
  340.    protocol.
  341.  
  342. 4.  Message Formats
  343.  
  344.    This section describes message formats used by BGP.
  345.  
  346.    Messages are sent over a reliable transport protocol connection.  A
  347.    message is processed only after it is entirely received.  The maximum
  348.    message size is 4096 octets.  All implementations are required to
  349.    support this maximum message size.  The smallest message that may be
  350.    sent consists of a BGP header without a data portion, or 19 octets.
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358. Expiration Date July 1997                                        [Page 6]
  359.  
  360.  
  361.  
  362.  
  363.  
  364. RFC DRAFT                                                  December 1997
  365.  
  366.  
  367. 4.1 Message Header Format
  368.  
  369.  
  370.    Each message has a fixed-size header.  There may or may not be a data
  371.    portion following the header, depending on the message type.  The
  372.    layout of these fields is shown below:
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.        0                   1                   2                   3
  381.        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
  382.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  383.       |                                                               |
  384.       +                                                               +
  385.       |                                                               |
  386.       +                                                               +
  387.       |                           Marker                              |
  388.       +                                                               +
  389.       |                                                               |
  390.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  391.       |          Length               |      Type     |
  392.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  393.  
  394.  
  395.       Marker:
  396.  
  397.          This 16-octet field contains a value that the receiver of the
  398.          message can predict.  If the Type of the message is OPEN, or if
  399.          the OPEN message carries no Authentication Information (as an
  400.          Optional Parameter), then the Marker must be all ones.
  401.          Otherwise, the value of the marker can be predicted by some a
  402.          computation specified as part of the authentication mechanism
  403.          (which is specified as part of the Authentication Information)
  404.          used.  The Marker can be used to detect loss of synchronization
  405.          between a pair of BGP peers, and to authenticate incoming BGP
  406.          messages.
  407.  
  408.  
  409.       Length:
  410.  
  411.          This 2-octet unsigned integer indicates the total length of the
  412.          message, including the header, in octets.  Thus, e.g., it
  413.          allows one to locate in the transport-level stream the (Marker
  414.          field of the) next message.  The value of the Length field must
  415.  
  416.  
  417.  
  418. Expiration Date July 1997                                        [Page 7]
  419.  
  420.  
  421.  
  422.  
  423.  
  424. RFC DRAFT                                                  December 1997
  425.  
  426.  
  427.          always be at least 19 and no greater than 4096, and may be
  428.          further constrained, depending on the message type.  No
  429.          "padding" of extra data after the message is allowed, so the
  430.          Length field must have the smallest value required given the
  431.          rest of the message.
  432.  
  433.       Type:
  434.  
  435.          This 1-octet unsigned integer indicates the type code of the
  436.          message.  The following type codes are defined:
  437.  
  438.                                     1 - OPEN
  439.                                     2 - UPDATE
  440.                                     3 - NOTIFICATION
  441.                                     4 - KEEPALIVE
  442.  
  443.  
  444. 4.2 OPEN Message Format
  445.  
  446.  
  447.    After a transport protocol connection is established, the first
  448.    message sent by each side is an OPEN message.  If the OPEN message is
  449.    acceptable, a KEEPALIVE message confirming the OPEN is sent back.
  450.    Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION
  451.    messages may be exchanged.
  452.  
  453.    In addition to the fixed-size BGP header, the OPEN message contains
  454.    the following fields:
  455.  
  456.  
  457.  
  458.  
  459.         0                   1                   2                   3
  460.        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
  461.        +-+-+-+-+-+-+-+-+
  462.        |    Version    |
  463.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  464.        |     My Autonomous System      |
  465.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  466.        |           Hold Time           |
  467.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  468.        |                         BGP Identifier                        |
  469.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  470.        | Opt Parm Len  |
  471.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  472.        |                                                               |
  473.        |                       Optional Parameters                     |
  474.        |                                                               |
  475.  
  476.  
  477.  
  478. Expiration Date July 1997                                        [Page 8]
  479.  
  480.  
  481.  
  482.  
  483.  
  484. RFC DRAFT                                                  December 1997
  485.  
  486.  
  487.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  488.  
  489.  
  490.  
  491.       Version:
  492.  
  493.          This 1-octet unsigned integer indicates the protocol version
  494.          number of the message.  The current BGP version number is 4.
  495.  
  496.       My Autonomous System:
  497.  
  498.          This 2-octet unsigned integer indicates the Autonomous System
  499.          number of the sender.
  500.  
  501.       Hold Time:
  502.  
  503.          This 2-octet unsigned integer indicates the number of seconds
  504.          that the sender proposes for the value of the Hold Timer.  Upon
  505.          receipt of an OPEN message, a BGP speaker MUST calculate the
  506.          value of the Hold Timer by using the smaller of its configured
  507.          Hold Time and the Hold Time received in the OPEN message.  The
  508.          Hold Time MUST be either zero or at least three seconds.  An
  509.          implementation may reject connections on the basis of the Hold
  510.          Time.  The calculated value indicates the maximum number of
  511.          seconds that may elapse between the receipt of successive
  512.          KEEPALIVE, and/or UPDATE messages by the sender.
  513.  
  514.       BGP Identifier:
  515.          This 4-octet unsigned integer indicates the BGP Identifier of
  516.          the sender. A given BGP speaker sets the value of its BGP
  517.          Identifier to an IP address assigned to that BGP speaker.  The
  518.          value of the BGP Identifier is determined on startup and is the
  519.          same for every local interface and every BGP peer.
  520.  
  521.       Optional Parameters Length:
  522.  
  523.          This 1-octet unsigned integer indicates the total length of the
  524.          Optional Parameters field in octets. If the value of this field
  525.          is zero, no Optional Parameters are present.
  526.  
  527.       Optional Parameters:
  528.  
  529.          This field may contain a list of optional parameters, where
  530.          each parameter is encoded as a <Parameter Type, Parameter
  531.          Length, Parameter Value> triplet.
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538. Expiration Date July 1997                                        [Page 9]
  539.  
  540.  
  541.  
  542.  
  543.  
  544. RFC DRAFT                                                  December 1997
  545.  
  546.  
  547.                 0                   1
  548.                 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  549.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
  550.                |  Parm. Type   | Parm. Length  |  Parameter Value (variable)
  551.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
  552.  
  553.  
  554.          Parameter Type is a one octet field that unambiguously
  555.          identifies individual parameters. Parameter Length is a one
  556.          octet field that contains the length of the Parameter Value
  557.          field in octets.  Parameter Value is a variable length field
  558.          that is interpreted according to the value of the Parameter
  559.          Type field.
  560.  
  561.          This document defines the following Optional Parameters:
  562.  
  563.          a) Authentication Information (Parameter Type 1):
  564.  
  565.  
  566.             This optional parameter may be used to authenticate a BGP
  567.             peer. The Parameter Value field contains a 1-octet
  568.             Authentication Code followed by a variable length
  569.             Authentication Data.
  570.  
  571.  
  572.                 0 1 2 3 4 5 6 7 8
  573.                 +-+-+-+-+-+-+-+-+
  574.                 |  Auth. Code   |
  575.                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  576.                 |                                                     |
  577.                 |              Authentication Data                    |
  578.                 |                                                     |
  579.                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  580.  
  581.  
  582.  
  583.                Authentication Code:
  584.  
  585.                   This 1-octet unsigned integer indicates the
  586.                   authentication mechanism being used.  Whenever an
  587.                   authentication mechanism is specified for use within
  588.                   BGP, three things must be included in the
  589.                   specification:
  590.                   - the value of the Authentication Code which indicates
  591.                   use of the mechanism,
  592.                   - the form and meaning of the Authentication Data, and
  593.                   - the algorithm for computing values of Marker fields.
  594.  
  595.  
  596.  
  597.  
  598. Expiration Date July 1997                                       [Page 10]
  599.  
  600.  
  601.  
  602.  
  603.  
  604. RFC DRAFT                                                  December 1997
  605.  
  606.  
  607.                   Note that a separate authentication mechanism may be
  608.                   used in establishing the transport level connection.
  609.  
  610.                Authentication Data:
  611.  
  612.                   The form and meaning of this field is a variable-
  613.                   length field depend on the Authentication Code.
  614.  
  615.          The minimum length of the OPEN message is 29 octets (including
  616.          message header).
  617.  
  618.  
  619. 4.3 UPDATE Message Format
  620.  
  621.  
  622.    UPDATE messages are used to transfer routing information between BGP
  623.    peers.  The information in the UPDATE packet can be used to construct
  624.    a graph describing the relationships of the various Autonomous
  625.    Systems.  By applying rules to be discussed, routing information
  626.    loops and some other anomalies may be detected and removed from
  627.    inter-AS routing.
  628.  
  629.    An UPDATE message is used to advertise a single feasible route to a
  630.    peer, or to withdraw multiple unfeasible routes from service (see
  631.    3.1). An UPDATE message may simultaneously advertise a feasible route
  632.    and withdraw multiple unfeasible routes from service.  The UPDATE
  633.    message always includes the fixed-size BGP header, and can optionally
  634.    include the other fields as shown below:
  635.  
  636.  
  637.       +-----------------------------------------------------+
  638.       |   Unfeasible Routes Length (2 octets)               |
  639.       +-----------------------------------------------------+
  640.       |  Withdrawn Routes (variable)                        |
  641.       +-----------------------------------------------------+
  642.       |   Total Path Attribute Length (2 octets)            |
  643.       +-----------------------------------------------------+
  644.       |    Path Attributes (variable)                       |
  645.       +-----------------------------------------------------+
  646.       |   Network Layer Reachability Information (variable) |
  647.       +-----------------------------------------------------+
  648.  
  649.  
  650.  
  651.       Unfeasible Routes Length:
  652.  
  653.          This 2-octets unsigned integer indicates the total length of
  654.          the Withdrawn Routes field in octets.  Its value must allow the
  655.  
  656.  
  657.  
  658. Expiration Date July 1997                                       [Page 11]
  659.  
  660.  
  661.  
  662.  
  663.  
  664. RFC DRAFT                                                  December 1997
  665.  
  666.  
  667.          length of the Network Layer Reachability Information field to
  668.          be determined as specified below.
  669.  
  670.          A value of 0 indicates that no routes are being withdrawn from
  671.          service, and that the WITHDRAWN ROUTES field is not present in
  672.          this UPDATE message.
  673.  
  674.       Withdrawn Routes:
  675.  
  676.  
  677.          This is a variable length field that contains a list of IP
  678.          address prefixes for the routes that are being withdrawn from
  679.          service.  Each IP address prefix is encoded as a 2-tuple of the
  680.          form <length, prefix>, whose fields are described below:
  681.  
  682.                   +---------------------------+
  683.                   |   Length (1 octet)        |
  684.                   +---------------------------+
  685.                   |   Prefix (variable)       |
  686.                   +---------------------------+
  687.  
  688.  
  689.          The use and the meaning of these fields are as follows:
  690.  
  691.          a) Length:
  692.  
  693.             The Length field indicates the length in bits of the IP
  694.             address prefix. A length of zero indicates a prefix that
  695.             matches all IP addresses (with prefix, itself, of zero
  696.             octets).
  697.  
  698.          b) Prefix:
  699.  
  700.             The Prefix field contains IP address prefixes followed by
  701.             enough trailing bits to make the end of the field fall on an
  702.             octet boundary. Note that the value of trailing bits is
  703.             irrelevant.
  704.  
  705.       Total Path Attribute Length:
  706.  
  707.          This 2-octet unsigned integer indicates the total length of the
  708.          Path Attributes field in octets.  Its value must allow the
  709.          length of the Network Layer Reachability field to be determined
  710.          as specified below.
  711.  
  712.          A value of 0 indicates that no Network Layer Reachability
  713.          Information field is present in this UPDATE message.
  714.  
  715.  
  716.  
  717.  
  718. Expiration Date July 1997                                       [Page 12]
  719.  
  720.  
  721.  
  722.  
  723.  
  724. RFC DRAFT                                                  December 1997
  725.  
  726.  
  727.       Path Attributes:
  728.  
  729.          A variable length sequence of path attributes is present in
  730.          every UPDATE.  Each path attribute is a triple <attribute type,
  731.          attribute length, attribute value> of variable length.
  732.  
  733.          Attribute Type is a two-octet field that consists of the
  734.          Attribute Flags octet followed by the Attribute Type Code
  735.          octet.
  736.  
  737.  
  738.  
  739.  
  740.                 0                   1
  741.                 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  742.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  743.                |  Attr. Flags  |Attr. Type Code|
  744.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  745.  
  746.  
  747.          The high-order bit (bit 0) of the Attribute Flags octet is the
  748.          Optional bit.  It defines whether the attribute is optional (if
  749.          set to 1) or well-known (if set to 0).
  750.  
  751.          The second high-order bit (bit 1) of the Attribute Flags octet
  752.          is the Transitive bit.  It defines whether an optional
  753.          attribute is transitive (if set to 1) or non-transitive (if set
  754.          to 0).  For well-known attributes, the Transitive bit must be
  755.          set to 1.  (See Section 5 for a discussion of transitive
  756.          attributes.)
  757.  
  758.          The third high-order bit (bit 2) of the Attribute Flags octet
  759.          is the Partial bit.  It defines whether the information
  760.          contained in the optional transitive attribute is partial (if
  761.          set to 1) or complete (if set to 0).  For well-known attributes
  762.          and for optional non-transitive attributes the Partial bit must
  763.          be set to 0.
  764.  
  765.          The fourth high-order bit (bit 3) of the Attribute Flags octet
  766.          is the Extended Length bit.  It defines whether the Attribute
  767.          Length is one octet (if set to 0) or two octets (if set to 1).
  768.          Extended Length may be used only if the length of the attribute
  769.          value is greater than 255 octets.
  770.  
  771.          The lower-order four bits of the Attribute Flags octet are .
  772.          unused. They must be zero (and must be ignored when received).
  773.  
  774.          The Attribute Type Code octet contains the Attribute Type Code.
  775.  
  776.  
  777.  
  778. Expiration Date July 1997                                       [Page 13]
  779.  
  780.  
  781.  
  782.  
  783.  
  784. RFC DRAFT                                                  December 1997
  785.  
  786.  
  787.          Currently defined Attribute Type Codes are discussed in Section
  788.          5.
  789.  
  790.          If the Extended Length bit of the Attribute Flags octet is set
  791.          to 0, the third octet of the Path Attribute contains the length
  792.          of the attribute data in octets.
  793.  
  794.          If the Extended Length bit of the Attribute Flags octet is set
  795.          to 1, then the third and the fourth octets of the path
  796.          attribute contain the length of the attribute data in octets.
  797.  
  798.          The remaining octets of the Path Attribute represent the
  799.          attribute value and are interpreted according to the Attribute
  800.          Flags and the Attribute Type Code. The supported Attribute Type
  801.          Codes, their attribute values and uses are the following:
  802.  
  803.          a)   ORIGIN (Type Code 1):
  804.  
  805.             ORIGIN is a well-known mandatory attribute that defines the
  806.             origin of the path information.   The data octet can assume
  807.             the following values:
  808.  
  809.                   Value      Meaning
  810.  
  811.                   0         IGP - Network Layer Reachability Information
  812.                                is interior to the originating AS
  813.  
  814.                   1         EGP - Network Layer Reachability Information
  815.                                learned via EGP
  816.  
  817.                   2         INCOMPLETE - Network Layer Reachability
  818.                                Information learned by some other means
  819.  
  820.             Its usage is defined in 5.1.1
  821.  
  822.          b) AS_PATH (Type Code 2):
  823.  
  824.             AS_PATH is a well-known mandatory attribute that is composed
  825.             of a sequence of AS path segments. Each AS path segment is
  826.             represented by a triple <path segment type, path segment
  827.             length, path segment value>.
  828.  
  829.             The path segment type is a 1-octet long field with the
  830.             following values defined:
  831.  
  832.                   Value      Segment Type
  833.  
  834.                   1         AS_SET: unordered set of ASs a route in the
  835.  
  836.  
  837.  
  838. Expiration Date July 1997                                       [Page 14]
  839.  
  840.  
  841.  
  842.  
  843.  
  844. RFC DRAFT                                                  December 1997
  845.  
  846.  
  847.                                UPDATE message has traversed
  848.  
  849.                   2         AS_SEQUENCE: ordered set of ASs a route in
  850.                                the UPDATE message has traversed
  851.  
  852.             The path segment length is a 1-octet long field containing
  853.             the number of ASs in the path segment value field.
  854.  
  855.             The path segment value field contains one or more AS
  856.             numbers, each encoded as a 2-octets long field.
  857.  
  858.             Usage of this attribute is defined in 5.1.2.
  859.  
  860.          c)   NEXT_HOP (Type Code 3):
  861.  
  862.             This is a well-known mandatory attribute that defines the IP
  863.             address of the border router that should be used as the next
  864.             hop to the destinations listed in the Network Layer
  865.             Reachability field of the UPDATE message.
  866.  
  867.             Usage of this attribute is defined in 5.1.3.
  868.  
  869.  
  870.          d) MULTI_EXIT_DISC (Type Code 4):
  871.  
  872.             This is an optional non-transitive attribute that is a four
  873.             octet non-negative integer. The value of this attribute may
  874.             be used by a BGP speaker's decision process to discriminate
  875.             among multiple exit points to a neighboring autonomous
  876.             system.
  877.  
  878.             Its usage is defined in 5.1.4.
  879.  
  880.          e) LOCAL_PREF (Type Code 5):
  881.  
  882.             LOCAL_PREF is a well-known mandatory attribute that is a
  883.             four octet non-negative integer. It is used by a BGP speaker
  884.             to inform other internal peers of the advertising speaker's
  885.             degree of preference for an advertised route. Usage of this
  886.             attribute is described in 5.1.5.
  887.  
  888.          f) ATOMIC_AGGREGATE (Type Code 6)
  889.  
  890.             ATOMIC_AGGREGATE is a well-known discretionary attribute of
  891.             length 0. It is used by a BGP speaker to inform other BGP
  892.             speakers that the local system selected a less specific
  893.             route without selecting a more specific route which is
  894.             included in it. Usage of this attribute is described in
  895.  
  896.  
  897.  
  898. Expiration Date July 1997                                       [Page 15]
  899.  
  900.  
  901.  
  902.  
  903.  
  904. RFC DRAFT                                                  December 1997
  905.  
  906.  
  907.             5.1.6.
  908.  
  909.          g) AGGREGATOR (Type Code 7)
  910.  
  911.             AGGREGATOR is an optional transitive attribute of length 6.
  912.             The attribute contains the last AS number that formed the
  913.             aggregate route (encoded as 2 octets), followed by the IP
  914.             address of the BGP speaker that formed the aggregate route
  915.             (encoded as 4 octets).  Usage of this attribute is described
  916.             in 5.1.7
  917.  
  918.       Network Layer Reachability Information:
  919.  
  920.          This variable length field contains a list of IP address
  921.          prefixes.  The length in octets of the Network Layer
  922.          Reachability Information is not encoded explicitly, but can be
  923.          calculated as:
  924.  
  925.             UPDATE message Length - 23 - Total Path Attributes Length -
  926.             Unfeasible Routes Length
  927.  
  928.          where UPDATE message Length is the value encoded in the fixed-
  929.          size BGP header, Total Path Attribute Length and Unfeasible
  930.          Routes Length  are the values encoded in the variable part of
  931.          the UPDATE message, and 23 is a combined length of the fixed-
  932.          size BGP header, the Total Path Attribute Length field and the
  933.          Unfeasible Routes Length field.
  934.  
  935.          Reachability information is encoded as one or more 2-tuples of
  936.          the form <length, prefix>, whose fields are described below:
  937.  
  938.  
  939.                   +---------------------------+
  940.                   |   Length (1 octet)        |
  941.                   +---------------------------+
  942.                   |   Prefix (variable)       |
  943.                   +---------------------------+
  944.  
  945.  
  946.          The use and the meaning of these fields are as follows:
  947.  
  948.          a) Length:
  949.  
  950.             The Length field indicates the length in bits of the IP
  951.             address prefix. A length of zero indicates a prefix that
  952.             matches all IP addresses (with prefix, itself, of zero
  953.             octets).
  954.  
  955.  
  956.  
  957.  
  958. Expiration Date July 1997                                       [Page 16]
  959.  
  960.  
  961.  
  962.  
  963.  
  964. RFC DRAFT                                                  December 1997
  965.  
  966.  
  967.          b) Prefix:
  968.  
  969.             The Prefix field contains IP address prefixes followed by
  970.             enough trailing bits to make the end of the field fall on an
  971.             octet boundary. Note that the value of the trailing bits is
  972.             irrelevant.
  973.  
  974.    The minimum length of the UPDATE message is 23 octets -- 19 octets
  975.    for the fixed header + 2 octets for the Unfeasible Routes Length + 2
  976.    octets for the Total Path Attribute Length (the value of Unfeasible
  977.    Routes Length is 0  and the value of Total Path Attribute Length is
  978.    0).
  979.  
  980.    An UPDATE message can advertise at most one route, which may be
  981.    described by several path attributes. All path attributes contained
  982.    in a given UPDATE messages apply to the destinations carried in the
  983.    Network Layer Reachability Information field of the UPDATE message.
  984.  
  985.    An UPDATE message can list multiple routes to be withdrawn from
  986.    service.  Each such route is identified by its destination (expressed
  987.    as an IP prefix), which unambiguously identifies the route in the
  988.    context of the BGP speaker - BGP speaker connection to which it has
  989.    been previously been advertised.
  990.  
  991.    An UPDATE message may advertise only routes to be withdrawn from
  992.    service, in which case it will not include path attributes or Network
  993.    Layer Reachability Information. Conversely, it may advertise only a
  994.    feasible route, in which case the WITHDRAWN ROUTES field need not be
  995.    present.
  996.  
  997.  
  998. 4.4 KEEPALIVE Message Format
  999.  
  1000.  
  1001.    BGP does not use any transport protocol-based keep-alive mechanism to
  1002.    determine if peers are reachable.  Instead, KEEPALIVE messages are
  1003.    exchanged between peers often enough as not to cause the Hold Timer
  1004.    to expire.  A reasonable maximum time between KEEPALIVE messages
  1005.    would be one third of the Hold Time interval.  KEEPALIVE messages
  1006.    MUST NOT be sent more frequently than one per second.  An
  1007.    implementation MAY adjust the rate at which it sends KEEPALIVE
  1008.    messages as a function of the Hold Time interval.
  1009.  
  1010.    If the negotiated Hold Time interval is zero, then periodic KEEPALIVE
  1011.    messages MUST NOT be sent.
  1012.  
  1013.    KEEPALIVE message consists of only message header and has a length of
  1014.    19 octets.
  1015.  
  1016.  
  1017.  
  1018. Expiration Date July 1997                                       [Page 17]
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024. RFC DRAFT                                                  December 1997
  1025.  
  1026.  
  1027. 4.5 NOTIFICATION Message Format
  1028.  
  1029.  
  1030.    A NOTIFICATION message is sent when an error condition is detected.
  1031.    The BGP connection is closed immediately after sending it.
  1032.  
  1033.    In addition to the fixed-size BGP header, the NOTIFICATION message
  1034.    contains the following fields:
  1035.  
  1036.  
  1037.         0                   1                   2                   3
  1038.         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
  1039.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1040.        | Error code    | Error subcode |           Data                |
  1041.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
  1042.        |                                                               |
  1043.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1044.  
  1045.  
  1046.  
  1047.       Error Code:
  1048.  
  1049.          This 1-octet unsigned integer indicates the type of
  1050.          NOTIFICATION.  The following Error Codes have been defined:
  1051.  
  1052.             Error Code       Symbolic Name               Reference
  1053.  
  1054.               1         Message Header Error             Section 6.1
  1055.  
  1056.               2         OPEN Message Error               Section 6.2
  1057.  
  1058.               3         UPDATE Message Error             Section 6.3
  1059.  
  1060.               4         Hold Timer Expired               Section 6.5
  1061.  
  1062.               5         Finite State Machine Error       Section 6.6
  1063.  
  1064.               6         Cease                            Section 6.7
  1065.  
  1066.  
  1067.       Error subcode:
  1068.  
  1069.          This 1-octet unsigned integer provides more specific
  1070.          information about the nature of the reported error.  Each Error
  1071.          Code may have one or more Error Subcodes associated with it.
  1072.          If no appropriate Error Subcode is defined, then a zero
  1073.          (Unspecific) value is used for the Error Subcode field.
  1074.  
  1075.  
  1076.  
  1077.  
  1078. Expiration Date July 1997                                       [Page 18]
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084. RFC DRAFT                                                  December 1997
  1085.  
  1086.  
  1087.          Message Header Error subcodes:
  1088.  
  1089.                                1  - Connection Not Synchronized.
  1090.                                2  - Bad Message Length.
  1091.                                3  - Bad Message Type.
  1092.  
  1093.          OPEN Message Error subcodes:
  1094.  
  1095.                                1  - Unsupported Version Number.
  1096.                                2  - Bad Peer AS.
  1097.                                3  - Bad BGP Identifier.
  1098.                                4  - Unsupported Optional Parameter.
  1099.                                5  - Authentication Failure.
  1100.                                6  - Unacceptable Hold Time.
  1101.  
  1102.          UPDATE Message Error subcodes:
  1103.  
  1104.                                1 - Malformed Attribute List.
  1105.                                2 - Unrecognized Well-known Attribute.
  1106.                                3 - Missing Well-known Attribute.
  1107.                                4 - Attribute Flags Error.
  1108.                                5 - Attribute Length Error.
  1109.                                6 - Invalid ORIGIN Attribute
  1110.                                7 - AS Routing Loop.
  1111.                                8 - Invalid NEXT_HOP Attribute.
  1112.                                9 - Optional Attribute Error.
  1113.                               10 - Invalid Network Field.
  1114.                               11 - Malformed AS_PATH.
  1115.  
  1116.       Data:
  1117.  
  1118.          This variable-length field is used to diagnose the reason for
  1119.          the NOTIFICATION.  The contents of the Data field depend upon
  1120.          the Error Code and Error Subcode.  See Section 6 below for more
  1121.          details.
  1122.  
  1123.          Note that the length of the Data field can be determined from
  1124.          the message Length field by the formula:
  1125.  
  1126.                   Message Length = 21 + Data Length
  1127.  
  1128.  
  1129.    The minimum length of the NOTIFICATION message is 21 octets
  1130.    (including message header).
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138. Expiration Date July 1997                                       [Page 19]
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144. RFC DRAFT                                                  December 1997
  1145.  
  1146.  
  1147. 5.  Path Attributes
  1148.  
  1149.  
  1150.    This section discusses the path attributes of the UPDATE message.
  1151.  
  1152.    Path attributes fall into four separate categories:
  1153.  
  1154.                1. Well-known mandatory.
  1155.                2. Well-known discretionary.
  1156.                3. Optional transitive.
  1157.                4. Optional non-transitive.
  1158.  
  1159.    Well-known attributes must be recognized by all BGP implementations.
  1160.    Some of these attributes are mandatory and must be included in every
  1161.    UPDATE message that contains NLRI.  Others are discretionary and may
  1162.    or may not be sent in a particular UPDATE message.
  1163.  
  1164.    All well-known attributes must be passed along (after proper
  1165.    updating, if necessary) to other BGP peers.
  1166.  
  1167.    In addition to well-known attributes, each path may contain one or
  1168.    more optional attributes.  It is not required or expected that all
  1169.    BGP implementations support all optional attributes.  The handling of
  1170.    an unrecognized optional attribute is determined by the setting of
  1171.    the Transitive bit in the attribute flags octet.  Paths with
  1172.    unrecognized transitive optional attributes should be accepted. If a
  1173.    path with unrecognized transitive optional attribute is accepted and
  1174.    passed along to other BGP peers, then the unrecognized transitive
  1175.    optional attribute of that path must be passed along with the path to
  1176.    other BGP peers with the Partial bit in the Attribute Flags octet set
  1177.    to 1. If a path with recognized transitive optional attribute is
  1178.    accepted and passed along to other BGP peers and the Partial bit in
  1179.    the Attribute Flags octet is set to 1 by some previous AS, it is not
  1180.    set back to 0 by the current AS. Unrecognized non-transitive optional
  1181.    attributes must be quietly ignored and not passed along to other BGP
  1182.    peers.
  1183.  
  1184.    New transitive optional attributes may be attached to the path by the
  1185.    originator or by any other AS in the path.  If they are not attached
  1186.    by the originator, the Partial bit in the Attribute Flags octet is
  1187.    set to 1.  The rules for attaching new non-transitive optional
  1188.    attributes will depend on the nature of the specific attribute.  The
  1189.    documentation of each new non-transitive optional attribute will be
  1190.    expected to include such rules.  (The description of the
  1191.    MULTI_EXIT_DISC attribute gives an example.)  All optional attributes
  1192.    (both transitive and non-transitive) may be updated (if appropriate)
  1193.    by ASs in the path.
  1194.  
  1195.  
  1196.  
  1197.  
  1198. Expiration Date July 1997                                       [Page 20]
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204. RFC DRAFT                                                  December 1997
  1205.  
  1206.  
  1207.    The sender of an UPDATE message should order path attributes within
  1208.    the UPDATE message in ascending order of attribute type.  The
  1209.    receiver of an UPDATE message must be prepared to handle path
  1210.    attributes within the UPDATE message that are out of order.
  1211.  
  1212.    The same attribute cannot appear more than once within the Path
  1213.    Attributes field of a particular UPDATE message.
  1214.  
  1215.    The mandatory category refers to an attribute which must be present
  1216.    in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE
  1217.    message.  Attributes classified as optional for the purpose of the
  1218.    protocol extension mechanism may be purely discretionary, or
  1219.    discretionary, required, or disallowed in certain contexts.
  1220.  
  1221.         attribute           EBGP                    IBGP
  1222.          ORIGIN             mandatory               mandatory
  1223.          AS_PATH            mandatory               mandatory
  1224.          NEXT_HOP           mandatory               mandatory
  1225.          MULTI_EXIT_DISC    discretionary           discretionary
  1226.          LOCAL_PREF         disallowed              required
  1227.          ATOMIC_AGGREGATE   see section 5.1.6 and 9.1.4
  1228.          AGGREGATOR         discretionary           discretionary
  1229.  
  1230.  
  1231.  
  1232.  
  1233. 5.1 Path Attribute Usage
  1234.  
  1235.  
  1236.    The usage of each BGP path attributes is described in the following
  1237.    clauses.
  1238.  
  1239.  
  1240.  
  1241. 5.1.1 ORIGIN
  1242.  
  1243.  
  1244.    ORIGIN is a well-known mandatory attribute.  The ORIGIN attribute
  1245.    shall be generated by the autonomous system that originates the
  1246.    associated routing information. It shall be included in the UPDATE
  1247.    messages of all BGP speakers that choose to propagate this
  1248.    information to other BGP speakers.
  1249.  
  1250.  
  1251. 5.1.2   AS_PATH
  1252.  
  1253.  
  1254.    AS_PATH is a well-known mandatory attribute. This attribute
  1255.  
  1256.  
  1257.  
  1258. Expiration Date July 1997                                       [Page 21]
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264. RFC DRAFT                                                  December 1997
  1265.  
  1266.  
  1267.    identifies the autonomous systems through which routing information
  1268.    carried in this UPDATE message has passed. The components of this
  1269.    list can be AS_SETs or AS_SEQUENCEs.
  1270.  
  1271.    When a BGP speaker propagates a route which it has learned from
  1272.    another BGP speaker's UPDATE message, it shall modify the route's
  1273.    AS_PATH attribute based on the location of the BGP speaker to which
  1274.    the route will be sent:
  1275.  
  1276.       a) When a given BGP speaker advertises the route to an internal
  1277.       peer, the advertising speaker shall not modify the AS_PATH
  1278.       attribute associated with the route.
  1279.  
  1280.       b) When a given BGP speaker advertises the route to an external
  1281.       peer, then the advertising speaker shall update the AS_PATH
  1282.       attribute as follows:
  1283.  
  1284.          1) if the first path segment of the AS_PATH is of type
  1285.          AS_SEQUENCE, the local system shall prepend its own AS number
  1286.          as the last element of the sequence  (put it in the leftmost
  1287.          position)
  1288.  
  1289.          2) if the first path segment of the AS_PATH is of type AS_SET,
  1290.          the local system shall prepend a new path segment of type
  1291.          AS_SEQUENCE to the AS_PATH, including its own AS number in that
  1292.          segment.
  1293.  
  1294.       When a BGP speaker originates a route then:
  1295.  
  1296.  
  1297.          a) the originating speaker shall include its own AS number in
  1298.          the AS_PATH attribute of all UPDATE messages sent to an
  1299.          external peer.  (In this case, the AS number of the originating
  1300.          speaker's autonomous system will be the only entry in the
  1301.          AS_PATH attribute).
  1302.  
  1303.          b) the originating speaker shall include an empty AS_PATH
  1304.          attribute in all UPDATE messages sent to internal peers.  (An
  1305.          empty AS_PATH attribute is one whose length field contains the
  1306.          value zero).
  1307.  
  1308.  
  1309. 5.1.3 NEXT_HOP
  1310.  
  1311.  
  1312.    The NEXT_HOP path attribute defines the IP address of the border
  1313.    router that should be used as the next hop to the destinations listed
  1314.    in the UPDATE message.  When advertising a NEXT_HOP attribute to an
  1315.  
  1316.  
  1317.  
  1318. Expiration Date July 1997                                       [Page 22]
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. RFC DRAFT                                                  December 1997
  1325.  
  1326.  
  1327.    external peer, a router may use one of its own interface addresses in
  1328.    the NEXT_HOP attribute provided the external peer to which the route
  1329.    is being advertised shares a common subnet with the NEXT_HOP address.
  1330.    This is known as a "first party" NEXT_HOP attribute.  A BGP speaker
  1331.    can advertise to an external peer an interface of any internal peer
  1332.    router in the NEXT_HOP attribute provided the external peer to which
  1333.    the route is being advertised shares a common subnet with the
  1334.    NEXT_HOP address.  This is known as a "third party" NEXT_HOP
  1335.    attribute.  A BGP speaker can advertise any external peer router in
  1336.    the NEXT_HOP attribute provided that the IP address of this border
  1337.    router was learned from an external peer and the external peer to
  1338.    which the route is being advertised shares a common subnet with the
  1339.    NEXT_HOP address.  This is a second form of "third party" NEXT_HOP
  1340.    attribute.
  1341.  
  1342.    Normally the NEXT_HOP attribute is chosen such that the shortest
  1343.    available path will be taken.  A BGP speaker must be able to support
  1344.    disabling advertisement of third party NEXT_HOP attributes to handle
  1345.    imperfectly bridged media.
  1346.  
  1347.    A BGP speaker must never advertise an address of a peer to that peer
  1348.    as a NEXT_HOP, for a route that the speaker is originating.  A BGP
  1349.    speaker must never install a route with itself as the next hop.
  1350.  
  1351.    When a BGP speaker advertises the route to an internal peer, the
  1352.    advertising speaker should not modify the NEXT_HOP attribute
  1353.    associated with the route.  When a BGP speaker receives the route via
  1354.    an internal link, it may forward packets to the NEXT_HOP address if
  1355.    the address contained in the attribute is on a common subnet with the
  1356.    local and remote BGP speakers.
  1357.  
  1358.  
  1359. 5.1.4   MULTI_EXIT_DISC
  1360.  
  1361.  
  1362.    The MULTI_EXIT_DISC attribute may be used on external (inter-AS)
  1363.    links to discriminate among multiple exit or entry points to the same
  1364.    neighboring AS.  The value of the MULTI_EXIT_DISC attribute is a four
  1365.    octet unsigned number which is called a metric.  All other factors
  1366.    being equal, the exit or entry point with lower metric should be
  1367.    preferred.  If received over external links, the MULTI_EXIT_DISC
  1368.    attribute MAY be propagated over internal links to other BGP speakers
  1369.    within the same AS.  The MULTI_EXIT_DISC attribute received from a
  1370.    neighboring AS MUST NOT be propagated to other neighboring ASs.
  1371.  
  1372.    A BGP speaker MUST IMPLEMENT a mechanism based on local configuration
  1373.    which allows the MULTI_EXIT_DISC attribute to be removed from a
  1374.    route.  This MAY be done either prior to or after determining the
  1375.  
  1376.  
  1377.  
  1378. Expiration Date July 1997                                       [Page 23]
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384. RFC DRAFT                                                  December 1997
  1385.  
  1386.  
  1387.    degree of preference of the route and performing route selection
  1388.    (decision process phases 1 and 2).
  1389.  
  1390.    An implementation MAY also (based on local configuration) alter the
  1391.    value of the MULTI_EXIT_DISC attribute received over an external
  1392.    link.  If it does so, it shall do so prior to determining the degree
  1393.    of preference of the route and performing route selection (decision
  1394.    process phases 1 and 2).
  1395.  
  1396.  
  1397. 5.1.5   LOCAL_PREF
  1398.  
  1399.  
  1400.    LOCAL_PREF is a well-known mandatory attribute that SHALL be included
  1401.    in all UPDATE messages that a given BGP speaker sends to the other
  1402.    internal peers. A BGP speaker SHALL calculate the degree of
  1403.    preference for each external route and include the degree of
  1404.    preference when advertising a route to its internal peers. The higher
  1405.    degree of preference MUST be preferred. A BGP speaker shall use the
  1406.    degree of preference learned via LOCAL_PREF in its decision process
  1407.    (see section 9.1.1).
  1408.  
  1409.    A BGP speaker MUST NOT include this attribute in UPDATE messages that
  1410.    it sends to external peers.  If it is contained in an UPDATE message
  1411.    that is received from an external peer, then this attribute MUST be
  1412.    ignored by the receiving speaker.
  1413.  
  1414.  
  1415. 5.1.6   ATOMIC_AGGREGATE
  1416.  
  1417.  
  1418.    ATOMIC_AGGREGATE is a well-known discretionary attribute.  If a BGP
  1419.    speaker, when presented with a set of overlapping routes from one of
  1420.    its peers (see 9.1.4), selects the less specific route without
  1421.    selecting the more specific one, then the local system MUST attach
  1422.    the ATOMIC_AGGREGATE attribute to the route when propagating it to
  1423.    other BGP speakers (if that attribute is not already present in the
  1424.    received less specific route). A BGP speaker that receives a route
  1425.    with the ATOMIC_AGGREGATE attribute MUST NOT remove the attribute
  1426.    from the route when propagating it to other speakers. A BGP speaker
  1427.    that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT
  1428.    make any NLRI of that route more specific (as defined in 9.1.4) when
  1429.    advertising this route to other BGP speakers.  A BGP speaker that
  1430.    receives a route with the ATOMIC_AGGREGATE attribute needs to be
  1431.    cognizant of the fact that the actual path to destinations, as
  1432.    specified in the NLRI of the route, while having the loop-free
  1433.    property, may traverse ASs that are not listed in the AS_PATH
  1434.    attribute.
  1435.  
  1436.  
  1437.  
  1438. Expiration Date July 1997                                       [Page 24]
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444. RFC DRAFT                                                  December 1997
  1445.  
  1446.  
  1447. 5.1.7   AGGREGATOR
  1448.  
  1449.  
  1450.    AGGREGATOR is an optional transitive attribute which may be included
  1451.    in updates which are formed by aggregation (see Section 9.2.4.2).  A
  1452.    BGP speaker which performs route aggregation may add the AGGREGATOR
  1453.    attribute which shall contain its own AS number and IP address.
  1454.  
  1455.  
  1456. 6.  BGP Error Handling.
  1457.  
  1458.  
  1459.    This section describes actions to be taken when errors are detected
  1460.    while processing BGP messages.
  1461.  
  1462.    When any of the conditions described here are detected, a
  1463.    NOTIFICATION message with the indicated Error Code, Error Subcode,
  1464.    and Data fields is sent, and the BGP connection is closed.  If no
  1465.    Error Subcode is specified, then a zero must be used.
  1466.  
  1467.    The phrase "the BGP connection is closed" means that the transport
  1468.    protocol connection has been closed and that all resources for that
  1469.    BGP connection have been deallocated.  Routing table entries
  1470.    associated with the remote peer are marked as invalid.  The fact that
  1471.    the routes have become invalid is passed to other BGP peers before
  1472.    the routes are deleted from the system.
  1473.  
  1474.    Unless specified explicitly, the Data field of the NOTIFICATION
  1475.    message that is sent to indicate an error is empty.
  1476.  
  1477.  
  1478. 6.1 Message Header error handling.
  1479.  
  1480.  
  1481.    All errors detected while processing the Message Header are indicated
  1482.    by sending the NOTIFICATION message with Error Code Message Header
  1483.    Error.  The Error Subcode elaborates on the specific nature of the
  1484.    error.
  1485.  
  1486.    The expected value of the Marker field of the message header is all
  1487.    ones if the message type is OPEN.  The expected value of the Marker
  1488.    field for all other types of BGP messages determined based on the
  1489.    presence of the Authentication Information Optional Parameter in the
  1490.    BGP OPEN message and the actual authentication mechanism (if the
  1491.    Authentication Information in the BGP OPEN message is present). If
  1492.    the Marker field of the message header is not the expected one, then
  1493.    a synchronization error has occurred and the Error Subcode is set to
  1494.    Connection Not Synchronized.
  1495.  
  1496.  
  1497.  
  1498. Expiration Date July 1997                                       [Page 25]
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504. RFC DRAFT                                                  December 1997
  1505.  
  1506.  
  1507.    If the Length field of the message header is less than 19 or greater
  1508.    than 4096, or if the Length field of an OPEN message is less  than
  1509.    the minimum length of the OPEN message, or if the Length field of an
  1510.    UPDATE message is less than the minimum length of the UPDATE message,
  1511.    or if the Length field of a KEEPALIVE message is not equal to 19, or
  1512.    if the Length field of a NOTIFICATION message is less than the
  1513.    minimum length of the NOTIFICATION message, then the Error Subcode is
  1514.    set to Bad Message Length.  The Data field contains the erroneous
  1515.    Length field.
  1516.  
  1517.    If the Type field of the message header is not recognized, then the
  1518.    Error Subcode is set to Bad Message Type.  The Data field contains
  1519.    the erroneous Type field.
  1520.  
  1521.  
  1522. 6.2 OPEN message error handling.
  1523.  
  1524.  
  1525.    All errors detected while processing the OPEN message are indicated
  1526.    by sending the NOTIFICATION message with Error Code OPEN Message
  1527.    Error.  The Error Subcode elaborates on the specific nature of the
  1528.    error.
  1529.  
  1530.    If the version number contained in the Version field of the received
  1531.    OPEN message is not supported, then the Error Subcode is set to
  1532.    Unsupported Version Number.  The Data field is a 2-octet unsigned
  1533.    integer, which indicates the largest locally supported version number
  1534.    less than the version the remote BGP peer bid (as indicated in the
  1535.    received OPEN message).
  1536.  
  1537.    If the Autonomous System field of the OPEN message is unacceptable,
  1538.    then the Error Subcode is set to Bad Peer AS.  The determination of
  1539.    acceptable Autonomous System numbers is outside the scope of this
  1540.    protocol.
  1541.  
  1542.    If the Hold Time field of the OPEN message is unacceptable, then the
  1543.    Error Subcode MUST be set to Unacceptable Hold Time.  An
  1544.    implementation MUST reject Hold Time values of one or two seconds.
  1545.    An implementation MAY reject any proposed Hold Time.  An
  1546.    implementation which accepts a Hold Time MUST use the negotiated
  1547.    value for the Hold Time.
  1548.  
  1549.    If the BGP Identifier field of the OPEN message is syntactically
  1550.    incorrect, then the Error Subcode is set to Bad BGP Identifier.
  1551.    Syntactic correctness means that the BGP Identifier field represents
  1552.    a valid IP host address.
  1553.  
  1554.    If one of the Optional Parameters in the OPEN message is not
  1555.  
  1556.  
  1557.  
  1558. Expiration Date July 1997                                       [Page 26]
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564. RFC DRAFT                                                  December 1997
  1565.  
  1566.  
  1567.    recognized, then the Error Subcode is set to Unsupported Optional
  1568.    Parameters.
  1569.  
  1570.  
  1571.    If the OPEN message carries Authentication Information (as an
  1572.    Optional Parameter), then the corresponding authentication procedure
  1573.    is invoked.  If the authentication procedure (based on Authentication
  1574.    Code and Authentication Data) fails, then the Error Subcode is set to
  1575.    Authentication Failure.
  1576.  
  1577.  
  1578.  
  1579. 6.3 UPDATE message error handling.
  1580.  
  1581.  
  1582.    All errors detected while processing the UPDATE message are indicated
  1583.    by sending the NOTIFICATION message with Error Code UPDATE Message
  1584.    Error.  The error subcode elaborates on the specific nature of the
  1585.    error.
  1586.  
  1587.    Error checking of an UPDATE message begins by examining the path
  1588.    attributes.  If the Unfeasible Routes Length or Total Attribute
  1589.    Length is too large (i.e., if Unfeasible Routes Length + Total
  1590.    Attribute Length + 23 exceeds the message Length), then the Error
  1591.    Subcode is set to Malformed Attribute List.
  1592.  
  1593.    If any recognized attribute has Attribute Flags that conflict with
  1594.    the Attribute Type Code, then the Error Subcode is set to Attribute
  1595.    Flags Error.  The Data field contains the erroneous attribute (type,
  1596.    length and value).
  1597.  
  1598.    If any recognized attribute has Attribute Length that conflicts with
  1599.    the expected length (based on the attribute type code), then the
  1600.    Error Subcode is set to Attribute Length Error.  The Data field
  1601.    contains the erroneous attribute (type, length and value).
  1602.  
  1603.    If any of the mandatory well-known attributes are not present, then
  1604.    the Error Subcode is set to Missing Well-known Attribute.  The Data
  1605.    field contains the Attribute Type Code of the missing well-known
  1606.    attribute.
  1607.  
  1608.    If any of the mandatory well-known attributes are not recognized,
  1609.    then the Error Subcode is set to Unrecognized Well-known Attribute.
  1610.    The Data field contains the unrecognized attribute (type, length and
  1611.    value).
  1612.  
  1613.    If the ORIGIN attribute has an undefined value, then the Error
  1614.    Subcode is set to Invalid Origin Attribute.  The Data field contains
  1615.  
  1616.  
  1617.  
  1618. Expiration Date July 1997                                       [Page 27]
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624. RFC DRAFT                                                  December 1997
  1625.  
  1626.  
  1627.    the unrecognized attribute (type, length and value).
  1628.  
  1629.    If the NEXT_HOP attribute field is syntactically incorrect, then the
  1630.    Error Subcode is set to Invalid NEXT_HOP Attribute.  The Data field
  1631.    contains the incorrect attribute (type, length and value).  Syntactic
  1632.    correctness means that the NEXT_HOP attribute represents a valid IP
  1633.    host address.  Semantic correctness applies only to the external BGP
  1634.    links. It means that the interface associated with the IP address, as
  1635.    specified in the NEXT_HOP attribute, shares a common subnet with the
  1636.    receiving BGP speaker and is not the IP address of the receiving BGP
  1637.    speaker.  If the NEXT_HOP attribute is semantically incorrect, the
  1638.    error should be logged, and the the route should be ignored.  In this
  1639.    case, no NOTIFICATION message should be sent.
  1640.  
  1641.    The AS_PATH attribute is checked for syntactic correctness.  If the
  1642.    path is syntactically incorrect, then the Error Subcode is set to
  1643.    Malformed AS_PATH.
  1644.  
  1645.  
  1646.    The information carried by the AS_PATH attribute is checked for AS
  1647.    loops. AS loop detection is done by scanning the full AS path (as
  1648.    specified in the AS_PATH attribute), and checking that the autonomous
  1649.    system number of the local system does not appear in the AS path. If
  1650.    the autonomous system number appears in the AS path the route may be
  1651.    stored in the Adj-RIB-In, but unless the router is configured to
  1652.    accept routes with its own autonomous system in the AS path, the
  1653.    route shall not be passed to the BGP Decision Process. Operations of
  1654.    a router that is configured to accept routes with its own autonomous
  1655.    system number in the AS path are outside the scope of this document.
  1656.  
  1657.    If an optional attribute is recognized, then the value of this
  1658.    attribute is checked.  If an error is detected, the attribute is
  1659.    discarded, and the Error Subcode is set to Optional Attribute Error.
  1660.    The Data field contains the attribute (type, length and value).
  1661.  
  1662.    If any attribute appears more than once in the UPDATE message, then
  1663.    the Error Subcode is set to Malformed Attribute List.
  1664.  
  1665.    The NLRI field in the UPDATE message is checked for syntactic
  1666.    validity.  If the field is syntactically incorrect, then the Error
  1667.    Subcode is set to Invalid Network Field.
  1668.  
  1669.    An UPDATE message that contains correct path attributes, but no NLRI
  1670.    shall be treated as a valid UPDATE message.
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678. Expiration Date July 1997                                       [Page 28]
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684. RFC DRAFT                                                  December 1997
  1685.  
  1686.  
  1687. 6.4 NOTIFICATION message error handling.
  1688.  
  1689.  
  1690.    If a peer sends a NOTIFICATION message, and there is an error in that
  1691.    message, there is unfortunately no means of reporting this error via
  1692.    a subsequent NOTIFICATION message.  Any such error, such as an
  1693.    unrecognized Error Code or Error Subcode, should be noticed, logged
  1694.    locally, and brought to the attention of the administration of the
  1695.    peer.  The means to do this, however, lies outside the scope of this
  1696.    document.
  1697.  
  1698.  
  1699. 6.5 Hold Timer Expired error handling.
  1700.  
  1701.  
  1702.    If a system does not receive successive KEEPALIVE and/or UPDATE
  1703.    and/or NOTIFICATION messages within the period specified in the Hold
  1704.    Time field of the OPEN message, then the NOTIFICATION message with
  1705.    Hold Timer Expired Error Code must be sent and the BGP connection
  1706.    closed.
  1707.  
  1708.  
  1709. 6.6 Finite State Machine error handling.
  1710.  
  1711.  
  1712.    Any error detected by the BGP Finite State Machine (e.g., receipt of
  1713.    an unexpected event) is indicated by sending the NOTIFICATION message
  1714.    with Error Code Finite State Machine Error.
  1715.  
  1716.  
  1717. 6.7 Cease.
  1718.  
  1719.  
  1720.    In absence of any fatal errors (that are indicated in this section),
  1721.    a BGP peer may choose at any given time to close its BGP connection
  1722.    by sending the NOTIFICATION message with Error Code Cease.  However,
  1723.    the Cease NOTIFICATION message must not be used when a fatal error
  1724.    indicated by this section does exist.
  1725.  
  1726.  
  1727. 6.8 Connection collision detection.
  1728.  
  1729.  
  1730.    If a pair of BGP speakers try simultaneously to establish a TCP
  1731.    connection to each other, then two parallel connections between this
  1732.    pair of speakers might well be formed.  We refer to this situation as
  1733.    connection collision.  Clearly, one of these connections must be
  1734.    closed.
  1735.  
  1736.  
  1737.  
  1738. Expiration Date July 1997                                       [Page 29]
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744. RFC DRAFT                                                  December 1997
  1745.  
  1746.  
  1747.    Based on the value of the BGP Identifier a convention is established
  1748.    for detecting which BGP connection is to be preserved when a
  1749.    collision does occur. The convention is to compare the BGP
  1750.    Identifiers of the peers involved in the collision and to retain only
  1751.    the connection initiated by the BGP speaker with the higher-valued
  1752.    BGP Identifier.
  1753.  
  1754.    Upon receipt of an OPEN message, the local system must examine all of
  1755.    its connections that are in the OpenConfirm state.  A BGP speaker may
  1756.    also examine connections in an OpenSent state if it knows the BGP
  1757.    Identifier of the peer by means outside of the protocol.  If among
  1758.    these connections there is a connection to a remote BGP speaker whose
  1759.    BGP Identifier equals the one in the OPEN message, then the local
  1760.    system performs the following collision resolution procedure:
  1761.  
  1762.  
  1763.       1. The BGP Identifier of the local system is compared to the BGP
  1764.       Identifier of the remote system (as specified in the OPEN
  1765.       message).
  1766.  
  1767.       2. If the value of the local BGP Identifier is less than the
  1768.       remote one, the local system closes BGP connection that already
  1769.       exists (the one that is already in the OpenConfirm state), and
  1770.       accepts BGP connection initiated by the remote system.
  1771.  
  1772.       3. Otherwise, the local system closes newly created BGP connection
  1773.       (the one associated with the newly received OPEN message), and
  1774.       continues to use the existing one (the one that is already in the
  1775.       OpenConfirm state).
  1776.  
  1777.       Comparing BGP Identifiers is done by treating them as (4-octet
  1778.       long) unsigned integers.
  1779.  
  1780.       A connection collision with an existing BGP connection that is in
  1781.       Established states causes unconditional closing of the newly
  1782.       created connection. Note that a connection collision cannot be
  1783.       detected with connections that are in Idle, or Connect, or Active
  1784.       states.
  1785.  
  1786.       Closing the BGP connection (that results from the collision
  1787.       resolution procedure) is accomplished by sending the NOTIFICATION
  1788.       message with the Error Code Cease.
  1789.  
  1790.  
  1791. 7.  BGP Version Negotiation.
  1792.  
  1793.  
  1794.    BGP speakers may negotiate the version of the protocol by making
  1795.  
  1796.  
  1797.  
  1798. Expiration Date July 1997                                       [Page 30]
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804. RFC DRAFT                                                  December 1997
  1805.  
  1806.  
  1807.    multiple attempts to open a BGP connection, starting with the highest
  1808.    version number each supports.  If an open attempt fails with an Error
  1809.    Code OPEN Message Error, and an Error Subcode Unsupported Version
  1810.    Number, then the BGP speaker has available the version number it
  1811.    tried, the version number its peer tried, the version number passed
  1812.    by its peer in the NOTIFICATION message, and the version numbers that
  1813.    it supports.  If the two peers do support one or more common
  1814.    versions, then this will allow them to rapidly determine the highest
  1815.    common version. In order to support BGP version negotiation, future
  1816.    versions of BGP must retain the format of the OPEN and NOTIFICATION
  1817.    messages.
  1818.  
  1819.  
  1820. 8.  BGP Finite State machine.
  1821.  
  1822.  
  1823.    This section specifies BGP operation in terms of a Finite State
  1824.    Machine (FSM).  Following is a brief summary and overview of BGP
  1825.    operations by state as determined by this FSM.  A condensed version
  1826.    of the BGP FSM is found in Appendix 1.
  1827.  
  1828.       Initially BGP is in the Idle state.
  1829.  
  1830.       Idle state:
  1831.  
  1832.          In this state BGP refuses all incoming BGP connections.  No
  1833.          resources are allocated to the peer.  In response to the Start
  1834.          event (initiated by either system or operator) the local system
  1835.          initializes all BGP resources, starts the ConnectRetry timer,
  1836.          initiates a transport connection to other BGP peer, while
  1837.          listening for connection that may be initiated by the remote
  1838.          BGP peer, and changes its state to Connect.  The exact value of
  1839.          the ConnectRetry timer is a local matter, but should be
  1840.          sufficiently large to allow TCP initialization.
  1841.  
  1842.          If a BGP speaker detects an error, it shuts down the connection
  1843.          and changes its state to Idle. Getting out of the Idle state
  1844.          requires generation of the Start event.  If such an event is
  1845.          generated automatically, then persistent BGP errors may result
  1846.          in persistent flapping of the speaker.  To avoid such a
  1847.          condition it is recommended that Start events should not be
  1848.          generated immediately for a peer that was previously
  1849.          transitioned to Idle due to an error. For a peer that was
  1850.          previously transitioned to Idle due to an error, the time
  1851.          between consecutive generation of Start events, if such events
  1852.          are generated automatically, shall exponentially increase. The
  1853.          value of the initial timer shall be 60 seconds. The time shall
  1854.          be doubled for each consecutive retry.
  1855.  
  1856.  
  1857.  
  1858. Expiration Date July 1997                                       [Page 31]
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864. RFC DRAFT                                                  December 1997
  1865.  
  1866.  
  1867.          Any other event received in the Idle state is ignored.
  1868.  
  1869.       Connect state:
  1870.  
  1871.          In this state BGP is waiting for the transport protocol
  1872.          connection to be completed.
  1873.  
  1874.          If the transport protocol connection succeeds, the local system
  1875.          clears the ConnectRetry timer, completes initialization, sends
  1876.          an OPEN message to its peer, and changes its state to OpenSent.
  1877.  
  1878.          If the transport protocol connect fails (e.g., retransmission
  1879.          timeout), the local system restarts the ConnectRetry timer,
  1880.          continues to listen for a connection that may be initiated by
  1881.          the remote BGP peer, and changes its state to Active state.
  1882.  
  1883.          In response to the ConnectRetry timer expired event, the local
  1884.          system restarts the ConnectRetry timer, initiates a transport
  1885.          connection to other BGP peer, continues to listen for a
  1886.          connection that may be initiated by the remote BGP peer, and
  1887.          stays in the Connect state.
  1888.  
  1889.          Start event is ignored in the Active state.
  1890.  
  1891.          In response to any other event (initiated by either system or
  1892.          operator), the local system releases all BGP resources
  1893.          associated with this connection and changes its state to Idle.
  1894.  
  1895.       Active state:
  1896.  
  1897.          In this state BGP is trying to acquire a peer by initiating a
  1898.          transport protocol connection.
  1899.  
  1900.          If the transport protocol connection succeeds, the local system
  1901.          clears the ConnectRetry timer, completes initialization, sends
  1902.          an OPEN message to its peer, sets its Hold Timer to a large
  1903.          value, and changes its state to OpenSent.  A Hold Timer value
  1904.          of 4 minutes is suggested.
  1905.  
  1906.          In response to the ConnectRetry timer expired event, the local
  1907.          system restarts the ConnectRetry timer, initiates a transport
  1908.          connection to other BGP peer, continues to listen for a
  1909.          connection that may be initiated by the remote BGP peer, and
  1910.          changes its state to Connect.
  1911.  
  1912.          If the local system detects that a remote peer is trying to
  1913.          establish BGP connection to it, and the IP address of the
  1914.          remote peer is not an expected one, the local system restarts
  1915.  
  1916.  
  1917.  
  1918. Expiration Date July 1997                                       [Page 32]
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924. RFC DRAFT                                                  December 1997
  1925.  
  1926.  
  1927.          the ConnectRetry timer, rejects the attempted connection,
  1928.          continues to listen for a connection that may be initiated by
  1929.          the remote BGP peer, and stays in the Active state.
  1930.  
  1931.          Start event is ignored in the Active state.
  1932.  
  1933.          In response to any other event (initiated by either system or
  1934.          operator), the local system releases all BGP resources
  1935.          associated with this connection and changes its state to Idle.
  1936.  
  1937.       OpenSent state:
  1938.  
  1939.          In this state BGP waits for an OPEN message from its peer.
  1940.          When an OPEN message is received, all fields are checked for
  1941.          correctness.  If the BGP message header checking or OPEN
  1942.          message checking detects an error (see Section 6.2), or a
  1943.          connection collision (see Section 6.8) the local system sends a
  1944.          NOTIFICATION message and changes its state to Idle.
  1945.  
  1946.          If there are no errors in the OPEN message, BGP sends a
  1947.          KEEPALIVE message and sets a KeepAlive timer.  The Hold Timer,
  1948.          which was originally set to a large value (see above), is
  1949.          replaced with the negotiated Hold Time value (see section 4.2).
  1950.          If the negotiated Hold Time value is zero, then the Hold Time
  1951.          timer and KeepAlive timers are not started.  If the value of
  1952.          the Autonomous System field is the same as the local Autonomous
  1953.          System number, then the connection is an "internal" connection;
  1954.          otherwise, it is "external".  (This will effect UPDATE
  1955.          processing as described below.) Finally, the state is changed
  1956.          to OpenConfirm.
  1957.  
  1958.          If a disconnect notification is received from the underlying
  1959.          transport protocol, the local system closes the BGP connection,
  1960.          restarts the ConnectRetry timer, while continue listening for
  1961.          connection that may be initiated by the remote BGP peer, and
  1962.          goes into the Active state.
  1963.  
  1964.          If the Hold Timer expires, the local system sends NOTIFICATION
  1965.          message with error code Hold Timer Expired and changes its
  1966.          state to Idle.
  1967.  
  1968.          In response to the Stop event (initiated by either system or
  1969.          operator) the local system sends NOTIFICATION message with
  1970.          Error Code Cease and changes its state to Idle.
  1971.  
  1972.          Start event is ignored in the OpenSent state.
  1973.  
  1974.          In response to any other event the local system sends
  1975.  
  1976.  
  1977.  
  1978. Expiration Date July 1997                                       [Page 33]
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. RFC DRAFT                                                  December 1997
  1985.  
  1986.  
  1987.          NOTIFICATION message with Error Code Finite State Machine Error
  1988.          and changes its state to Idle.
  1989.  
  1990.          Whenever BGP changes its state from OpenSent to Idle, it closes
  1991.          the BGP (and transport-level) connection and releases all
  1992.          resources associated with that connection.
  1993.  
  1994.       OpenConfirm state:
  1995.  
  1996.          In this state BGP waits for a KEEPALIVE or NOTIFICATION
  1997.          message.
  1998.  
  1999.          If the local system receives a KEEPALIVE message, it changes
  2000.          its state to Established.
  2001.  
  2002.          If the Hold Timer expires before a KEEPALIVE message is
  2003.          received, the local system sends NOTIFICATION message with
  2004.          error code Hold Timer Expired and changes its state to Idle.
  2005.  
  2006.          If the local system receives a NOTIFICATION message, it changes
  2007.          its state to Idle.
  2008.  
  2009.          If the KeepAlive timer expires, the local system sends a
  2010.          KEEPALIVE message and restarts its KeepAlive timer.
  2011.  
  2012.          If a disconnect notification is received from the underlying
  2013.          transport protocol, the local system changes its state to Idle.
  2014.  
  2015.          In response to the Stop event (initiated by either system or
  2016.          operator) the local system sends NOTIFICATION message with
  2017.          Error Code Cease and changes its state to Idle.
  2018.  
  2019.          Start event is ignored in the OpenConfirm state.
  2020.  
  2021.          In response to any other event the local system sends
  2022.          NOTIFICATION message with Error Code Finite State Machine Error
  2023.          and changes its state to Idle.
  2024.  
  2025.          Whenever BGP changes its state from OpenConfirm to Idle, it
  2026.          closes the BGP (and transport-level) connection and releases
  2027.          all resources associated with that connection.
  2028.  
  2029.       Established state:
  2030.  
  2031.          In the Established state BGP can exchange UPDATE, NOTIFICATION,
  2032.          and KEEPALIVE messages with its peer.
  2033.  
  2034.          If the local system receives an UPDATE or KEEPALIVE message, it
  2035.  
  2036.  
  2037.  
  2038. Expiration Date July 1997                                       [Page 34]
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044. RFC DRAFT                                                  December 1997
  2045.  
  2046.  
  2047.          restarts its Hold Timer, if the negotiated Hold Time value is
  2048.          non-zero.
  2049.  
  2050.          If the local system receives a NOTIFICATION message, it changes
  2051.          its state to Idle.
  2052.  
  2053.          If the local system receives an UPDATE message and the UPDATE
  2054.          message error handling procedure (see Section 6.3) detects an
  2055.          error, the local system sends a NOTIFICATION message and
  2056.          changes its state to Idle.
  2057.  
  2058.          If a disconnect notification is received from the underlying
  2059.          transport protocol, the local system changes its state to Idle.
  2060.  
  2061.          If the Hold Timer expires, the local system sends a
  2062.          NOTIFICATION message with Error Code Hold Timer Expired and
  2063.          changes its state to Idle.
  2064.  
  2065.          If the KeepAlive timer expires, the local system sends a
  2066.          KEEPALIVE message and restarts its KeepAlive timer.
  2067.  
  2068.          Each time the local system sends a KEEPALIVE or UPDATE message,
  2069.          it restarts its KeepAlive timer, unless the negotiated Hold
  2070.          Time value is zero.
  2071.  
  2072.          In response to the Stop event (initiated by either system or
  2073.          operator), the local system sends a NOTIFICATION message with
  2074.          Error Code Cease and changes its state to Idle.
  2075.  
  2076.          Start event is ignored in the Established state.
  2077.  
  2078.          In response to any other event, the local system sends
  2079.          NOTIFICATION message with Error Code Finite State Machine Error
  2080.          and changes its state to Idle.
  2081.  
  2082.          Whenever BGP changes its state from Established to Idle, it
  2083.          closes the BGP (and transport-level) connection, releases all
  2084.          resources associated with that connection, and deletes all
  2085.          routes derived from that connection.
  2086.  
  2087.  
  2088. 9.  UPDATE Message Handling
  2089.  
  2090.  
  2091.    An UPDATE message may be received only in the Established state.
  2092.    When an UPDATE message is received, each field is checked for
  2093.    validity as specified in Section 6.3.
  2094.  
  2095.  
  2096.  
  2097.  
  2098. Expiration Date July 1997                                       [Page 35]
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104. RFC DRAFT                                                  December 1997
  2105.  
  2106.  
  2107.    If an optional non-transitive attribute is unrecognized, it is
  2108.    quietly ignored.  If an optional transitive attribute is
  2109.    unrecognized, the Partial bit (the third high-order bit) in the
  2110.    attribute flags octet is set to 1, and the attribute is retained for
  2111.    propagation to other BGP speakers.
  2112.  
  2113.    If an optional attribute is recognized, and has a valid value, then,
  2114.    depending on the type of the optional attribute, it is processed
  2115.    locally, retained, and updated, if necessary, for possible
  2116.    propagation to other BGP speakers.
  2117.  
  2118.  
  2119.    If the UPDATE message contains a non-empty WITHDRAWN ROUTES field,
  2120.    the previously advertised routes whose  destinations (expressed as IP
  2121.    prefixes) contained in this field shall be removed from the Adj-RIB-
  2122.    In.  This BGP speaker shall run its Decision Process since the
  2123.    previously advertised route is not longer available for use.
  2124.  
  2125.    If the UPDATE message contains a feasible route, it shall be placed
  2126.    in the appropriate Adj-RIB-In, and the following additional actions
  2127.    shall be taken:
  2128.  
  2129.    i) If its Network Layer Reachability Information (NLRI) is identical
  2130.    to the one of a route currently stored in the Adj-RIB-In, then the
  2131.    new route shall replace the older route in the Adj-RIB-In, thus
  2132.    implicitly withdrawing the older route from service. The BGP speaker
  2133.    shall run its Decision Process since the older route is no longer
  2134.    available for use.
  2135.  
  2136.    ii) If the new route is an overlapping route that is included (see
  2137.    9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP
  2138.    speaker shall run its Decision Process since the more specific route
  2139.    has implicitly made a portion of the less specific route unavailable
  2140.    for use.
  2141.  
  2142.    iii) If the new route has identical path attributes to an earlier
  2143.    route contained in the Adj-RIB-In, and is more specific (see 9.1.4)
  2144.    than the earlier route, no further actions are necessary.
  2145.  
  2146.    iv) If the new route has NLRI that is not present in any of the
  2147.    routes currently stored in the Adj-RIB-In, then the new route shall
  2148.    be placed in the Adj-RIB-In. The BGP speaker shall run its Decision
  2149.    Process.
  2150.  
  2151.    v) If the new route is an overlapping route that is less specific
  2152.    (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the
  2153.    BGP speaker shall run its Decision Process on the set of destinations
  2154.    described only by the less specific route.
  2155.  
  2156.  
  2157.  
  2158. Expiration Date July 1997                                       [Page 36]
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164. RFC DRAFT                                                  December 1997
  2165.  
  2166.  
  2167. 9.1 Decision Process
  2168.  
  2169.  
  2170.    The Decision Process selects routes for subsequent advertisement by
  2171.    applying the policies in the local Policy Information Base (PIB) to
  2172.    the routes stored in its Adj-RIB-In. The output of the Decision
  2173.    Process is the set of routes that will be advertised to all peers;
  2174.    the selected routes will be stored in the local speaker's Adj-RIB-
  2175.    Out.
  2176.  
  2177.    The selection process is formalized by defining a function that takes
  2178.    the attribute of a given route as an argument and returns a non-
  2179.    negative integer denoting the degree of preference for the route.
  2180.    The function that calculates the degree of preference for a given
  2181.    route shall not use as its inputs any of the following: the existence
  2182.    of other routes, the non-existence of other routes, or the path
  2183.    attributes of other routes. Route selection then consists of
  2184.    individual application of the degree of preference function to each
  2185.    feasible route, followed by the choice of the one with the highest
  2186.    degree of preference.
  2187.  
  2188.    The Decision Process operates on routes contained in each Adj-RIB-In,
  2189.    and is responsible for:
  2190.  
  2191.       - selection of routes to be advertised to internal peers
  2192.  
  2193.       - selection of routes to be advertised to external peers
  2194.  
  2195.       - route aggregation and route information reduction
  2196.  
  2197.    The Decision Process takes place in three distinct phases, each
  2198.    triggered by a different event:
  2199.  
  2200.       a) Phase 1 is responsible for calculating the degree of preference
  2201.       for each route received from an external peer, and for advertising
  2202.       to the other internal peers the routes that have the highest
  2203.       degree of preference for each distinct destination.
  2204.  
  2205.       b) Phase 2 is invoked on completion of phase 1. It is responsible
  2206.       for choosing the best route out of all those available for each
  2207.       distinct destination, and for installing each chosen route into
  2208.       the appropriate Loc-RIB.
  2209.  
  2210.       c) Phase 3 is invoked after the Loc-RIB has been modified. It is
  2211.       responsible for disseminating routes in the Loc-RIB to each
  2212.       external peer, according to the policies contained in the PIB.
  2213.       Route aggregation and information reduction can optionally be
  2214.       performed within this phase.
  2215.  
  2216.  
  2217.  
  2218. Expiration Date July 1997                                       [Page 37]
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224. RFC DRAFT                                                  December 1997
  2225.  
  2226.  
  2227. 9.1.1 Phase 1: Calculation of Degree of Preference
  2228.  
  2229.  
  2230.    The Phase 1 decision function shall be invoked whenever the local BGP
  2231.    speaker receives from a peer an UPDATE message that advertises a new
  2232.    route, a replacement route, or a withdrawn route.
  2233.  
  2234.    The Phase 1 decision function is a separate process which completes
  2235.    when it has no further work to do.
  2236.  
  2237.    The Phase 1 decision function shall lock an Adj-RIB-In prior to
  2238.    operating on any route contained within it, and shall unlock it after
  2239.    operating on all new or unfeasible routes contained within it.
  2240.  
  2241.    For each newly received or replacement feasible route, the local BGP
  2242.    speaker shall determine a degree of preference.  If the route is
  2243.    learned from an internal peer, the value of the LOCAL_PREF attribute
  2244.    shall be taken as the degree of preference.  If the route is learned
  2245.    from an external peer, then the degree of preference shall be
  2246.    computed based on preconfigured policy information and used as the
  2247.    LOCAL_PREF value in any IBGP readvertisement.  The exact nature of
  2248.    this policy information and the computation involved is a local
  2249.    matter.  The local speaker shall then run the internal update process
  2250.    of 9.2.1 to select and advertise the most preferable route.
  2251.  
  2252.  
  2253. 9.1.2 Phase 2: Route Selection
  2254.  
  2255.  
  2256.    The Phase 2 decision function shall be invoked on completion of Phase
  2257.    1.  The Phase 2 function is a separate process which completes when
  2258.    it has no further work to do. The Phase 2 process shall consider all
  2259.    routes that are present in the Adj-RIBs-In, including those received
  2260.    from both internal and external peers.
  2261.  
  2262.    The Phase 2 decision function shall be blocked from running while the
  2263.    Phase 3 decision function is in process. The Phase 2 function shall
  2264.    lock all Adj-RIBs-In prior to commencing its function, and shall
  2265.    unlock them on completion.
  2266.  
  2267.    If the NEXT_HOP attribute of a BGP route depicts an address to which
  2268.    the local BGP speaker doesn't have a route in its Loc-RIB, the BGP
  2269.    route should be excluded from the Phase 2 decision function.
  2270.  
  2271.    It is critical that routers within an AS do not make conflicting
  2272.    decisions regarding route selection that would cause forwarding loops
  2273.    to occur.
  2274.  
  2275.  
  2276.  
  2277.  
  2278. Expiration Date July 1997                                       [Page 38]
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284. RFC DRAFT                                                  December 1997
  2285.  
  2286.  
  2287.    For each set of destinations for which a feasible route exists in the
  2288.    Adj-RIBs-In, the local BGP speaker shall identify the route that has:
  2289.  
  2290.       a) the highest degree of preference of any route to the same set
  2291.       of destinations, or
  2292.  
  2293.       b) is the only route to that destination, or
  2294.  
  2295.       c) is selected as a result of the Phase 2 tie breaking rules
  2296.       specified in 9.1.2.1.
  2297.  
  2298.  
  2299.    The local speaker SHALL then install that route in the Loc-RIB,
  2300.    replacing any route to the same destination that is currently being
  2301.    held in the Loc-RIB. The local speaker MUST determine the immediate
  2302.    next hop to the address depicted by the NEXT_HOP attribute of the
  2303.    selected route by performing a lookup in the IGP and selecting one of
  2304.    the possible paths in the IGP.  This immediate next hop MUST be used
  2305.    when installing the selected route in the Loc-RIB.  If the route to
  2306.    the address depicted by the NEXT_HOP attribute changes such that the
  2307.    immediate next hop changes, route selection should be recalculated as
  2308.    specified above.
  2309.  
  2310.    Unfeasible routes shall be removed from the Loc-RIB, and
  2311.    corresponding unfeasible routes shall then be removed from the Adj-
  2312.    RIBs-In.
  2313.  
  2314.  
  2315. 9.1.2.1 Breaking Ties (Phase 2)
  2316.  
  2317.  
  2318.    In its Adj-RIBs-In a BGP speaker may have several routes to the same
  2319.    destination that have the same degree of preference. The local
  2320.    speaker can select only one of these routes for inclusion in the
  2321.    associated Loc-RIB. The local speaker considers all routes with the
  2322.    same degrees of preference, both those received from internal peers,
  2323.    and those received from external peers.
  2324.  
  2325.    The following tie-breaking procedure assumes that for each candidate
  2326.    route all the BGP speakers within an autonomous system can ascertain
  2327.    the cost of a path (interior distance) to the address depicted by the
  2328.    NEXT_HOP attribute of the route.
  2329.  
  2330.    The tie-breaking algorithm begins by considering all equally
  2331.    preferable routes and then selects routes to be removed from
  2332.    consideration.  The algorithm terminates as soon as only one route
  2333.    remains in consideration.  The criteria must be applied in the order
  2334.    specified.
  2335.  
  2336.  
  2337.  
  2338. Expiration Date July 1997                                       [Page 39]
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344. RFC DRAFT                                                  December 1997
  2345.  
  2346.  
  2347.    Several of the criteria are described using pseudo-code.  Note that
  2348.    the pseudo-code shown was chosen for clarity, not efficiency.  It is
  2349.    not intended to specify any particular implementation.  BGP
  2350.    implementations MAY use any algorithm which produces the same results
  2351.    as those described here.
  2352.  
  2353.       a) Remove from consideration routes with less-preferred
  2354.       MULTI_EXIT_DISC attributes.  MULTI_EXIT_DISC is only comparable
  2355.       between routes learned from the same neighboring AS.  Routes which
  2356.       do not have the MULTI_EXIT_DISC attribute are considered to have
  2357.       the highest possible MULTI_EXIT_DISC value.
  2358.  
  2359.       This is also described in the following procedure:
  2360.  
  2361.             for m = all routes still under consideration
  2362.                 for n = all routes still under consideration
  2363.                     if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m))
  2364.                         remove route m from consideration
  2365.  
  2366.       In the pseudo-code above, MED(n) is a function which returns the
  2367.       value of route n's MULTI_EXIT_DISC attribute.  If route n has no
  2368.       MULTI_EXIT_DISC attribute, the function returns the highest
  2369.       possible MULTI_EXIT_DISC value, i.e. 2^32-1.
  2370.  
  2371.       Similarly, neighborAS(n) is a function which returns the neighbor
  2372.       AS from which the route was received.
  2373.  
  2374.       b) Remove from consideration any routes with less-preferred
  2375.       interior cost.  The interior cost of a route is determined by
  2376.       calculating the metric to the next hop for the route using the
  2377.       interior routing protocol(s).  If the next hop for a route is
  2378.       reachable, but no cost can be determined, then this step should be
  2379.       should be skipped (equivalently, consider all routes to have equal
  2380.       costs).
  2381.  
  2382.       This is also described in the following procedure.
  2383.  
  2384.             for m = all routes still under consideration
  2385.                 for n = all routes in still under consideration
  2386.                     if (cost(n) is better than cost(m))
  2387.                         remove m from consideration
  2388.  
  2389.       In the pseudo-code above, cost(n) is a function which returns the
  2390.       cost of the path (interior distance) to the address given in the
  2391.       NEXT_HOP attribute of the route.
  2392.  
  2393.       c) If at least one of the candidate routes was received from an
  2394.       external peer in a neighboring autonomous system, remove from
  2395.  
  2396.  
  2397.  
  2398. Expiration Date July 1997                                       [Page 40]
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404. RFC DRAFT                                                  December 1997
  2405.  
  2406.  
  2407.       consideration all routes which were received from internal peers.
  2408.  
  2409.       d) Remove from consideration all routes other than the route that
  2410.       was advertised by the BGP speaker whose BGP Identifier has the
  2411.       lowest value.
  2412.  
  2413.  
  2414. 9.1.3   Phase 3: Route Dissemination
  2415.  
  2416.  
  2417.    The Phase 3 decision function shall be invoked on completion of Phase
  2418.    2, or when any of the following events occur:
  2419.  
  2420.       a) when routes in a Loc-RIB to local destinations have changed
  2421.  
  2422.       b) when locally generated routes learned by means outside of BGP
  2423.       have changed
  2424.  
  2425.       c) when a new BGP speaker - BGP speaker connection has been
  2426.       established
  2427.  
  2428.    The Phase 3 function is a separate process which completes when it
  2429.    has no further work to do. The Phase 3 Routing Decision function
  2430.    shall be blocked from running while the Phase 2 decision function is
  2431.    in process.
  2432.  
  2433.    All routes in the Loc-RIB shall be processed into a corresponding
  2434.    entry in the associated Adj-RIBs-Out. Route aggregation and
  2435.    information reduction techniques (see 9.2.4.1) may optionally be
  2436.    applied.
  2437.  
  2438.    For the benefit of future support of inter-AS multicast capabilities,
  2439.    a BGP speaker that participates in inter-AS multicast routing shall
  2440.    advertise a route it receives from one of its external peers and if
  2441.    it installs it in its Loc-RIB, it shall advertise it back to the peer
  2442.    from which the route was received. For a BGP speaker that does not
  2443.    participate in inter-AS multicast routing such an advertisement is
  2444.    optional. When doing such an advertisement, the NEXT_HOP attribute
  2445.    should be set to the address of the peer. An implementation may also
  2446.    optimize such an advertisement by truncating information in the
  2447.    AS_PATH attribute to include only its own AS number and that of the
  2448.    peer that advertised the route (such truncation requires the ORIGIN
  2449.    attribute to be set to INCOMPLETE).  In addition an implementation is
  2450.    not required to pass optional or discretionary path attributes with
  2451.    such an advertisement.
  2452.  
  2453.    When the updating of the Adj-RIBs-Out and the Forwarding Information
  2454.    Base (FIB) is complete, the local BGP speaker shall run the external
  2455.  
  2456.  
  2457.  
  2458. Expiration Date July 1997                                       [Page 41]
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464. RFC DRAFT                                                  December 1997
  2465.  
  2466.  
  2467.    update process of 9.2.2.
  2468.  
  2469.  
  2470. 9.1.4 Overlapping Routes
  2471.  
  2472.  
  2473.    A BGP speaker may transmit routes with overlapping Network Layer
  2474.    Reachability Information (NLRI) to another BGP speaker. NLRI overlap
  2475.    occurs when a set of destinations are identified in non-matching
  2476.    multiple routes. Since BGP encodes NLRI using IP prefixes, overlap
  2477.    will always exhibit subset relationships.  A route describing a
  2478.    smaller set of destinations (a longer prefix) is said to be more
  2479.    specific than a route describing a larger set of destinations (a
  2480.    shorted prefix); similarly, a route describing a larger set of
  2481.    destinations (a shorter prefix) is said to be less specific than a
  2482.    route describing a smaller set of destinations (a longer prefix).
  2483.  
  2484.    The precedence relationship effectively decomposes less specific
  2485.    routes into two parts:
  2486.  
  2487.       -  a set of destinations described only by the less specific
  2488.       route, and
  2489.  
  2490.       -  a set of destinations described by the overlap of the less
  2491.       specific and the more specific routes
  2492.  
  2493.  
  2494.    When overlapping routes are present in the same Adj-RIB-In, the more
  2495.    specific route shall take precedence, in order from more specific to
  2496.    least specific.
  2497.  
  2498.    The set of destinations described by the overlap represents a portion
  2499.    of the less specific route that is feasible, but is not currently in
  2500.    use.  If a more specific route is later withdrawn, the set of
  2501.    destinations described by the overlap will still be reachable using
  2502.    the less specific route.
  2503.  
  2504.    If a BGP speaker receives overlapping routes, the Decision Process
  2505.    MUST consider both routes based on the configured acceptance policy.
  2506.    If both a less and a more specific route are accepted, then the
  2507.    Decision Process MUST either install both the less and the more
  2508.    specific routes or it MUST aggregate the two routes and install the
  2509.    aggregated route.
  2510.  
  2511.    If a BGP speaker chooses to aggregate, then it MUST add
  2512.    ATOMIC_AGGREGATE attribute to the route. A route that carries
  2513.    ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the
  2514.    NLRI of this route can not be made more specific.  Forwarding along
  2515.  
  2516.  
  2517.  
  2518. Expiration Date July 1997                                       [Page 42]
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524. RFC DRAFT                                                  December 1997
  2525.  
  2526.  
  2527.    such a route does not guarantee that IP packets will actually
  2528.    traverse only ASs listed in the AS_PATH attribute of the route.  If a
  2529.    BGP speaker chooses a), it must not advertise the more general route
  2530.    without the more specific route.
  2531.  
  2532.  
  2533. 9.2 Update-Send Process
  2534.  
  2535.  
  2536.    The Update-Send process is responsible for advertising UPDATE
  2537.    messages to all peers. For example, it distributes the routes chosen
  2538.    by the Decision Process to other BGP speakers which may be located in
  2539.    either the same autonomous system or a neighboring autonomous system.
  2540.    Rules for information exchange between BGP speakers located in
  2541.    different autonomous systems are given in 9.2.2; rules for
  2542.    information exchange between BGP speakers located in the same
  2543.    autonomous system are given in 9.2.1.
  2544.  
  2545.    Distribution of routing information between a set of BGP speakers,
  2546.    all of which are located in the same autonomous system, is referred
  2547.    to as internal distribution.
  2548.  
  2549.  
  2550. 9.2.1 Internal Updates
  2551.  
  2552.  
  2553.    The Internal update process is concerned with the distribution of
  2554.    routing information to internal peers.
  2555.  
  2556.    When a BGP speaker receives an UPDATE message from an internal peer,
  2557.    the receiving BGP speaker shall not re-distribute the routing
  2558.    information contained in that UPDATE message to other internal peers.
  2559.  
  2560.    When a BGP speaker receives a new route from an external peer, it
  2561.    MUST advertise that route to all other internal peers by means of an
  2562.    UPDATE message if this routes has been installed in its Loc-RIB
  2563.    according to the route selection rules in 9.1.2.
  2564.  
  2565.    When a BGP speaker receives an UPDATE message with a non-empty
  2566.    WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all
  2567.    routes whose destinations was carried in this field (as IP prefixes).
  2568.    The speaker shall take the following additional steps:
  2569.  
  2570.       1) if the corresponding feasible route had not been previously
  2571.       advertised, then no further action is necessary
  2572.  
  2573.       2) if the corresponding feasible route had been previously
  2574.       advertised, then:
  2575.  
  2576.  
  2577.  
  2578. Expiration Date July 1997                                       [Page 43]
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584. RFC DRAFT                                                  December 1997
  2585.  
  2586.  
  2587.          i) if a new route is selected for advertisement that has the
  2588.          same Network Layer Reachability Information as the unfeasible
  2589.          routes, then the local BGP speaker shall advertise the
  2590.          replacement route
  2591.  
  2592.          ii) if a replacement route is not available for advertisement,
  2593.          then the BGP speaker shall include the destinations  of the
  2594.          unfeasible route (in form of IP prefixes) in the WITHDRAWN
  2595.          ROUTES field of an UPDATE message, and shall send this message
  2596.          to each peer to whom it had previously advertised the
  2597.          corresponding feasible route.
  2598.  
  2599.  
  2600.    All feasible routes which are advertised shall be placed in the
  2601.    appropriate Adj-RIBs-Out, and all unfeasible routes which are
  2602.    advertised shall be removed from the Adj-RIBs-Out.
  2603.  
  2604.  
  2605. 9.2.1.1 Breaking Ties (Internal Updates)
  2606.  
  2607.  
  2608.    If a local BGP speaker has connections to several external peers,
  2609.    there will be multiple Adj-RIBs-In associated with these peers. These
  2610.    Adj-RIBs-In might contain several equally preferable routes to the
  2611.    same destination, all of which were advertised by external peers.
  2612.    The local BGP speaker shall select one of these routes according to
  2613.    the following rules:
  2614.  
  2615.       a) If the candidate routes differ only in their NEXT_HOP and
  2616.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2617.       take into account the MULTI_EXIT_DISC attribute, select the route
  2618.       that has the lowest value of the MULTI_EXIT_DISC attribute. A
  2619.       route with the MULTI_EXIT_DISC attribute shall be preferred to a
  2620.       route without the MULTI_EXIT_DISC attribute.
  2621.  
  2622.       b) If the local system can ascertain the cost of a path to the
  2623.       entity depicted by the NEXT_HOP attribute of the candidate route,
  2624.       select the route with the lowest cost.
  2625.  
  2626.       c) In all other cases, select the route that was advertised by the
  2627.       BGP speaker whose BGP Identifier has the lowest value.
  2628.  
  2629.  
  2630.  
  2631. 9.2.2 External Updates
  2632.  
  2633.  
  2634.    The external update process is concerned with the distribution of
  2635.  
  2636.  
  2637.  
  2638. Expiration Date July 1997                                       [Page 44]
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. RFC DRAFT                                                  December 1997
  2645.  
  2646.  
  2647.    routing information to external peers.  As part of Phase 3 route
  2648.    selection process, the BGP speaker has updated its Adj-RIBs-Out and
  2649.    its Forwarding Table. All newly installed routes and all newly
  2650.    unfeasible routes for which there is no replacement route shall be
  2651.    advertised to external peers by means of UPDATE message.
  2652.  
  2653.    Any routes in the Loc-RIB marked as unfeasible shall be removed.
  2654.    Changes to the reachable destinations within its own autonomous
  2655.    system shall also be advertised in an UPDATE message.
  2656.  
  2657.  
  2658. 9.2.3 Controlling Routing Traffic Overhead
  2659.  
  2660.  
  2661.    The BGP protocol constrains the amount of routing traffic (that is,
  2662.    UPDATE messages) in order to limit both the link bandwidth needed to
  2663.    advertise UPDATE messages and the processing power needed by the
  2664.    Decision Process to digest the information contained in the UPDATE
  2665.    messages.
  2666.  
  2667.  
  2668. 9.2.3.1 Frequency of Route Advertisement
  2669.  
  2670.  
  2671.    The parameter MinRouteAdvertisementInterval determines the minimum
  2672.    amount of time that must elapse between advertisement of routes to a
  2673.    particular destination from a single BGP speaker. This rate limiting
  2674.    procedure applies on a per-destination basis, although the value of
  2675.    MinRouteAdvertisementInterval is set on a per BGP peer basis.
  2676.  
  2677.    Two UPDATE messages sent from a single BGP speaker that advertise
  2678.    feasible routes to some common set of destinations received from
  2679.    external peers must be separated by at least
  2680.    MinRouteAdvertisementInterval. Clearly, this can only be achieved
  2681.    precisely by keeping a separate timer for each common set of
  2682.    destinations. This would be unwarranted overhead. Any technique which
  2683.    ensures that the interval between two UPDATE messages sent from a
  2684.    single BGP speaker that advertise feasible routes to some common set
  2685.    of destinations received from external peers will be at least
  2686.    MinRouteAdvertisementInterval, and will also ensure a constant upper
  2687.    bound on the interval is acceptable.
  2688.  
  2689.    Since fast convergence is needed within an autonomous system, this
  2690.    procedure does not apply for routes receives from other internal
  2691.    peers.  To avoid long-lived black holes, the procedure does not apply
  2692.    to the explicit withdrawal of unfeasible routes (that is, routes
  2693.    whose destinations (expressed as IP prefixes) are listed in the
  2694.    WITHDRAWN ROUTES field of an UPDATE message).
  2695.  
  2696.  
  2697.  
  2698. Expiration Date July 1997                                       [Page 45]
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704. RFC DRAFT                                                  December 1997
  2705.  
  2706.  
  2707.    This procedure does not limit the rate of route selection, but only
  2708.    the rate of route advertisement. If new routes are selected multiple
  2709.    times while awaiting the expiration of MinRouteAdvertisementInterval,
  2710.    the last route selected shall be advertised at the end of
  2711.    MinRouteAdvertisementInterval.
  2712.  
  2713.  
  2714. 9.2.3.2 Frequency of Route Origination
  2715.  
  2716.  
  2717.    The parameter MinASOriginationInterval determines the minimum amount
  2718.    of time that must elapse between successive advertisements of UPDATE
  2719.    messages that report changes within the advertising BGP speaker's own
  2720.    autonomous systems.
  2721.  
  2722.  
  2723. 9.2.3.3 Jitter
  2724.  
  2725.  
  2726.    To minimize the likelihood that the distribution of BGP messages by a
  2727.    given BGP speaker will contain peaks, jitter should be applied to the
  2728.    timers associated with MinASOriginationInterval, Keepalive, and
  2729.    MinRouteAdvertisementInterval. A given BGP speaker shall apply the
  2730.    same jitter to each of these quantities regardless of the
  2731.    destinations to which the updates are being sent; that is, jitter
  2732.    will not be applied on a "per peer" basis.
  2733.  
  2734.    The amount of jitter to be introduced shall be determined by
  2735.    multiplying the base value of the appropriate timer by a random
  2736.    factor which is uniformly distributed in the range from 0.75 to 1.0.
  2737.  
  2738.  
  2739. 9.2.4 Efficient Organization of Routing Information
  2740.  
  2741.  
  2742.    Having selected the routing information which it will advertise, a
  2743.    BGP speaker may avail itself of several methods to organize this
  2744.    information in an efficient manner.
  2745.  
  2746.  
  2747. 9.2.4.1 Information Reduction
  2748.  
  2749.  
  2750.    Information reduction may imply a reduction in granularity of policy
  2751.    control - after information is collapsed, the same policies will
  2752.    apply to all destinations and paths in the equivalence class.
  2753.  
  2754.    The Decision Process may optionally reduce the amount of information
  2755.  
  2756.  
  2757.  
  2758. Expiration Date July 1997                                       [Page 46]
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764. RFC DRAFT                                                  December 1997
  2765.  
  2766.  
  2767.    that it will place in the Adj-RIBs-Out by any of the following
  2768.    methods:
  2769.  
  2770.       a)   Network Layer Reachability Information (NLRI):
  2771.  
  2772.       Destination IP addresses can be represented as IP address
  2773.       prefixes.  In cases where there is a correspondence between the
  2774.       address structure and the systems under control of an autonomous
  2775.       system administrator, it will be possible to reduce the size of
  2776.       the NLRI carried in the UPDATE messages.
  2777.  
  2778.       b)   AS_PATHs:
  2779.  
  2780.       AS path information can be represented as ordered AS_SEQUENCEs or
  2781.       unordered AS_SETs. AS_SETs are used in the route aggregation
  2782.       algorithm described in 9.2.4.2. They reduce the size of the
  2783.       AS_PATH information by listing each AS number only once,
  2784.       regardless of how many times it may have appeared in multiple
  2785.       AS_PATHs that were aggregated.
  2786.  
  2787.       An AS_SET implies that the destinations listed in the NLRI can be
  2788.       reached through paths that traverse at least some of the
  2789.       constituent autonomous systems. AS_SETs provide sufficient
  2790.       information to avoid routing information looping; however their
  2791.       use may prune potentially feasible paths, since such paths are no
  2792.       longer listed individually as in the form of AS_SEQUENCEs.  In
  2793.       practice this is not likely to be a problem, since once an IP
  2794.       packet arrives at the edge of a group of autonomous systems, the
  2795.       BGP speaker at that point is likely to have more detailed path
  2796.       information and can distinguish individual paths to destinations.
  2797.  
  2798.  
  2799. 9.2.4.2 Aggregating Routing Information
  2800.  
  2801.  
  2802.    Aggregation is the process of combining the characteristics of
  2803.    several different routes in such a way that a single route can be
  2804.    advertised.  Aggregation can occur as part of the decision  process
  2805.    to reduce the amount of routing information that will be placed in
  2806.    the Adj-RIBs-Out.
  2807.  
  2808.    Aggregation reduces the amount of information that a BGP speaker must
  2809.    store and exchange with other BGP speakers. Routes can be aggregated
  2810.    by applying the following procedure separately to path attributes of
  2811.    like type and to the Network Layer Reachability Information.
  2812.  
  2813.    Routes that have the following attributes shall not be aggregated
  2814.    unless the corresponding attributes of each route are identical:
  2815.  
  2816.  
  2817.  
  2818. Expiration Date July 1997                                       [Page 47]
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824. RFC DRAFT                                                  December 1997
  2825.  
  2826.  
  2827.    MULTI_EXIT_DISC, NEXT_HOP.
  2828.  
  2829.    Path attributes that have different type codes can not be aggregated
  2830.    together. Path of the same type code may be aggregated, according to
  2831.    the following rules:
  2832.  
  2833.       ORIGIN attribute: If at least one route among routes that are
  2834.       aggregated has ORIGIN with the value INCOMPLETE, then the
  2835.       aggregated route must have the ORIGIN attribute with the value
  2836.       INCOMPLETE. Otherwise, if at least one route among routes that are
  2837.       aggregated has ORIGIN with the value EGP, then the aggregated
  2838.       route must have the origin attribute with the value EGP. In all
  2839.       other case the value of the ORIGIN attribute of the aggregated
  2840.       route is INTERNAL.
  2841.  
  2842.       AS_PATH attribute: If routes to be aggregated have identical
  2843.       AS_PATH attributes, then the aggregated route has the same AS_PATH
  2844.       attribute as each individual route.
  2845.  
  2846.       For the purpose of aggregating AS_PATH attributes we model each AS
  2847.       within the AS_PATH attribute as a tuple <type, value>, where
  2848.       "type" identifies a type of the path segment the AS belongs to
  2849.       (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number.  If the
  2850.       routes to be aggregated have different AS_PATH attributes, then
  2851.       the aggregated AS_PATH attribute shall satisfy all of the
  2852.       following conditions:
  2853.  
  2854.          - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH
  2855.          shall appear in all of the AS_PATH in the initial set of routes
  2856.          to be aggregated.
  2857.  
  2858.          - all tuples of the type AS_SET in the aggregated AS_PATH shall
  2859.          appear in at least one of the AS_PATH in the initial set (they
  2860.          may appear as either AS_SET or AS_SEQUENCE types).
  2861.  
  2862.          - for any tuple X of the type AS_SEQUENCE in the aggregated
  2863.          AS_PATH which precedes tuple Y in the aggregated AS_PATH, X
  2864.          precedes Y in each AS_PATH in the initial set which contains Y,
  2865.          regardless of the type of Y.
  2866.  
  2867.          - No tuple with the same value shall appear more than once in
  2868.          the aggregated AS_PATH, regardless of the tuple's type.
  2869.  
  2870.       An implementation may choose any algorithm which conforms to these
  2871.       rules.  At a minimum a conformant implementation shall be able to
  2872.       perform the following algorithm that meets all of the above
  2873.       conditions:
  2874.  
  2875.  
  2876.  
  2877.  
  2878. Expiration Date July 1997                                       [Page 48]
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884. RFC DRAFT                                                  December 1997
  2885.  
  2886.  
  2887.          - determine the longest leading sequence of tuples (as defined
  2888.          above) common to all the AS_PATH attributes of the routes to be
  2889.          aggregated. Make this sequence the leading sequence of the
  2890.          aggregated AS_PATH attribute.
  2891.  
  2892.          - set the type of the rest of the tuples from the AS_PATH
  2893.          attributes of the routes to be aggregated to AS_SET, and append
  2894.          them to the aggregated AS_PATH attribute.
  2895.  
  2896.          - if the aggregated AS_PATH has more than one tuple with the
  2897.          same value (regardless of tuple's type), eliminate all, but one
  2898.          such tuple by deleting tuples of the type AS_SET from the
  2899.          aggregated AS_PATH attribute.
  2900.  
  2901.       Appendix 6, section 6.8 presents another algorithm that satisfies
  2902.       the conditions and  allows for more complex policy configurations.
  2903.  
  2904.       ATOMIC_AGGREGATE: If at least one of the routes to be aggregated
  2905.       has ATOMIC_AGGREGATE path attribute, then the aggregated route
  2906.       shall have this attribute as well.
  2907.  
  2908.       AGGREGATOR: All AGGREGATOR attributes of all routes to be
  2909.       aggregated should be ignored.
  2910.  
  2911.  
  2912. 9.3   Route Selection Criteria
  2913.  
  2914.  
  2915.    Generally speaking, additional rules for comparing routes among
  2916.    several alternatives are outside the scope of this document.  There
  2917.    are two exceptions:
  2918.  
  2919.       - If the local AS appears in the AS path of the new route being
  2920.       considered, then that new route cannot be viewed as better than
  2921.       any other route.  If such a route were ever used, a routing loop
  2922.       could result (see Section 6.3).
  2923.  
  2924.       - In order to achieve successful distributed operation, only
  2925.       routes with a likelihood of stability can be chosen.  Thus, an AS
  2926.       must avoid using unstable routes, and it must not make rapid
  2927.       spontaneous changes to its choice of route.  Quantifying the terms
  2928.       "unstable" and "rapid" in the previous sentence will require
  2929.       experience, but the principle is clear.
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938. Expiration Date July 1997                                       [Page 49]
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944. RFC DRAFT                                                  December 1997
  2945.  
  2946.  
  2947. 9.4   Originating BGP routes
  2948.  
  2949.    A BGP speaker may originate BGP routes by injecting routing
  2950.    information acquired by some other means (e.g. via an IGP) into BGP.
  2951.    A BGP speaker that originates BGP routes shall assign the degree of
  2952.    preference to these routes by passing them through the Decision
  2953.    Process (see Section 9.1).  These routes may also be distributed to
  2954.    other BGP speakers within the local AS as part of the Internal update
  2955.    process (see Section 9.2.1). The decision whether to distribute non-
  2956.    BGP acquired routes within an AS via BGP or not depends on the
  2957.    environment within the AS (e.g. type of IGP) and should be controlled
  2958.    via configuration.
  2959.  
  2960.  
  2961.  
  2962.  
  2963. Appendix 1.  BGP FSM State Transitions and Actions.
  2964.  
  2965.  
  2966.    This Appendix discusses the transitions between states in the BGP FSM
  2967.    in response to BGP events.  The following is the list of these states
  2968.    and events when the negotiated Hold Time value is non-zero.
  2969.  
  2970.        BGP States:
  2971.  
  2972.                 1 - Idle
  2973.                 2 - Connect
  2974.                 3 - Active
  2975.                 4 - OpenSent
  2976.                 5 - OpenConfirm
  2977.                 6 - Established
  2978.  
  2979.  
  2980.        BGP Events:
  2981.  
  2982.                 1 - BGP Start
  2983.                 2 - BGP Stop
  2984.                 3 - BGP Transport connection open
  2985.                 4 - BGP Transport connection closed
  2986.                 5 - BGP Transport connection open failed
  2987.                 6 - BGP Transport fatal error
  2988.                 7 - ConnectRetry timer expired
  2989.                 8 - Hold Timer expired
  2990.                 9 - KeepAlive timer expired
  2991.                10 - Receive OPEN message
  2992.                11 - Receive KEEPALIVE message
  2993.                12 - Receive UPDATE messages
  2994.                13 - Receive NOTIFICATION message
  2995.  
  2996.  
  2997.  
  2998. Expiration Date July 1997                                       [Page 50]
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004. RFC DRAFT                                                  December 1997
  3005.  
  3006.  
  3007.    The following table describes the state transitions of the BGP FSM
  3008.    and the actions triggered by these transitions.
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.        Event                Actions               Message Sent   Next State
  3015.        --------------------------------------------------------------------
  3016.        Idle (1)
  3017.         1            Initialize resources            none             2
  3018.                      Start ConnectRetry timer
  3019.                      Initiate a transport connection
  3020.         others               none                    none             1
  3021.  
  3022.        Connect(2)
  3023.         1                    none                    none             2
  3024.         3            Complete initialization         OPEN             4
  3025.                      Clear ConnectRetry timer
  3026.         5            Restart ConnectRetry timer      none             3
  3027.         7            Restart ConnectRetry timer      none             2
  3028.                      Initiate a transport connection
  3029.         others       Release resources               none             1
  3030.  
  3031.        Active (3)
  3032.         1                    none                    none             3
  3033.         3            Complete initialization         OPEN             4
  3034.                      Clear ConnectRetry timer
  3035.         5            Close connection                                 3
  3036.                      Restart ConnectRetry timer
  3037.         7            Restart ConnectRetry timer      none             2
  3038.                      Initiate a transport connection
  3039.         others       Release resources               none             1
  3040.  
  3041.        OpenSent(4)
  3042.         1                    none                    none             4
  3043.         4            Close transport connection      none             3
  3044.                      Restart ConnectRetry timer
  3045.         6            Release resources               none             1
  3046.        10            Process OPEN is OK            KEEPALIVE          5
  3047.                      Process OPEN failed           NOTIFICATION       1
  3048.        others        Close transport connection    NOTIFICATION       1
  3049.                      Release resources
  3050.  
  3051.        OpenConfirm (5)
  3052.         1                   none                     none             5
  3053.         4            Release resources               none             1
  3054.         6            Release resources               none             1
  3055.  
  3056.  
  3057.  
  3058. Expiration Date July 1997                                       [Page 51]
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064. RFC DRAFT                                                  December 1997
  3065.  
  3066.  
  3067.         9            Restart KeepAlive timer       KEEPALIVE          5
  3068.        11            Complete initialization         none             6
  3069.                      Restart Hold Timer
  3070.        13            Close transport connection                       1
  3071.                      Release resources
  3072.        others        Close transport connection    NOTIFICATION       1
  3073.                      Release resources
  3074.  
  3075.  
  3076.  
  3077.  
  3078.        Established (6)
  3079.         1                   none                     none             6
  3080.         4            Release resources               none             1
  3081.         6            Release resources               none             1
  3082.         9            Restart KeepAlive timer       KEEPALIVE          6
  3083.        11            Restart Hold Timer            KEEPALIVE          6
  3084.        12            Process UPDATE is OK          UPDATE             6
  3085.                      Process UPDATE failed         NOTIFICATION       1
  3086.        13            Close transport connection                       1
  3087.                      Release resources
  3088.        others        Close transport connection    NOTIFICATION       1
  3089.                      Release resources
  3090.       ---------------------------------------------------------------------
  3091.  
  3092.  
  3093.       The following is a condensed version of the above state transition
  3094.       table.
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.    Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab
  3101.          | (1)  |   (2)   |  (3)   |    (4)   |     (5)     |   (6)
  3102.          |---------------------------------------------------------------
  3103.     1    |  2   |    2    |   3    |     4    |      5      |    6
  3104.          |      |         |        |          |             |
  3105.     2    |  1   |    1    |   1    |     1    |      1      |    1
  3106.          |      |         |        |          |             |
  3107.     3    |  1   |    4    |   4    |     1    |      1      |    1
  3108.          |      |         |        |          |             |
  3109.     4    |  1   |    1    |   1    |     3    |      1      |    1
  3110.          |      |         |        |          |             |
  3111.     5    |  1   |    3    |   3    |     1    |      1      |    1
  3112.          |      |         |        |          |             |
  3113.     6    |  1   |    1    |   1    |     1    |      1      |    1
  3114.          |      |         |        |          |             |
  3115.  
  3116.  
  3117.  
  3118. Expiration Date July 1997                                       [Page 52]
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124. RFC DRAFT                                                  December 1997
  3125.  
  3126.  
  3127.     7    |  1   |    2    |   2    |     1    |      1      |    1
  3128.          |      |         |        |          |             |
  3129.     8    |  1   |    1    |   1    |     1    |      1      |    1
  3130.          |      |         |        |          |             |
  3131.     9    |  1   |    1    |   1    |     1    |      5      |    6
  3132.          |      |         |        |          |             |
  3133.    10    |  1   |    1    |   1    |  1 or 5  |      1      |    1
  3134.          |      |         |        |          |             |
  3135.    11    |  1   |    1    |   1    |     1    |      6      |    6
  3136.          |      |         |        |          |             |
  3137.    12    |  1   |    1    |   1    |     1    |      1      | 1 or 6
  3138.          |      |         |        |          |             |
  3139.    13    |  1   |    1    |   1    |     1    |      1      |    1
  3140.          |      |         |        |          |             |
  3141.          ---------------------------------------------------------------
  3142.  
  3143.  
  3144.  
  3145.  
  3146. Appendix 2. Comparison with RFC1267
  3147.  
  3148.  
  3149.    BGP-4 is capable of operating in an environment where a set of
  3150.    reachable destinations may be expressed via a single IP prefix.  The
  3151.    concept of network classes, or subnetting is foreign to BGP-4.  To
  3152.    accommodate these capabilities BGP-4 changes semantics and encoding
  3153.    associated with the AS_PATH attribute. New text has been added to
  3154.    define semantics associated with IP prefixes.  These abilities allow
  3155.    BGP-4 to support the proposed supernetting scheme [9].
  3156.  
  3157.    To simplify configuration this version introduces a new attribute,
  3158.    LOCAL_PREF, that facilitates route selection procedures.
  3159.  
  3160.    The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC.
  3161.    A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that
  3162.    certain aggregates are not de-aggregated.  Another new attribute,
  3163.    AGGREGATOR, can be added to aggregate routes in order to advertise
  3164.    which AS and which BGP speaker within that AS caused the aggregation.
  3165.  
  3166.    To insure that Hold Timers are symmetric, the Hold Time is now
  3167.    negotiated on a per-connection basis.  Hold Times of zero are now
  3168.    supported.
  3169.  
  3170. Appendix 3.  Comparison with RFC 1163
  3171.  
  3172.  
  3173.    All of the changes listed in Appendix 2, plus the following.
  3174.  
  3175.  
  3176.  
  3177.  
  3178. Expiration Date July 1997                                       [Page 53]
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184. RFC DRAFT                                                  December 1997
  3185.  
  3186.  
  3187.    To detect and recover from BGP connection collision, a new field (BGP
  3188.    Identifier) has been added to the OPEN message. New text (Section
  3189.    6.8) has been added to specify the procedure for detecting and
  3190.    recovering from collision.
  3191.  
  3192.    The new document no longer restricts the border router that is passed
  3193.    in the NEXT_HOP path attribute to be part of the same Autonomous
  3194.    System as the BGP Speaker.
  3195.  
  3196.    New document optimizes and simplifies the exchange of the information
  3197.    about previously reachable routes.
  3198.  
  3199.  
  3200. Appendix 4.  Comparison with RFC 1105
  3201.  
  3202.  
  3203.    All of the changes listed in Appendices 2 and 3, plus the following.
  3204.  
  3205.    Minor changes to the RFC1105 Finite State Machine were necessary to
  3206.    accommodate the TCP user interface provided by 4.3 BSD.
  3207.  
  3208.    The notion of Up/Down/Horizontal relations present in RFC1105 has
  3209.    been removed from the protocol.
  3210.  
  3211.    The changes in the message format from RFC1105 are as follows:
  3212.  
  3213.       1.  The Hold Time field has been removed from the BGP header and
  3214.       added to the OPEN message.
  3215.  
  3216.       2.  The version field has been removed from the BGP header and
  3217.       added to the OPEN message.
  3218.  
  3219.       3.  The Link Type field has been removed from the OPEN message.
  3220.  
  3221.       4.  The OPEN CONFIRM message has been eliminated and replaced with
  3222.       implicit confirmation provided by the KEEPALIVE message.
  3223.  
  3224.       5.  The format of the UPDATE message has been changed
  3225.       significantly.  New fields were added to the UPDATE message to
  3226.       support multiple path attributes.
  3227.  
  3228.       6.  The Marker field has been expanded and its role broadened to
  3229.       support authentication.
  3230.  
  3231.       Note that quite often BGP, as specified in RFC 1105, is referred
  3232.       to as BGP-1, BGP, as specified in RFC 1163, is referred to as
  3233.       BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and
  3234.       BGP, as specified in this document is referred to as BGP-4.
  3235.  
  3236.  
  3237.  
  3238. Expiration Date July 1997                                       [Page 54]
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244. RFC DRAFT                                                  December 1997
  3245.  
  3246.  
  3247. Appendix 5.  TCP options that may be used with BGP
  3248.  
  3249.  
  3250.    If a local system TCP user interface supports TCP PUSH function, then
  3251.    each BGP message should be transmitted with PUSH flag set.  Setting
  3252.    PUSH flag forces BGP messages to be transmitted promptly to the
  3253.    receiver.
  3254.  
  3255.    If a local system TCP user interface supports setting precedence for
  3256.    TCP connection, then the BGP transport connection should be opened
  3257.    with precedence set to Internetwork Control (110) value (see also
  3258.    [6]).
  3259.  
  3260.  
  3261.  
  3262. Appendix 6.  Implementation Recommendations
  3263.  
  3264.  
  3265.       This section presents some implementation recommendations.
  3266.  
  3267.  
  3268. 6.1 Multiple Networks Per Message
  3269.  
  3270.  
  3271.    The BGP protocol allows for multiple address prefixes with the same
  3272.    AS path and next-hop gateway to be specified in one message. Making
  3273.    use of this capability is highly recommended. With one address prefix
  3274.    per message there is a substantial increase in overhead in the
  3275.    receiver. Not only does the system overhead increase due to the
  3276.    reception of multiple messages, but the overhead of scanning the
  3277.    routing table for updates to BGP peers and other routing protocols
  3278.    (and sending the associated messages) is incurred multiple times as
  3279.    well. One method of building messages containing many address
  3280.    prefixes per AS path and gateway from a routing table that is not
  3281.    organized per AS path is to build many messages as the routing table
  3282.    is scanned. As each address prefix is processed, a message for the
  3283.    associated AS path and gateway is allocated, if it does not exist,
  3284.    and the new address prefix is added to it.  If such a message exists,
  3285.    the new address prefix is just appended to it. If the message lacks
  3286.    the space to hold the new address prefix, it is transmitted, a new
  3287.    message is allocated, and the new address prefix is inserted into the
  3288.    new message. When the entire routing table has been scanned, all
  3289.    allocated messages are sent and their resources released.  Maximum
  3290.    compression is achieved when all  the destinations covered by the
  3291.    address prefixes share a gateway and common path attributes, making
  3292.    it possible to send many address prefixes in one 4096-byte message.
  3293.  
  3294.    When peering with a BGP implementation that does not compress
  3295.  
  3296.  
  3297.  
  3298. Expiration Date July 1997                                       [Page 55]
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. RFC DRAFT                                                  December 1997
  3305.  
  3306.  
  3307.    multiple address prefixes into one message, it may be necessary to
  3308.    take steps to reduce the overhead from the flood of data received
  3309.    when a peer is acquired or a significant network topology change
  3310.    occurs. One method of doing this is to limit the rate of updates.
  3311.    This will eliminate the redundant scanning of the routing table to
  3312.    provide flash updates for BGP peers and other routing protocols. A
  3313.    disadvantage of this approach is that it increases the propagation
  3314.    latency of routing information.  By choosing a minimum flash update
  3315.    interval that is not much greater than the time it takes to process
  3316.    the multiple messages this latency should be minimized. A better
  3317.    method would be to read all received messages before sending updates.
  3318.  
  3319.  
  3320. 6.2  Processing Messages on a Stream Protocol
  3321.  
  3322.  
  3323.    BGP uses TCP as a transport mechanism.  Due to the stream nature of
  3324.    TCP, all the data for received messages does not necessarily arrive
  3325.    at the same time. This can make it difficult to process the data as
  3326.    messages, especially on systems such as BSD Unix where it is not
  3327.    possible to determine how much data has been received but not yet
  3328.    processed.
  3329.  
  3330.    One method that can be used in this situation is to first try to read
  3331.    just the message header. For the KEEPALIVE message type, this is a
  3332.    complete message; for other message types, the header should first be
  3333.    verified, in particular the total length. If all checks are
  3334.    successful, the specified length, minus the size of the message
  3335.    header is the amount of data left to read. An implementation that
  3336.    would "hang" the routing information process while trying to read
  3337.    from a peer could set up a message buffer (4096 bytes) per peer and
  3338.    fill it with data as available until a complete message has been
  3339.    received.
  3340.  
  3341.  
  3342. 6.3 Reducing route flapping
  3343.  
  3344.  
  3345.    To avoid excessive route flapping a BGP speaker which needs to
  3346.    withdraw a destination and send an update about a more specific or
  3347.    less specific route SHOULD combine them into the same UPDATE message.
  3348.  
  3349.  
  3350. 6.4 BGP Timers
  3351.  
  3352.  
  3353.    BGP employs five timers: ConnectRetry, Hold Time, KeepAlive,
  3354.    MinASOriginationInterval, and MinRouteAdvertisementInterval The
  3355.  
  3356.  
  3357.  
  3358. Expiration Date July 1997                                       [Page 56]
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364. RFC DRAFT                                                  December 1997
  3365.  
  3366.  
  3367.    suggested value for the ConnectRetry timer is 120 seconds.  The
  3368.    suggested value for the Hold Time is 90 seconds.  The suggested value
  3369.    for the KeepAlive timer is 30 seconds.  The suggested value for the
  3370.    MinASOriginationInterval is 15 seconds.  The suggested value for the
  3371.    MinRouteAdvertisementInterval is 30 seconds.
  3372.  
  3373.    An implementation of BGP MUST allow these timers to be configurable.
  3374.  
  3375.  
  3376. 6.5 Path attribute ordering
  3377.  
  3378.  
  3379.    Implementations which combine update messages as described above in
  3380.    6.1 may prefer to see all path attributes presented in a known order.
  3381.    This permits them to quickly identify sets of attributes from
  3382.    different update messages which are semantically identical.  To
  3383.    facilitate this, it is a useful optimization to order the path
  3384.    attributes according to type code.  This optimization is entirely
  3385.    optional.
  3386.  
  3387.  
  3388. 6.6 AS_SET sorting
  3389.  
  3390.  
  3391.    Another useful optimization that can be done to simplify this
  3392.    situation is to sort the AS numbers found in an AS_SET.  This
  3393.    optimization is entirely optional.
  3394.  
  3395.  
  3396. 6.7 Control over version negotiation
  3397.  
  3398.  
  3399.    Since BGP-4 is capable of carrying aggregated routes which cannot be
  3400.    properly represented in BGP-3, an implementation which supports BGP-4
  3401.    and another BGP version should provide the capability to only speak
  3402.    BGP-4 on a per-peer basis.
  3403.  
  3404.  
  3405. 6.8 Complex AS_PATH aggregation
  3406.  
  3407.  
  3408.    An implementation which chooses to provide a path aggregation
  3409.    algorithm which retains significant amounts of path information may
  3410.    wish to use the following procedure:
  3411.  
  3412.       For the purpose of aggregating AS_PATH attributes of two routes,
  3413.       we model each AS as a tuple <type, value>, where "type" identifies
  3414.       a type of the path segment the AS belongs to (e.g.  AS_SEQUENCE,
  3415.  
  3416.  
  3417.  
  3418. Expiration Date July 1997                                       [Page 57]
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424. RFC DRAFT                                                  December 1997
  3425.  
  3426.  
  3427.       AS_SET), and "value" is the AS number.  Two ASs are said to be the
  3428.       same if their corresponding <type, value> tuples are the same.
  3429.  
  3430.       The algorithm to aggregate two AS_PATH attributes works as
  3431.       follows:
  3432.  
  3433.          a) Identify the same ASs (as defined above) within each AS_PATH
  3434.          attribute that are in the same relative order within both
  3435.          AS_PATH attributes.  Two ASs, X and Y, are said to be in the
  3436.          same order if either:
  3437.             - X precedes Y in both AS_PATH attributes, or - Y precedes X
  3438.             in both AS_PATH attributes.
  3439.  
  3440.          b) The aggregated AS_PATH attribute consists of ASs identified
  3441.          in (a) in exactly the same order as they appear in the AS_PATH
  3442.          attributes to be aggregated. If two consecutive ASs identified
  3443.          in (a) do not immediately follow each other in both of the
  3444.          AS_PATH attributes to be aggregated, then the intervening ASs
  3445.          (ASs that are between the two consecutive ASs that are the
  3446.          same) in both attributes are combined into an AS_SET path
  3447.          segment that consists of the intervening ASs from both AS_PATH
  3448.          attributes; this segment is then placed in between the two
  3449.          consecutive ASs identified in (a) of the aggregated attribute.
  3450.          If two consecutive ASs identified in (a) immediately follow
  3451.          each other in one attribute, but do not follow in another, then
  3452.          the intervening ASs of the latter are combined into an AS_SET
  3453.          path segment; this segment is then placed in between the two
  3454.          consecutive ASs identified in (a) of the aggregated attribute.
  3455.  
  3456.  
  3457.       If as a result of the above procedure a given AS number appears
  3458.       more than once within the aggregated AS_PATH attribute, all, but
  3459.       the last instance (rightmost occurrence) of that AS number should
  3460.       be removed from the aggregated AS_PATH attribute.
  3461.  
  3462. References
  3463.  
  3464.  
  3465.    [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC
  3466.    904, BBN, April 1984.
  3467.  
  3468.    [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET
  3469.    Backbone", RFC 1092, T.J. Watson Research Center, February 1989.
  3470.  
  3471.    [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093,
  3472.    MERIT/NSFNET Project, February 1989.
  3473.  
  3474.    [4] Postel, J., "Transmission Control Protocol - DARPA Internet
  3475.  
  3476.  
  3477.  
  3478. Expiration Date July 1997                                       [Page 58]
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484. RFC DRAFT                                                  December 1997
  3485.  
  3486.  
  3487.    Program Protocol Specification", RFC 793, DARPA, September 1981.
  3488.  
  3489.    [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway
  3490.    Protocol in the Internet", T.J. Watson Research Center, IBM Corp.,
  3491.    MCI, Internet Draft.
  3492.  
  3493.    [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol
  3494.    Specification", RFC 791, DARPA, September 1981.
  3495.  
  3496.    [7] "Information Processing Systems - Telecommunications and
  3497.    Information Exchange between Systems - Protocol for Exchange of
  3498.    Inter-domain Routeing Information among Intermediate Systems to
  3499.    Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993
  3500.  
  3501.    [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter-
  3502.    Domain Routing (CIDR): an Address Assignment and Aggregation
  3503.    Strategy", RFC 1519, BARRNet, cisco, MERIT, OARnet, September 1993
  3504.  
  3505.    [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation
  3506.    with CIDR", RFC 1518, T.J. Watson Research Center, cisco, September
  3507.    1993
  3508.  
  3509.  
  3510. Security Considerations
  3511.  
  3512.    Security issues are not discussed in this document.
  3513.  
  3514.  
  3515. Editors' Addresses
  3516.  
  3517.    Yakov Rekhter
  3518.    cisco Systems, Inc.
  3519.    170 W. Tasman Dr.
  3520.    San Jose, CA 95134
  3521.    email:  yakov@cisco.com
  3522.  
  3523.    Tony Li
  3524.    Juniper Networks, Inc.
  3525.    3260 Jay St.
  3526.    Santa Clara, CA 95051
  3527.    (408) 327-1906
  3528.    email: tli@juniper.net
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538. Expiration Date July 1997                                       [Page 59]
  3539.  
  3540.  
  3541.