Extended Optional Parameters Length for BGP OPEN Message
updates
- rfc-4271 — A Border Gateway Protocol 4 (BGP-4)
Extracted elements (17)
Optional Parameter type code 255 is reserved as the 'Extended Length' signal. When the Non-Ext OP Type octet equals 255, the receiver switches to extended parsing. This re-uses an existing field position to signal the format change without altering the base message framing.
The backward-compatible design avoids new version negotiation by re-purposing the existing first-octet field position: setting Non-Ext OP Len. to 255 and Non-Ext OP Type to 255 is detectable by old speakers as an unrecognized parameter, causing a clean NOTIFICATION rather than silent misparse.
It is not a fatal error to receive an OPEN whose Non-Ext OP Len. is not 255 but whose first Optional Parameter type code is 255; in this case the extended encoding MUST still be used for decoding.
Receiving an OPEN message whose Extended Optional Parameters Length value is less than or equal to 255 is not considered an error.
When a new speaker (supporting this spec) needs to send Optional Parameters exceeding 255 octets to an old speaker, the old speaker will see type code 255 as an unrecognized Optional Parameter and is expected to close the connection with a NOTIFICATION (OPEN Message Error / Unsupported Optional Parameters).
An implementation MUST accept a BGP OPEN message that uses the extended encoding of this specification even if the length of the Optional Parameters is 255 octets or less.
Configuration MAY override the above to force the extended format to be used in all cases, for example to test that a peer supports this specification.
If the length of the Optional Parameters in the BGP OPEN message does exceed 255 octets, the OPEN message MUST be encoded according to the extended format procedure.
The Non-Ext OP Type field MUST be set to 255 on transmission when using the extended format. On receipt, a value of 255 for this field is the indication that the extended format is in use.
The Non-Extended Optional Parameters Length field (Non-Ext OP Len.) SHOULD be set to 255 on transmission and MUST NOT be set to 0; it MUST be ignored on receipt once the extended format is confirmed.
Type code 255 is not a bona fide Optional Parameter type code and MUST NOT be used other than as the Non-Ext OP Type signal. If encountered in any other position, it MUST be treated as an unrecognized Optional Parameter and handled per RFC 4271 Section 6.2.
When parsing an OPEN, if Non-Ext OP Len. is non-zero, the BGP speaker MUST inspect the Non-Ext OP Type octet to determine which encoding is in use. If that value is 255, the extended format is used; otherwise RFC 4271 encoding applies.
The Extended Optional Parameters Length field is a two-octet unsigned integer indicating the total length of the Optional Parameters field in octets. A value of zero means no Optional Parameters are present.
IANA assigned value 255 to the new 'Extended Length' type code in the 'BGP OPEN Optional Parameter Types' registry.
This extension to BGP does not change the underlying security or confidentiality issues inherent in the existing BGP protocol as analyzed in RFC 4272.
Extended OPEN format replaces the one-octet Optional Parameters Length with three fields: Non-Ext OP Len. (1 octet), Non-Ext OP Type (1 octet, set to 255), and Extended Opt. Parm. Length (2 octets, unsigned integer indicating total Optional Parameters length).
In the extended encoding, each individual Optional Parameter uses a 2-octet unsigned integer Parameter Length field (instead of the 1-octet field in RFC 4271), preceded by the 1-octet Parameter Type field.