dhcp4o6.dox 2.97 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

/**
 @page dhcpv4o6Dhcp6 DHCPv4-over-DHCPv6 DHCPv6 Server Side

Kea supports DHCPv4-over-DHCPv6 using cooperating DHCPv6 and DHCPv4
11
12
servers. This section describes the DHCPv6 server side. For its
DHCPv6 counter-part, see @ref dhcpv4o6Dhcp4.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

@section dhcp6to4Ipc DHCPv6-to-DHCPv4 Inter Process Communication

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

@section dhcp6to4Process 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) @ref
  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 (@c IfaceMgr) using the external socket
  mechanism invokes @ref isc::dhcp::Dhcp6to4Ipc::handler

- @ref isc::dhcp::Dhcp6to4Ipc::handler receives the packet by
  (inherited) @ref 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
  (@ref dhcpv6HooksBuffer6Send). 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

@section dhcp6SubnetSelection DHCPv6 Subnet Selection

@todo Move this to libdhcpsrv

Selectors (i.e., members of @c SubnetSelector class) are:
- incoming interface name
- remote address
- first relay link address - undefined or the first relay link address which
  is not undefined or link local (i.e., usable)
- interface ID - when a relay message includes an interface ID relay option
- client classes - used to reject a matching rule and try next rules

If the first relay link address is undefined the client is directly connected:
the interface name is matched and if it does not select a subnet the remote
address is matched in a subnet address range.

If the first relay link address is not undefined the query was relayed:
the interface ID is tried and if it does not select a subnet the first
relay address is matched as a subnet relay address.

*/