Kea 2.6.0
DHCPv4-over-DHCPv6 DHCPv6 Server Side

Kea supports DHCPv4-over-DHCPv6 using cooperating DHCPv6 and DHCPv4 servers.

This section describes the DHCPv6 server side. For its DHCPv6 counter-part, see DHCPv4-over-DHCPv6 DHCPv4 Server Side.

DHCPv6-to-DHCPv4 Inter Process Communication

The Dhcp6to4Ipc class is derived from the base Dhcp4o6IpcBase as a singleton class (by the static isc::dhcp::Dhcp6to4Ipc::instance function). isc::dhcp::Dhcp6to4Ipc::open is called to open IPC UDP sockets and to register isc::dhcp::Dhcp6to4Ipc::handler on external sockets on the IfaceMgr.

DHCPv6-to-DHCPv4 Packet Processing

Following the DHCPv4-over-DHCPv6 packet flow:

  • a DHCPv6 DHCPv4-QUERY is received from a DHCPv4-over-DHCPv6 client (standard incoming DHCPv6 message processing is done until the message type specific part)
  • the isc::dhcp::Dhcpv6Srv::processDhcp4Query method which verifies a DHCPv4 message option is present and calls the (inherited) isc::dhcp::Dhcp4o6IpcBase::send method to transmit the DHCPv4-QUERY with the interface name and remote IPv6 address to the DHCPv4 server
  • the DHCPv4 server processes the DHCPv4-QUERY and returns a DHCPv4-RESPONSE using the IPC
  • the interface manager (IfaceMgr) using the external socket mechanism invokes isc::dhcp::Dhcp6to4Ipc::handler
  • isc::dhcp::Dhcp6to4Ipc::handler receives the packet by (inherited) isc::dhcp::Dhcp4o6IpcBase::receive which decodes and strips the ISC Vendor option. From this point the code mimics the sending part of standard DHCPv6 packet processing.
  • the callouts registered for "buffer6_send" hook point are called (buffer6_send). Note the "pkt6_send" hook is not used because the matching query packet is not available
  • the DHCPv6 DHCPv4-RESPONSE packet is sent back to the IPv6 remote address