13 Apr
2018
13 Apr
'18
4:55 a.m.
With the current code you'll get alike SubTLVs occurring consecutively in the packed VSA/TLV attribute so you'd end up with one of those two variations.
The reason why this happens is the encoder performs a merge sort on the attribute list prior to attempting to encode the attributes. This makes efficient packing of SubTLV attributes into VSAs/TLVs much easier, because you can just look at the next attribute to see if it's in the same parent TLV, or see if there's a common nesting level.
Because merge sort is a stable sort, you should find the ordering of attributes of the same number and lineage don't change.
Arran many thanks for your explanation.