Subject: [Idr] BGP-LS TLV Error Conditions

From: Alvaro Retana <[email-masked]>
Date: Wed, 30 Jan 2019 21:44:47 +0000

[Speaking as a WG participant.]

Dear idr WG:

tl;dr I think that rfc7752 doesn't do a good job in specifying actions
resulting from error conditions related to the use of TLVs.

As you all know, rfc7752 defines a set of TLVs to be used in describing the
different Link-State NLRI types, or in the BGP-LS Attribute.

The use of these TLVs is specific to the reason they were created, and in
most cases that use is very clear; for example, the "Local Node Descriptors
TLV contains Node Descriptors for the node anchoring the local end of the
link.  This is a mandatory TLV in all three types of NLRIs (node, link, and
prefix)."  However, it is not clear what should happen if the Local Node
Descriptors TLV (for example [*]) is present in the BGP-LS Attribute.

I think that the easy answer is that it should simply be ignored...silently
ignored.  But the text doesn't say what to do...at least I didn't find it
anywhere.

§3.1 (TLV Format) offers the following: "Unrecognized types MUST be
preserved and propagated."  The Local Node Descriptors TLV is not really
"unrecognized", but I can imagine that an implementation can interpret it
that way.  IOW, if the Local Node Descriptors TLV was received in the
BGP-LS Attribute then it would not be processed, but it would be
propagated...which is akin to silently ignored...

Is this the right interpretation: should "unrecognized" be interpreted also
as "not belonging here"?  Are there cases where it is not as clear to
determine what should be "unrecognized"?

Personally, I find the interpretation above to be a stretch, and not all
TLV descriptions are as specific as the one for the Local Node Descriptors
TLV, which "is a mandatory TLV in all three types of NLRIs".  Other text
say things like: "Node attribute TLVs are the TLVs that may be encoded in
the BGP-LS attribute with a Node NLRI"..."following Link Attribute TLVs are
valid in the BGP-LS attribute with a Link NLRI" (are others not valid?)...

Other parts of rfc7752 also talk about how to handle TLVs, but I think they
also paint an incomplete picture:

- §3.1 also says: "In order to compare NLRIs with unknown TLVs, all TLVs
MUST be ordered in ascending order by TLV Type.  If there are more TLVs of
the same type, then the TLVs MUST be ordered in ascending order of the TLV
value..."   I'm assuming that "unknown" is the same as "unrecognized"...
This text doesn't talk about what should be done if the ordering is not
ascending...should the TLVs be ignored?  "treat-as-withdraw" [rfc7606]?

- §3.2.1.4 (Node Descriptor Sub-TLVs) has similar ordering requirements for
sub-TLVs...

- §6.2.2 (Fault Management) talks about syntactic checks that can lead to
"attribute discard", but it says nothing about finding "unrecognized" or
unordered TLVs.

In summary, I think that rfc7752 could use a refresh (or another document
Updating it) related to the handling of TLVs.  Yes, we should have been
clearer when rfc7752 was published, but we weren't. :-(

I'm hoping that implementers, who should have already made decisions on
these topics, can take on this work.  Any volunteers?  [Personally, I
haven't coded an implementation, but would be willing to help if needed.]

Thanks!

Alvaro.

[*] Just using the Local Node Descriptors TLV to illustrate...