<div dir="ltr">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 <a href="https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso">VIVSO</a>). 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. :)<div><br></div><div><b>Questions on VIVSO with client classification:</b><br></div><div>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. </div><div><br></div><div>Regarding the use of VIVSO suboptions in client classification, I am trying to perform the same matching in Kea, as described <a href="https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso">here</a> 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:</div><div><br></div><div><font face="monospace, monospace"><span style="color:rgb(51,51,51)">substring(vendor[</span>42623<span style="color:rgb(51,51,51)">].option[4].hex) == </span></font><span style="color:rgb(51,51,51)"><font face="monospace, monospace">"powerpc"</font></span><br></div><div><br></div><div>I assume the <b>vendor[42623]</b> is essentially "option[125].suboption[42623]". Then the final "<b>.option[4].hex</b>" will reference the suboption value? </div><div><br></div><div>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?</div><div><br></div><div>Finally, I wanted to create multiple classifiers to build some logic deciding what option values to send back to the client. </div><div>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? </div><div>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?</div><div><br></div><div><div><font face="monospace, monospace" size="1">"client-classes": [</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "name": "onie-ppc",</font></div><div><font face="monospace, monospace" size="1">       "option-data": [</font></div><div><font face="monospace, monospace" size="1">           {</font></div><div><font face="monospace, monospace" size="1">               "data": "<a href="http://image-server/onie-installer-powerpc">http://image-server/onie-installer-powerpc</a>",</font></div><div><font face="monospace, monospace" size="1">               "name": "installer_url"</font></div><div><font face="monospace, monospace" size="1">           }</font></div><div><font face="monospace, monospace" size="1">       ],</font></div><div><font face="monospace, monospace" size="1">       "test": "substring(vendor[42623].option[4].hex == 'powerpc')"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">       "name": "onie-ppc",</font></div><div><font face="monospace, monospace" size="1">       "option-data": [</font></div><div><font face="monospace, monospace" size="1">           {</font></div><div><font face="monospace, monospace" size="1">               "data": "<a href="http://image-server/onie-installer-powerpc-dell_switch">http://image-server/onie-installer-powerpc-dell_switch</a>",</font></div><div><font face="monospace, monospace" size="1">               "name": "installer_url"</font></div><div><font face="monospace, monospace" size="1">           }</font></div><div><font face="monospace, monospace" size="1">       ],</font></div><div><font face="monospace, monospace" size="1">       "test": "substring(vendor[42623].option[4].hex == 'powerpc' and substring(vendor[42623].option[3].hex == 'dell_switch')"</font></div><div><font face="monospace, monospace" size="1">    }</font></div><div><font face="monospace, monospace" size="1">]</font></div></div><div><br></div><div><br></div><div><div><b>Questions on VIVSO option-def:</b></div></div><div>I think I have successfully created the option namespace in Kea as described <a href="https://opencomputeproject.github.io/onie/user-guide/index.html#advanced-dhcp-2-vivso">here</a> 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].</div><div><br></div><div><div><font face="monospace, monospace" size="1">"option-data": [</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><div><font face="monospace, monospace" size="1">       "code": 125,</font></div><div><font face="monospace, monospace" size="1">       "csv-format": true,       </font></div><div><font face="monospace, monospace" size="1">       "data": "42623,0",</font></div><div><font face="monospace, monospace" size="1">       "name": "vivso-suboptions"</font></div><div><font face="monospace, monospace" size="1">       "space": 'dhcp4"</font></div></div><div><font face="monospace, monospace" size="1">   }</font></div><div><font face="monospace, monospace" size="1">],</font></div><div><font face="monospace, monospace" size="1">"option-def": [</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "code": 1,</font></div><div><font face="monospace, monospace" size="1">       "name": "installer_url",</font></div><div><font face="monospace, monospace" size="1">       "space": "onie",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "code": 2,</font></div><div><font face="monospace, monospace" size="1">       "name": "updater_url",</font></div><div><font face="monospace, monospace" size="1">       "space": "onie",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "code": 3,</font></div><div><font face="monospace, monospace" size="1">       "name": "machine",</font></div><div><font face="monospace, monospace" size="1">       "space": "onie",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "code": 4,</font></div><div><font face="monospace, monospace" size="1">       "name": "arch",</font></div><div><font face="monospace, monospace" size="1">       "space": "onie",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><font face="monospace, monospace" size="1">       "code": 5,</font></div><div><font face="monospace, monospace" size="1">       "name": "machine_rev",</font></div><div><font face="monospace, monospace" size="1">       "space": "onie",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   },</font></div><div><font face="monospace, monospace" size="1">   {</font></div><div><span style="font-family:monospace,monospace;font-size:x-small">       "code": 42623,</span><br></div><div><font face="monospace, monospace" size="1">       "encapsulate": "onie",</font></div><div><font face="monospace, monospace" size="1">       "name": "vivso-onie",</font></div><div><span style="font-family:monospace,monospace;font-size:x-small">       "space": "dhcp4",</span><br></div><div><font face="monospace, monospace" size="1">       "type": "empty"</font></div><div><font face="monospace, monospace" size="1">   },</font></div></div><div><div><font face="monospace, monospace" size="1">   {</font></div><div><span style="font-family:monospace,monospace;font-size:x-small">       "code": 0,</span><br></div><div><span style="font-family:monospace,monospace;font-size:x-small">       "name": "vivso-iana",</span><br></div><div><font face="monospace, monospace" size="1">       "space": "dhcp4",</font></div><div><font face="monospace, monospace" size="1">       "type": "string"</font></div><div><font face="monospace, monospace" size="1">   }</font></div><div><font face="monospace, monospace" size="1">]</font></div></div><div><br></div><div><br></div><div>Thanks in advance,</div><div>Jason</div></div>