Babel over DTLS requires some changes to how Babel operates. First, DTLS is a client-server protocol, while Babel is a peer-to-peer protocol. Second, DTLS can only protect unicast communication, while Babel packets can be sent to both unicast and multicast destinations.
Babel over DTLS operates on a different port than unencrypted Babel. All Babel over DTLS nodes
MUST act as DTLS servers on a given UDP port and
MUST listen for unencrypted Babel traffic on another UDP port, which
MUST be distinct from the first one. The default port for Babel over DTLS is registered with IANA as the "babel-dtls" port (UDP port 6699, see
Section 4), and the port exchanging unencrypted Babel traffic is registered as the "babel" port (UDP port 6696, see
Section 5 of
RFC 8966).
When a Babel node discovers a new neighbour (generally by receiving an unencrypted multicast Babel packet), it compares the neighbour's IP address with its own, using network byte ordering. If a node's address is lower than the recently discovered neighbour's address, it acts as a client and connects to the neighbour. In other words, the node with the lowest address is the DTLS client for this pairwise relationship. As an example, fe80::1:2 is considered lower than fe80::2:1.
The node acting as DTLS client initiates its DTLS connection from an ephemeral UDP port. Nodes
SHOULD ensure that new client DTLS connections use different ephemeral ports from recently used connections to allow servers to differentiate between the new and old DTLS connections. Alternatively, nodes could use DTLS connection identifiers [
DTLS-CID] as a higher-entropy mechanism to distinguish between connections.
When a node receives a new DTLS connection, it
MUST verify that the source IP address is either an IPv6 link-local address or an IPv4 address belonging to the local network; if it is neither, it
MUST reject the connection. Nodes use mutual authentication (authenticating both client and server); clients
MUST authenticate servers and servers
MUST authenticate clients. Implementations
MUST support authenticating peers against a local store of credentials. If either node fails to authenticate its peer against its local policy, it
MUST abort the DTLS handshake. The guidance given in [
BCP195]
MUST be followed to avoid attacks on DTLS. Additionally, nodes
MUST only negotiate DTLS version 1.2 or higher. Nodes
MUST use DTLS replay protection to prevent attackers from replaying stale information. Nodes
SHOULD drop packets that have been reordered by more than two IHU (I Heard You) intervals, to avoid letting attackers make stale information last longer. If a node receives a new DTLS connection from a neighbour to whom it already has a connection, the node
MUST NOT discard the older connection until it has completed the handshake of the new one and validated the identity of the peer.
Babel over DTLS sends all unicast Babel packets protected by DTLS. The entire Babel packet, from the Magic byte at the start of the Babel header to the last byte of the Babel packet trailer, is sent protected by DTLS.
When sending packets, Babel over DTLS nodes
MUST NOT send any TLVs over the unprotected "babel" port, with the exception of Hello TLVs without the Unicast flag set. Babel over DTLS nodes
MUST NOT send any unprotected unicast packets. This ensures the confidentiality of the information sent in Babel packets (e.g., the network topology) by only sending it encrypted by DTLS. Unless some out-of-band neighbour discovery mechanism is available, nodes
SHOULD periodically send unprotected Multicast Hellos to ensure discovery of new neighbours. In order to maintain bidirectional reachability, nodes can either rely entirely on unprotected Multicast Hellos, or send protected Unicast Hellos in addition to the Multicast Hellos.
Since Babel over DTLS only protects unicast packets, implementors may implement Babel over DTLS by modifying an implementation of Babel without DTLS support and replacing any TLV previously sent over multicast with a separate TLV sent over unicast for each neighbour. TLVs previously sent over multicast can be replaced with the same contents over unicast, with the exception of Hellos as described above. Some implementations could also change the contents of IHU TLVs when converting to unicast in order to remove redundant information.
Babel over DTLS nodes can receive Babel packets either protected over a DTLS connection or unprotected directly over the "babel" port. To ensure the security properties of this mechanism, unprotected packets are treated differently. Nodes
MUST silently ignore any unprotected packet sent over unicast. When parsing an unprotected packet, a node
MUST silently ignore all TLVs that are not of type Hello. Nodes
MUST also silently ignore any unprotected Hello with the Unicast flag set. Note that receiving an unprotected packet can still be used to discover new neighbours, even when all TLVs in that packet are silently ignored.
It is
RECOMMENDED for nodes to associate the state of their DTLS connection with their neighbour table. When a neighbour entry is flushed from the neighbour table (
Appendix A of
RFC 8966), its associated DTLS state
SHOULD be discarded. The node
SHOULD send a DTLS close_notify alert to the neighbour if it believes the link is still viable.
Implementations
MAY implement both Babel over DTLS and unprotected Babel. Additionally, a node
MAY simultaneously run both Babel over DTLS and unprotected Babel. However, a node running both
MUST ensure that it runs them on separate interfaces, as the security properties of Babel over DTLS rely on ignoring unprotected Babel packets (other than Multicast Hellos). An implementation
MAY offer configuration options to allow unprotected Babel on some interfaces but not others, which effectively gives nodes on that interface the same access as authenticated nodes; however, this
SHOULD NOT be done unless that interface has a mechanism to authenticate nodes at a lower layer (e.g., IPsec).
If Babel over DTLS and unprotected Babel are both operated on the same network, the Babel over DTLS implementation will receive unprotected Multicast Hellos and attempt to initiate a DTLS connection. These connection attempts can be sent to nodes that only run unprotected Babel, who will not respond. Babel over DTLS implementations
SHOULD therefore rate-limit their DTLS connection attempts to avoid causing undue load on the network.