Grouping of sub attributes in seperate VSAs

Alan DeKok aland at deployingradius.com
Thu Apr 12 17:18:52 CEST 2018


On Apr 12, 2018, at 11:07 AM, Бенджамин Томпсон <b.thompson at latera.ru> wrote:
> 
> We have a device which sends individual traffic counters for several
> different services. The dicitionary is as follows:
> 
> VENDOR      VasExperts              43823
> 
> BEGIN-VENDOR    VasExperts
> 
> ...
> 
> ATTRIBUTE   VasExperts-Acct-Traffic-Class-Name              16  string
> ATTRIBUTE   VasExperts-Acct-Traffic-Class-Input-Octets      17  integer64
> ATTRIBUTE   VasExperts-Acct-Traffic-Class-Output-Octets     18  integer64
> ATTRIBUTE   VasExperts-Acct-Traffic-Class-Input-Packets     19  integer64
> ATTRIBUTE   VasExperts-Acct-Traffic-Class-Output-Packets    20  integer64

   That might work...

> In the accounting packet these attribtues are grouped into individual VSAs
> as follows:

  If you want *real* grouping, you need to use TLVs.  i.e. one master attribute, and the sub-attributes within that.

> Here the fact that the five attributes are gouped together in a single VSA
> means that they all contain data which pertains to the same service.

  That's what you mean.  But that's not how RADIUS works.  The attributes are all in a flat space.

> When FreeRADIUS processes the packet the attribtues are as I understand it
> added to one long list and I can access them individually by their index.

  Yes.

> However, as I understand it the ordering of RADIUS attributes is not
> something which is normally guaranteed

  RADIUS guarantees ordering of attributes which have the same number.  It does NOT guarantee ordering of attributes which have a different number.

  This restriction applies to VSAs, soo.

> and I would like to ask is whether
> there is any way in unlang or by other means to figure out which which sub
> attribtues came from the same parent attribute.

  No.  But you can fix the dictionary:

VENDOR      VasExperts              43823

BEGIN-VENDOR    VasExperts

...
ATTRIBUTE   VasExperts-Acct-Traffic			              	16  tlv
ATTRIBUTE   VasExperts-Acct-Traffic-Class-Name               16.1  string
ATTRIBUTE   VasExperts-Acct-Traffic-Class-Input-Octets      16.2  integer64
ATTRIBUTE   VasExperts-Acct-Traffic-Class-Output-Octets    16.3   integer64
ATTRIBUTE   VasExperts-Acct-Traffic-Class-Input-Packets     16.4  integer64
ATTRIBUTE   VasExperts-Acct-Traffic-Class-Output-Packets   16.5  integer64
...

  These attributes will be packed into one parent attribute: VasExperts-Acct-Traffic.  And ordering of THAT attribute is guaranteed.

  Alan DeKok.




More information about the Freeradius-Users mailing list