Opened 23 months ago

Closed 23 months ago

Last modified 22 months ago

#5595 closed defect (complete)

HA hook library is not compatible with new client classification

Reported by: marcin Owned by: marcin
Priority: high Milestone: Kea1.4
Component: high-availability Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


Currently the HA hooks library uses pkt4_receive for load balancing. It assigns appropriate classes to the packet depending on which server should process the packet. The problem with this approach is that this is performed after client classification performed by the server so at the point where the server is classifying the packet we don't yet know the HA classes.

One possible solution is to modify the HA library to do load balancing within the buffer4_receive callout which is invoked before classification. The down side is that at that point the query isn't unpacked so there is no access to the HW address. The callout would need to dig into the MAC address within unpacked query.


Change History (8)

comment:1 Changed 23 months ago by fdupont

If you use classification for pools the #5549 provides a solution.

comment:2 Changed 23 months ago by marcin

  • Owner set to UnAssigned
  • Status changed from new to reviewing

I now used buffer4_reeceive callout instead of pkt4_receive for filtering packets. This works, because this callout is invoked before the client classification step.

Proposed ChangeLog entry:

XX.	[func]		marcin
	HA hook library uses buffer4_receive for filtering DHCP queries,
	which is required for compatibility of the library with
	advanced client classification.
	(Trac #5595, git cafe)

comment:3 Changed 23 months ago by tmark

  • Owner changed from UnAssigned to tmark

comment:4 Changed 23 months ago by tmark

  • Owner changed from tmark to marcin


HAImpl::buffer4Receive(hooks::CalloutHandle?& callout_handle)

Two issues If an unpack exception occurs:

  1. If it's a SkipRemainingOptions? exception we won't log it and we'll drop it
  1. If it's any other exception, we won't update statistics for pkt4-parse-failed, pkt4-receive-drop

Also, please a comment where you set status to skip explaining
that this is done to bypass unpacking the again

HA unit tests pass under Ubuntu 16.04.

comment:5 Changed 23 months ago by marcin

  • Owner changed from marcin to tmark

Ok. I addressed your review comments. All good catches.

comment:6 Changed 23 months ago by tmark

  • Owner changed from tmark to marcin

Changes look good. We should consider adding unit tests for bad packets, maybe under a new ticket?

comment:7 Changed 23 months ago by marcin

  • Resolution set to complete
  • Status changed from reviewing to closed

Added TODO and merged with commit 90c5cc185b0d27f252838c47a8328e2e0535b67f

comment:8 Changed 22 months ago by tomek

  • Milestone changed from Kea-proposed to Kea1.4

Tickets already closed, moving to 1.4 as this is where they were closed.

Note: See TracTickets for help on using tickets.