Skip to content

Commit 9d52e2f

Browse files
authored
doc: clarify SCMP reality vs. ambition (scionproto#4533)
The SCMP "specification" document described support for SCMP as mandatory. Furthermore, it mandates the use of SPAO+DRKey authentication for SCMPs. This does not correspond to what is currently implemented. SCMP support has been treated as at least semi-optional e.g. in discussions around the dispatcher-less end host stack. Regarding the authentication, there is no full implementation of this neither in router (support in "our" router is experimental/demo-level, no other router implementation supports it at all) nor in end hosts (currently, nothing at all). There is not sufficiently clear consensus around this to pretend that we'll realize this ambition shortly. Update the documentation specs to reflect this reality. Move the SCMP authentication description into a design document. Closes scionproto#4528
1 parent a773605 commit 9d52e2f

File tree

4 files changed

+150
-88
lines changed

4 files changed

+150
-88
lines changed

doc/dev/design/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Active
4242
BorderRouter
4343
router-perf-model
4444
router-port-dispatch
45+
scmp-authentication
4546

4647
.. _design-docs-completed:
4748

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
*******************
2+
SCMP Authentication
3+
*******************
4+
5+
- Author(s): Matthias Frei
6+
- Last updated: 2024-05-23
7+
- Discussion at: :issue:`3969`
8+
- Status:
9+
10+
- On hold. No clear consensus that this is the right approach. See "Discussion" section.
11+
- Experimental support in router, added in :issue:`4255`.
12+
13+
14+
Abstract
15+
========
16+
:doc:`SCMP </protocols/scmp>` error messages can potentially be abused by an attacker to signal spurious network errors, attempting to degrade or deny a victim's use of a service or network path.
17+
Employ cryptographic validation to check authenticity and authorization of the sender of an SCMP message.
18+
19+
Background
20+
==========
21+
22+
SCMP error messages can potentially be abused by an attacker to signal spurious network errors.
23+
Implementations of TCP/IP, face a similar challenge with ICMP error messages; in order to avoid acting on fraudulent errors, they carefully validate ICMP messages using their internal state machine and ignore errors that appear unlikely to happen e.g. after the connection has already been established RFC 5927.
24+
QUIC goes even further and simply ignores all ICMP errors, except those related to MTU discovery.
25+
26+
This approach can only mitigate the problem.
27+
Furthermore, this approach is not sufficient in SCION as the applications/transport layer on end hosts are expected to react to events in the network, e.g. path failures, by changing to a different path.
28+
The occurrence of such events is independent of the transport's internal state machine.
29+
This aspect does not exist in IP based internet, where the network will transparently adapt the routing (or not) on faults.
30+
31+
To address this, we use :doc:`/cryptography/drkey` and the :doc:`/protocols/authenticator-option` to authenticate SCMP messages.
32+
33+
Proposal
34+
========
35+
36+
As noted in the :doc:`/protocols/scmp`, support for the SCMP protocol is optional for SCION nodes.
37+
This proposal *mandates* authentication for most SCMP messages.
38+
Should this proposal be adopted, it extends the SCMP specification, and terms MUST/MUST NOT/MAY used below will apply to all SCION nodes with an SCMP implementations.
39+
In other words, SCION nodes either need to implement the additional processing rules for SCMP messages described in this document, or remove SCMP support altogether.
40+
41+
.. _scmp-spao:
42+
43+
SCMP with SCION Packet Authenticator Option
44+
-------------------------------------------
45+
46+
SCMP messages can be authenticated with a MAC based on a symmetric key established with the :ref:`DRKey infrastructure <drkey>`.
47+
The MAC is transported in the :ref:`authenticator-option` End-to-End extension header.
48+
49+
The Authenticator MAC algorithm is AES-CMAC (identifier :code:`0`).
50+
51+
SCMP error messages MUST always be authenticated.
52+
SCMP informational messages MAY optionally be authenticated; a response message
53+
MUST be authenticated if and only if the corresponding request message was
54+
authenticated.
55+
56+
All DRKey keys used here are derived with :ref:`protocol identifier <drkey-protocol-identifiers>` :code:`SCMP`, decimal :code:`1`.
57+
58+
SCMP messages from (and to) routers are authenticated with :ref:`AS-host keys <drkey-as-host>`.
59+
SCMP response messages from a router in AS :math:`D` to a node :math:`H_s` in
60+
AS :math:`S` are authenticated with the DRKey :math:`K_{D,S:H_s}`.
61+
SCMP requests (specifically, :ref:`traceroute-request`) processed by a router
62+
are authenticated with the same key.
63+
64+
SCMP messages between two end-hosts are authenticated with :ref:`host-host keys <drkey-host-host>`.
65+
An SCMP response message from a node :math:`H_d` in AS :math:`D` to a node
66+
:math:`H_s` in AS :math:`S` is authenticated with the key
67+
:math:`K_{D:H_d,S:H_s}`.
68+
SCMP requests and data packets from :math:`H_s` to :math:`H_d` are
69+
authenticated with this same key.
70+
71+
For packets addressed to a router directly (specifically for
72+
:ref:`echo-request` and :ref:`echo-reply`) it is treated like an end-host and
73+
the corresponding host-host keys are used.
74+
75+
.. note::
76+
Recall that :ref:`traceroute-request`\s are *not* addressed to the router.
77+
Instead, the router processes the request if its router alert flag is set.
78+
79+
Processing Rules
80+
----------------
81+
The processing rules for SCMP messages are extended with the following points:
82+
83+
- Every SCMP error message MUST be authenticated.
84+
85+
Every SCMP informational reply message MUST be authenticated if and only if
86+
the corresponding request was authenticated.
87+
88+
.. note::
89+
Consequentially, an implementation without support for SCMP
90+
authentication MUST never send SCMP error messages and MUST NOT reply to
91+
authenticated SCMP informational request messages.
92+
93+
- When an SCMP message is received, the receiver MUST check the
94+
authentication header.
95+
96+
- SCMP error messages without or with an invalid authentication header and
97+
SCMP informational messages with an invalid authentication header MUST
98+
be silently dropped.
99+
100+
- The receiver checks that the :ref:`DRKey identified by the SPI <spao-spi-drkey>`
101+
is appropriate for the SCMP message type and code, as described above in
102+
the section :ref:`scmp-spao`.
103+
104+
- The receiver derives or fetches the relevant key for validation of the MAC.
105+
106+
- Before checking the authentication, and in particular before fetching a
107+
key, the receiver SHOULD check whether the quoted message was possibly
108+
recently sent via/to the originator of the error message.
109+
110+
- The receiver MUST limit the traffic to the control service to fetch keys
111+
for verifying the authentication of an SCMP message.
112+
At most one packet SHOULD be sent to fetch the key for a received SCMP
113+
message. If this fails or is not possible (e.g. because there is no
114+
existing TCP session to the control service), the message SHOULD be
115+
silently dropped.
116+
117+
Compatibility
118+
=============
119+
As SCMP authentication is a new addition, there will be a transition period during which receivers
120+
may accept SCMP error messages without authentication.
121+
122+
Discussion
123+
==========
124+
125+
Even though this proposal had been accepted, it later turned out that there is no strong consensus
126+
to implement this in all routers and end points. For now, this has been put on hold.
127+
Alternative options that can be considered:
128+
129+
- No authentication, expand the heuristics that end hosts apply to detect fraudulent SCMP messages.
130+
- Authenticate only :ref:`external-interface-down` and :ref:`internal-connectivity-down` messages.
131+
If we authenticate only the information about the link that is down (ISD, AS, interface IDs) and a coarse timestamp, we can reuse the same signed message body for link down notifications for some time period, e.g. a few seconds.
132+
Protection against message replay is not a concern for these messages types, as receivers can naturally consider them less and less relevant the longer ago they were created.
133+
This allows authenticating these message body with relatively slow asymmetric cryptographic signatures with the CP-PKI, removing the dependency on DRKey.
134+
The signature would be part of the SCMP message format for these specific messages and thus no longer requires the SPAO header.
135+
Overall, this approach is very similar to the "Path revocation" messages that we historically used to have.

doc/manuals/router.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ considers the following options.
137137

138138
.. option:: features.experimental_scmp_authentication = <bool> (Default: false)
139139

140-
Enable the :ref:`DRKey-based authentication of SCMPs <scmp-authentication>` in the
140+
Enable the :doc:`DRKey-based authentication of SCMPs </dev/design/scmp-authentication>` in the
141141
router, which is **experimental** and currently **incomplete**.
142142

143143
When enabled, the router inserts the :ref:`authenticator-option` for SCMP messages.

doc/protocols/scmp.rst

Lines changed: 13 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ Introduction
1616
The SCION Control Message Protocol (SCMP) is analogous to the Internet Control
1717
Message Protocol (ICMP). It provides functionality for network diagnostics, such
1818
as ping and traceroute, and error messages that signal packet processing or
19-
network-layer problems. SCMP is an integral part of SCION, and as such, all
20-
messages and behavior required by this specification MUST be fully implemented
21-
by every SCION node.
19+
network-layer problems.
20+
SCMP is a helpful tool for network diagnostics and, in the case of
21+
:ref:`External Interface Down <external-interface-down>` and
22+
:ref:`Internal Connectivity Down <internal-connectivity-down>` messages, an optimization for end
23+
hosts to detect network failures more rapidly and fail-over to different paths.
24+
However, SCION nodes should not strictly rely on the availability of SCMP, as this protocol may not
25+
be supported by all devices and/or may be subject to rate limiting.
2226

2327
General Format
2428
==============
@@ -116,46 +120,6 @@ entire SCMP message, starting with the SCMP message type field, and prepended
116120
with a "pseudo-header" consisting of the SCION address header and the layer-4
117121
protocol type as defined in :ref:`pseudo-header-upper-layer-checksum`.
118122

119-
.. _scmp-authentication:
120-
121-
Authentication
122-
--------------
123-
SCMP messages can be authenticated with a MAC based on a symmetric key
124-
established with the :ref:`DRKey infrastructure <drkey>`.
125-
The MAC is transported in the :ref:`authenticator-option` End-to-End extension
126-
header.
127-
128-
The Authenticator MAC algorithm is AES-CMAC (identifier :code:`0`).
129-
130-
SCMP error messages MUST always be authenticated.
131-
SCMP informational messages CAN optionally be authenticated; a response message
132-
MUST be authenticated if and only if the corresponding request message was
133-
authenticated.
134-
135-
All DRKey keys used here are derived with :ref:`protocol identifier <drkey-protocol-identifiers>` :code:`SCMP`, decimal :code:`1`.
136-
137-
SCMP messages from (and to) routers are authenticated with :ref:`AS-host keys <drkey-as-host>`.
138-
SCMP response messages from a router in AS :math:`D` to a node :math:`H_s` in
139-
AS :math:`S` are authenticated with the DRKey :math:`K_{D,S:H_s}`.
140-
SCMP requests (specifically, :ref:`traceroute-request`) processed by a router
141-
are authenticated with the same key.
142-
143-
SCMP messages between two end-hosts are authenticated with :ref:`host-host keys <drkey-host-host>`.
144-
An SCMP response message from a node :math:`H_d` in AS :math:`D` to a node
145-
:math:`H_s` in AS :math:`S` is authenticated with the key
146-
:math:`K_{D:H_d,S:H_s}`.
147-
SCMP requests and data packets from :math:`H_s` to :math:`H_d` are
148-
authenticated with this same key.
149-
150-
For packets addressed to a router directly (specifically for
151-
:ref:`echo-request` and :ref:`echo-reply`) it is treated like an end-host and
152-
the corresponding host-host keys are used.
153-
154-
.. note::
155-
Recall that :ref:`traceroute-request`\s are *not* addressed to the router.
156-
Instead, the router processes the request if its router alert flag is set.
157-
158-
159123
Processing Rules
160124
----------------
161125

@@ -188,44 +152,6 @@ Implementations MUST respect the following rules when processing SCMP messages:
188152
#. A packet whose source address does not uniquely identify a single node.
189153
E.g., an IPv4 or IPv6 multicast address.
190154

191-
#. Every SCMP error message MUST be authenticated.
192-
193-
Every SCMP informational reply message MUST be authenticated if and only if
194-
the corresponding request was authenticated.
195-
196-
.. note::
197-
Consequentially, an implementation without support for SCMP
198-
authentication MUST never send SCMP error messages and MUST NOT reply to
199-
authenticated SCMP informational request messages.
200-
201-
#. When an SCMP message is received, the receiver SHOULD check the
202-
authentication header.
203-
204-
- SCMP error messages without or with an invalid authentication header and
205-
SCMP informational messages with an invalid authentication header SHOULD
206-
be silently dropped.
207-
208-
.. note::
209-
As SCMP authentication is a new addition, there will be a transition period
210-
during which receivers may accept SCMP error messages without authentication.
211-
212-
- The receiver checks that the :ref:`DRKey identified by the SPI <spao-spi-drkey>`
213-
is appropriate for the SCMP message type and code, as described above in
214-
the :ref:`section Authentication <scmp-authentication>`.
215-
216-
- The receiver derives or fetches the relevant key for validation of the MAC.
217-
218-
- Before checking the authentication, and in particular before fetching a
219-
key, the receiver SHOULD check whether the quoted message was possibly
220-
recently sent via/to the originator of the error message.
221-
222-
- The receiver MUST limit the traffic to the control service to fetch keys
223-
for verifying the authentication of an SCMP message.
224-
At most one packet SHOULD be sent to fetch the key for a received SCMP
225-
message. If this fails or is not possible (e.g. because there is no
226-
existing TCP session to the control service), the message SHOULD be
227-
silently dropped.
228-
229155

230156
SCMP Error Messages
231157
===================
@@ -327,7 +253,7 @@ Packet Too Big
327253
| MTU | The Maximum Transmission Unit of the next-hop link. |
328254
+--------------+---------------------------------------------------------------+
329255

330-
A **Packet Too Big** message MUST be originated by a router in response to a
256+
A **Packet Too Big** message SHOULD be originated by a router in response to a
331257
packet that cannot be forwarded because the packet is larger than the MTU of the
332258
outgoing link. The MTU value is set to the maximum size a SCION packet can have
333259
to still fit on the next-hop link, as the sender has no knowledge of the
@@ -457,7 +383,7 @@ External Interface Down
457383
| Interface ID | The interface ID of the external link with connectivity issue.|
458384
+--------------+---------------------------------------------------------------+
459385

460-
A **External Interface Down** message MUST be originated by a router in response
386+
A **External Interface Down** message SHOULD be originated by a router in response
461387
to a packet that cannot be forwarded because the link to an external AS broken.
462388
The ISD and AS identifier are set to the ISD-AS of the originating router.
463389
The interface ID identifies the link of the originating AS that is down.
@@ -509,7 +435,7 @@ Internal Connectivity Down
509435
| Egress ID | The interface ID of the egress link. |
510436
+--------------+---------------------------------------------------------------+
511437

512-
A **Internal Connectivity Down** message MUST be originated by a router in
438+
A **Internal Connectivity Down** message SHOULD be originated by a router in
513439
response to a packet that cannot be forwarded inside the AS because because the
514440
connectivity between the ingress and egress routers is broken. The ISD and AS
515441
identifier are set to the ISD-AS of the originating router. The ingress
@@ -554,7 +480,7 @@ Echo Request
554480
| Data | Variable length of arbitrary data |
555481
+--------------+---------------------------------------------------------------+
556482

557-
Every node MUST implement a SCMP Echo responder function that receives Echo
483+
Every node SHOULD implement a SCMP Echo responder function that receives Echo
558484
Requests and originates corresponding Echo replies.
559485

560486
.. _echo-reply:
@@ -588,7 +514,7 @@ Echo Reply
588514
| Data | The data of the Echo Request |
589515
+--------------+---------------------------------------------------------------+
590516

591-
Every node MUST implement a SCMP Echo responder function that receives Echo
517+
Every node SHOULD implement a SCMP Echo responder function that receives Echo
592518
Requests and originates corresponding Echo replies.
593519

594520
The data received in the SCMP Echo Request message MUST be returned entirely and
@@ -682,7 +608,7 @@ Traceroute Reply
682608

683609
The border router is alerted of the Traceroute Request message through the
684610
ConsIngress or ConsEgress Router Alert flag in the hop field. When such a packet
685-
is received, the border router **MUST** reply with a Traceroute Reply message.
611+
is received, the border router SHOULD reply with a Traceroute Reply message.
686612

687613
The identifier is set to the value of the Traceroute Request message. The ISD
688614
and AS identifiers are set to the ISD-AS of the originating border router.

0 commit comments

Comments
 (0)