dhcp6.dox 4.17 KB
 Tomek Mrugalski committed Oct 01, 2012 1 /**  Tomek Mrugalski committed Oct 12, 2012 2  @page dhcp6 DHCPv6 Server Component  Tomek Mrugalski committed Oct 01, 2012 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  BIND10 offers DHCPv6 server implementation. It is implemented as b10-dhcp6 component. Its primary code is located in isc::dhcp::Dhcpv6Srv class. It uses \ref libdhcp extensively, especially lib::dhcp::Pkt6, isc::dhcp::Option and isc::dhcp::IfaceMgr classes. Currently this code offers skeleton functionality, i.e. it is able to receive and process incoming requests and trasmit responses. However, it does not have database management, so it returns only one, hardcoded lease to whoever asks for it. DHCPv6 server component does not support relayed traffic yet, as support for relay decapsulation is not implemented yet. DHCPv6 server component does not use BIND10 logging yet.  Stephen Morris committed Dec 10, 2012 19  @section dhcpv6Session BIND10 message queue integration  Tomek Mrugalski committed Oct 01, 2012 20 21 22 23 24  DHCPv4 server component is now integrated with BIND10 message queue. It follows the same principle as DHCPv4. See \ref dhcpv4Session for details.  Stephen Morris committed Dec 10, 2012 25  @section dhcpv6ConfigParser Configuration Parser in DHCPv6  Tomek Mrugalski committed Oct 01, 2012 26 27  b10-dhcp6 component uses BIND10 cfgmgr for commands and configuration. During  Tomek Mrugalski committed Oct 01, 2012 28 29 30 31 32 33 34  initial configuration (See \ref isc::dhcp::ControlledDhcpv6Srv::establishSession()), the configuration handler callback is installed (see isc::dhcp::ControlledDhcpv6Srv::dhcp6ConfigHandler(). It is called every time there is a new configuration. In particular, it is called every time during daemon start process. It contains a isc::data::ConstElementPtr to a new configuration. This simple handler calls \ref isc::dhcp::configureDhcp6Server() method that processes received configuration.  Tomek Mrugalski committed Oct 01, 2012 35   Tomek Mrugalski committed Oct 01, 2012 36 37  This method iterates over list of received configuration elements and creates a list of parsers for each received entry. Parser is an object that is derived  Marcin Siodelski committed Dec 21, 2012 38  from a DhcpConfigParser class. Once a parser is created  Tomek Mrugalski committed Oct 01, 2012 39 40 41  (constructor), its value is set (using build() method). Once all parsers are build, the configuration is then applied ("commited") and commit() method is called.  Tomek Mrugalski committed Oct 01, 2012 42   Tomek Mrugalski committed Oct 01, 2012 43  All parsers are defined in src/bin/dhcp6/config_parser.cc file. Some of them  Marcin Siodelski committed Dec 21, 2012 44 45 46 47 48 49 50  are generic (e.g. Uint32Parser that is able to handle any unsigned 32 bit integer), but some are very specialized (e.g. Subnets6ListConfigParser parses definitions of Subnet6 lists). In some cases, e.g. subnet6 definitions, the configuration entry is not a simple value, but a map or a list itself. In such case, the parser iterates over all elements and creates parsers for a given scope. This process may be repeated (sort of) recursively.  Tomek Mrugalski committed Oct 01, 2012 51   Stephen Morris committed Dec 10, 2012 52  @section dhcpv6ConfigInherit DHCPv6 Configuration Inheritance  Tomek Mrugalski committed Oct 01, 2012 53   Tomek Mrugalski committed Oct 25, 2012 54  One notable useful feature of DHCP configuration is its parameter inheritance.  Tomek Mrugalski committed Oct 01, 2012 55 56 57  For example, renew-timer value may be specified at a global scope and it then applies to all subnets. However, some subnets may have it overwritten with more specific values that takes precedence over global values that are considered  Marcin Siodelski committed Dec 21, 2012 58 59 60 61 62 63 64  defaults. Some parsers (e.g. Uint32Parser and StringParser) implement that inheritance. By default, they store values in global uint32_defaults and string_defaults storages. However, it is possible to instruct them to store parsed values in more specific storages. That capability is used, e.g. in Subnet6ConfigParser that has its own storage that is unique for each subnet. Finally, during commit phase (commit() method), appropriate parsers can use apply parameter inheritance.  Tomek Mrugalski committed Oct 01, 2012 65 66  Debugging configuration parser may be confusing. Therefore there is a special  Marcin Siodelski committed Dec 21, 2012 67  class called DebugParser. It does not configure anything, but just  Tomek Mrugalski committed Oct 01, 2012 68 69  accepts any parameter of any type. If requested to commit configuration, it will print out received parameter name and its value. This class is not currently used,  Tomek Mrugalski committed Oct 01, 2012 70 71 72 73 74 75 76 77 78  but it is convenient to have it every time a new parameter is added to DHCP configuration. For that purpose it should be left in the code. Parameter inheritance is done during reconfiguration phase, as reconfigurations are rare, so extra logic here is not a problem. On the other hand, values of those parameters may be used thousands times per second, so its use must be as simple as possible. In fact, currently the code has to call Subnet6->getT1() and do not implement any fancy inheritance logic.  Marcin Siodelski committed Oct 30, 2012 79 80  @todo Add section about setting up options and their definitions with bindctl.  Tomek Mrugalski committed Oct 01, 2012 81  */