A YANG Data Model for Babel
Extracted elements (30)
A Babel router can auto-detect wired (eth0) vs. wireless (wlan0) interface parameters: wired defaults to two-out-of-three metric algorithm and split-horizon true, while wireless defaults to etx and split-horizon false. Tunnel interfaces require explicit configuration. This allows minimal YANG configuration for common cases.
The 'default-apply' boolean on both mac-key-set and dtls objects enables automatic propagation of security credentials to newly created interfaces, reducing the risk of an interface being inadvertently left unsecured when added to a router already using MAC or DTLS.
The information model (RFC 9046) mandates certain read-only attributes (e.g., babel-implementation-version, babel-self-router-id), but YANG has no mechanism to mandate that a config-false leaf be present; implementations must ensure these attributes are present when the protocol is enabled.
The statistics reset action is scoped to individual interface statistics containers rather than being system-wide (as in the RFC 9046 information model) because YANG associates actions with their enclosing container. Implementations wanting system-wide reset must call the action for every interface instance.
The YANG module augments ietf-routing (RFC 8349) rather than defining a standalone module, providing a common building block for routes and RIBs. This approach allows Babel to share infrastructure with other routing protocol YANG models.
The dtls-cached-info boolean enables the cached_info TLS extension for inclusion in ClientHello and ServerHello messages; this corresponds to behavior defined in RFC 8968 (Babel over DTLS) Appendix A. The dtls-cert-prefer list populates TLS certificate type extensions during handshaking.
The YANG module is defined using YANG 1.1 (RFC 7950) and is compatible with the Network Management Datastore Architecture (NMDA, RFC 8342). It is based on the Babel information model (RFC 9046) and only includes data nodes useful for managing Babel over IPv6.
At least one of calculated-metric or received-metric MUST be non-NULL for each route object.
For HMAC-based MAC algorithms, the key value length MUST be between 0 and an upper limit at least the size of the output length (32 octets for HMAC-SHA256). For BLAKE2s-128, the length MUST be between 0 and 32 bytes inclusive.
The certificate name value MUST NOT be empty and can only be provided when the instance is created (not subsequently writable). The certificate type value MUST be one of the identities listed with base 'dtls-cert-types'.
The exp-mcast-hello-seqno leaf MUST be NULL if multicast Hello packets are not expected or processing of multicast packets is not enabled. Similarly, exp-ucast-hello-seqno and ucast-hello-seqno MUST be NULL if unicast Hellos are not expected or not being sent.
The metric-algorithm leaf on each interface is mandatory and its value MUST be one of the identities derived from metric-comp-algorithms.
The packet-log leaf SHOULD support the libpcap file format with .pcap file extension for packet log files.
A 'test' action on each MAC key object accepts a test-string (binary) and mac (binary) as input and returns an indication (boolean) of whether the MAC computed by the implementation over the test-string matches the provided mac.
The 'constants' container under the babel container holds udp-port (default 6696, type inet:port-number) and mcast-group (default ff02::1:6, type inet:ip-address), defining the UDP port and IPv6 multicast group for Babel message exchange.
The 'dtls-cert-prefer' leaf-list (ordered-by user) on each interface holds leafrefs to ../../dtls/certs/type; it populates the server_certificate_type extension in ClientHello, while entries with a non-empty private key populate the client_certificate_type extension.
The 'dtls' list (keyed by name) contains a 'certs' sub-list with mandatory fields value (PEM-format string, nacm:default-deny-write), type (identityref from dtls-cert-types), private-key (binary, nacm:default-deny-all), and algorithm (identityref). The 'default-apply' boolean is mandatory.
The ietf-babel YANG module augments /rt:routing/rt:control-plane-protocols/rt:control-plane-protocol with a 'babel' presence container. The top-level container holds version (read-only string), enable (mandatory boolean), router-id (read-only 8-octet binary), seqno (read-only uint16), and statistics-enabled (boolean).
The 'interfaces' list (keyed by 'reference', an if:interface-ref) configures per-interface Babel behavior including metric-algorithm (mandatory identityref from metric-comp-algorithms), split-horizon, mcast-hello-interval, update-interval (both in centiseconds), and enable/disable flags for MAC and DTLS security.
The 'mac-key-set' list (keyed by name) contains a 'keys' sub-list with mandatory fields use-send, use-verify, value (binary, nacm:default-deny-all), and algorithm (identityref from mac-algorithms). The 'default-apply' boolean controls whether the key set is automatically applied to new interfaces.
The module defines feature guards: two-out-of-three-supported, etx-supported, mac-supported, dtls-supported, hmac-sha256-supported, blake2s-supported, x-509-supported, and raw-public-key-supported. Identities metric-comp-algorithms (base for two-out-of-three and etx), mac-algorithms (base for hmac-sha256 and blake2s), and dtls-cert-types (base for x-509 and raw-public-key) are defined.
The 'neighbor-objects' list (config false, keyed by neighbor-address) within each interface entry tracks per-neighbor state: hello-mcast-history, hello-ucast-history (hex strings), txcost (int32), exp-mcast-hello-seqno, exp-ucast-hello-seqno, ucast-hello-seqno (all union of null enum and uint16), ucast-hello-interval (centiseconds), rxcost (uint16), and cost (int32).
The 'routes' grouping (config false) provides a list keyed by ip-prefix with fields: router-id (8-byte binary), neighbor (leafref), received-metric (union of null enum and uint16), calculated-metric (union of null enum and uint16), seqno (uint16), next-hop (union of null enum and ip-address), feasible (boolean), and selected (boolean).
The 'statistics' container (config false) under each interface includes counter32 leaves for sent-mcast-hello, sent-mcast-update, sent-ucast-hello, sent-ucast-update, sent-ihu, and received-packets, plus a mandatory discontinuity-time (date-and-time) and a 'reset' action that takes reset-at (date-and-time) and returns reset-finished-at.
IANA has registered the URI 'urn:ietf:params:xml:ns:yang:ietf-babel' in the 'ns' registry of the IETF XML Registry (RFC 3688).
IANA has registered the YANG module name 'ietf-babel' with namespace 'urn:ietf:params:xml:ns:yang:ietf-babel' and prefix 'babel' in the YANG Module Names registry (RFC 6020).
Implementations SHOULD use a constant-time comparison between the input MAC and the locally generated MAC value in the 'test' action to avoid side-channel leakage that could reveal the MAC key to an attacker who does not know it.
Read access to config-false 'babel' nodes can disclose the network topology, and the routes used by a device may enable subsequent attacks on traffic. Access to these nodes must be controlled via NACM (RFC 8341) through NETCONF or RESTCONF with mandatory secure transport (SSH, TLS, or QUIC).
The MAC key value leaf carries nacm:default-deny-all and the DTLS private-key leaf also carries nacm:default-deny-all, making these sensitive credentials unreadable via NETCONF/RESTCONF by default. The 'babel/hmac' and 'babel/dtls' subtrees influence whether incoming and outgoing packets are trusted.
Writable nodes under 'babel', 'babel/constants', and 'babel/interfaces' can disrupt network operations if misconfigured without proper access control. Enabling packet logging without controlling access to log files gives attackers detailed network topology knowledge.