dhcp6.dox 4.3 KB

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