4. Capabilities Optional Parameter (Parameter Type 2)
4. Capabilities Optional Parameter (Parameter Type 2)
This is an Optional Parameter that is used by a BGP speaker to convey to its BGP peer the list of capabilities supported by the speaker. The encoding of BGP Optional Parameters is specified in Section 4.2 of [RFC4271]. The parameter type of the Capabilities Optional Parameter is 2.
The parameter contains one or more triples <Capability Code, Capability Length, Capability Value>, where each triple is encoded as shown below:
+------------------------------+
| Capability Code (1 octet) |
+------------------------------+
| Capability Length (1 octet) |
+------------------------------+
| Capability Value (variable) |
~ ~
+------------------------------+
The use and meaning of these fields are as follows:
Capability Code:
Capability Code is a one-octet unsigned binary integer that unambiguously identifies individual capabilities.
Capability Length:
Capability Length is a one-octet unsigned binary integer that contains the length of the Capability Value field in octets.
Capability Value:
Capability Value is a variable-length field that is interpreted according to the value of the Capability Code field.
BGP speakers SHOULD NOT include more than one instance of a capability with the same Capability Code, Capability Length, and Capability Value. Note, however, that processing of multiple instances of such capability does not require special handling, as additional instances do not change the meaning of the announced capability; thus, a BGP speaker MUST be prepared to accept such multiple instances.
BGP speakers MAY include more than one instance of a capability (as identified by the Capability Code) with non-zero Capability Length field, but with different Capability Value and either the same or different Capability Length. Processing of these capability instances is specific to the Capability Code and MUST be described in the document introducing the new capability.
The Capabilities Optional Parameter (OPEN Optional Parameter Type 2) SHOULD only be included in the OPEN message once. If the BGP speaker wishes to include multiple capabilities in the OPEN message, it SHOULD do so as discussed above -- by listing all those capabilities as TLVs within a single Capabilities Optional Parameter. However, for backward compatibility, a BGP speaker MUST be prepared to receive an OPEN message that contains multiple Capabilities Optional Parameters, each of which contains one or more capabilities TLVs. The set of capabilities should be processed in the same way in either case, whether it is enumerated within a single Capabilities Optional Parameter of the OPEN message or split across multiple Capabilities Optional Parameters.