[Kea-users] VIVSO and use with client classification

Jason Guy jguy at cumulusnetworks.com
Wed Dec 20 19:20:47 UTC 2017


Hi. We are using Kea in our lab and I am trying to figure out how to use
complex client classification with custom options. This pertains to booting
open networking switches from the network using ONIE (references config
options using VIVSO
<https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso>).
I have some questions about how to implement the equivalent in Kea. I would
like to augment the ONIE docs to include the Kea config as well as the
ISC-DHCP configuration if I can verify this works. :)

*Questions on VIVSO with client classification:*
I was not entirely sure about this, but I assumed I have to first create
the option definition for the nested option structure of the VIVSO, before
a client class can parse it. I have a follow-on question for the option
definition for VIVSO custom options at the end.

Regarding the use of VIVSO suboptions in client classification, I am trying
to perform the same matching in Kea, as described here
<https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso>
for
isc-dhcp. The part I am not sure about is how to match vendor (vivso)
sub-option content. In the option definition (see below), option[125]
encapsulates two "containers" (iana and onie). The onie "container" has 5
suboptions. So I am not entirely clear how to match a string with this
nested structure, but I think it is like this:

substring(vendor[42623].option[4].hex) == "powerpc"

I assume the *vendor[42623]* is essentially "option[125].suboption[42623]".
Then the final "*.option[4].hex*" will reference the suboption value?

Since the vivso options and sub-option codes are defined, can the option
name be used in the brackets instead of the option code number?

Finally, I wanted to create multiple classifiers to build some logic
deciding what option values to send back to the client.
Does the classification code process all classifications before returning
the final answer? Or does it match in a specific order and return on first
successful match?
For example, if a client sent the onie.arch = powerpc, and the onie.machine
= dell_switch, would the first class here return the installer_url option,
or will it fall through to the second class which is more specific?

"client-classes": [
   {
       "name": "onie-ppc",
       "option-data": [
           {
               "data": "http://image-server/onie-installer-powerpc",
               "name": "installer_url"
           }
       ],
       "test": "substring(vendor[42623].option[4].hex == 'powerpc')"
   },
       "name": "onie-ppc",
       "option-data": [
           {
               "data": "
http://image-server/onie-installer-powerpc-dell_switch",
               "name": "installer_url"
           }
       ],
       "test": "substring(vendor[42623].option[4].hex == 'powerpc' and
substring(vendor[42623].option[3].hex == 'dell_switch')"
    }
]


*Questions on VIVSO option-def:*
I think I have successfully created the option namespace in Kea as
described here
<https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso>
for isc-dhcp. Though this is a bit more elaborate than any of the examples
in the docs. I was not sure if I created this properly, by just specifying
the 2 custom option codes in the data field for the VIVSO option[125].

"option-data": [
   {
       "code": 125,
       "csv-format": true,
       "data": "42623,0",
       "name": "vivso-suboptions"
       "space": 'dhcp4"
   }
],
"option-def": [
   {
       "code": 1,
       "name": "installer_url",
       "space": "onie",
       "type": "string"
   },
   {
       "code": 2,
       "name": "updater_url",
       "space": "onie",
       "type": "string"
   },
   {
       "code": 3,
       "name": "machine",
       "space": "onie",
       "type": "string"
   },
   {
       "code": 4,
       "name": "arch",
       "space": "onie",
       "type": "string"
   },
   {
       "code": 5,
       "name": "machine_rev",
       "space": "onie",
       "type": "string"
   },
   {
       "code": 42623,
       "encapsulate": "onie",
       "name": "vivso-onie",
       "space": "dhcp4",
       "type": "empty"
   },
   {
       "code": 0,
       "name": "vivso-iana",
       "space": "dhcp4",
       "type": "string"
   }
]


Thanks in advance,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20171220/d34860f5/attachment.htm>


More information about the Kea-users mailing list