<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted1">This is my understanding of how the unacked clients functionality
works. My explanation is based upon the DHCP4 source code and may differ for DHCP6. I will include references at the bottom of my email which I encourage double-checking for accuracy. I am not a contributor to Kea and have not thoroughly tested the conclusions
I draw here.
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">1. The DHCP packet enters Kea. The HA hook receives the packet in the buffer4Receive[1] function. The packet contents are parsed and dropped if invalid.</div>
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">2. The packet is checked to be in scope [2][3][4][5][6] (and if it isn't, the packet status is set to NEXT_STEP_DROP [21]). Whether a packet is in scope is decided by the following:</div>
<div class="FluidPluginCopy ContentPasted1"> a. If the packet is not one that can be handled by HA (is one of DHCPDISCOVER, DHCPREQUEST, DHCPDECLINE, DHCPRELEASE, or DHCPINFORM [7]), then the current server will process it [8].</div>
<div class="FluidPluginCopy ContentPasted1"> b. If HA is configured in load balancing mode, the packet is classed according to the aforementioned HBA defined in RFC 3074 section 6 [9][10]. The HBA returns the server that must handle the packet (either primary
or secondary). Otherwise (server is in hot standby), the packet is classed as belonging to the primary server in the HA configuration [12]. The class given in either of these conditions is the defined name of the respective server, coming from the HA section
of the Kea DHCP4 configuration [13].</div>
<div class="FluidPluginCopy ContentPasted1"> c. The current server will process the packet if it is serving packets with the class determined in (2)(b).</div>
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">Note: every heartbeat, the servers send each other their scopes [15]. A failed heartbeat sets the HA status to "unavailable" [24], which eventually transitions the server to partner down state.</div>
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">3. If the server is in a communication interrupted state and the packet is not classed for the current server, then:</div>
<div class="FluidPluginCopy ContentPasted1"> a. Maintain a global counter, incrementing it once per packet (every successful heartbeat counts as a "poke" for the partner [16], which resets this global counter to zero [17]).</div>
<div class="FluidPluginCopy ContentPasted1"> b. Get the "secs" field of the packet. Compare the value to the value configured in the Kea DHCP4 configuration for "max-ack-delay" [18], or 10 seconds by default [19]. If the value of this field is greater than
the max-ack-delay, the packet is considered unacked [20]. All packets (unacked or not) are kept track of in a map containing the hardware address, client ID, and last unacked status; if the packet is being received unacked, and it has not been previously recorded
as being unacked (that is, the packet secs field just exceeded the max-ack-delay threshold for the first time), the server logs a warning message.</div>
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">4. A failure is detected if the number of packets in the unacked state is greater than the "max-unacked-clients" setting of the Kea DHCP4 config [22] (or 10 by default [19]). If a failure is detected, the server eventually
transitions to partner-down state [23]. More information about when exactly the server transitions to partner-down state is shown by the usages of HAService::shouldPartnerDown() [25] (in other words, I'm not digging into that tonight).</div>
<div class="FluidPluginCopy"><br class="ContentPasted1">
</div>
<div class="FluidPluginCopy ContentPasted1">[1]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_impl.cc#L60-L111</div>
<div class="FluidPluginCopy ContentPasted1">[2]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1021</div>
<div class="FluidPluginCopy ContentPasted1">[3]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1029-L1047</div>
<div class="FluidPluginCopy ContentPasted1">[4]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1034</div>
<div class="FluidPluginCopy ContentPasted1">[5]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L376</div>
<div class="FluidPluginCopy ContentPasted1">[6]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L382-L414</div>
<div class="FluidPluginCopy ContentPasted1">[7]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L51-L71</div>
<div class="FluidPluginCopy ContentPasted1">[8]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L395</div>
<div class="FluidPluginCopy ContentPasted1">[9]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L416-L446</div>
<div class="FluidPluginCopy ContentPasted1">[10]: https://www.rfc-editor.org/rfc/rfc3074</div>
<div class="FluidPluginCopy ContentPasted1">[11]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L413</div>
<div class="FluidPluginCopy ContentPasted1">[12]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/query_filter.cc#L398</div>
<div class="FluidPluginCopy ContentPasted1">[13]: https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#load-balancing-configuration</div>
<div class="FluidPluginCopy ContentPasted1">[14]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/communication_state.cc#L617-L625</div>
<div class="FluidPluginCopy ContentPasted1">[15]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1757-L1758</div>
<div class="FluidPluginCopy ContentPasted1">[16]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1793-L1794</div>
<div class="FluidPluginCopy ContentPasted1">[17]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/communication_state.cc#L274</div>
<div class="FluidPluginCopy ContentPasted1">[18]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_config_parser.cc#L180-L181</div>
<div class="FluidPluginCopy ContentPasted1">[19]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_config.cc#L166</div>
<div class="FluidPluginCopy ContentPasted1">[20]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/communication_state.cc#L652</div>
<div class="FluidPluginCopy ContentPasted1">[21]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_impl.cc#L104</div>
<div class="FluidPluginCopy ContentPasted1">[22]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_config_parser.cc#L184-L185</div>
<div class="FluidPluginCopy ContentPasted1">[23]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1097</div>
<div class="FluidPluginCopy ContentPasted1">[24]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1799</div>
[25]: https://gitlab.isc.org/isc-projects/kea/-/blob/c4c53a0168ffa385c387ba685ac16e5544feaad4/src/hooks/dhcp/high_availability/ha_service.cc#L1081-L1106<br>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<br>
</span></div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<b>Eric Graham</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<i>DevOps Specialist</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-size: 8pt;">Direct: 605.990.1859</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 8pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"></span><i><br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<i><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 8pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"></span></i><a href="mailto:eric.graham@vantagepnt.com" title="mailto:eric.graham@vantagepnt.com"><span style="font-size: 8pt;">Eric.Graham@vantagepnt.com</span></a><i><br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<i><img style="max-width:100%" class="ContentPasted0" id="imageSelected0" data-outlook-trace="F:1|T:1" src="cid:446fdf61-044d-49d2-a820-4da231cbe5e1"><br>
</i></div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kea-users <kea-users-bounces@lists.isc.org> on behalf of Kevin P. Fleming <lists.kea-users@kevin.km6g.us><br>
<b>Sent:</b> Monday, January 9, 2023 12:38 PM<br>
<b>To:</b> kea-users@lists.isc.org <kea-users@lists.isc.org><br>
<b>Subject:</b> Re: [Kea-users] Load-Balancing Network issue between Relay and Kea</font>
<div> </div>
</div>
<style type="text/css">
<!--
p.x_MsoNormal, p.x_MsoNoSpacing
{margin:0}
-->
</style>
<div>
<div style="border-radius:15px; padding:3px 3px 3px 10px; font-size:9pt; font-family:Arial,sans-serif; color:#ffffff; background-color:rgb(143,16,16)">
<b>CAUTION:</b> This email originated outside the organization. Do not click any links or attachments unless you have verified the sender.
</div>
<div>
<div>On Mon, Jan 9, 2023, at 11:54, Veronique Lefebure wrote:<br>
</div>
<blockquote type="cite" id="x_qt" style="">
<div class="x_qt-elementToProof"><span style="color:rgb(0,0,0); background-color:rgb(255,255,255)"><span class="x_font" style="font-family:Calibri,Arial,Helvetica,sans-serif"><span class="x_size" style="font-size:12pt">
<div><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><span class="x_font" style=""><span class="x_qt-ContentPasted0" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; background-color:rgb(255,255,255)"><span class="x_font" style="font-family:Calibri,Arial,Helvetica,sans-serif"><span class="x_size" style="font-size:12pt">Very
interesting thread.</span></span></span></span></span> <br>
</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; background-color:rgb(255,255,255)"><span class="x_font" style="font-family:Calibri,Arial,Helvetica,sans-serif"><span class="x_size" style="font-size:12pt"></span></span></span><br>
</div>
<div class="x_qt-elementToProof" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; background-color:rgb(255,255,255)"><span class="x_font" style="font-family:Calibri,Arial,Helvetica,sans-serif"><span class="x_size" style="font-size:12pt">Mathias, you wrote
"<span class="x_qt-ContentPasted1" style="background-color:rgb(255,255,255); display:inline!important"><span class="x_font" style=""><span class="x_size" style="font-size:14px">Expected behaviour: Kea 2 sees the unacked clients of Kea 1 and sets Kea 1 in partner-down
state and handles all requests.", b</span></span></span></span></span></span><span style=""><span class="x_font" style="font-family:Calibri,Arial,Helvetica,sans-serif"><span class="x_size" style="font-size:12pt">ut, If there is no traffic between DHCP clients
and Kea1, then the value of </span></span></span><span class="x_qt-ContentPasted0" style="color:rgb(36,36,36); display:inline!important"><span class="x_font" style="font-family:Calibri,sans-serif"><span class="x_size" style="font-size:14.6667px">max-unacked-clients
on server1 cannot increase anyway, right ? In other words, Kea2 cannot "see" anything ?</span></span></span><br>
</div>
</span></span></span></div>
<div id="x_qt-appendonsend"><br>
</div>
</blockquote>
<div><br>
</div>
<div>It can 'see', because it *also* saw all of the client requests and knows which ones it expected to be handled by Kea1 (as noted earlier in the thread it even emits a log message indicating this).<br>
</div>
<div><br>
</div>
<div>Forgive my presumption, but I assumed that 'max-unacked-clients' would be a counter of 'unacked clients' which belong to a Kea server *other than this one*. I don't immediately know how counting the number of clients *this server* has not acked would be
useful, although I won't be surprised to learn that it is useful to someone.<br>
</div>
</div>
</div>
</body>
</html>