Internet-Draft | Babel-MAC Relaxed PC | June 2023 |
Chroboczek & Høiland-Jørgensen | Expires 14 December 2023 | [Page] |
This document relaxes packet verification rules defined in the Babel MAC Authentication protocol in order to make it more robust in the presence of packet reordering. This document updates RFC 8967 by relaxing the packet validation rules defined therein.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 14 December 2023.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The design of the Babel MAC authentication mechanism [RFC8967] assumes that packet reordering is an exceptional occurrence, and the protocol drops any packets that arrive out-of-order. The assumption that packets are not routinely reordered is generally correct on wired links, but turns out to be incorrect on some kinds of wireless links.¶
In particular, IEEE 802.11 (Wi-Fi) [IEEE80211] defines a number of power-saving modes that allow stations (mobile nodes) to switch their radio off for extended periods of time, ranging in the hundreds of milliseconds. The access point (network switch) buffers all multicast packets, and only sends them out after the power-saving interval ends. The result is that multicast packets are delayed by up to a few hundred milliseconds with respect to unicast packets, which, under some traffic patterns, causes the Packet Counter (PC) verification procedure in RFC 8967 to systematically fail for multicast packets.¶
This document defines two distinct ways to relax the PC validation: using two separate receiver-side states, one for unicast and one for multicast packets (Section 3.1), which allows arbitrary reordering between unicast and multicast packets, and using a window of previously received PC values (Section 3.2), which allows a bounded amount of reordering between arbitrary packets. We assume that reordering between arbitrary packets only happens occasionally, and, since Babel is designed to gracefully deal with occasional packet loss, usage of the former mechanism is RECOMMENDED, while usage of the latter is OPTIONAL. The two mechanisms MAY be used simultaneously (Section 3.3).¶
This document updates RFC 8967 by relaxing the packet validation rules defined therein. It does not change the security properties of the protocol.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The Babel MAC authentication mechanism prevents replay by decorating every sent packet with a strictly increasing value, the Packet Counter (PC). Notwithstanding the name, the PC does not actually count packets: a sender is permitted to increment the PC by more than one between two packets.¶
A receiver maintains the highest PC received from each neighbour. When a new packet is received, the receiver compares the PC contained in the packet with the highest received PC; if the new value is smaller or equal, the packet is discarded; otherwise, the packet is accepted, and the highest PC value for that neighbour is updated.¶
Note that there does not exist a one-to-one correspondence between sender states and receiver states: multiple receiver states track a single sender state. The receiver states corresponding to single sender state are not necessarily identical, since only a subset of receiver states are updated when a packet is sent to a unicast address or when a multicast packet is received by a subset of the receivers.¶
Instead of a single highest PC value maintained for each neighbour, an implementation of the procedure described in this section uses two values, the highest multicast value PCm and the highest non-multicast (unicast) value PCu. More precisely, the (Index, PC) pair contained in the neighbour table (Section 3.2 of [RFC8967]) is replaced by:¶
When a challenge reply is successful, both highest PC values are updated to the value contained in the PC TLV from the packet containing the successful challenge. More precisely, the last sentence of the fourth bullet point of Section 4.3 of [RFC8967] is replaced by:¶
When a packet that does not contain a successful challenge reply is received, the PC value that it contains is compared to either the PCu or the PCm field of the corresponding neighbour entry, depending on whether the packet was sent to a muticast address or not. If the comparison is successful, then the same value (PCm or PCu) is updated. More precisely, the last bullet point of Section 4.3 of [RFC8967] is replaced by:¶
Modern networking hardware tends to maintain more than just two queues, and it might be tempting to generalise the approach taken to more than just two last PC values. For example, one might be tempted to use distinct last PC values for packets received with different values of the Type of Service (ToS) field, or with different IEEE 802.11 [IEEE80211] access categories. However, choosing a highest PC field by consulting a value that is not protected by the MAC (Section 4.1 of [RFC8967]) would no longer protect against replay. In effect, this means that only the destination address and port number and data stored in the packet body may be used for choosing the highest PC value, since these are the only fields that are protected by the MAC (in addition to the source address and port number, which are already used when choosing the neighbour table entry and therefore provide no additional information). Since Babel implementations do not usually send packets with differing ToS values or IEEE 802.11 access categories, this is unlikely to be an issue in practice.¶
The following example shows why it would be unsafe to select the highest PC depending on the ToS field. Suppose that a node B were to maintain distinct highest PC values for different values T1 and T2 of the ToS field, and that initially all of the highest PC fields at B have value 42. Suppose now that a node A sends a packet P1 with ToS equal to T1 and PC equal to 43; when B receives the packet, it sets the highest PC value associated with ToS T1 to 43. If an attacker were now to send an exact copy of P1 but with ToS equal to T2, B would consult the highest PC value associated with T2, which is still equal to 42, and accept the replayed packet.¶
Window-based validation is similar to what is described in Section 3.4.3 of [RFC4303]. When using window-based validation, in addition to retaining within its neighbour table the highest PC value PCh seen from every neighbour, an implementation maintains a fixed-size window of booleans corresponding to PC values directly below PCh. More precisely, the (Index, PC) pair contained in the neighbour table (Section 3.2 of [RFC8967]) is replaced by:¶
The window is a vector of S boolean values numbered from 0 (the "left edge" of the window) up to S-1 (the "right edge"); the boolean associated with the index i indicates whether a packet with PC value (PCh - (S-1) + i) has been seen before. Shifting the window to the left by an integer amount k is defined as moving all values so that the value previously at index n is now at index (n - k); k values are discarded at the left edge, and k new unset values are inserted at the right edge.¶
Whenever a packet is received, the receiver computes its index i = (PC - PCh + S - 1). It then proceeds as follows:¶
When receiving a successful Challenge Reply, the remembered highest PC value PCh MUST be set to the value received in the challenge reply, and all of the values in the window MUST be reset except the value at index S - 1, which MUST be set.¶
The two techniques described above serve complementary purposes: splitting the state allows multicast packets to be reordered with respect to unicast ones by an arbitrary number of PC values, while the window-based technique allows arbitrary packets to be reordered but only by a bounded number of PC values. Thus, they can profitably be combined.¶
An implementation that uses both techniques MUST maintain, for every entry of the neighbour table, two distinct windows, one for multicast and one for unicast packets. When a successful challenge reply is received, both windows MUST be reset. When a packet that does not contain a challenge reply is received, then if the packet's destination address is a multicast address, the multicast window MUST be consulted and possibly updated, as described in Section 3.2; otherwise, the unicast window MUST be consulted and possibly updated.¶
The procedures described in this document do not change the security properties described in Section 1.2 of RFC 8967. In particular, the choice between the multicast and the unicast packet counter is done by examining a packet's destination IP address, which is included in the pseudo-header and therefore participates in MAC computation; hence, an attacker cannot change the destination address without invalidating the MAC, and therefore cannot replay a unicast packet as a multicast one or vice versa.¶
While these procedures do slightly increase the amount of per-neighbour state maintained by each node, this increase is marginal (between 4 and 36 octets per neighbour, depending on implementation choices), and should not significantly impact the ability of nodes to survive denial-of-service attacks.¶
This document requires no IANA actions.¶
The authors are greatly indebted to Daniel Gröber, who first identified the problem that document aims to solve and first suggested the solution described in Section 3.1.¶