-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrfc4656.txt
More file actions
3139 lines (2158 loc) · 129 KB
/
rfc4656.txt
File metadata and controls
3139 lines (2158 loc) · 129 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
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
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Network Working Group S. Shalunov
Request for Comments: 4656 B. Teitelbaum
Category: Standards Track A. Karp
J. Boote
M. Zekauskas
Internet2
September 2006
A One-way Active Measurement Protocol (OWAMP)
Status of This Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2006).
Abstract
The One-Way Active Measurement Protocol (OWAMP) measures
unidirectional characteristics such as one-way delay and one-way
loss. High-precision measurement of these one-way IP performance
metrics became possible with wider availability of good time sources
(such as GPS and CDMA). OWAMP enables the interoperability of these
measurements.
Table of Contents
1. Introduction ....................................................2
1.1. Relationship of Test and Control Protocols .................3
1.2. Logical Model ..............................................4
2. Protocol Overview ...............................................5
3. OWAMP-Control ...................................................6
3.1. Connection Setup ...........................................6
3.2. Integrity Protection (HMAC) ...............................11
3.3. Values of the Accept Field ................................11
3.4. OWAMP-Control Commands ....................................12
3.5. Creating Test Sessions ....................................13
3.6. Send Schedules ............................................18
3.7. Starting Test Sessions ....................................19
3.8. Stop-Sessions .............................................20
3.9. Fetch-Session .............................................24
Shalunov, et al. Standards Track [Page 1]
RFC 4656 One-way Active Measurement Protocol September 2006
4. OWAMP-Test .....................................................27
4.1. Sender Behavior ...........................................28
4.1.1. Packet Timings .....................................28
4.1.2. OWAMP-Test Packet Format and Content ...............29
4.2. Receiver Behavior .........................................33
5. Computing Exponentially Distributed Pseudo-Random Numbers ......35
5.1. High-Level Description of the Algorithm ...................35
5.2. Data Types, Representation, and Arithmetic ................36
5.3. Uniform Random Quantities .................................37
6. Security Considerations ........................................38
6.1. Introduction ..............................................38
6.2. Preventing Third-Party Denial of Service ..................38
6.3. Covert Information Channels ...............................39
6.4. Requirement to Include AES in Implementations .............39
6.5. Resource Use Limitations ..................................39
6.6. Use of Cryptographic Primitives in OWAMP ..................40
6.7. Cryptographic Primitive Replacement .......................42
6.8. Long-term Manually Managed Keys ...........................43
6.9. (Not) Using Time as Salt ..................................44
6.10. The Use of AES-CBC and HMAC ..............................44
7. Acknowledgements ...............................................45
8. IANA Considerations ............................................45
9. Internationalization Considerations ............................46
10. References ....................................................46
10.1. Normative References .....................................46
10.2. Informative References ...................................47
Appendix A: Sample C Code for Exponential Deviates ................49
Appendix B: Test Vectors for Exponential Deviates .................54
1. Introduction
The IETF IP Performance Metrics (IPPM) working group has defined
metrics for one-way packet delay [RFC2679] and loss [RFC2680] across
Internet paths. Although there are now several measurement platforms
that implement collection of these metrics [SURVEYOR] [SURVEYOR-INET]
[RIPE] [BRIX], there is not currently a standard that would permit
initiation of test streams or exchange of packets to collect
singleton metrics in an interoperable manner.
With the increasingly wide availability of affordable global
positioning systems (GPS) and CDMA-based time sources, hosts
increasingly have available to them very accurate time sources,
either directly or through their proximity to Network Time Protocol
(NTP) primary (stratum 1) time servers. By standardizing a technique
for collecting IPPM one-way active measurements, we hope to create an
environment where IPPM metrics may be collected across a far broader
mesh of Internet paths than is currently possible. One particularly
compelling vision is of widespread deployment of open OWAMP servers
Shalunov, et al. Standards Track [Page 2]
RFC 4656 One-way Active Measurement Protocol September 2006
that would make measurement of one-way delay as commonplace as
measurement of round-trip time using an ICMP-based tool like ping.
Additional design goals of OWAMP include: being hard to detect and
manipulate, security, logical separation of control and test
functionality, and support for small test packets. (Being hard to
detect makes interference with measurements more difficult for
intermediaries in the middle of the network.)
OWAMP test traffic is hard to detect because it is simply a stream of
UDP packets from and to negotiated port numbers, with potentially
nothing static in the packets (size is negotiated, as well). OWAMP
also supports an encrypted mode that further obscures the traffic and
makes it impossible to alter timestamps undetectably.
Security features include optional authentication and/or encryption
of control and test messages. These features may be useful to
prevent unauthorized access to results or man-in-the-middle attacks
that attempt to provide special treatment to OWAMP test streams or
that attempt to modify sender-generated timestamps to falsify test
results.
In this document, the key words "MUST", "REQUIRED", "SHOULD",
"RECOMMENDED", and "MAY" are to be interpreted as described in
[RFC2119].
1.1. Relationship of Test and Control Protocols
OWAMP actually consists of two inter-related protocols: OWAMP-Control
and OWAMP-Test. OWAMP-Control is used to initiate, start, and stop
test sessions and to fetch their results, whereas OWAMP-Test is used
to exchange test packets between two measurement nodes.
Although OWAMP-Test may be used in conjunction with a control
protocol other than OWAMP-Control, the authors have deliberately
chosen to include both protocols in the same RFC to encourage the
implementation and deployment of OWAMP-Control as a common
denominator control protocol for one-way active measurements. Having
a complete and open one-way active measurement solution that is
simple to implement and deploy is crucial to ensuring a future in
which inter-domain one-way active measurement could become as
commonplace as ping. We neither anticipate nor recommend that
OWAMP-Control form the foundation of a general-purpose extensible
measurement and monitoring control protocol.
OWAMP-Control is designed to support the negotiation of one-way
active measurement sessions and results retrieval in a
straightforward manner. At session initiation, there is a
Shalunov, et al. Standards Track [Page 3]
RFC 4656 One-way Active Measurement Protocol September 2006
negotiation of sender and receiver addresses and port numbers,
session start time, session length, test packet size, the mean
Poisson sampling interval for the test stream, and some attributes of
the very general [RFC 2330] notion of packet type, including packet
size and per-hop behavior (PHB) [RFC2474], which could be used to
support the measurement of one-way network characteristics across
differentiated services networks. Additionally, OWAMP-Control
supports per-session encryption and authentication for both test and
control traffic, measurement servers that can act as proxies for test
stream endpoints, and the exchange of a seed value for the pseudo-
random Poisson process that describes the test stream generated by
the sender.
We believe that OWAMP-Control can effectively support one-way active
measurement in a variety of environments, from publicly accessible
measurement beacons running on arbitrary hosts to network monitoring
deployments within private corporate networks. If integration with
Simple Network Management Protocol (SNMP) or proprietary network
management protocols is required, gateways may be created.
1.2. Logical Model
Several roles are logically separated to allow for broad flexibility
in use. Specifically, we define the following:
Session-Sender The sending endpoint of an OWAMP-Test session;
Session-Receiver The receiving endpoint of an OWAMP-Test session;
Server An end system that manages one or more OWAMP-Test
sessions, is capable of configuring per-session
state in session endpoints, and is capable of
returning the results of a test session;
Control-Client An end system that initiates requests for
OWAMP-Test sessions, triggers the start of a set
of sessions, and may trigger their termination;
and
Fetch-Client An end system that initiates requests to fetch
the results of completed OWAMP-Test sessions.
Shalunov, et al. Standards Track [Page 4]
RFC 4656 One-way Active Measurement Protocol September 2006
One possible scenario of relationships between these roles is shown
below.
+----------------+ +------------------+
| Session-Sender |--OWAMP-Test-->| Session-Receiver |
+----------------+ +------------------+
^ ^
| |
| |
| |
| +----------------+<----------------+
| | Server |<-------+
| +----------------+ |
| ^ |
| | |
| OWAMP-Control OWAMP-Control
| | |
v v v
+----------------+ +-----------------+
| Control-Client | | Fetch-Client |
+----------------+ +-----------------+
(Unlabeled links in the figure are unspecified by this document and
may be proprietary protocols.)
Different logical roles can be played by the same host. For example,
in the figure above, there could actually be only two hosts: one
playing the roles of Control-Client, Fetch-Client, and Session-
Sender, and the other playing the roles of Server and Session-
Receiver. This is shown below.
+-----------------+ +------------------+
| Control-Client |<--OWAMP-Control-->| Server |
| Fetch-Client | | |
| Session-Sender |---OWAMP-Test----->| Session-Receiver |
+-----------------+ +------------------+
Finally, because many Internet paths include segments that transport
IP over ATM, delay and loss measurements can include the effects of
ATM segmentation and reassembly (SAR). Consequently, OWAMP has been
designed to allow for small test packets that would fit inside the
payload of a single ATM cell (this is only achieved in
unauthenticated mode).
Shalunov, et al. Standards Track [Page 5]
RFC 4656 One-way Active Measurement Protocol September 2006
2. Protocol Overview
As described above, OWAMP consists of two inter-related protocols:
OWAMP-Control and OWAMP-Test. The former is layered over TCP and is
used to initiate and control measurement sessions and to fetch their
results. The latter protocol is layered over UDP and is used to send
singleton measurement packets along the Internet path under test.
The initiator of the measurement session establishes a TCP connection
to a well-known port, 861, on the target point and this connection
remains open for the duration of the OWAMP-Test sessions. An OWAMP
server SHOULD listen to this well-known port.
OWAMP-Control messages are transmitted only before OWAMP-Test
sessions are actually started and after they are completed (with the
possible exception of an early Stop-Sessions message).
The OWAMP-Control and OWAMP-Test protocols support three modes of
operation: unauthenticated, authenticated, and encrypted. The
authenticated or encrypted modes require that endpoints possess a
shared secret.
All multi-octet quantities defined in this document are represented
as unsigned integers in network byte order unless specified
otherwise.
3. OWAMP-Control
The type of each OWAMP-Control message can be found after reading the
first 16 octets. The length of each OWAMP-Control message can be
computed upon reading its fixed-size part. No message is shorter
than 16 octets.
An implementation SHOULD expunge unused state to prevent denial-of-
service attacks, or unbounded memory usage, on the server. For
example, if the full control message is not received within some
number of minutes after it is expected, the TCP connection associated
with the OWAMP-Control session SHOULD be dropped. In absence of
other considerations, 30 minutes seems like a reasonable upper bound.
3.1. Connection Setup
Before either a Control-Client or a Fetch-Client can issue commands
to a Server, it has to establish a connection to the server.
First, a client opens a TCP connection to the server on a well-known
port 861. The server responds with a server greeting:
Shalunov, et al. Standards Track [Page 6]
RFC 4656 One-way Active Measurement Protocol September 2006
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Unused (12 octets) |
| |
|+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Modes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Challenge (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Salt (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Count (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| MBZ (12 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The following Mode values are meaningful: 1 for unauthenticated, 2
for authenticated, and 4 for encrypted. The value of the Modes field
sent by the server is the bit-wise OR of the mode values that it is
willing to support during this session. Thus, the last three bits of
the Modes 32-bit value are used. The first 29 bits MUST be zero. A
client MUST ignore the values in the first 29 bits of the Modes
value. (This way, the bits are available for future protocol
extensions. This is the only intended extension mechanism.)
Challenge is a random sequence of octets generated by the server; it
is used subsequently by the client to prove possession of a shared
secret in a manner prescribed below.
Salt and Count are parameters used in deriving a key from a shared
secret as described below.
Salt MUST be generated pseudo-randomly (independently of anything
else in this document).
Count MUST be a power of 2. Count MUST be at least 1024. Count
SHOULD be increased as more computing power becomes common.
Shalunov, et al. Standards Track [Page 7]
RFC 4656 One-way Active Measurement Protocol September 2006
If the Modes value is zero, the server does not wish to communicate
with the client and MAY close the connection immediately. The client
SHOULD close the connection if it receives a greeting with Modes
equal to zero. The client MAY close the connection if the client's
desired mode is unavailable.
Otherwise, the client MUST respond with the following Set-Up-Response
message:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mode |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. KeyID (80 octets) .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Token (64 octets) .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Client-IV (16 octets) .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Here Mode is the mode that the client chooses to use during this
OWAMP-Control session. It will also be used for all OWAMP-Test
sessions started under control of this OWAMP-Control session. In
Mode, one or zero bits MUST be set within last three bits. If it is
one bit that is set within the last three bits, this bit MUST
indicate a mode that the server agreed to use (i.e., the same bit
MUST have been set by the server in the server greeting). The first
29 bits of Mode MUST be zero. A server MUST ignore the values of the
first 29 bits. If zero Mode bits are set by the client, the client
indicates that it will not continue with the session; in this case,
the client and the server SHOULD close the TCP connection associated
with the OWAMP-Control session.
Shalunov, et al. Standards Track [Page 8]
RFC 4656 One-way Active Measurement Protocol September 2006
In unauthenticated mode, KeyID, Token, and Client-IV are unused.
Otherwise, KeyID is a UTF-8 string, up to 80 octets in length (if the
string is shorter, it is padded with zero octets), that tells the
server which shared secret the client wishes to use to authenticate
or encrypt, while Token is the concatenation of a 16-octet challenge,
a 16-octet AES Session-key used for encryption, and a 32-octet HMAC-
SHA1 Session-key used for authentication. The token itself is
encrypted using the AES (Advanced Encryption Standard) [AES] in
Cipher Block Chaining (CBC). Encryption MUST be performed using an
Initialization Vector (IV) of zero and a key derived from the shared
secret associated with KeyID. (Both the server and the client use
the same mappings from KeyIDs to shared secrets. The server, being
prepared to conduct sessions with more than one client, uses KeyIDs
to choose the appropriate secret key; a client would typically have
different secret keys for different servers. The situation is
analogous to that with passwords.)
The shared secret is a passphrase; it MUST not contain newlines. The
secret key is derived from the passphrase using a password-based key
derivation function PBKDF2 (PKCS #5) [RFC2898]. The PBKDF2 function
requires several parameters: the PRF is HMAC-SHA1 [RFC2104]; the salt
and count are as transmitted by the server.
AES Session-key, HMAC Session-key and Client-IV are generated
randomly by the client. AES Session-key and HMAC Session-key MUST be
generated with sufficient entropy not to reduce the security of the
underlying cipher [RFC4086]. Client-IV merely needs to be unique
(i.e., it MUST never be repeated for different sessions using the
same secret key; a simple way to achieve that without the use of
cumbersome state is to generate the Client-IV values using a
cryptographically secure pseudo-random number source: if this is
done, the first repetition is unlikely to occur before 2^64 sessions
with the same secret key are conducted).
Shalunov, et al. Standards Track [Page 9]
RFC 4656 One-way Active Measurement Protocol September 2006
The server MUST respond with the following Server-Start message:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| MBZ (15 octets) |
| |
| +-+-+-+-+-+-+-+-+
| | Accept |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Server-IV (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Start-Time (Timestamp) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MBZ (8 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The MBZ parts MUST be zero. The client MUST ignore their value. MBZ
(MUST be zero) fields here and after have the same semantics: the
party that sends the message MUST set the field so that all bits are
equal to zero; the party that interprets the message MUST ignore the
value. (This way, the field could be used for future extensions.)
Server-IV is generated randomly by the server. In unauthenticated
mode, Server-IV is unused.
The Accept field indicates the server's willingness to continue
communication. A zero value in the Accept field means that the
server accepts the authentication and is willing to conduct further
transactions. Non-zero values indicate that the server does not
accept the authentication or, for some other reason, is not willing
to conduct further transactions in this OWAMP-Control session. The
full list of available Accept values is described in Section 3.3,
"Values of the Accept Field".
If a negative (non-zero) response is sent, the server MAY (and the
client SHOULD) close the connection after this message.
Start-Time is a timestamp representing the time when the current
instantiation of the server started operating. (For example, in a
multi-user general purpose operating system, it could be the time
when the server process was started.) If Accept is non-zero, Start-
Shalunov, et al. Standards Track [Page 10]
RFC 4656 One-way Active Measurement Protocol September 2006
Time SHOULD be set so that all of its bits are zeros. In
authenticated and encrypted modes, Start-Time is encrypted as
described in Section 3.4, "OWAMP-Control Commands", unless Accept is
non-zero. (Authenticated and encrypted mode cannot be entered unless
the control connection can be initialized.)
Timestamp format is described in Section 4.1.2. The same
instantiation of the server SHOULD report the same exact Start-Time
value to each client in each session.
The previous transactions constitute connection setup.
3.2. Integrity Protection (HMAC)
Authentication of each message (also referred to as a command in this
document) in OWAMP-Control is accomplished by adding an HMAC to it.
The HMAC that OWAMP uses is HMAC-SHA1 truncated to 128 bits. Thus,
all HMAC fields are 16 octets. An HMAC needs a key. The HMAC
Session-key is communicated along with the AES Session-key during
OWAMP-Control connection setup. The HMAC Session-key SHOULD be
derived independently of the AES Session-key (an implementation, of
course, MAY use the same mechanism to generate the random bits for
both keys). Each HMAC sent covers everything sent in a given
direction between the previous HMAC (but not including it) and up to
the beginning of the new HMAC. This way, once encryption is set up,
each bit of the OWAMP-Control connection is authenticated by an HMAC
exactly once.
When encrypting, authentication happens before encryption, so HMAC
blocks are encrypted along with the rest of the stream. When
decrypting, the order, of course, is reversed: first one decrypts,
then one checks the HMAC, then one proceeds to use the data.
The HMAC MUST be checked as early as possible to avoid using and
propagating corrupt data.
In open mode, the HMAC fields are unused and have the same semantics
as MBZ fields.
3.3. Values of the Accept Field
Accept values are used throughout the OWAMP-Control protocol to
communicate the server response to client requests. The full set of
valid Accept field values are as follows:
0 OK.
1 Failure, reason unspecified (catch-all).
Shalunov, et al. Standards Track [Page 11]
RFC 4656 One-way Active Measurement Protocol September 2006
2 Internal error.
3 Some aspect of request is not supported.
4 Cannot perform request due to permanent resource limitations.
5 Cannot perform request due to temporary resource limitations.
All other values are reserved. The sender of the message MAY use the
value of 1 for all non-zero Accept values. A message sender SHOULD
use the correct Accept value if it is going to use other values. The
message receiver MUST interpret all values of Accept other than these
reserved values as 1. This way, other values are available for
future extensions.
3.4. OWAMP-Control Commands
In authenticated or encrypted mode (which are identical as far as
OWAMP-Control is concerned, and only differ in OWAMP-Test), all
further communications are encrypted with the AES Session-key (using
CBC mode) and authenticated with HMAC Session-key. The client
encrypts everything it sends through the just-established OWAMP-
Control connection using stream encryption with Client-IV as the IV.
Correspondingly, the server encrypts its side of the connection using
Server-IV as the IV.
The IVs themselves are transmitted in cleartext. Encryption starts
with the block immediately following the block containing the IV.
The two streams (one going from the client to the server and one
going back) are encrypted independently, each with its own IV, but
using the same key (the AES Session-key).
The following commands are available for the client: Request-Session,
Start-Sessions, Stop-Sessions, and Fetch-Session. The command Stop-
Sessions is available to both the client and the server. (The server
can also send other messages in response to commands it receives.)
After the client sends the Start-Sessions command and until it both
sends and receives (in an unspecified order) the Stop-Sessions
command, it is said to be conducting active measurements. Similarly,
the server is said to be conducting active measurements after it
receives the Start-Sessions command and until it both sends and
receives (in an unspecified order) the Stop-Sessions command.
While conducting active measurements, the only command available is
Stop-Sessions.
These commands are described in detail below.
Shalunov, et al. Standards Track [Page 12]
RFC 4656 One-way Active Measurement Protocol September 2006
3.5. Creating Test Sessions
Individual one-way active measurement sessions are established using
a simple request/response protocol. An OWAMP client MAY issue zero
or more Request-Session messages to an OWAMP server, which MUST
respond to each with an Accept-Session message. An Accept-Session
message MAY refuse a request.
Shalunov, et al. Standards Track [Page 13]
RFC 4656 One-way Active Measurement Protocol September 2006
The format of Request-Session message is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 1 | MBZ | IPVN | Conf-Sender | Conf-Receiver |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Schedule Slots |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Packets |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sender Port | Receiver Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sender Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Sender Address (cont.) or MBZ (12 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Receiver Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Receiver Address (cont.) or MBZ (12 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| SID (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Padding Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Start Time |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Timeout, (8 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type-P Descriptor |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MBZ (8 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| HMAC (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Shalunov, et al. Standards Track [Page 14]
RFC 4656 One-way Active Measurement Protocol September 2006
This is immediately followed by one or more schedule slot
descriptions (the number of schedule slots is specified in the
"Number of Schedule Slots" field above):
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Slot Type | |
+-+-+-+-+-+-+-+-+ MBZ (7 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Slot Parameter (Timestamp) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
These are immediately followed by HMAC:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| HMAC (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
All these messages constitute one logical message: the Request-
Session command.
Above, the first octet (1) indicates that this is the Request-Session
command.
IPVN is the IP version numbers for Sender and Receiver. When the IP
version number is 4, 12 octets follow the 4-octet IPv4 address stored
in Sender Address and Receiver Address. These octets MUST be set to
zero by the client and MUST be ignored by the server. Currently
meaningful IPVN values are 4 and 6.
Conf-Sender and Conf-Receiver MUST be set to 0 or 1 by the client.
The server MUST interpret any non-zero value as 1. If the value is
1, the server is being asked to configure the corresponding agent
(sender or receiver). In this case, the corresponding Port value
SHOULD be disregarded by the server. At least one of Conf-Sender and
Conf-Receiver MUST be 1. (Both can be set, in which case the server
is being asked to perform a session between two hosts it can
configure.)
Shalunov, et al. Standards Track [Page 15]
RFC 4656 One-way Active Measurement Protocol September 2006
Number of Schedule Slots, as mentioned before, specifies the number
of slot records that go between the two blocks of HMAC. It is used
by the sender to determine when to send test packets (see next
section).
Number of Packets is the number of active measurement packets to be
sent during this OWAMP-Test session (note that either the server or
the client can abort the session early).
If Conf-Sender is not set, Sender Port is the UDP port from which
OWAMP-Test packets will be sent. If Conf-Receiver is not set,
Receiver Port is the UDP port OWAMP-Test to which packets are
requested to be sent.
The Sender Address and Receiver Address fields contain, respectively,
the sender and receiver addresses of the end points of the Internet
path over which an OWAMP test session is requested.
SID is the session identifier. It can be used in later sessions as
an argument for the Fetch-Session command. It is meaningful only if
Conf-Receiver is 0. This way, the SID is always generated by the
receiving side. See the end of the section for information on how
the SID is generated.
Padding length is the number of octets to be appended to the normal
OWAMP-Test packet (see more on padding in discussion of OWAMP-Test).
Start Time is the time when the session is to be started (but not
before Start-Sessions command is issued). This timestamp is in the
same format as OWAMP-Test timestamps.
Timeout (or a loss threshold) is an interval of time (expressed as a
timestamp). A packet belonging to the test session that is being set
up by the current Request-Session command will be considered lost if
it is not received during Timeout seconds after it is sent.
Type-P Descriptor covers only a subset of (very large) Type-P space.
If the first two bits of the Type-P Descriptor are 00, then the
subsequent six bits specify the requested Differentiated Services
Codepoint (DSCP) value of sent OWAMP-Test packets, as defined in
[RFC2474]. If the first two bits of Type-P descriptor are 01, then
the subsequent 16 bits specify the requested PHB Identification Code
(PHB ID), as defined in [RFC2836].
Therefore, the value of all zeros specifies the default best-effort
service.
Shalunov, et al. Standards Track [Page 16]
RFC 4656 One-way Active Measurement Protocol September 2006
If Conf-Sender is set, the Type-P Descriptor is to be used to
configure the sender to send packets according to its value. If
Conf-Sender is not set, the Type-P Descriptor is a declaration of how
the sender will be configured.
If Conf-Sender is set and the server does not recognize the Type-P
Descriptor, or it cannot or does not wish to set the corresponding
attributes on OWAMP-Test packets, it SHOULD reject the session
request. If Conf-Sender is not set, the server SHOULD accept or
reject the session, paying no attention to the value of the Type-P
Descriptor.
To each Request-Session message, an OWAMP server MUST respond with an
Accept-Session message:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Accept | MBZ | Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| |
| SID (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| MBZ (12 octets) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| HMAC (16 octets) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
In this message, zero in the Accept field means that the server is
willing to conduct the session. A non-zero value indicates rejection
of the request. The full list of available Accept values is
described in Section 3.3, "Values of the Accept Field".
If the server rejects a Request-Session message, it SHOULD not close
the TCP connection. The client MAY close it if it receives a
negative response to the Request-Session message.
The meaning of Port in the response depends on the values of Conf-
Sender and Conf-Receiver in the query that solicited the response.
If both were set, the Port field is unused. If only Conf-Sender was
set, Port is the port from which to expect OWAMP-Test packets. If
Shalunov, et al. Standards Track [Page 17]
RFC 4656 One-way Active Measurement Protocol September 2006
only Conf-Receiver was set, Port is the port to which OWAMP-Test
packets are sent.
If only Conf-Sender was set, the SID field in the response is unused.
Otherwise, SID is a unique server-generated session identifier. It
can be used later as handle to fetch the results of a session.
SIDs SHOULD be constructed by concatenation of the 4-octet IPv4 IP
number belonging to the generating machine, an 8-octet timestamp, and
a 4-octet random value. To reduce the probability of collisions, if
the generating machine has any IPv4 addresses (with the exception of
loopback), one of them SHOULD be used for SID generation, even if all
communication is IPv6-based. If it has no IPv4 addresses at all, the
last four octets of an IPv6 address MAY be used instead. Note that
SID is always chosen by the receiver. If truly random values are not
available, it is important that the SID be made unpredictable, as
knowledge of the SID might be used for access control.
3.6. Send Schedules
The sender and the receiver both need to know the same send schedule.
This way, when packets are lost, the receiver knows when they were
supposed to be sent. It is desirable to compress common schedules
and still to be able to use an arbitrary one for the test sessions.
In many cases, the schedule will consist of repeated sequences of
packets: this way, the sequence performs some test, and the test is
repeated a number of times to gather statistics.
To implement this, we have a schedule with a given number of slots.
Each slot has a type and a parameter. Two types are supported:
exponentially distributed pseudo-random quantity (denoted by a code
of 0) and a fixed quantity (denoted by a code of 1). The parameter
is expressed as a timestamp and specifies a time interval. For a
type 0 slot (exponentially distributed pseudo-random quantity), this
interval is the mean value (or 1/lambda if the distribution density
function is expressed as lambda*exp(-lambda*x) for positive values of
x). For a type 1 (fixed quantity) slot, the parameter is the delay
itself. The sender starts with the beginning of the schedule and
executes the instructions in the slots: for a slot of type 0, wait an
exponentially distributed time with a mean of the specified parameter
and then send a test packet (and proceed to the next slot); for a
slot of type 1, wait the specified time and send a test packet (and