diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am index 01f6539a87..1eea0d551b 100644 --- a/doc/sphinx/Makefile.am +++ b/doc/sphinx/Makefile.am @@ -102,6 +102,7 @@ umls += uml/currentHost4.uml umls += uml/lease-states.uml umls += uml/main-loop.uml umls += uml/packet4.uml +umls += uml/recognizing-same-client.uml umls += uml/request4-lease.uml umls += uml/request4.uml umls += uml/requestLease4.uml @@ -118,6 +119,7 @@ pngs += uml/currentHost4.png pngs += uml/lease-states.png pngs += uml/main-loop.png pngs += uml/packet4.png +pngs += uml/recognizing-same-client.png pngs += uml/request4-lease.png pngs += uml/request4.png pngs += uml/requestLease4.png @@ -134,6 +136,7 @@ svgs += uml/currentHost4.svg svgs += uml/lease-states.svg svgs += uml/main-loop.svg svgs += uml/packet4.svg +svgs += uml/recognizing-same-client.svg svgs += uml/request4-lease.svg svgs += uml/request4.svg svgs += uml/requestLease4.svg diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index adcf25aeb7..6c4d99c3b6 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -4170,6 +4170,9 @@ identifier which is different from the client identifier used by the client, the lease will be assumed to belong to another client and a new lease will be allocated. +For a more visual representation of how Kea recognizes the same client, +check :ref:`uml-recognizing-same-client`. + .. _dhcp4-authoritative: Authoritative DHCPv4 Server Behavior diff --git a/doc/sphinx/uml/recognizing-same-client.png b/doc/sphinx/uml/recognizing-same-client.png new file mode 100644 index 0000000000..eeadd87a86 Binary files /dev/null and b/doc/sphinx/uml/recognizing-same-client.png differ diff --git a/doc/sphinx/uml/recognizing-same-client.svg b/doc/sphinx/uml/recognizing-same-client.svg new file mode 100644 index 0000000000..bb7cf5545c --- /dev/null +++ b/doc/sphinx/uml/recognizing-same-client.svg @@ -0,0 +1,216 @@ + + + + How Kea Recognizes the Same Client In Different DHCP Messages (Kea 2.4.0) + libdhcp_flex_id.so is used + yes + no + replace-client-id is true (the default) + yes + no + Client is recognized + by the result of the + identifier + expression in + libdhcp_flex_id.so. + client has a reservation + yes + no + for the purpose + of acquiring a reservation + for the purpose + of leasing outside a + reservation or acquiring + any other value outside + of reservations + Client is recognized + by the result of the + identifier + expression in + libdhcp_flex_id.so. + Go through the + diagram from the + beginning as if + libdhcp_flex_id.so + is unused. + Go through the + diagram from the + beginning as if + libdhcp_flex_id.so + is unused. + DHCPv4 + or + DHCPv6? + DHCPv4 + DHCPv6 + MAC + address is + present + yes + no + match-client-id + is true + (the default) + yes + client ID option (code 61) is present + yes + Client is recognized + by the client ID + option (code 61). + Client is recognized + by the MAC address. + Client is recognized + by the MAC address. + DHCP message is not + well formed. + client ID + option (code 1) is + present + yes + no + interested in + identifying as a + single client - + the device or + the lease + device + lease + Client is recognized + by the client ID + option (code 1) aka + DUID. + Client is recognized + by the tuple + <DUID, IA-type, IAID>. + DHCP message is not + well formed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/sphinx/uml/recognizing-same-client.uml b/doc/sphinx/uml/recognizing-same-client.uml new file mode 100644 index 0000000000..15b7c4fab6 --- /dev/null +++ b/doc/sphinx/uml/recognizing-same-client.uml @@ -0,0 +1,113 @@ +@startuml + +/' +This UML uses the new syntax of activity diagrams from plantuml. +Unfortunately, it also results in a more wide spread of the resulting +visual diagram, so wide that it becomes unreadable when automatically +scaled down in the ARM. This is the reason for the aggressive word +wrapping below - to force the diagram to be longer and less wide, and +as a result - more readable. +'/ + +start + +title How Kea Recognizes the Same Client In Different DHCP Messages (Kea 2.4.0) + +if (libdhcp_flex_id.so is used) then (yes) + if (replace-client-id is true (the default)) then (yes) + #palegreen:Client is recognized + by the result of the + identifier + expression in + libdhcp_flex_id.so.; + stop + else (no) + if (client has a reservation) then (yes) + if () then (for the purpose +of acquiring a reservation) + #palegreen:Client is recognized + by the result of the + identifier + expression in + libdhcp_flex_id.so.; + stop + else (for the purpose +of leasing outside a +reservation or acquiring +any other value outside +of reservations) + :Go through the + diagram from the + beginning as if + libdhcp_flex_id.so + is unused.; + stop + endif + else (no) + :Go through the + diagram from the + beginning as if + libdhcp_flex_id.so + is unused.; + stop + endif + endif +else (no) + if (DHCPv4 +or +DHCPv6?) then (DHCPv4) + if (MAC +address is +present) then (yes) + if (match-client-id +is true +(the default)) then (yes) + if (client ID option (code 61) is present) then (yes) + #palegreen:Client is recognized + by the client ID + option (code 61).; + stop + else + #palegreen:Client is recognized + by the MAC address.; + stop + endif + else + #palegreen:Client is recognized + by the MAC address.; + stop + endif + else (no) + #pink:DHCP message is not + well formed.; + stop + endif + else (DHCPv6) + if (client ID +option (code 1) is +present) then (yes) + if (interested in +identifying as a +single client - +the device or +the lease) then (device) + #palegreen:Client is recognized + by the client ID + option (code 1) aka + DUID.; + stop + else (lease) + #palegreen:Client is recognized + by the tuple + .; + stop + endif + else (no) + #pink:DHCP message is not + well formed.; + stop + endif + endif +endif + +@enduml diff --git a/doc/sphinx/umls.rst b/doc/sphinx/umls.rst index 105431064e..79f91ccb66 100644 --- a/doc/sphinx/umls.rst +++ b/doc/sphinx/umls.rst @@ -144,3 +144,14 @@ Before sending a response, options are added: .. figure:: uml/appendRequestedVendorOptions.* The appendRequestedVendorOptions (append vendor requested options) algorithm + + +.. _uml-recognizing-same-client: + +How Kea Recognizes the Same Client In Different DHCP Messages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. + Use the PNG, because, for some reason, the SVG has missing text. + +.. figure:: uml/recognizing-same-client.png