Debian Codegraph @

rfc7820.html

raw
1 <pre>Internet Engineering Task Force (IETF) T. Mizrahi
2 Request for Comments: 7820 Marvell
3 Category: Experimental March 2016
4 ISSN: 2070-1721
5
6
7 <span class="h1">UDP Checksum Complement in</span>
8 <span class="h1">the One-Way Active Measurement Protocol (OWAMP) and</span>
9 <span class="h1">Two-Way Active Measurement Protocol (TWAMP)</span>
10
11 Abstract
12
13 The One-Way Active Measurement Protocol (OWAMP) and the Two-Way
14 Active Measurement Protocol (TWAMP) are used for performance
15 monitoring in IP networks. Delay measurement is performed in these
16 protocols by using timestamped test packets. Some implementations
17 use hardware-based timestamping engines that integrate the accurate
18 transmission time into every outgoing OWAMP/TWAMP test packet during
19 transmission. Since these packets are transported over UDP, the UDP
20 Checksum field is then updated to reflect this modification. This
21 document proposes to use the last 2 octets of every test packet as a
22 Checksum Complement, allowing timestamping engines to reflect the
23 checksum modification in the last 2 octets rather than in the UDP
24 Checksum field. The behavior defined in this document is completely
25 interoperable with existing OWAMP/TWAMP implementations.
26
27 Status of This Memo
28
29 This document is not an Internet Standards Track specification; it is
30 published for examination, experimental implementation, and
31 evaluation.
32
33 This document defines an Experimental Protocol for the Internet
34 community. This document is a product of the Internet Engineering
35 Task Force (IETF). It represents the consensus of the IETF
36 community. It has received public review and has been approved for
37 publication by the Internet Engineering Steering Group (IESG). Not
38 all documents approved by the IESG are a candidate for any level of
39 Internet Standard; see <a href="./rfc5741#section-2">Section&nbsp;2 of RFC 5741</a>.
40
41 Information about the current status of this document, any errata,
42 and how to provide feedback on it may be obtained at
43 <a href="http://www.rfc-editor.org/info/rfc7820">http://www.rfc-editor.org/info/rfc7820</a>.
44
45
46
47
48
49
50
51
52 <span class="grey">Mizrahi Experimental [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
55
56
57 Copyright Notice
58
59 Copyright (c) 2016 IETF Trust and the persons identified as the
60 document authors. All rights reserved.
61
62 This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
63 Provisions Relating to IETF Documents
64 (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
65 publication of this document. Please review these documents
66 carefully, as they describe your rights and restrictions with respect
67 to this document. Code Components extracted from this document must
68 include Simplified BSD License text as described in Section 4.e of
69 the Trust Legal Provisions and are provided without warranty as
70 described in the Simplified BSD License.
71
72 Table of Contents
73
74 <a href="#section-1">1</a>. Introduction ....................................................<a href="#page-3">3</a>
75 <a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-5">5</a>
76 <a href="#section-2.1">2.1</a>. Terminology ................................................<a href="#page-5">5</a>
77 <a href="#section-2.2">2.2</a>. Abbreviations ..............................................<a href="#page-5">5</a>
78 <a href="#section-3">3</a>. Using the UDP Checksum Complement in OWAMP and TWAMP ............<a href="#page-6">6</a>
79 <a href="#section-3.1">3.1</a>. Overview ...................................................<a href="#page-6">6</a>
80 <a href="#section-3.2">3.2</a>. OWAMP/TWAMP Test Packets with Checksum Complement ..........<a href="#page-6">6</a>
81 3.2.1. Transmission of OWAMP/TWAMP with Checksum
82 Complement .........................................<a href="#page-10">10</a>
83 3.2.2. Intermediate Updates of OWAMP/TWAMP with
84 Checksum Complement ................................<a href="#page-10">10</a>
85 <a href="#section-3.2.3">3.2.3</a>. Reception of OWAMP/TWAMP with Checksum Complement ..10
86 <a href="#section-3.3">3.3</a>. Interoperability with Existing Implementations ............<a href="#page-10">10</a>
87 3.4. Using the Checksum Complement with or without
88 Authentication ............................................<a href="#page-11">11</a>
89 <a href="#section-3.4.1">3.4.1</a>. Checksum Complement in Authenticated Mode ..........<a href="#page-11">11</a>
90 <a href="#section-3.4.2">3.4.2</a>. Checksum Complement in Encrypted Mode ..............<a href="#page-11">11</a>
91 <a href="#section-4">4</a>. Security Considerations ........................................<a href="#page-12">12</a>
92 <a href="#section-5">5</a>. References .....................................................<a href="#page-12">12</a>
93 <a href="#section-5.1">5.1</a>. Normative References ......................................<a href="#page-12">12</a>
94 <a href="#section-5.2">5.2</a>. Informative References ....................................<a href="#page-13">13</a>
95 <a href="#appendix-A">Appendix A</a>. Checksum Complement Usage Example .....................<a href="#page-14">14</a>
96 Acknowledgments ...................................................<a href="#page-15">15</a>
97 Author's Address ..................................................<a href="#page-15">15</a>
98
99
100
101
102
103
104
105
106
107
108 <span class="grey">Mizrahi Experimental [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
111
112
113 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
114
115 The One-Way Active Measurement Protocol [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] and the Two-Way
116 Active Measurement Protocol [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>] are used for performance
117 monitoring in IP networks.
118
119 Delay and delay variation are two of the metrics that OWAMP/TWAMP can
120 measure. Measurement is performed using timestamped test packets.
121 In some use cases, such as carrier networks, these two metrics are an
122 essential aspect of the Service Level Agreement (SLA) and therefore
123 must be measured with a high degree of accuracy. If packets are
124 timestamped in hardware as they exit the host, then greater accuracy
125 is possible in comparison to higher-layer timestamps (as explained
126 further below).
127
128 The accuracy of delay measurements relies on the timestamping method
129 and its implementation. In order to facilitate accurate
130 timestamping, an implementation can use a hardware-based timestamping
131 engine, as shown in Figure 1. In such cases, the OWAMP/TWAMP packets
132 are sent and received by a software layer, whereas the timestamping
133 engine modifies every outgoing test packet by incorporating its
134 accurate transmission time into the Timestamp field in the packet.
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164 <span class="grey">Mizrahi Experimental [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
167
168
169 OWAMP/TWAMP-enabled Node
170 +-------------------+
171 | |
172 | +-----------+ |
173 Software | |OWAMP/TWAMP| |
174 | | protocol | |
175 | +-----+-----+ |
176 | | | +-----------------------+
177 | +-----+-----+ | / Intermediate entity |
178 | | Accurate | | / in charge of: |
179 ASIC/FPGA | | Timestamp | | /__ - Timestamping |
180 | | engine | | |- Updating checksum or |
181 | +-----------+ | | Checksum Complement |
182 | | | +-----------------------+
183 +---------+---------+
184 |
185 |test packets
186 |
187 ___ v _
188 / \_/ \__
189 / \_
190 / IP /
191 \_ Network /
192 / \
193 \__/\_ ___/
194 \_/
195
196 ASIC: Application-Specific Integrated Circuit
197 FPGA: Field-Programmable Gate Array
198
199 Figure 1: Accurate Timestamping in OWAMP/TWAMP
200
201 OWAMP/TWAMP test packets are transported over UDP. When the UDP
202 payload is changed by an intermediate entity such as the timestamping
203 engine, the UDP Checksum field must be updated to reflect the new
204 payload. When using UDP over IPv4 [<a href="#ref-UDP" title="&quot;User Datagram Protocol&quot;">UDP</a>], an intermediate entity that
205 cannot update the value of the UDP Checksum has no choice except to
206 assign a value of zero to the Checksum field, causing the receiver to
207 ignore the Checksum field and potentially accept corrupted packets.
208 UDP over IPv6, as defined in [<a href="#ref-IPv6" title="&quot;Internet Protocol, Version 6 (IPv6) Specification&quot;">IPv6</a>], does not allow a zero checksum,
209 except in specific cases [<a href="#ref-ZeroChecksum">ZeroChecksum</a>]. As discussed in
210 [<a href="#ref-ZeroChecksum">ZeroChecksum</a>], the use of a zero checksum is generally not
211 recommended and should be avoided to the extent possible.
212
213 Since an intermediate entity only modifies a specific field in the
214 packet, i.e., the Timestamp field, the UDP Checksum update can be
215 performed incrementally, using the concepts presented in [<a href="#ref-Checksum" title="&quot;Computation of the Internet Checksum via Incremental Update&quot;">Checksum</a>].
216
217
218
219
220 <span class="grey">Mizrahi Experimental [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
223
224
225 A similar problem is addressed in Annex E of [<a href="#ref-IEEE1588" title="&quot;IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems&quot;">IEEE1588</a>]. When the
226 Precision Time Protocol (PTP) is transported over IPv6, 2 octets are
227 appended to the end of the PTP payload for UDP Checksum updates. The
228 value of these 2 octets can be updated by an intermediate entity,
229 causing the value of the UDP Checksum field to remain correct.
230
231 This document defines a similar concept for [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] and [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>],
232 allowing intermediate entities to update OWAMP/TWAMP test packets and
233 maintain the correctness of the UDP Checksum by modifying the last
234 2 octets of the packet.
235
236 The term "Checksum Complement" is used throughout this document and
237 refers to the 2 octets at the end of the UDP payload, used for
238 updating the UDP Checksum by intermediate entities.
239
240 The usage of the Checksum Complement can in some cases simplify the
241 implementation, because if the packet data is processed in serial
242 order, it is simpler to first update the Timestamp field and then
243 update the Checksum Complement, rather than to update the timestamp
244 and then update the UDP Checksum residing at the UDP header.
245
246 The Checksum Complement mechanism is also defined for the Network
247 Time Protocol in [<a href="./rfc7821" title="&quot;UDP Checksum Complement in the Network Time Protocol (NTP)&quot;">RFC7821</a>].
248
249 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in This Document</span>
250
251 <span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Terminology</span>
252
253 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
254 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
255 document are to be interpreted as described in [<a href="#ref-KEYWORDS" title="&quot;Key words for use in RFCs to Indicate Requirement Levels&quot;">KEYWORDS</a>].
256
257 <span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a>. Abbreviations</span>
258
259 HMAC Hashed Message Authentication Code
260
261 OWAMP One-Way Active Measurement Protocol
262
263 PTP Precision Time Protocol
264
265 TWAMP Two-Way Active Measurement Protocol
266
267 UDP User Datagram Protocol
268
269
270
271
272
273
274
275
276 <span class="grey">Mizrahi Experimental [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
279
280
281 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Using the UDP Checksum Complement in OWAMP and TWAMP</span>
282
283 <span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Overview</span>
284
285 The UDP Checksum Complement is a 2-octet field that is piggybacked at
286 the end of the test packet. It resides in the last 2 octets of the
287 UDP payload.
288
289 +----------------------------------+
290 | IPv4/IPv6 Header |
291 +----------------------------------+
292 | UDP Header |
293 +----------------------------------+
294 ^ | |
295 | | OWAMP/TWAMP |
296 UDP | packet |
297 Payload +----------------------------------+
298 | |UDP Checksum Complement (2 octets)|
299 v +----------------------------------+
300
301 Figure 2: Checksum Complement in OWAMP/TWAMP Test Packets
302
303 The Checksum Complement is used to compensate for changes performed
304 in the packet by intermediate entities, as described in the
305 Introduction (<a href="#section-1">Section 1</a>). An example of the usage of the Checksum
306 Complement is provided in <a href="#appendix-A">Appendix A</a>.
307
308 <span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. OWAMP/TWAMP Test Packets with Checksum Complement</span>
309
310 The One-Way Active Measurement Protocol [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] and the Two-Way
311 Active Measurement Protocol [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>] both make use of timestamped test
312 packets. A Checksum Complement MAY be used in the following cases:
313
314 o In OWAMP test packets sent by the sender to the receiver.
315
316 o In TWAMP test packets sent by the sender to the reflector.
317
318 o In TWAMP test packets sent by the reflector to the sender.
319
320 OWAMP/TWAMP test packets are transported over UDP, either over IPv4
321 or over IPv6. This document applies to both OWAMP and TWAMP over
322 IPv4 and over IPv6.
323
324
325
326
327
328
329
330
331
332 <span class="grey">Mizrahi Experimental [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
335
336
337 OWAMP/TWAMP test packets contain a Packet Padding field. This
338 document proposes to use the last 2 octets of the Packet Padding
339 field as the Checksum Complement. In this case, the Checksum
340 Complement is always the last 2 octets of the UDP payload, and thus
341 the field is located at (UDP Length - 2 octets) after the beginning
342 of the UDP header.
343
344 Figure 3 illustrates the OWAMP test packet format, including the UDP
345 Checksum Complement.
346
347 0 1 2 3
348 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
349 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
350 | Sequence Number |
351 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
352 | Timestamp |
353 | |
354 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
355 | Error Estimate | |
356 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
357 | |
358 . Packet Padding .
359 . .
360 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
361 | | Checksum Complement |
362 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
363
364 Figure 3: Checksum Complement in OWAMP Test Packets
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388 <span class="grey">Mizrahi Experimental [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
391
392
393 Figure 4 illustrates the TWAMP test packet format, including the UDP
394 Checksum Complement. ("TTL" means "Time to Live", and "MBZ" refers
395 to the "MUST be zero" field [<a href="#ref-IPPMIPsec" title="&quot;IKEv2-Derived Shared Secret Key for the One-Way Active Measurement Protocol (OWAMP) and Two-Way Active Measurement Protocol (TWAMP)&quot;">IPPMIPsec</a>].)
396
397 0 1 2 3
398 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
399 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
400 | Sequence Number |
401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
402 | Timestamp |
403 | |
404 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
405 | Error Estimate | MBZ |
406 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
407 | Receive Timestamp |
408 | |
409 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
410 | Sender Sequence Number |
411 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
412 | Sender Timestamp |
413 | |
414 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
415 | Sender Error Estimate | MBZ |
416 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
417 | Sender TTL | |
418 +-+-+-+-+-+-+-+-+ +
419 | |
420 . .
421 . Packet Padding .
422 . .
423 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
424 | | Checksum Complement |
425 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
426
427 Figure 4: Checksum Complement in TWAMP Test Packets
428
429 The length of the Packet Padding field in test packets is announced
430 during the session initiation through the &lt;Padding Length&gt; field in
431 the Request-Session message [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] or in the Request-TW-Session
432 message [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>].
433
434
435
436
437
438
439
440
441
442
443
444 <span class="grey">Mizrahi Experimental [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
447
448
449 When a Checksum Complement is included, the padding length MUST be
450 sufficiently long to include the Checksum Complement:
451
452 o In OWAMP, the padding length is at least 2 octets, allowing the
453 sender to incorporate the Checksum Complement in the last 2 octets
454 of the padding.
455
456 o In TWAMP, the padding length is at least 29 octets in
457 unauthenticated mode and at least 58 octets in authenticated mode.
458 The additional padding is required, since the header of reflector
459 test packets is longer than the header of sender test packets.
460 The difference between the sender packet and the reflector packet
461 is 27 octets in unauthenticated mode and 56 octets in
462 authenticated mode. Thus, the padding in reflector test packets
463 is shorter than the padding in sender packets. Using at least
464 29 octets of padding (58 in authenticated mode) in sender test
465 packets allows both the sender and the reflector to use a 2-octet
466 Checksum Complement. Note: If the minimal length requirement is
467 not met, the reflector cannot use a Checksum Complement in the
468 reflected test packets, but the sender can use a Checksum
469 Complement in the test packets it transmits.
470
471 o Two optional TWAMP features are defined in [<a href="#ref-TWAMP-Reflect">TWAMP-Reflect</a>]:
472 octet reflection and symmetrical size. When at least one of these
473 features is enabled, the Request-TW-Session message includes the
474 &lt;Padding Length&gt; field, as well as a &lt;Length of padding to
475 reflect&gt; field. In this case, both fields must be sufficiently
476 long to allow at least 2 octets of padding in both sender test
477 packets and reflector test packets. Specifically, when octet
478 reflection is enabled, the two Length fields must be defined such
479 that the padding expands at least 2 octets beyond the end of the
480 reflected octets.
481
482 As described in <a href="#section-1">Section 1</a>, the extensions described in this document
483 are implemented by two logical layers -- a protocol layer and a
484 timestamping layer. It is assumed that the two layers are
485 synchronized regarding whether the usage of the Checksum Complement
486 is enabled or not; since both logical layers reside in the same
487 network device, it is assumed that there is no need for a protocol
488 that synchronizes this information between the two layers. When
489 Checksum Complement usage is enabled, the protocol layer must take
490 care to verify that test packets include the necessary padding,
491 thereby avoiding the need for the timestamping layer to verify that
492 en-route test packets include the necessary padding.
493
494
495
496
497
498
499
500 <span class="grey">Mizrahi Experimental [Page 9]</span></pre>
501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
502 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
503
504
505 <span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a>. Transmission of OWAMP/TWAMP with Checksum Complement</span>
506
507 The transmitter of an OWAMP/TWAMP test packet MAY include a Checksum
508 Complement field, incorporated in the last 2 octets of the padding.
509
510 A transmitter that includes a Checksum Complement in its outgoing
511 test packets MUST include a Packet Padding field in these packets,
512 the length of which MUST be sufficient to include the Checksum
513 Complement. The length of the Packet Padding field is negotiated
514 during session initiation, as described in <a href="#section-3.2">Section 3.2</a>.
515
516 <span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a>. Intermediate Updates of OWAMP/TWAMP with Checksum Complement</span>
517
518 An intermediate entity that receives and alters an OWAMP/TWAMP
519 test packet can alter either the UDP Checksum field or the Checksum
520 Complement field in order to maintain the correctness of the
521 UDP Checksum value.
522
523 <span class="h4"><a class="selflink" id="section-3.2.3" href="#section-3.2.3">3.2.3</a>. Reception of OWAMP/TWAMP with Checksum Complement</span>
524
525 This document does not impose new requirements on the receiving end
526 of an OWAMP/TWAMP test packet.
527
528 The UDP layer at the receiving end verifies the UDP Checksum of
529 received test packets, and the OWAMP/TWAMP layer should treat the
530 Checksum Complement as part of the padding.
531
532 <span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. Interoperability with Existing Implementations</span>
533
534 The behavior defined in this document does not impose new
535 requirements on the reception behavior of OWAMP/TWAMP test packets.
536 The protocol stack of the receiving host performs the conventional
537 UDP Checksum verification; thus, from the perspective of the
538 receiving host, the existence of the Checksum Complement is
539 transparent. Therefore, the functionality described in this document
540 allows interoperability with existing implementations that comply
541 with [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] or [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>].
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556 <span class="grey">Mizrahi Experimental [Page 10]</span></pre>
557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
558 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
559
560
561 <span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>. Using the Checksum Complement with or without Authentication</span>
562
563 Both OWAMP and TWAMP may use authentication or encryption, as defined
564 in [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] and [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>].
565
566 <span class="h4"><a class="selflink" id="section-3.4.1" href="#section-3.4.1">3.4.1</a>. Checksum Complement in Authenticated Mode</span>
567
568 OWAMP and TWAMP test packets can be authenticated using an HMAC
569 (Hashed Message Authentication Code). The HMAC covers some of the
570 fields in the test packet header. The HMAC does not cover the
571 Timestamp field and the Packet Padding field.
572
573 A Checksum Complement MAY be used when authentication is enabled. In
574 this case, an intermediate entity can timestamp test packets and
575 update their Checksum Complement field without modifying the HMAC.
576
577 <span class="h4"><a class="selflink" id="section-3.4.2" href="#section-3.4.2">3.4.2</a>. Checksum Complement in Encrypted Mode</span>
578
579 When OWAMP and TWAMP are used in encrypted mode, the Timestamp field
580 is encrypted.
581
582 A Checksum Complement SHOULD NOT be used in encrypted mode. The
583 Checksum Complement is effective in both unauthenticated mode and
584 authenticated mode, allowing the intermediate entity to perform
585 serial processing of the packet without storing and forwarding it.
586
587 On the other hand, in encrypted mode, an intermediate entity that
588 timestamps a test packet must also re-encrypt the packet accordingly.
589 Re-encryption typically requires the intermediate entity to store the
590 packet, re-encrypt it, and then forward it. Thus, from an
591 implementer's perspective, the Checksum Complement has very little
592 value in encrypted mode, as it does not necessarily simplify the
593 implementation.
594
595 Note: While [<a href="#ref-OWAMP" title="&quot;A One-way Active Measurement Protocol (OWAMP)&quot;">OWAMP</a>] and [<a href="#ref-TWAMP" title="&quot;A Two-Way Active Measurement Protocol (TWAMP)&quot;">TWAMP</a>] include an inherent security
596 mechanism, these protocols can be secured by other measures, e.g.,
597 [<a href="#ref-IPPMIPsec" title="&quot;IKEv2-Derived Shared Secret Key for the One-Way Active Measurement Protocol (OWAMP) and Two-Way Active Measurement Protocol (TWAMP)&quot;">IPPMIPsec</a>]. For reasons similar to those described above, a
598 Checksum Complement SHOULD NOT be used in this case.
599
600
601
602
603
604
605
606
607
608
609
610
611
612 <span class="grey">Mizrahi Experimental [Page 11]</span></pre>
613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
614 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
615
616
617 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Security Considerations</span>
618
619 This document describes how a Checksum Complement extension can be
620 used for maintaining the correctness of the UDP Checksum.
621
622 The purpose of this extension is to ease the implementation of
623 accurate timestamping engines, as illustrated in Figure 1. The
624 extension is intended to be used internally in an OWAMP/TWAMP-enabled
625 node, and not intended to be used by intermediate switches and
626 routers that reside between the sender and the receiver/reflector.
627 Any modification of a test packet by intermediate switches or routers
628 should be considered a malicious man-in-the-middle (MITM) attack.
629
630 It is important to emphasize that the scheme described in this
631 document does not increase the protocol's vulnerability to MITM
632 attacks; a MITM attacker who maliciously modifies a packet and its
633 Checksum Complement is logically equivalent to a MITM attacker who
634 modifies a packet and its UDP Checksum field.
635
636 The concept described in this document is intended to be used only in
637 unauthenticated mode or authenticated mode. As described in
638 <a href="#section-3.4.2">Section 3.4.2</a>, using the Checksum Complement in encrypted mode does
639 not simplify the implementation compared to using the conventional
640 checksum, and therefore the Checksum Complement should not be used.
641
642 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. References</span>
643
644 <span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Normative References</span>
645
646 [<a id="ref-Checksum">Checksum</a>] Rijsinghani, A., Ed., "Computation of the Internet
647 Checksum via Incremental Update", <a href="./rfc1624">RFC 1624</a>,
648 DOI 10.17487/RFC1624, May 1994,
649 &lt;<a href="http://www.rfc-editor.org/info/rfc1624">http://www.rfc-editor.org/info/rfc1624</a>&gt;.
650
651 [<a id="ref-IPv6">IPv6</a>] Deering, S. and R. Hinden, "Internet Protocol, Version 6
652 (IPv6) Specification", <a href="./rfc2460">RFC 2460</a>, DOI 10.17487/RFC2460,
653 December 1998, &lt;<a href="http://www.rfc-editor.org/info/rfc2460">http://www.rfc-editor.org/info/rfc2460</a>&gt;.
654
655 [<a id="ref-KEYWORDS">KEYWORDS</a>] Bradner, S., "Key words for use in RFCs to Indicate
656 Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
657 DOI 10.17487/RFC2119, March 1997,
658 &lt;<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>&gt;.
659
660 [<a id="ref-OWAMP">OWAMP</a>] Shalunov, S., Teitelbaum, B., Karp, A., Boote, J., and M.
661 Zekauskas, "A One-way Active Measurement Protocol
662 (OWAMP)", <a href="./rfc4656">RFC 4656</a>, DOI 10.17487/RFC4656, September 2006,
663 &lt;<a href="http://www.rfc-editor.org/info/rfc4656">http://www.rfc-editor.org/info/rfc4656</a>&gt;.
664
665
666
667
668 <span class="grey">Mizrahi Experimental [Page 12]</span></pre>
669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
670 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
671
672
673 [<a id="ref-TWAMP">TWAMP</a>] Hedayat, K., Krzanowski, R., Morton, A., Yum, K., and J.
674 Babiarz, "A Two-Way Active Measurement Protocol (TWAMP)",
675 <a href="./rfc5357">RFC 5357</a>, DOI 10.17487/RFC5357, October 2008,
676 &lt;<a href="http://www.rfc-editor.org/info/rfc5357">http://www.rfc-editor.org/info/rfc5357</a>&gt;.
677
678 [<a id="ref-TWAMP-Reflect">TWAMP-Reflect</a>]
679 Morton, A. and L. Ciavattone, "Two-Way Active Measurement
680 Protocol (TWAMP) Reflect Octets and Symmetrical Size
681 Features", <a href="./rfc6038">RFC 6038</a>, DOI 10.17487/RFC6038, October 2010,
682 &lt;<a href="http://www.rfc-editor.org/info/rfc6038">http://www.rfc-editor.org/info/rfc6038</a>&gt;.
683
684 [<a id="ref-UDP">UDP</a>] Postel, J., "User Datagram Protocol", STD 6, <a href="./rfc768">RFC 768</a>,
685 DOI 10.17487/RFC768, August 1980,
686 &lt;<a href="http://www.rfc-editor.org/info/rfc768">http://www.rfc-editor.org/info/rfc768</a>&gt;.
687
688 <span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Informative References</span>
689
690 [<a id="ref-IEEE1588">IEEE1588</a>] IEEE, "IEEE Standard for a Precision Clock
691 Synchronization Protocol for Networked Measurement and
692 Control Systems", IEEE Std 1588-2008,
693 DOI 10.1109/IEEESTD.2008.4579760, July 2008.
694
695 [<a id="ref-IPPMIPsec">IPPMIPsec</a>] Pentikousis, K., Ed., Zhang, E., and Y. Cui,
696 "IKEv2-Derived Shared Secret Key for the One-Way Active
697 Measurement Protocol (OWAMP) and Two-Way Active
698 Measurement Protocol (TWAMP)", <a href="./rfc7717">RFC 7717</a>,
699 DOI 10.17487/RFC7717, December 2015,
700 &lt;<a href="http://www.rfc-editor.org/info/rfc7717">http://www.rfc-editor.org/info/rfc7717</a>&gt;.
701
702 [<a id="ref-RFC7821">RFC7821</a>] Mizrahi, T., "UDP Checksum Complement in the Network Time
703 Protocol (NTP)", <a href="./rfc7821">RFC 7821</a>, DOI 10.17487/RFC7821,
704 March 2016, &lt;<a href="http://www.rfc-editor.org/info/rfc7821">http://www.rfc-editor.org/info/rfc7821</a>&gt;.
705
706 [<a id="ref-ZeroChecksum">ZeroChecksum</a>]
707 Fairhurst, G. and M. Westerlund, "Applicability Statement
708 for the Use of IPv6 UDP Datagrams with Zero Checksums",
709 <a href="./rfc6936">RFC 6936</a>, DOI 10.17487/RFC6936, April 2013,
710 &lt;<a href="http://www.rfc-editor.org/info/rfc6936">http://www.rfc-editor.org/info/rfc6936</a>&gt;.
711
712
713
714
715
716
717
718
719
720
721
722
723
724 <span class="grey">Mizrahi Experimental [Page 13]</span></pre>
725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
726 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
727
728
729 <span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Checksum Complement Usage Example</span>
730
731 Consider a session between an OWAMP sender and an OWAMP receiver, in
732 which the sender transmits test packets to the receiver.
733
734 The sender's software layer generates an OWAMP test packet with a
735 timestamp T and a UDP Checksum value U. The value of U is the
736 checksum of the UDP header, UDP payload, and pseudo-header. Thus,
737 U is equal to:
738
739 U = Const + checksum(T) (1)
740
741 Where "Const" is the checksum of all the fields that are covered by
742 the checksum, except the timestamp T.
743
744 Recall that the sender's software emits the test packet with a
745 Checksum Complement field, which is simply the last 2 octets of the
746 padding. In this example, it is assumed that the sender initially
747 assigns zero to these 2 octets.
748
749 The sender's timestamping engine updates the Timestamp field to the
750 accurate time, changing its value from T to T'. The sender also
751 updates the Checksum Complement field from zero to a new value C,
752 such that:
753
754 checksum(C) = checksum(T) - checksum(T') (2)
755
756 When the test packet is transmitted by the sender's timestamping
757 engine, the value of the checksum remains U as before:
758
759 U = Const + checksum(T) = Const + checksum(T) + checksum(T') -
760 checksum(T') = Const + checksum(T') + checksum(C) (3)
761
762 Thus, after the timestamping engine has updated the timestamp,
763 U remains the correct checksum of the packet.
764
765 When the test packet reaches the receiver, the receiver performs a
766 conventional UDP Checksum computation, and the computed value is U.
767 Since the Checksum Complement is part of the padding, the value of
768 checksum(C) is transparently included in the computation, as per
769 Equation (3), without requiring special treatment by the receiver.
770
771
772
773
774
775
776
777
778
779
780 <span class="grey">Mizrahi Experimental [Page 14]</span></pre>
781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
782 <span class="grey"><a href="./rfc7820">RFC 7820</a> OWAMP and TWAMP Checksum Complement March 2016</span>
783
784
785 Acknowledgments
786
787 The author gratefully acknowledges Al Morton, Greg Mirsky, Steve
788 Baillargeon, Brian Haberman, and Spencer Dawkins for their helpful
789 comments.
790
791 Author's Address
792
793 Tal Mizrahi
794 Marvell
795 6 Hamada St.
796 Yokneam, 20692
797 Israel
798
799 Email: [email protected]
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836 Mizrahi Experimental [Page 15]
837 </pre>