[bind10-dev] CCSession question

Tomek Mrugalski tomasz at isc.org
Wed Sep 26 17:51:30 UTC 2012


Hi,
This is posted to bind10-dev, not to bind10-dhcp, as it is a generic
question about configuration, rather than DHCP-specific stuff. Perhaps
such discussions should be cross-posted?

I'm working on configuration code for b10-dhcp6. I have written
configuration parser that is able to parse the configuration. However,
there's a problem when bind10 (or just the b10-dhcp6 module) is
restarted. Let me explain the nature of the issue:

There are 4 integer parameters frequently used in DHCPv6: renew-timer,
rebind-timer, preferred-lifetime and valid-lifetime. Since the issue is
common for all of them, I will focus on renew-timer for simplicity.

Typical DHCP server serves many subnets. Usually, renew-timer is the
same for all subnets, but sometimes one subnet needs some tweaking. ISC
DHCP solves that problem with allowing user to define renew-timer in a
global scope and override its value in specific subnet, if needed. For
easier transition from DHCP4 to BIND10, we need to retain that approach.

Translated to BIND10 nomenclature, it means that we have
Dhcp6/renew-timer entry of type integer and a default value of 1000.
There is a subnet6 list that contains entries for specific subnets. Each
subnet may have its own renew-timer value. An example simple
configuration looks as follows:

> config show Dhcp6
Dhcp6/interface/	list	(default)
Dhcp6/renew-timer	1000	integer	(default)
Dhcp6/rebind-timer	2000	integer	(default)
Dhcp6/preferred-lifetime	3000	integer	(default)
Dhcp6/valid-lifetime	4000	integer	(default)
Dhcp6/subnet6/	list	
> config show Dhcp6/subnet6
Dhcp6/subnet6[0]/subnet	"2001:db8:1::/64"	string	
Dhcp6/subnet6[0]/renew-timer	1000	integer	(default)
Dhcp6/subnet6[0]/rebind-timer	2000	integer	(default)
Dhcp6/subnet6[0]/preferred-lifetime	3000	integer	(default)
Dhcp6/subnet6[0]/valid-lifetime	7200	integer	(default)
Dhcp6/subnet6[0]/pool/	list	

When I start bind10 with no configuration, add the configuration as
above, and then type config commit, my config_handler function will get
the whole configuration and I will be able to parse it as needed.

The problem occurs, when I stop and start bind10. As soon as I create
ModuleCCSession(), it will call my config_handler, but will pass only
part of the configuration (without any fields that have default values).
In this particular example, I receive only:

{ "subnet6": [ { "pool": [ "2001:db8:1::1 - 2001:db8:1::ffff" ],
"subnet": "2001:db8:1::/64" } ] }

My parser does not know values of renew-timer, so I can't really
configure subnets.

How can I make this work? First possible solution would be to tell
ModuleCCSession() to not send the configuration. As soon as the session
module is created, I call configureDhcp6Server() with
config_session_->getFullConfig() anyway. Second possible approach would
be to tell ModuleCCSession() somehow to send me the full configuration,
including defaults.

Third possible (but ugly) solution would be to have the capability to
query configuration somehow. Even though I received only subnet6, I
could check "is there Dhcp6/renew-timer?" and get the default value of
it. That would work for me.

Fourth solution would to change spec file to not allow default values,
but require user to always explicitly define them. That would be very
bad choice, as it would penalize user's experience due to limitations of
our framework.

I'd love to hear your comments and suggestions on that matter.

Tomek

p.s.
If you are interested in the details, the configuration handler
(ControlledDhcpv6Srv::dhcp6ConfigHandler) is in
src/bin/dhcp6/ctrl_dhcp6_srv.cc:48. It is a dummy wrapper around
configureDhcp6Server that is in src/bin/dhcp6/config_parser.cc:470.
I'm not sure if that is useful, but my config_handler is called from
ModuleCCSession constructor, from handleConfigUpdate(new_config) in line
474 in src/lib/config/ccsession.cc. If you are interested, the code is
on branch trac2269.


More information about the bind10-dev mailing list