idnits 2.17.1 draft-ietf-ippm-owdp-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 18. -- Found old boilerplate from RFC 3978, Section 5.5 on line 2409. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 2386. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 2393. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. ** The document seems to lack an RFC 3979 Section 5, para. 3 IPR Disclosure Invitation -- however, there's a paragraph with a matching beginning. Boilerplate error? Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 2 instances of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 187 has weird spacing: '...eceiver the...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: If the server rejects a Request-Session message, it SHOULD not close the TCP connection. The client MAY close it if it receives negative response to the Request-Session message. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (November 2005) is 6734 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 2127 -- Looks like a reference, but probably isn't: '16' on line 2036 == Missing Reference: 'Loop' is mentioned on line 1617, but not defined == Missing Reference: 'K' is mentioned on line 2049, but not defined -- Looks like a reference, but probably isn't: '4' on line 2096 -- Looks like a reference, but probably isn't: '2' on line 2125 -- Looks like a reference, but probably isn't: '0' on line 2104 -- Looks like a reference, but probably isn't: '15' on line 2167 -- Looks like a reference, but probably isn't: '1000000' on line 2256 == Unused Reference: 'RFC2026' is defined on line 2266, but no explicit reference was found in the text == Unused Reference: 'RFC2330' is defined on line 2272, but no explicit reference was found in the text == Unused Reference: 'RFC2836' is defined on line 2285, but no explicit reference was found in the text == Unused Reference: 'RIPE-NLUUG' is defined on line 2315, but no explicit reference was found in the text == Unused Reference: 'SURVEYOR-INET' is defined on line 2322, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' ** Downref: Normative reference to an Informational RFC: RFC 1321 ** Downref: Normative reference to an Informational RFC: RFC 2330 ** Obsolete normative reference: RFC 2679 (Obsoleted by RFC 7679) ** Obsolete normative reference: RFC 2680 (Obsoleted by RFC 7680) ** Obsolete normative reference: RFC 2836 (Obsoleted by RFC 3140) -- Obsolete informational reference (is this intentional?): RFC 1305 (Obsoleted by RFC 5905) -- Obsolete informational reference (is this intentional?): RFC 2246 (Obsoleted by RFC 4346) -- Obsolete informational reference (is this intentional?): RFC 2401 (Obsoleted by RFC 4301) -- Obsolete informational reference (is this intentional?): RFC 3546 (Obsoleted by RFC 4366) Summary: 10 errors (**), 0 flaws (~~), 12 warnings (==), 19 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Stanislav Shalunov 3 Internet Draft Benjamin Teitelbaum 4 Expiration Date: May 2006 Anatoly Karp 5 Jeff W. Boote 6 Matthew J. Zekauskas 7 Internet2 8 November 2005 10 A One-way Active Measurement Protocol (OWAMP) 11 13 Status of this Memo 15 By submitting this Internet-Draft, each author represents that any 16 applicable patent or other IPR claims of which he or she is aware 17 have been or will be disclosed, and any of which he or she becomes 18 aware will be disclosed, in accordance with Section 6 of BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as 23 Internet-Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 Copyright Notice 38 Copyright (C) The Internet Society (2005). 40 Abstract 42 With growing availability of good time sources to network nodes, it 43 becomes increasingly possible to measure one-way IP performance 44 metrics with high precision. To do so in an interoperable manner, a 45 common protocol for such measurements is required. The One-Way 46 Active Measurement Protocol (OWAMP) can measure one-way delay, as 47 well as other unidirectional characteristics, such as one-way loss. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 3 52 1.1. Relationship of Test and Control Protocols . . . . . . 4 53 1.2. Logical Model . . . . . . . . . . . . . . . . . . . . 5 54 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . 6 55 3. OWAMP-Control . . . . . . . . . . . . . . . . . . . . . . . 7 56 3.1. Connection Setup . . . . . . . . . . . . . . . . . . . 7 57 3.2. Integrity Zero Padding (IZP) . . . . . . . . . . . . . 11 58 3.3. Values of the Accept Field . . . . . . . . . . . . . . 12 59 3.4. OWAMP-Control Commands . . . . . . . . . . . . . . . . 12 60 3.5. Creating Test Sessions . . . . . . . . . . . . . . . . 13 61 3.6. Send Schedules . . . . . . . . . . . . . . . . . . . . 18 62 3.7. Starting Test Sessions . . . . . . . . . . . . . . . . 19 63 3.8. Stop-Sessions . . . . . . . . . . . . . . . . . . . . 20 64 3.9. Fetch-Session . . . . . . . . . . . . . . . . . . . . 23 65 4. OWAMP-Test . . . . . . . . . . . . . . . . . . . . . . . . 28 66 4.1. Sender Behavior . . . . . . . . . . . . . . . . . . . 28 67 4.1.1. Packet Timings . . . . . . . . . . . . . . . . . 28 68 4.1.2. Packet Format and Content . . . . . . . . . . . . 29 69 4.2. Receiver Behavior . . . . . . . . . . . . . . . . . . 32 70 5. Computing Exponentially Distributed Pseudo-Random Numbers . 34 71 5.1. High-Level Description of the Algorithm . . . . . . . 34 72 5.2. Data Types, Representation, and Arithmetic . . . . . . 35 73 5.3. Uniform Random Quantities . . . . . . . . . . . . . . 36 74 6. Security Considerations . . . . . . . . . . . . . . . . . . 37 75 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . 37 76 6.2. Preventing Third-Party Denial of Service . . . . . . . 38 77 6.3. Covert Information Channels . . . . . . . . . . . . . 38 78 6.4. Requirement to Include AES in Implementations . . . . 38 79 6.5. Resource Use Limitations . . . . . . . . . . . . . . . 38 80 6.6. Use of Cryptographic Primitives in OWAMP . . . . . . . 39 81 6.7. Cryptographic primitive replacement . . . . . . . . . 42 82 6.8. (Not) Using Time as Salt . . . . . . . . . . . . . . . 42 83 6.9. Required Properties of MD5 . . . . . . . . . . . . . . 43 84 6.10. The Use of AES-CBC-MAC . . . . . . . . . . . . . . . 44 85 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . 45 86 8. Internationalization Considerations . . . . . . . . . . . . 45 87 9. Appendix A: Sample C Code for Exponential Deviates . . . . 45 88 10. Appendix B: Test Vectors for Exponential Deviates . . . . 50 89 11. Normative References . . . . . . . . . . . . . . . . . . . 51 90 12. Informative References . . . . . . . . . . . . . . . . . . 52 91 13. Authors' Addresses . . . . . . . . . . . . . . . . . . . . 53 93 1. Introduction 95 The IETF IP Performance Metrics (IPPM) working group has proposed 96 metrics for one-way packet delay [RFC2679] and loss [RFC2680] across 97 Internet paths. Although there are now several measurement platforms 98 that implement collection of these metrics [SURVEYOR] [RIPE] [BRIX], 99 there is not currently a standard that would permit initiation of 100 test streams or exchange of packets to collect singleton metrics in 101 an interoperable manner. 103 With the increasingly wide availability of affordable global 104 positioning systems (GPS) and CDMA-based time sources, hosts 105 increasingly have available to them very accurate time 106 sources--either directly or through their proximity to Network Time 107 Protocol (NTP) primary (stratum 1) time servers. By standardizing a 108 technique for collecting IPPM one-way active measurements, we hope to 109 create an environment where IPPM metrics may be collected across a 110 far broader mesh of Internet paths than is currently possible. One 111 particularly compelling vision is of widespread deployment of open 112 OWAMP servers that would make measurement of one-way delay as 113 commonplace as measurement of round-trip time using an ICMP-based 114 tool like ping. 116 Additional design goals of OWAMP include: being hard to detect and 117 manipulate, security, logical separation of control and test 118 functionality, and support for small test packets. (Being hard to 119 detect makes interference with measurements more difficult for 120 intermediaries in the middle of the network.) 122 OWAMP test traffic is hard to detect because it is simply a stream of 123 UDP packets from and to negotiated port numbers, with potentially 124 nothing static in the packets (size is negotiated, as well). OWAMP 125 also supports an encrypted mode that further obscures the traffic, at 126 the same time making it impossible to alter timestamps undetectably. 128 Security features include optional authentication and/or encryption 129 of control and test messages. These features may be useful to 130 prevent unauthorized access to results or man-in-the-middle attackers 131 who attempt to provide special treatment to OWAMP test streams or who 132 attempt to modify sender-generated timestamps to falsify test 133 results. 135 The key words "MUST", "REQUIRED", "SHOULD", "RECOMMENDED", and "MAY" 136 in this document are to be interpreted as described in [RFC2119]. 138 1.1. Relationship of Test and Control Protocols 140 OWAMP actually consists of two inter-related protocols: OWAMP-Control 141 and OWAMP-Test. OWAMP-Control is used to initiate, start, and stop 142 test sessions and fetch their results, while OWAMP-Test is used to 143 exchange test packets between two measurement nodes. 145 Although OWAMP-Test may be used in conjunction with a control 146 protocol other than OWAMP-Control, the authors have deliberately 147 chosen to include both protocols in the same draft to encourage the 148 implementation and deployment of OWAMP-Control as a common 149 denominator control protocol for one-way active measurements. Having 150 a complete and open one-way active measurement solution that is 151 simple to implement and deploy is crucial to assuring a future in 152 which inter-domain one-way active measurement could become as 153 commonplace as ping. We neither anticipate nor recommend that 154 OWAMP-Control form the foundation of a general-purpose extensible 155 measurement and monitoring control protocol. 157 OWAMP-Control is designed to support the negotiation of one-way 158 active measurement sessions and results retrieval in a 159 straightforward manner. At session initiation, there is a negotiation 160 of sender and receiver addresses and port numbers, session start 161 time, session length, test packet size, the mean Poisson sampling 162 interval for the test stream, and some attributes of the very general 163 RFC 2330 notion of packet type, including packet size and per-hop 164 behavior (PHB) [RFC2474], which could be used to support the 165 measurement of one-way network characteristics across differentiated 166 services networks. Additionally, OWAMP-Control supports per-session 167 encryption and authentication for both test and control traffic, 168 measurement servers that can act as proxies for test stream 169 endpoints, and the exchange of a seed value for the pseudo-random 170 Poisson process that describes the test stream generated by the 171 sender. 173 We believe that OWAMP-Control can effectively support one-way active 174 measurement in a variety of environments, from publicly accessible 175 measurement beacons running on arbitrary hosts to network monitoring 176 deployments within private corporate networks. If integration with 177 Simple Network Management Protocol (SNMP) or proprietary network 178 management protocols is required, gateways may be created. 180 1.2. Logical Model 182 Several roles are logically separated to allow for broad flexibility 183 in use. Specifically, we define: 185 Session-Sender the sending endpoint of an OWAMP-Test session; 187 Session-Receiver the receiving endpoint of an OWAMP-Test session; 189 Server an end system that manages one or more OWAMP-Test 190 sessions, is capable of configuring per-session 191 state in session endpoints, and is capable of 192 returning the results of a test session; 194 Control-Client an end system that initiates requests for 195 OWAMP-Test sessions, triggers the start of a set 196 of sessions, and may trigger their termination; and 198 Fetch-Client an end system that initiates requests to fetch 199 the results of completed OWAMP-Test sessions. 201 One possible scenario of relationships between these roles is shown 202 below. 204 +----------------+ +------------------+ 205 | Session-Sender |--OWAMP-Test-->| Session-Receiver | 206 +----------------+ +------------------+ 207 ^ ^ 208 | | 209 | | 210 | | 211 | +----------------+<----------------+ 212 | | Server |<-------+ 213 | +----------------+ | 214 | ^ | 215 | | | 216 | OWAMP-Control OWAMP-Control 217 | | | 218 v v v 219 +----------------+ +-----------------+ 220 | Control-Client | | Fetch-Client | 221 +----------------+ +-----------------+ 223 (Unlabeled links in the figure are unspecified by this draft and may 224 be proprietary protocols.) 226 Different logical roles can be played by the same host. For example, 227 in the figure above, there could actually be only two hosts: one 228 playing the roles of Control-Client, Fetch-Client, and 229 Session-Sender, and the other playing the roles of Server and 230 Session-Receiver. This is shown below. 232 +-----------------+ +------------------+ 233 | Control-Client |<--OWAMP-Control-->| Server | 234 | Fetch-Client | | | 235 | Session-Sender |---OWAMP-Test----->| Session-Receiver | 236 +-----------------+ +------------------+ 238 Finally, because many Internet paths include segments that transport 239 IP over ATM, delay and loss measurements can include the effects of 240 ATM segmentation and reassembly (SAR). Consequently, OWAMP has been 241 designed to allow for small test packets that would fit inside the 242 payload of a single ATM cell (this is only achieved in 243 unauthenticated mode). 245 2. Protocol Overview 247 As described above, OWAMP consists of two inter-related protocols: 248 OWAMP-Control and OWAMP-Test. The former is layered over TCP and is 249 used to initiate and control measurement sessions and to fetch their 250 results. The latter protocol is layered over UDP and is used to send 251 singleton measurement packets along the Internet path under test. 253 The initiator of the measurement session establishes a TCP connection 254 to a well-known port XXX on the target point and this connection 255 remains open for the duration of the OWAMP-Test sessions. An OWAMP 256 server SHOULD listen to this well-known port. [RFC Editor: IANA is 257 requested to allocate a well-known port number for OWAMP-Control 258 sessions. Please replace ``XXX'' with the value assigned by IANA.] 260 OWAMP-Control messages are transmitted only before OWAMP-Test 261 sessions are actually started and after they complete (with the 262 possible exception of an early Stop-Sessions message). 264 The OWAMP-Control and OWAMP-Test protocols support three modes of 265 operation: unauthenticated, authenticated, and encrypted. The 266 authenticated or encrypted modes require endpoints to possess a 267 shared secret. 269 All multi-octet quantities defined in this document are represented 270 as unsigned integers in network byte order unless specified 271 otherwise. 273 3. OWAMP-Control 275 Each type of OWAMP-Control message has a fixed length. The recipient 276 will know the full length of a message after examining the first 16 277 octets of it. No message is shorter than 16 octets. 279 An implementation SHOULD expunge unused state to prevent denial-of- 280 service attacks, or unbounded memory usage, on the server. For 281 example, if the full control message is not received within some 282 number of minutes after it is expected, the TCP connection associated 283 with the OWAMP-Control session SHOULD be dropped. In absence of 284 other considerations, 30 minutes seems like a reasonable upper bound. 286 3.1. Connection Setup 288 Before either a Control-Client or a Fetch-Client can issue commands 289 of a Server, it has to establish a connection to the server. 291 First, a client opens a TCP connection to the server on a well-known 292 port XXX. The server responds with a server greeting: [RFC Editor: 293 Please replace ``XXX'' with the well-known port value assigned by 294 IANA.] 296 0 1 2 3 297 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 298 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 299 | | 300 | Unused (12 octets) | 301 | | 302 |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 303 | Modes | 304 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 305 | | 306 | Challenge (16 octets) | 307 | | 308 | | 309 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 311 The following Mode values are meaningful: 1 for unauthenticated, 2 312 for authenticated, and 4 for encrypted. The value of the Modes field 313 sent by the server is the bit-wise OR of the mode values that it is 314 willing to support during this session. Thus, the last three bits of 315 the Modes 32-bit value are used. The first 29 bits MUST be zero. A 316 client MUST ignore the values in the first 29 bits of the Modes 317 value. (This way, the bits are available for future protocol 318 extensions. This is the only intended extension mechanism.) 319 Challenge is a random sequence of octets generated by the server; it 320 is used subsequently by the client to prove possession of a shared 321 secret in a manner prescribed below. 323 If Modes value is zero, the server does not wish to communicate with 324 the client and MAY close the connection immediately. The client 325 SHOULD close the connection if it receives a greeting with Modes 326 equal to zero. The client MAY close the connection if the client's 327 desired mode is unavailable. 329 Otherwise, the client MUST respond with the following Set-Up-Response 330 message: 332 0 1 2 3 333 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 334 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 335 | Mode | 336 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 337 | | 338 . . 339 . KeyID (80 octets) . 340 . . 341 | | 342 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 343 | | 344 . . 345 . Token (32 octets) . 346 . . 347 | | 348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 349 | | 350 . . 351 . Client-IV (16 octets) . 352 . . 353 | | 354 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 356 Here Mode is the mode that the client chooses to use during this 357 OWAMP-Control session. It will also be used for all OWAMP-Test 358 sessions started under control of this OWAMP-Control session. In 359 Mode, one or zero bits MUST be set within last three bits. If it is 360 one bit that is set within the last three bits, this bit MUST 361 indicate a mode that the server agreed to use (i.e., the same bit 362 MUST have been set by the server in the server greeting). The first 363 29 bits of Mode MUST be zero. A server MUST ignore the values of the 364 first 29 bits. If zero Mode bits are set by the client, the client 365 indicates that it will not continue with the session; in this case, 366 the client and the server SHOULD close the TCP connection associated 367 with the OWAMP-Control session. 369 In unauthenticated mode, KeyID, Token, and Client-IV are unused. 371 Otherwise, KeyID is a UTF-8 string, up to 80 octets in length (if the 372 string is shorter, it is padded with zero octets), that tells the 373 server which shared secret the client wishes to use to authenticate 374 or encrypt, while Token is the concatenation of a 16-octet challenge 375 and a 16-octet Session-key, encrypted using the AES (Advanced 376 Encryption Standard) [AES] in Cipher Block Chaining (CBC). Encryption 377 MUST be performed using an Initialization Vector (IV) of zero and a 378 key value that is the shared secret associated with KeyID. (Both the 379 server and the client use the same mappings from KeyIDs to secret 380 keys. The server, being prepared to conduct sessions with more than 381 one client, uses KeyIDs to choose the appropriate secret key; a 382 client would typically have different secret keys for different 383 servers. The situation is analogous to that of passwords, except 384 that secret keys, rather than having the low entropy typical of 385 passwords, are suitable for use as AES keys.) 387 The shared secret MUST be generated with sufficient entropy not to 388 reduce the security of the underlying cipher. Typical methods of its 389 generation might be from a random number generator [RFC4086] or from 390 the hash of a passphrase. If the shared secret is provided as a 391 passphrase (typical for the case of interactive tools) then the MD5 392 sum [RFC1321] of the passphrase (without possible newline 393 character(s) at the end of the passphrase) MUST be used as the key 394 for encryption by the client and decryption by the server (the 395 passphrase also MUST NOT contain newlines in the middle). This 396 ensures that a passphrase used to generate a secret in one 397 implementation will generate the same secret in another 398 implementation and the implementations will, therefore, be 399 interoperable. 401 Session-key and Client-IV are generated randomly by the client. 402 Session-key MUST be generated with sufficient entropy not to reduce 403 the security of the underlying cipher [RFC4086]. Client-IV merely 404 needs to be unique (i.e., it MUST never be repeated for different 405 sessions using the same secret key; a simple way to achieve that 406 without the use of cumbersome state is to generate the Client-IV 407 values using a cryptographically secure pseudo-random number source: 408 if this is done, the first repetition is unlikely to occur before 409 2^64 sessions with the same secret key are conducted). 411 The server MUST respond with the following Server-Start message: 413 0 1 2 3 414 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 415 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 416 | | 417 | MBZ (15 octets) | 418 | | 419 | +-+-+-+-+-+-+-+-+ 420 | | Accept | 421 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 422 | | 423 | Server-IV (16 octets) | 424 | | 425 | | 426 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 427 | Start-Time (Timestamp) | 428 | | 429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 430 | IZP (8 octets) | 431 | | 432 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 434 The MBZ 15-octet part MUST be zero. The client MUST ignore its 435 value. MBZ (MUST be zero) fields here and hereafter have the same 436 semantics: the party that sends the message MUST set the field so 437 that all bits are equal to zero; the party that interprets the 438 message MUST ignore the value. (This way the field could be used for 439 future extensions.) 441 Server-IV is generated randomly by the server. In unauthenticated 442 mode, Server-IV is unused. 444 The Accept field indicates the server's willingness to continue 445 communication. A zero value in the Accept field means that the 446 server accepts the authentication and is willing to conduct further 447 transactions. Non-zero values indicate that the server does not 448 accept the authentication or, for some other reason, is not willing 449 to conduct further transactions in this OWAMP-Control session. The 450 full list of available Accept values is described in Section 3.3, 451 ``Values of the Accept Field''. 453 If a negative (non-zero) response is sent, the server MAY and the 454 client SHOULD close the connection after this message. 456 Start-Time is a timestamp representing the time when the current 457 instantiation of the server started operating. (For example, in a 458 multi-user general purpose operating system (OS), it could be the 459 time when the server process was started.) If Accept is non-zero, 460 Start-Time SHOULD be set so that all of its bits are zeros. In 461 authenticated and encrypted modes, Start-Time is encrypted as 462 described in the next section, unless Accept is non-zero. 463 (Authenticated and encrypted mode cannot be entered unless the 464 control connection can be initialized.) 466 Timestamp format is described in Section 4.1.2. The same 467 instantiation of the server SHOULD report the same exact Start-Time 468 value to each client in each session. 470 Integrity Zero Padding (IZP) is treated the same way as IZP in the 471 next section and beyond. 473 The previous transactions constitute connection setup. 475 3.2. Integrity Zero Padding (IZP) 477 IZP MUST be all zeros in all messages that use IZP. The recipient of 478 a message where IZP is not zero MUST reject the message, as it is an 479 indication of tampering with the content of the message by an 480 intermediary (or brokenness). If the message is part of 481 OWAMP-Control, the session MUST be terminated and results 482 invalidated. If the message is part of OWAMP-Test, it MUST be 483 silently ignored. 485 The purpose of the IZP field is to ensure data integrity. In 486 unauthenticated mode, IZP is nothing more than a simple check. In 487 authenticated and encrypted modes, however, it ensures, in 488 conjunction with properties of CBC chaining mode, that everything 489 received before was not tampered with. For this reason, it is 490 important to check the IZP field as soon as possible, so that bad 491 data doesn't get propagated. See section 6.8 for more on the use of 492 structured redundant messages with CBC mode. (Informally, if a 493 message is tampered with, the IZP field would decrypt to random 494 garbage and thus ensure the detection of tampering. If such a field 495 were not present, then redundance inherent in the messages would have 496 needed to be used to detect modification; this could allow for 497 existential forgery of, e.g., last block of a message if that last 498 block were not redundant. To avoid considering these complications 499 and specifying the exact redundancy checks for every different 500 message we, instead, specify the use of IZP, which makes implementing 501 OWAMP more straightforward.) 503 3.3. Values of the Accept Field 505 Accept values are used throughout the OWAMP-Control protocol to 506 communicate the server response to client requests. The full set of 507 valid Accept field values are: 509 0 OK. 511 1 Failure, reason unspecified (catch-all). 513 2 Internal error. 515 3 Some aspect of request is not supported. 517 4 Cannot perform request due to permanent resource limitations. 519 5 Cannot perform request due to temporary resource limitations. 521 All other values are reserved. The sender of the message MAY use the 522 value of 1 for all non-zero Accept values. A message sender SHOULD 523 use the correct Accept value if it is going to use other values. The 524 message receiver MUST interpret all values of Accept other than these 525 reserved values as 1. This way, other values are available for 526 future extensions. 528 3.4. OWAMP-Control Commands 530 In authenticated or encrypted mode (which are identical as far as 531 OWAMP-Control is concerned, and only differ in OWAMP-Test) all 532 further communications are encrypted with the Session-key, using CBC 533 mode. The client encrypts its stream using Client-IV. The server 534 encrypts its stream using Server-IV. 536 The following commands are available for the client: Request-Session, 537 Start-Sessions, Stop-Sessions, and Fetch-Session. The command 538 Stop-Sessions is available to both the client and the server. (The 539 server can also send other messages in response to commands it 540 receives.) 542 After the client sends the Start-Sessions command and until it both 543 sends and receives (in an unspecified order) the Stop-Sessions 544 command, it is said to be conducting active measurements. Similarly, 545 the server is said to be conducting active measurements after it 546 receives the Start-Sessions command and until it both sends and 547 receives (in an unspecified order) the Stop-Sessions command. 549 While conducting active measurements, the only command available is 550 Stop-Sessions. 552 These commands are described in detail below. 554 3.5. Creating Test Sessions 556 Individual one-way active measurement sessions are established using 557 a simple request/response protocol. An OWAMP client MAY issue zero or 558 more Request-Session messages to an OWAMP server, which MUST respond 559 to each with an Accept-Session message. An Accept-Session message 560 MAY refuse a request. 562 The format of Request-Session message is as follows: 564 0 1 2 3 565 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 566 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 567 | 1 | MBZ | IPVN | Conf-Sender | Conf-Receiver | 568 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 569 | Number of Schedule Slots | 570 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 571 | Number of Packets | 572 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 573 | Sender Port | Receiver Port | 574 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 575 | Sender Address | 576 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 577 | | 578 | Sender Address (cont.) or MBZ (12 octets) | 579 | | 580 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 581 | Receiver Address | 582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 583 | | 584 | Receiver Address (cont.) or MBZ (12 octets) | 585 | | 586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 587 | | 588 | SID (16 octets) | 589 | | 590 | | 591 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 592 | Padding Length | 593 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 594 | Start Time | 595 | | 596 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 597 | Timeout, (8 octets) | 598 | | 599 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 600 | Type-P Descriptor | 601 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 602 | MBZ (8 octets) | 603 | | 604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 605 | | 606 | IZP (16 octets) | 607 | | 608 | | 609 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 611 This is immediately followed by one or more schedule slot 612 descriptions (the number of schedule slots is specified in the 613 `Number of Schedule Slots' field above): 615 0 1 2 3 616 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 617 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 618 | Slot Type | | 619 +-+-+-+-+-+-+-+-+ MBZ (15 octets) | 620 | | 621 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 622 | Slot Parameter (Timestamp) | 623 | | 624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 626 These are immediately followed by IZP: 628 0 1 2 3 629 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 630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 631 | | 632 | IZP (16 octets) | 633 | | 634 | | 635 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 637 All these messages comprise one logical message: the Request-Session 638 command. 640 Above, the first octet (1) indicates that this is Request-Session 641 command. 643 IPVN is the IP version numbers for Sender and Receiver. When the IP 644 version number is 4, 12 octets follow the 4-octet IPv4 address stored 645 in Sender Address and Receiver Address. These octets MUST be set to 646 zero by the client and MUST be ignored by the server. Currently 647 meaningful IPVN values are 4 and 6. 649 Conf-Sender and Conf-Receiver MUST be set to 0 or 1 by the client. 650 The server MUST interpret any non-zero value as 1. If the value is 651 1, the server is being asked to configure the corresponding agent 652 (sender or receiver). In this case, the corresponding Port value 653 SHOULD be disregarded by the server. At least one of Conf-Sender and 654 Conf-Receiver MUST be 1. (Both can be set, in which case the server 655 is being asked to perform a session between two hosts it can 656 configure.) 658 Number of Schedule Slots, as mentioned before, specifies the number 659 of slot records that go between the two blocks of IZP. It is used by 660 the sender to determine when to send test packets (see next section). 662 Number of Packets is the number of active measurement packets to be 663 sent during this OWAMP-Test session (note that either the server or 664 the client can abort the session early). 666 If Conf-Sender is not set, Sender Port is the UDP port from which 667 OWAMP-Test packets will be sent. If Conf-Receiver is not set, 668 Receiver Port is the UDP port OWAMP-Test to which packets are 669 requested to be sent. 671 The Sender Address and Receiver Address fields contain, respectively, 672 the sender and receiver addresses of the end points of the Internet 673 path over which an OWAMP test session is requested. 675 SID is the session identifier. It can be used in later sessions as 676 an argument for the Fetch-Session command. It is meaningful only if 677 Conf-Receiver is 0. This way, the SID is always generated by the 678 receiving side. See the end of the section for information on how 679 the SID is generated. 681 Padding length is the number of octets to be appended to the normal 682 OWAMP-Test packet (see more on padding in discussion of OWAMP-Test). 684 Start Time is the time when the session is to be started (but not 685 before Start-Sessions command is issued). This timestamp is in the 686 same format as OWAMP-Test timestamps. 688 Timeout (or a loss threshold) is an interval of time (expressed as a 689 timestamp). A packet belonging to the test session that is being set 690 up by the current Request-Session command will be considered lost if 691 it is not received during Timeout seconds after it is sent. 693 Type-P Descriptor covers only a subset of (very large) Type-P space. 694 If the first two bits of the Type-P Descriptor are 00, then 695 subsequent six bits specify the requested Differentiated Services 696 Codepoint (DSCP) value of sent OWAMP-Test packets, as defined in 697 RFC 2474. If the first two bits of Type-P descriptor are 01, then 698 the subsequent 16 bits specify the requested PHB Identification Code 699 (PHB ID), as defined in RFC 2836. 701 Therefore, the value of all zeros specifies the default best-effort 702 service. 704 If Conf-Sender is set, the Type-P Descriptor is to be used to 705 configure the sender to send packets according to its value. If 706 Conf-Sender is not set, the Type-P Descriptor is a declaration of how 707 the sender will be configured. 709 If Conf-Sender is set and the server does not recognize the Type-P 710 Descriptor, or it cannot or does not wish to set the corresponding 711 attributes on OWAMP-Test packets, it SHOULD reject the session 712 request. If Conf-Sender is not set, the server SHOULD accept or 713 reject the session paying no attention to the value of the Type-P 714 Descriptor. 716 To each Request-Session message, an OWAMP server MUST respond with an 717 Accept-Session message: 719 0 1 2 3 720 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 721 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 722 | Accept | MBZ | Port | 723 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| 724 | | 725 | SID (16 octets) | 726 | | 727 | | 728 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 729 | | 730 | IZP (12 octets) | 731 | | 732 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 734 In this message, zero in the Accept field means that the server is 735 willing to conduct the session. A non-zero value indicates rejection 736 of the request. The full list of available Accept values is 737 described in Section 3.3, ``Values of the Accept Field''. 739 If the server rejects a Request-Session message, it SHOULD not close 740 the TCP connection. The client MAY close it if it receives negative 741 response to the Request-Session message. 743 The meaning of Port in the response depends on the values of 744 Conf-Sender and Conf-Receiver in the query that solicited the 745 response. If both were set, the Port field is unused. If only 746 Conf-Sender was set, Port is the port from which to expect OWAMP-Test 747 packets. If only Conf-Receiver was set, Port is the port to which 748 OWAMP-Test packets are sent. 750 If only Conf-Sender was set, the SID field in the response is unused. 751 Otherwise, SID is a unique server-generated session identifier. It 752 can be used later as handle to fetch the results of a session. 754 SIDs SHOULD be constructed by concatenation of the 4-octet IPv4 IP 755 number belonging to the generating machine, an 8-octet timestamp, and 756 a 4-octet random value. To reduce the probability of collisions, if 757 the generating machine has any IPv4 addresses (with the exception of 758 loopback), one of them SHOULD be used for SID generation, even if all 759 communication is IPv6-based. If it has no IPv4 addresses at all, the 760 last four octets of an IPv6 address MAY be used instead. Note that 761 SID is always chosen by the receiver. If truly random values are not 762 available, it is important that the SID be made unpredictable, as 763 knowledge of the SID might be used for access control. 765 3.6. Send Schedules 767 The sender and the receiver both need to know the same send schedule. 768 This way, when packets are lost, the receiver knows when they were 769 supposed to be sent. It is desirable to compress common schedules 770 and still to be able to use an arbitrary one for the test sessions. 771 In many cases, the schedule will consist of repeated sequences of 772 packets: this way, the sequence performs some test, and the test is 773 repeated a number of times to gather statistics. 775 To implement this, we have a schedule with a given number of slots. 776 Each slot has a type and a parameter. Two types are supported: 777 exponentially distributed pseudo-random quantity (denoted by a code 778 of 0) and a fixed quantity (denoted by a code of 1). The parameter 779 is expressed as a timestamp and specifies a time interval. For a 780 type 0 slot (exponentially distributed pseudo-random quantity) this 781 interval is the mean value (or 1/lambda if the distribution density 782 function is expressed as lambda*exp(-lambda*x) for positive values of 783 x). For a type 1 (fixed quantity) slot, the parameter is the delay 784 itself. The sender starts with the beginning of the schedule, and 785 executes the instructions in the slots: for a slot of type 0, wait an 786 exponentially distributed time with a mean of the specified parameter 787 and then send a test packet (and proceed to the next slot); for a 788 slot of type 1, wait the specified time and send a test packet (and 789 proceed to the next slot). The schedule is circular: when there are 790 no more slots, the sender returns to the first slot. 792 The sender and the receiver need to be able to reproducibly execute 793 the entire schedule (so, if a packet is lost, the receiver can still 794 attach a send timestamp to it). Slots of type 1 are trivial to 795 reproducibly execute. To reproducibly execute slots of type 0, we 796 need to be able to generate pseudo-random exponentially distributed 797 quantities in a reproducible manner. The way this is accomplished is 798 discussed later. 800 Using this mechanism one can easily specify common testing scenarios. 801 Some examples include: 803 + Poisson stream: a single slot of type 0; 805 + Periodic stream: a single slot of type 1; 807 + Poisson stream of back-to-back packet pairs: two slots -- type 0 808 with a non-zero parameter and type 1 with a zero parameter. 810 Further, a completely arbitrary schedule can be specified (albeit 811 inefficiently) by making the number of test packets equal to the 812 number of schedule slots. In this case, the complete schedule is 813 transmitted in advance of an OWAMP-Test session. 815 3.7. Starting Test Sessions 817 Having requested one or more test sessions and received affirmative 818 Accept-Session responses, an OWAMP client MAY start the execution of 819 the requested test sessions by sending a Start-Sessions message to 820 the server. 822 The format of this message is as follows: 824 0 1 2 3 825 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 826 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 827 | 2 | | 828 +-+-+-+-+-+-+-+-+ | 829 | MBZ (15 octets) | 830 | | 831 | | 832 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 833 | | 834 | IZP (16 octets) | 835 | | 836 | | 837 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 839 The server MUST respond with an Start-Ack message (which SHOULD be 840 sent as quickly as possible). Start-Ack messages have the following 841 format: 843 0 1 2 3 844 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 845 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 846 | Accept | | 847 +-+-+-+-+-+-+-+-+ | 848 | MBZ (15 octets) | 849 | | 850 | | 851 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 852 | | 853 | IZP (16 octets) | 854 | | 855 | | 856 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 858 If Accept is non-zero, the Start-Sessions request was rejected; zero 859 means that the command was accepted. The full list of available 860 Accept values is described in Section 3.3, ``Values of the Accept 861 Field''. The server MAY, and the client SHOULD, close the connection 862 in the case of a rejection. 864 The server SHOULD start all OWAMP-Test streams immediately after it 865 sends the response or immediately after their specified start times, 866 whichever is later. If the client represents a Sender, the client 867 SHOULD start its OWAMP-Test streams immediately after it sees the 868 Start-Ack response from the Server (if the Start-Sessions command was 869 accepted) or immediately after their specified start times, whichever 870 is later. See more on OWAMP-Test sender behavior in a separate 871 section below. 873 3.8. Stop-Sessions 875 The Stop-Sessions message may be issued by either the Control-Client 876 or the Server. The format of this command is as follows: 878 0 1 2 3 879 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 880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 881 | 3 | Accept | MBZ | 882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 883 | Number of Sessions | 884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 885 | MBZ (8 octets) | 886 | | 887 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 889 This is immediately followed by zero or more session description 890 records (the number of session description records is specified in 891 the ``Number of Sessions'' field above). The session description 892 record is used to indicate which packets were actually sent by the 893 sender process (rather than skipped). The header of the session 894 description record is as follows: 896 0 1 2 3 897 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 898 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| 899 | | 900 | SID (16 octets) | 901 | | 902 | | 903 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 904 | Next Seqno | 905 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 906 | Number of Skip Ranges | 907 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 909 This is immediately followed by zero or more Skip Range descriptions 910 as specified by the ``Number of Skip Ranges'' field above. Skip 911 Ranges are simply two sequence numbers that, together, indicate a 912 range of packets that were not sent: 914 0 1 2 3 915 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 916 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| 917 | First Seqno Skipped | 918 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 919 | Last Seqno Skipped | 920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 922 Skip Ranges MUST be in order. The last (possibly full, possibly 923 incomplete) block (16 octets) of data MUST be padded with zeros, if 924 necessary. This ensures that the next session description record 925 starts on a block boundary. 927 Finally, a single block (16 octets) of IZP is concatenated on the end 928 to complete the Stop-Sessions message. 930 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 931 | | 932 | IZP (16 octets) | 933 | | 934 | | 935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 937 All these records comprise one logical message: the Stop-Sessions 938 command. 940 Above, the first octet (3) indicates that this is the Stop-Sessions 941 command. 943 Non-zero Accept values indicate a failure of some sort. Zero values 944 indicate normal (but possibly premature) completion. The full list 945 of available Accept values is described in Section 3.3, ``Values of 946 the Accept Field''. 948 If Accept had a non-zero value (from either party), results of all 949 OWAMP-Test sessions spawned by this OWAMP-Control session SHOULD be 950 considered invalid, even if a Fetch-Session with SID from this 951 session works for a different OWAMP-Control session. If Accept was 952 not transmitted at all (for whatever reason, including the TCP 953 connection used for OWAMP-Control breaking), the results of all 954 OWAMP-Test sessions spawned by this OWAMP-control session MAY be 955 considered invalid. 957 Number of Sessions indicates the number of session description 958 records that immediately follow the Stop-Sessions header. 960 Number of Sessions MUST contain the number of send sessions started 961 by the local side of the control connection that have not been 962 previously terminated by a Stop-Sessions command (i.e., the 963 Control-Client MUST account for each accepted Request-Session where 964 Conf-Receiver was set; the Control-Server MUST account for each 965 accepted Request-Session where Conf-Sender was set). If the 966 Stop-Sessions message does not account for exactly the send sessions 967 controlled by that side, then it is to be considered invalid and the 968 connection SHOULD be closed and any results obtained considered 969 invalid. 971 Each session description record represents one OWAMP-Test session. 973 SID is the session identifier (SID) used to indicate which send 974 session is being described. 976 Next Seqno indicates the next sequence number that would have been 977 sent from this send session. For completed sessions, this will equal 978 NumPackets from the Request-Session. 980 Number of Skip Ranges indicates the number of holes that actually 981 occurred in the sending process. This is a range of packets that were 982 never actually sent by the sending process. For example, if a send 983 session is started too late for the first 10 packets to be sent and 984 this is the only hole in the schedule, then ``Number of Skip Ranges'' 985 would be 1. The single Skip Range description will have First Seqno 986 Skipped equal to 0 and Last Seqno Skipped equal to 9. This is 987 described further in the ``Sender Behavior'' section. 989 If the OWAMP-Control connection breaks when the Stop-Sessions command 990 is sent, the receiver MAY not completely invalidate the session 991 results. It MUST discard all record of packets that follow (in other 992 words, have greater sequence number than) the last packet that was 993 actually received before before any lost packet records. This will 994 help differentiate between packet losses that occurred in the network 995 and packets the sending process may have never sent. 997 If a receiver of an OWAMP-Test session learns, through an OWAMP- 998 Control Stop-Sessions message, that the OWAMP-Test sender's last 999 sequence number is lower than any sequence number actually received, 1000 the results of the complete OWAMP-Test session MUST be invalidated. 1002 A receiver of an OWAMP-Test session, upon receipt of an OWAMP-Control 1003 Stop-Sessions command, MUST discard any packet records -- including 1004 lost packet records -- with a (computed) send time that falls between 1005 the current time minus Timeout and the current time. This ensures 1006 statistical consistency for the measurement of loss and duplicates in 1007 the event that the Timeout is greater than the time it takes for the 1008 Stop-Sessions command to take place. 1010 To effect complete sessions, each side of the control connection 1011 SHOULD wait until all sessions are complete before sending the 1012 Stop-Sessions message. The completed time of each sessions is 1013 determined as Timeout after the scheduled time for the last sequence 1014 number. Endpoints MAY add a small increment to the computed 1015 completed time for send endpoints to ensure the Stop-Sessions message 1016 reaches the receiver endpoint after Timeout. 1018 To effect a premature stop of sessions, the party that initiates this 1019 command MUST stop its OWAMP-Test send streams to send the Session 1020 Packets Sent values before sending this command. That party SHOULD 1021 wait until receiving the response Stop-Sessions message before 1022 stopping the receiver streams so that it can use the values from the 1023 received Stop-Sessions message to validate the data. 1025 3.9. Fetch-Session 1027 The format of this client command is as follows: 1029 0 1 2 3 1030 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 1031 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1032 | 4 | | 1033 +-+-+-+-+-+-+-+-+ | 1034 | MBZ (7 octets) | 1035 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1036 | Begin Seq | 1037 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1038 | End Seq | 1039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1040 | | 1041 | SID (16 octets) | 1042 | | 1043 | | 1044 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1045 | | 1046 | IZP (16 octets) | 1047 | | 1048 | | 1049 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1051 Begin Seq is the sequence number of the first requested packet. End 1052 Seq is the sequence number of the last requested packet. If Begin 1053 Seq is all zeros and End Seq is all ones, complete session is said to 1054 be requested. 1056 If a complete session is requested and the session is still in 1057 progress, or has terminated in any way other than normal, the request 1058 to fetch session results MUST be denied. If an incomplete session is 1059 requested, all packets received so far that fall into the requested 1060 range SHOULD be returned. Note that, since no commands can be issued 1061 between Start-Sessions and Stop-Sessions, incomplete requests can 1062 only happen on a different OWAMP-Control connection (from the same or 1063 different host as Control-Client). 1065 The server MUST respond with a Fetch-Ack message. The format of this 1066 server response is as follows: 1068 0 1 2 3 1069 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 1070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1071 | Accept | Finished | MBZ (2 octets) | 1072 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1073 | Next Seqno | 1074 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1075 | Number of Skip Ranges | 1076 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1077 | Number of Records | 1078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1079 | | 1080 | IZP (16 octets) | 1081 | | 1082 | | 1083 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1085 Again, non-zero in the Accept field means a rejection of command. 1086 The server MUST specify zero for all remaining fields if Accept is 1087 non-zero. The client MUST ignore all remaining fields (except for the 1088 IZP) if Accept is non-zero. The full list of available Accept values 1089 is described in Section 3.3, ``Values of the Accept Field''. 1091 Finished is non-zero if the OWAMP-Test session has terminated. 1093 Next Seqno indicates the next sequence number that would have been 1094 sent from this send session. For completed sessions, this will equal 1095 NumPackets from the Request-Session. This information is only 1096 available if the session has terminated. If Finished is zero, then 1097 Next Seqno MUST be set to zero by the server. 1099 Number of Skip Ranges indicates the number of holes that actually 1100 occurred in the sending process. This information is only available 1101 if the session has terminated. If Finished is zero, then Skip Ranges 1102 MUST be set to zero by the server. 1104 Number of Records is the number of packet records that fall within 1105 the requested range. This number might be less than the Number of 1106 Packets in the reproduction of the Request-Session command because of 1107 a session that ended prematurely or it might be greater because of 1108 duplicates. 1110 If Accept was non-zero, this concludes the response to the Fetch- 1111 Session message. If Accept was 0, the server then MUST immediately 1112 send the OWAMP-Test session data in question. 1114 The OWAMP-Test session data consists of the following (concatenated): 1116 + A reproduction of the Request-Session command that was used to 1117 start the session; it is modified so that actual sender and 1118 receiver port numbers that were used by the OWAMP-Test session 1119 always appear in the reproduction. 1121 + Zero or more (as specified) Skip Range descriptions. The last 1122 (possibly full, possibly incomplete) block (16 octets) of Skip 1123 Range descriptions is padded with zeros if necessary. (These 1124 zeros are simple padding and should be distinguished from the 16 1125 octets of IZP that follow.) 1127 + 16 octets of IZP. 1129 + Zero or more (as specified) packet records. The last (possibly 1130 full, possibly incomplete) block (16 octets) of data is padded 1131 with zeros if necessary. (These zeros are simple padding and 1132 should be distinguished from the 16 octets of IZP that follow.) 1134 + 16 octets of IZP. 1136 Skip Range descriptions are simply two sequence numbers that, 1137 together, indicate a range of packets that were not sent: 1139 0 1 2 3 1140 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 1141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| 1142 | First Seqno Skipped | 1143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1144 | Last Seqno Skipped | 1145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1147 Skip Range descriptions should be sent out in order, as sorted by 1148 First Seqno. If any Skip Ranges overlap, or are out of order, the 1149 session data is to be considered invalid and the connection SHOULD be 1150 closed and any results obtained considered invalid. 1152 Each packet record is 25 octets, and includes 4 octets of sequence 1153 number, 8 octets of send timestamp, 2 octets of send timestamp error 1154 estimate, 8 octets of receive timestamp, 2 octets of receive 1155 timestamp error estimate, and 1 octet of Time To Live (TTL), or Hop 1156 Limit in IPv6: 1158 0 1 2 3 1159 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 1160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1161 00| Seq Number | 1162 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1163 04| Send Error Estimate | Receive Error Estimate | 1164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1165 08| Send Timestamp | 1166 12| | 1167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1168 16| Receive Timestamp | 1169 20| | 1170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1171 24| TTL | 1172 +-+-+-+-+-+-+-+-+ 1174 Packet records are sent out in the same order the actual packets were 1175 received. Therefore, the data is in arrival order. 1177 Note that lost packets (if any losses were detected during the 1178 OWAMP-Test session) MUST appear in the sequence of packets. They can 1179 appear either at the point when the loss was detected or at any later 1180 point. Lost packet records are distinguished as follows: 1182 + A send timestamp filled with the presumed send time (as computed 1183 by the send schedule). 1185 + A send error estimate filled with Multiplier=1, Scale=64, and S=0 1186 (see the OWAMP-Test description for definition of these quantities 1187 and explanation of timestamp format and error estimate format). 1189 + A normal receive error estimate as determined by the error of the 1190 clock being used to declare the packet lost. (It is declared lost 1191 if it is not received by the Timeout after the presumed send time, 1192 as determined by the receiver's clock.) 1194 + A receive timestamp consisting of all zero bits. 1196 + A TTL value of 255. 1198 4. OWAMP-Test 1200 This section describes OWAMP-Test protocol. It runs over UDP using 1201 sender and receiver IP and port numbers negotiated during the 1202 Request-Session exchange. 1204 As with OWAMP-Control, OWAMP-Test has three modes: unauthenticated, 1205 authenticated, and encrypted. All OWAMP-Test sessions that are 1206 spawned by an OWAMP-Control session inherit its mode. 1208 OWAMP-Control client, OWAMP-Control server, OWAMP-Test sender, and 1209 OWAMP-Test receiver can potentially all be different machines. (In a 1210 typical case, we expect that there will be only two machines.) 1212 4.1. Sender Behavior 1214 4.1.1. Packet Timings 1216 Send schedules based on slots, described previously, in conjunction 1217 with scheduled session start time, enable the sender and the receiver 1218 to compute the same exact packet sending schedule independently of 1219 each other. These sending schedules are independent for different 1220 OWAMP-Test sessions, even if they are governed by the same 1221 OWAMP-Control session. 1223 Consider any OWAMP-Test session. Once Start-Sessions exchange is 1224 complete, the sender is ready to start sending packets. Under normal 1225 OWAMP use circumstances, the time to send the first packet is in the 1226 near future (perhaps a fraction of a second away). The sender SHOULD 1227 send packets as close as possible to their scheduled time, with the 1228 following exception: if the scheduled time to send is in the past, 1229 and separated from the present by more than Timeout time, the sender 1230 MUST NOT send the packet. (Indeed, such a packet would be considered 1231 lost by the receiver anyway.) The sender MUST keep track of which 1232 packets it does not send. It will use this to tell the receiver what 1233 packets were not sent by setting Skip Ranges in the Stop-Sessions 1234 message from the sender to the receiver upon completion of the test. 1235 The Skip Ranges are also sent to a Fetch-Client as part of the 1236 session data results. These holes in the sending schedule can happen 1237 if a time in the past was specified in the Request-Session command, 1238 or if the Start-Sessions exchange took unexpectedly long, or if the 1239 sender could not start serving the OWAMP-Test session on time due to 1240 internal scheduling problems of the OS. Packets in the past, but 1241 separated from the present by less than Timeout value, SHOULD be sent 1242 as quickly as possible. With normal test rates and timeout values, 1243 the number of packets in such a burst is limited. Nevertheless, 1244 hosts SHOULD NOT intentionally schedule sessions so that such bursts 1245 of packets occur. 1247 Regardless of any scheduling delays, each packet that is actually 1248 sent MUST have the best possible approximation of its real time of 1249 departure as its timestamp (in the packet). 1251 4.1.2. Packet Format and Content 1253 The sender sends the receiver a stream of packets with the schedule 1254 specified in the Request-Session command. The sender SHOULD set the 1255 TTL in IPv4 (or Hop Limit in IPv6) in the UDP packet to 255. The 1256 format of the body of a UDP packet in the stream depends on the mode 1257 being used. 1259 For unauthenticated mode: 1261 0 1 2 3 1262 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 1263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1264 | Sequence Number | 1265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1266 | Timestamp | 1267 | | 1268 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1269 | Error Estimate | | 1270 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1271 | | 1272 . . 1273 . Packet Padding . 1274 . . 1275 | | 1276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1278 For authenticated and encrypted modes: 1280 0 1 2 3 1281 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 1282 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1283 | Sequence Number | 1284 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1285 | | 1286 | IZP (12 octets) | 1287 | | 1288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1289 | Timestamp | 1290 | | 1291 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1292 | Error Estimate | | 1293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1294 | IZP (6 octets) | 1295 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1296 | | 1297 . . 1298 . Packet Padding . 1299 . . 1300 | | 1301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1303 The format of the timestamp is the same as in [RFC1305] and is as 1304 follows: first 32 bits represent the unsigned integer number of 1305 seconds elapsed since 0h on 1 January 1900; next 32 bits represent 1306 the fractional part of a second that has elapsed since then. 1308 So, Timestamp is represented as follows: 1309 0 1 2 3 1310 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 1311 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1312 | Integer part of seconds | 1313 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1314 | Fractional part of seconds | 1315 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1317 The Error Estimate specifies the estimate of the error and 1318 synchronization. It has the following format: 1320 0 1 1321 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1323 |S|Z| Scale | Multiplier | 1324 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1326 The first bit S SHOULD be set if the party generating the timestamp 1327 has a clock that is synchronized to UTC using an external source 1328 (e.g., the bit should be set if GPS hardware is used and it indicates 1329 that it has acquired current position and time or if NTP is used and 1330 it indicates that it has synchronized to an external source, which 1331 includes stratum 0 source, etc.); if there is no notion of external 1332 synchronization for the time source, the bit SHOULD NOT be set. The 1333 next bit has the same semantics as MBZ fields elsewhere: it MUST be 1334 set to zero by the sender and ignored by everyone else. The next six 1335 bits, Scale, form an unsigned integer; Multiplier is an unsigned 1336 integer as well. They are interpreted as follows: the error estimate 1337 is equal to Multiplier*2^(-32)*2^Scale (in seconds). [Notation 1338 clarification: 2^Scale is two to the power of Scale.] Multiplier 1339 MUST NOT be set to zero. If Multiplier is zero, the packet SHOULD be 1340 considered corrupt and discarded. 1342 Sequence numbers start with zero and are incremented by one for each 1343 subsequent packet. 1345 The minimum data segment length is, therefore, 14 octets in 1346 unauthenticated mode, and 32 octets in both authenticated mode and 1347 encrypted modes. 1349 The OWAMP-Test packet layout is the same in authenticated and 1350 encrypted modes. The encryption operations are, however, different. 1351 The difference is that in encrypted mode both the sequence number and 1352 the timestamp are encrypted to provide maximum data integrity 1353 protection while in authenticated mode the sequence number is 1354 encrypted and the timestamp is sent in clear text. Sending the 1355 timestamp in clear text in authenticated mode allows one to reduce 1356 the time between when a timestamp is obtained by a sender and when 1357 the packet is shipped out. In encrypted mode, the sender has to 1358 fetch the timestamp, encrypt it, and send it; in authenticated mode, 1359 the middle step is removed, potentially improving accuracy (the 1360 sequence number can be encrypted before the timestamp is fetched). 1362 In authenticated mode, the first block (16 octets) of each packet is 1363 encrypted using AES Electronic Cookbook (ECB) mode. 1365 The key to use is obtained as follows: the 16-octet session 1366 identifier (SID) is encrypted with the same session key as is used 1367 for the corresponding OWAMP-Control session (where it is used in a 1368 different chaining mode); this is a single-block ECB encryption; its 1369 result is the key to use in encrypting (and decrypting) the packets 1370 of the particular OWAMP-Test session. 1372 ECB mode used for encrypting the first block of OWAMP-Test packets in 1373 authenticated mode does not involve any actual chaining; this way, 1374 lost, duplicated, or reordered packets do not cause problems with 1375 deciphering any packet in an OWAMP-Test session. 1377 In encrypted mode, the first two blocks (32 octets) are encrypted 1378 using AES CBC mode. The key to use is obtained in the same way as 1379 the key for authenticated mode. Each OWAMP-Test packet is encrypted 1380 as a separate stream, with just one chaining operation; chaining does 1381 not span multiple packets so that lost, duplicated, or reordered 1382 packets do not cause problems. The initialization vector for the CBC 1383 encryption is a value with all bits equal to zero. 1385 Implementation note: Naturally, the key schedule for each OWAMP-Test 1386 session need only be set up once per session, not once per packet. 1388 In unauthenticated mode, no encryption is applied. 1390 Packet Padding in OWAMP-Test SHOULD be pseudo-random (it MUST be 1391 generated independently of any other pseudo-random numbers mentioned 1392 in this document). However, implementations MUST provide a 1393 configuration parameter, an option, or a different means of making 1394 Packet Padding consist of all zeros. 1396 The time elapsed between packets is computed according to the slot 1397 schedule as mentioned in Request-Session command description. At 1398 that point, we skipped over the issue of computing exponentially 1399 distributed pseudo-random numbers in a reproducible fashion. It is 1400 discussed later in a separate section. 1402 4.2. Receiver Behavior 1404 The receiver knows when the sender will send packets. The following 1405 parameter is defined: Timeout (from Request-Session). Packets that 1406 are delayed by more than Timeout are considered lost (or `as good as 1407 lost'). Note that there is never an actual assurance of loss by the 1408 network: a `lost' packet might still be delivered at any time. The 1409 original specification for IPv4 required that packets be delivered 1410 within TTL seconds or never (with TTL having a maximum value of 255). 1411 To the best of the authors' knowledge, this requirement was never 1412 actually implemented (and, of course, only a complete and universal 1413 implementation would ensure that packets do not travel for longer 1414 than TTL seconds). In fact, in IPv6, the name of this field has 1415 actually been changed to Hop Limit. Further, IPv4 specification 1416 makes no claims about the time it takes the packet to traverse the 1417 last link of the path. 1419 The choice of a reasonable value of Timeout is a problem faced by a 1420 user of OWAMP protocol, not by an implementor. A value such as two 1421 minutes is very safe. Note that certain applications (such as 1422 interactive `one-way ping') might wish to obtain the data faster than 1423 that. 1425 As packets are received, 1427 + Timestamp the received packet. 1429 + In authenticated or encrypted mode, decrypt the first block (16 1430 octets) of the packet body. 1432 + Store the packet sequence number, send time, receive time, and the 1433 TTL for IPv4 (or Hop Limit for IPv6) from the packet IP header for 1434 the results to be transferred. 1436 + Packets not received within the Timeout are considered lost. They 1437 are recorded with their true sequence number, presumed send time, 1438 receive time value with all bits being zero, and TTL (or Hop 1439 Limit) of 255. 1441 Implementations SHOULD fetch the TTL/Hop Limit value from the IP 1442 header of the packet. If an implementation does not fetch the actual 1443 TTL value (the only good reason to not do so is inability to access 1444 the TTL field of arriving packets), it MUST record the TTL value as 1445 255. 1447 Packets that are actually received are recorded in the order of 1448 arrival. Lost packet records serve as indications of the send times 1449 of lost packets. They SHOULD be placed either at the point where the 1450 receiver learns about the loss or at any later point; in particular, 1451 one MAY place all the records that correspond to lost packets at the 1452 very end. 1454 Packets that have send time in the future MUST be recorded normally, 1455 without changing their send timestamp, unless they have to be 1456 discarded. (Send timestamps in the future would normally indicate 1457 clocks that differ by more than the delay. Some data -- such as 1458 jitter -- can be extracted even without knowledge of time difference. 1459 For other kinds of data, the adjustment is best handled by the data 1460 consumer on the basis of the complete information in a measurement 1461 session, as well as, possibly, external data.) 1463 Packets with a sequence number that was already observed (duplicate 1464 packets) MUST be recorded normally. (Duplicate packets are sometimes 1465 introduced by IP networks. The protocol has to be able to measure 1466 duplication.) 1468 If any of the following is true, the packet MUST be discarded: 1470 + Send timestamp is more than Timeout in the past or in the future. 1472 + Send timestamp differs by more than Timeout from the time when the 1473 packet should have been sent according to its sequence number. 1475 + In authenticated or encrypted mode, any of the bits of zero 1476 padding inside the first 16 octets of packet body is non-zero. 1478 5. Computing Exponentially Distributed Pseudo-Random Numbers 1480 Here we describe the way exponential random quantities used in the 1481 protocol are generated. While there is a fair number of algorithms 1482 for generating exponential random variables, most of them rely on 1483 having logarithmic function as a primitive, resulting in potentially 1484 different values, depending on the particular implementation of the 1485 math library. We use algorithm 3.4.1.S in [KNUTH], which is free 1486 of the above-mentioned problem, and guarantees the same output on any 1487 implementation. The algorithm belongs to the ziggurat family 1488 developed in the 1970s by G. Marsaglia, M. Sibuya and J. H. Ahrens 1489 [ZIGG]. It replaces the use of logarithmic function by clever bit 1490 manipulation, still producing the exponential variates on output. 1492 5.1. High-Level Description of the Algorithm 1494 For ease of exposition, the algorithm is first described with all 1495 arithmetic operations being interpreted in their natural sense. 1496 Later, exact details on data types, arithmetic, and generation of the 1497 uniform random variates used by the algorithm are given. It is an 1498 almost verbatim quotation from [KNUTH], p.133. 1500 Algorithm S: Given a real positive number 'mu', produce an 1501 exponential random variate with mean 'mu'. 1503 First, the constants 1505 Q[k] = (ln2)/(1!) + (ln2)^2/(2!) + ... + (ln2)^k/(k!), 1 <= k <= 11 1507 are computed in advance. The exact values which MUST be used by all 1508 implementations are given in the next section. This is necessary to 1509 insure that exactly the same pseudo-random sequences are produced by 1510 all implementations. 1512 S1. [Get U and shift.] Generate a 32-bit uniform random binary 1513 fraction 1515 U = (.b0 b1 b2 ... b31) [note the binary point] 1517 Locate the first zero bit b_j, and shift off the leading (j+1) bits, 1518 setting U <- (.b_{j+1} ... b31) 1520 Note: In the rare case that the zero has not been found, it is 1521 prescribed that the algorithm return (mu*32*ln2). 1523 S2. [Immediate acceptance?] If U < ln2, set X <- mu*(j*ln2 + U) and 1524 terminate the algorithm. (Note that Q[1] = ln2.) 1526 S3. [Minimize.] Find the least k >= 2 such that U < Q[k]. Generate k 1527 new uniform random binary fractions U1,...,Uk and set V <- 1528 min(U1,...,Uk). 1530 S4. [Deliver the answer.] Set X <- mu*(j + V)*ln2. 1532 5.2. Data Types, Representation, and Arithmetic 1534 The high-level algorithm operates on real numbers -- typically 1535 represented as floating point numbers. This specification prescribes 1536 that unsigned 64-bit integers be used instead. 1538 u_int64_t integers are interpreted as real numbers by placing the 1539 decimal point after the first 32 bits. In other words, conceptually, 1540 the interpretation is given by the map: 1542 u_int64_t u; 1544 u |--> (double)u / (2**32) 1546 The algorithm produces a sequence of such u_int64_t integers that, 1547 for any given value of SID, is guaranteed to be the same on any 1548 implementation. 1550 We specify that the u_int64_t representations of the first 11 values 1551 of the Q array in the high-level algorithm MUST be as follows: 1553 #1 0xB17217F8, 1554 #2 0xEEF193F7, 1555 #3 0xFD271862, 1556 #4 0xFF9D6DD0, 1557 #5 0xFFF4CFD0, 1558 #6 0xFFFEE819, 1559 #7 0xFFFFE7FF, 1560 #8 0xFFFFFE2B, 1561 #9 0xFFFFFFE0, 1562 #10 0xFFFFFFFE, 1563 #11 0xFFFFFFFF 1565 For example, Q[1] = ln2 is indeed approximated by 0xB17217F8/(2**32) 1566 = 0.693147180601954; for j > 11, Q[j] is 0xFFFFFFFF. 1568 Small integer j in the high-level algorithm is represented as 1569 u_int64_t value j * (2**32). 1571 Operation of addition is done as usual on u_int64_t numbers; however, 1572 the operation of multiplication in the high-level algorithm should be 1573 replaced by 1575 (u, v) |---> (u * v) >> 32. 1577 Implementations MUST compute the product (u * v) exactly. For 1578 example, a fragment of unsigned 128-bit arithmetic can be implemented 1579 for this purpose (see sample implementation below). 1581 5.3. Uniform Random Quantities 1583 The procedure for obtaining a sequence of 32-bit random numbers (such 1584 as U in algorithm S) relies on using AES encryption in counter mode. 1585 To describe the exact working of the algorithm, we introduce two 1586 primitives from Rijndael. Their prototypes and specification are 1587 given below, and they are assumed to be provided by the supporting 1588 Rijndael implementation, such as [RIJN]. 1590 + A function that initializes a Rijndael key with bytes from seed 1591 (the SID will be used as the seed): 1593 void KeyInit(unsigned char seed[16]); 1595 + A function that encrypts the 16-octet block inblock with the 1596 specified key, returning a 16-octet encrypted block. Here 1597 keyInstance is an opaque type used to represent Rijndael keys: 1599 void BlockEncrypt(keyInstance key, unsigned char inblock[16]); 1601 Algorithm Unif: given a 16-octet quantity seed, produce a sequence of 1602 unsigned 32-bit pseudo-random uniformly distributed integers. In 1603 OWAMP, the SID (session ID) from Control protocol plays the role of 1604 seed. 1606 U1. [Initialize Rijndael key] key <- KeyInit(seed) [Initialize an 1607 unsigned 16-octet (network byte order) counter] c <- 0 U2. [Need 1608 more random bytes?] Set i <- c mod 4. If (i == 0) set s <- 1609 BlockEncrypt(key, c) 1611 U3. [Increment the counter as unsigned 16-octet quantity] c <- c + 1 1613 U4. [Do output] Output the i_th quartet of octets from s starting 1614 from high-order octets, converted to native byte order and 1615 represented as OWPNum64 value (as in 3.b). 1617 U5. [Loop] Go to step U2. 1619 6. Security Considerations 1621 6.1. Introduction 1623 The goal of authenticated mode to let one passphrase-protect the 1624 service provided by a particular OWAMP-Control server. One can 1625 imagine a variety of circumstances where this could be useful. 1626 Authenticated mode is designed to prohibit theft of service. 1628 An additional design objective of the authenticated mode was to make 1629 it impossible for an attacker who cannot read traffic between OWAMP- 1630 Test sender and receiver to tamper with test results in a fashion 1631 that affects the measurements, but not other traffic. 1633 The goal of encrypted mode is quite different: to make it hard for a 1634 party in the middle of the network to make results look `better' than 1635 they should be. This is especially true if one of client and server 1636 does not coincide with either sender or receiver. 1638 Encryption of OWAMP-Control using AES CBC mode with blocks of zeros 1639 after each message aims to achieve two goals: (i) to provide secrecy 1640 of exchange; (ii) to provide authentication of each message. 1642 6.2. Preventing Third-Party Denial of Service 1644 OWAMP-Test sessions directed at an unsuspecting party could be used 1645 for denial of service (DoS) attacks. In unauthenticated mode, 1646 servers SHOULD limit receivers to hosts they control or to the OWAMP- 1647 Control client. 1649 Unless otherwise configured, the default behavior of servers MUST be 1650 to decline requests where the Receiver Address field is not equal to 1651 the address that the control connection was initiated from or an 1652 address of the server (or an address of a host it controls). Given 1653 the TCP handshake procedure and sequence numbers in the control 1654 connection, this ensures that the hosts that make such requests are 1655 actually those hosts themselves, or at least on the path towards 1656 them. If either this test or the handshake procedure were omitted, 1657 it would become possible for attackers anywhere in the Internet to 1658 request large amounts of test packets be directed against victim 1659 nodes somewhere else. 1661 In any case, OWAMP-Test packets with a given source address MUST only 1662 be sent from the node that has been assigned that address (i.e., 1663 address spoofing is not permitted). 1665 6.3. Covert Information Channels 1667 OWAMP-Test sessions could be used as covert channels of information. 1668 Environments that are worried about covert channels should take this 1669 into consideration. 1671 6.4. Requirement to Include AES in Implementations 1673 Notice that AES, in counter mode, is used for pseudo-random number 1674 generation, so implementation of AES MUST be included, even in a 1675 server that only supports unauthenticated mode. 1677 6.5. Resource Use Limitations 1679 An OWAMP server can consume resources of various kinds. The two most 1680 important kinds of resources are network capacity and memory (primary 1681 or secondary) for storing test results. 1683 Any implementation of OWAMP server MUST include technical mechanisms 1684 to limit the use of network capacity and memory. Mechanisms for 1685 managing the resources consumed by unauthenticated users and users 1686 authenticated with a KeyID and passphrase SHOULD be separate. The 1687 default configuration of an implementation MUST enable these 1688 mechanisms and set the resource use limits to conservatively low 1689 values. 1691 One way to design the resource limitation mechanisms is as follows: 1692 assign each session to a user class. User classes are partially 1693 ordered with ``includes'' relation, with one class (``all users'') 1694 that is always present and that includes any other class. The 1695 assignment of a session to a user class can be based on the presence 1696 of authentication of the session, the KeyID, IP address range, time 1697 of day, and, perhaps, other factors. Each user class would have a 1698 limit for usage of network capacity (specified in units of 1699 bit/second) and memory for storing test results (specified in units 1700 of octets). Along with the limits for resource use, current use 1701 would be tracked by the server. When a session is requested by a 1702 user in a specific user class, the resources needed for this session 1703 are computed: the average network capacity use (based on the sending 1704 schedule) and the maximum memory use (based on the number of packets 1705 and number of octets each packet would need to be stored internally 1706 -- note that outgoing sessions would not require any memory use). 1707 These resource use numbers are added to the current resource use 1708 numbers for the given user class; if such addition would take the 1709 resource use outside of the limits for the given user class, the 1710 session is rejected. When resources are reclaimed, corresponding 1711 measures are subtracted from the current use. Network capacity is 1712 reclaimed as soon as the session ends. Memory is reclaimed when the 1713 data is deleted. For unauthenticated sessions, memory consumed by an 1714 OWAMP-Test session SHOULD be reclaimed after the OWAMP-Control 1715 connection that initiated the session is closed (gracefully or 1716 otherwise). For authenticated sessions, the administrator who 1717 configures the service should be able to decide the exact policy, but 1718 useful policy mechanisms that MAY be implemented are the ability to 1719 automatically reclaim memory when the data is retrieved and the 1720 ability to reclaim memory after a certain configurable (based on user 1721 class) period of time passes after the OWAMP-Test session terminates. 1723 6.6. Use of Cryptographic Primitives in OWAMP 1725 At an early stage in designing the protocol, we considered using 1726 Transport Layer Security (TLS) [RFC2246, RFC3546] and IPsec [RFC2401] 1727 as cryptographic security mechanisms for OWAMP; later, we also 1728 considered DTLS. The disadvantages of those are as follows (not an 1729 exhaustive list): 1731 Regarding TLS: 1733 + TLS could be used to secure TCP-based OWAMP-Control, but it would 1734 be difficult to use it to secure UDP-based OWAMP-Test: OWAMP-Test 1735 packets, if lost, are not resent, so packets have to be 1736 (optionally) encrypted and authenticated while retaining 1737 individual usability. Stream-based TLS cannot be easily used for 1738 this. 1740 + Dealing with streams, TLS does not authenticate individual 1741 messages (even in OWAMP-Control). The easiest way out would be to 1742 add some known-format padding to each message and verify that the 1743 format of the padding is intact before using the message. The 1744 solution would thus lose some of its appeal (``just use TLS''); it 1745 would also be much more difficult to evaluate the security of this 1746 scheme with the various modes and options of TLS -- it would 1747 almost certainly not be secure with all. The capacity of an 1748 attacker to replace parts of messages (namely, the end) with 1749 random garbage could have serious security implications and would 1750 need to be analyzed carefully: suppose, for example, that a 1751 parameter that is used in some form to control the rate were 1752 replaced by random garbage -- chances are the result (an unsigned 1753 integer) would be quite large. 1755 + Dependent on the mode of use, one can end up with a requirement 1756 for certificates for all users and a PKI. Even if one is to 1757 accept that PKI is desirable, there just isn't a usable one today. 1759 + TLS requires a fairly large implementation. OpenSSL, for example, 1760 is larger than our implementation of OWAMP as a whole. This can 1761 matter for embedded implementations. 1763 Regarding DTLS: 1765 + Duplication and, similarly, reordering are network phenomena that 1766 OWAMP needs to be able to measure; yet anti-replay measures and 1767 reordering protection of DTLS would prevent the duplicated and 1768 reordered packets from reaching the relevant part of the OWAMP 1769 code. One could, of course, modify DTLS so that these protections 1770 are weakened, or even specify examining the messages in a 1771 carefully crafted sequence somewhere in between of DTLS checks, 1772 but then, of course, the advantage of using an existing protocol 1773 would not be realized. 1775 + In authenticated mode the timestamp is in the clear and not 1776 protected cryptographically in any way, while the rest of the 1777 message has the same protection as in encrypted mode. This mode 1778 allows one to trade off cryptographic protection against accuracy 1779 of timestamps. For example, the APAN hardware implementation of 1780 OWAMP [APAN-OWAMP] is capable of supporting authenticated mode. 1781 The accuracy of these measurements is in sub-microsecond range. 1782 The errors in OWAMP measurements of Abilene [Abilene-OWAMP] (done 1783 using a software implementation, in its encrypted mode) exceed 1784 10us. Users in different environments have different concerns, 1785 and some might very well care about every last microsecond of 1786 accuracy; at the same time, users in these same environments might 1787 care about access control to the service. Authenticated mode 1788 permits them to control access to the server, yet use unprotected 1789 timestamps, perhaps generated by a hardware device. 1791 Regarding IPsec: 1793 + What we now call authenticated mode would not be possible (in 1794 IPsec you can't authenticate part of a packet). 1796 + The deployment paths of IPsec and OWAMP could be separate if OWAMP 1797 does not depend on IPsec. After nine years of IPsec, only 0.05% 1798 of traffic on an advanced backbone network such as Abilene uses 1799 IPsec (for comparison purposes with encryption above layer 4, SSH 1800 use is at 2-4% and HTTPS use is at 0.2-0.6%). It is desirable to 1801 be able to deploy OWAMP on as large of a number of different 1802 platforms as possible. 1804 + The deployment problems of a protocol dependent on IPsec would be 1805 especially acute in the case of lightweight embedded devices. 1806 Ethernet switches, DSL ``modems,'' and other such devices mostly 1807 do not support IPsec. 1809 + The API for manipulating IPsec from an application is currently 1810 poorly understood. Writing a program that needs to encrypt some 1811 packets, authenticate some packets, and leave some open -- for the 1812 same destination -- would become more of an exercise in IPsec 1813 rather than in IP measurement. 1815 For the enumerated reasons, we decided to use a simple cryptographic 1816 protocol (based on a block cipher in CBC mode) that is different from 1817 TLS and IPsec. 1819 6.7. Cryptographic primitive replacement 1821 It might become necessary in the future to replace AES, or the way it 1822 is used in OWAMP, with a new cryptographic primitive---or to make 1823 other security-related changes to the protocol. OWAMP provides a 1824 well-defined point of extensibility: the Modes word in the server 1825 greeting and the Mode response in the Set-Up-Response message. For 1826 example, if a simple replacement of AES with a different block cipher 1827 with a 128-bit block is needed, this could be accomplished as 1828 follows: take two bits from the reserved (MBZ) part of the Modes word 1829 of the server greeting; use one of these bits to indicate encrypted 1830 mode with the new cipher and another one to indicate authenticated 1831 mode with the new cipher. (Bit consumption could, in fact, be 1832 reduced from two to one, if the client is allowed to return a mode 1833 selection with more than a single bit set: one could designate a 1834 single bit to mean that the new cipher is supported [in the case of 1835 the server] or selected [in the case of the client] and continue to 1836 use already allocated bits for authenticated and encrypted modes; 1837 this optimization is unimportant conceptually, but could be useful in 1838 practice to make the best use of bits.) Then, if the new cipher is 1839 negotiated, all subsequent operations simply use it instead of AES. 1840 Note that the normal transition sequence would be used in such a 1841 case: implementations would probably first start supporting and 1842 preferring the new cipher, and then drop support for the old 1843 (presumably no longer considered secure) cipher. 1845 If the need arises to make more extensive changes (perhaps replace 1846 AES with a 256-bit-block cipher), this would be more difficult and 1847 would require changing the layout of the messages. However, the 1848 change can still be conducted within the framework of OWAMP 1849 extensibility using the Modes/Mode words. (The semantics of the new 1850 bits [or single bit, if the optimization described above is used] 1851 would include the change to message layout as well as the change in 1852 the cryptographic primitive.) 1854 6.8. (Not) Using Time as Salt 1856 A natural idea is to use the current time as salt when deriving 1857 session keys. Unfortunately, this appears too limiting. 1859 While OWAMP is often run on hosts with well-synchronized clocks, it 1860 is also possible to run it on hosts with clocks completely untrained. 1861 The delays obtained thusly are, of course, not directly usable; 1862 however, some metrics, such as unidirectional loss, reordering, 1863 measures of congestion such as the median delay minus minimum, and 1864 many others are usable directly and immediately (and improve upon the 1865 information that would have been provided by a round-trip 1866 measurement); further, even delay information can be useful with 1867 appropriate post-processing---indeed, one can even argue that running 1868 the clocks free and post-processing the results of a mesh of 1869 measurements will result in better accuracy, as more information is 1870 available a posteriori and correlation of data from different hosts 1871 is possible in post-processing, but not with online clock training. 1873 Given this, time is not used as salt in key derivation. 1875 6.9. Required Properties of MD5 1877 The protocol makes use of the MD5 hash function to convert a 1878 user-supplied passphrase into a key that will be used to encrypt a 1879 short piece of random data (the session key). 1881 In this document we use cryptographic terminology of [MENEZES]. 1883 It has long been suspected, and has been conclusively shown recently 1884 that MD5 is not a collision-resistant hash function. Since collision 1885 resistance was one of design goals of MD5, this casts strong 1886 suspicion on the other design goals of MD5, namely preimage 1887 resistance and 2nd preimage resistance. 1889 OWAMP does not rely on any of these properties. 1891 The properties of MD5 that are necessary are as follows: (1) it is a 1892 function that maps arbitrary length inputs into 128-bit outputs 1893 [fixed-length hash function], (2) a change in any bit of the input 1894 usually results in a change of a few bits of output [weakened 1895 avalanche property], (3) many 128-bit values have preimages [almost 1896 surjective], and (4) the visible special structure of 1897 natural-language text possibly present in the passphrase is concealed 1898 after application of the function. These are very weak requirements 1899 that many functions satisfy. Something resembling CRC-128 would work 1900 just as well. 1902 We chose MD5 here because it has the required properties and is 1903 widely implemented, understood, and documented. Alternatives would 1904 include (1) a non-cryptographic primitive, such as CRC-128, (2) SHA-1 1905 truncated to 128 bits, or (3) a hash function based on AES (using 1906 Matyas-Meyer-Oseas, Davies-Meyer, or Miyaguchi-Preneel constructions; 1907 we would probably gravitate towards the last one if a block-cipher- 1908 based cryptographically secure hash function were required). Note 1909 that option 1 would not have any cryptographically relevant 1910 properties. We chose not to use it because of lack of 1911 well-documented 128-bit checksums; this specification would incur an 1912 unnecessary burden precisely defining one, providing test vectors, 1913 etc., with no advantage over MD5. Option 2, SHA-1, belongs to the 1914 MD4 family that appears to be under suspicion in light of recent 1915 developments. To avoid creating an impression that any potential 1916 future changes in the status of SHA-1 can affect the status of OWAMP 1917 we chose not to use it. Option 3 would result in a hash function 1918 that, with the current state of knowledge, would probably be one of 1919 the most cryptographically sound. Our requirements 1-4 from the 1920 preceding paragraph, however, do not call for a cryptographically 1921 sound hash function. Just as with CRC-128, this specification would 1922 need to define the hash function and provide test vectors (and 1923 perhaps sample code); we see no advantage in this approach versus 1924 using MD5. (Note that the performance advantages of MD5 are 1925 irrelevant for this application, as the hash is computed on a 1926 relatively short human-supplied string only once per OWAMP-Control 1927 session, so if the Miyaguchi-Preneel construction were documented in 1928 an RFC, we might just as well have used that.) 1930 6.10. The Use of AES-CBC-MAC 1932 OWAMP relies on AES-CBC-MAC for message authentication. Random IV 1933 choice is important for prevention of a codebook attack on the first 1934 block; it is unimportant for the purposes of CBC-MAC authentication 1935 (it should also be noted that, with its 128-bit block size, AES is 1936 more resistant to codebook attacks than ciphers with shorter blocks; 1937 we use random IV anyway). 1939 IZP, when decrypted, MUST be zero. It is crucial to check for this 1940 before using the message, otherwise existential forgery becomes 1941 possible. The complete message for which IZP is decrypted to non- 1942 zero MUST be discarded (for both short messages consisting of a few 1943 blocks and potentially long messages, such as a response to the 1944 Fetch-Session command). 1946 Since OWAMP messages can have different numbers of blocks, the 1947 existential forgery attack described in example 9.62 of [MENEZES] 1948 becomes a concern. To prevent it (and to simplify implementation), 1949 the length of any message becomes known after decrypting the first 1950 block of it. 1952 A special case is the first (fixed-length) message sent by the 1953 client. There, the token is a concatenation of the 128-bit challenge 1954 (transmitted by the server in the clear) and a 128-bit session key 1955 (generated randomly by the client, encrypted with AES-CBC with IV=0. 1956 Since IV=0, the challenge (a single cipher block) is simply encrypted 1957 with the secret key. Therefore, we rely on resistance of AES to 1958 chosen plaintext attacks (as the challenge could be substituted by an 1959 attacker). It should be noted that the number of blocks of chosen 1960 plaintext an attacker can have encrypted with the secret key is 1961 limited by the number of sessions the client wants to initiate. An 1962 attacker who knows the encryption of a server's challenge can produce 1963 an existential forgery of the session key and thus disrupt the 1964 session; however, any attacker can disrupt a session by corrupting 1965 the protocol messages in an arbitrary fashion, therefore no new 1966 threat is created here; nevertheless, we require that the server 1967 never issues the same challenge twice (if challenges are generated 1968 randomly, a repetition would occur, on average, after 2^64 sessions; 1969 we deem this satisfactory as this is enough even for an implausibly 1970 busy server that participates in 1,000,000 sessions per second to go 1971 without repetitions for more than 500 centuries). With respect to 1972 the second part of the token, an attacker can produce an existential 1973 forgery of the session key by modifying the second half of the 1974 client's token while leaving the first part intact. This forgery, 1975 however, would be immediately discovered by the client when the IZP 1976 on the server's next message (acceptance or rejection of the 1977 connection) does not verify. 1979 7. IANA Considerations 1981 IANA is requested to allocate a well-known TCP port number for the 1982 OWAMP-Control part of the OWAMP protocol. 1984 8. Internationalization Considerations 1986 The protocol does not carry any information in a natural language, 1987 with the possible exception of the KeyID in OWAMP-Control, which is 1988 encoded in UTF-8. 1990 9. Appendix A: Sample C Code for Exponential Deviates 1992 The values in array Q[] are the exact values that MUST be used by all 1993 implementations (see sections 5.1 and 5.2). This appendix only 1994 serves for illustrative purposes. 1996 /* 1997 ** Example usage: generate a stream of exponential (mean 1) 1998 ** random quantities (ignoring error checking during initialization). 1999 ** If a variate with some mean mu other than 1 is desired, the output 2000 ** of this algorithm can be multiplied by mu according to the rules 2001 ** of arithmetic we described. 2003 ** Assume that a 16-octet 'seed' has been initialized 2004 ** (as the shared secret in OWAMP, for example) 2005 ** unsigned char seed[16]; 2007 ** OWPrand_context next; 2009 ** (initialize state) 2010 ** OWPrand_context_init(&next, seed); 2012 ** (generate a sequence of exponential variates) 2013 ** while (1) { 2014 ** u_int64_t num = OWPexp_rand64(&next); 2015 2016 ... 2017 ** } 2018 */ 2020 #include 2022 typedef u_int64_t u_int64_t; 2024 /* (K - 1) is the first k such that Q[k] > 1 - 1/(2^32). */ 2025 #define K 12 2027 #define BIT31 0x80000000UL /* See if first bit in the lower 2028 32 bits is zero. */ 2029 #define MASK32(n) ((n) & 0xFFFFFFFFUL) 2031 #define EXP2POW32 0x100000000ULL 2033 typedef struct OWPrand_context { 2034 unsigned char counter[16]; /* Counter (network byte order). */ 2035 keyInstance key; /* Key to encrypt the counter. */ 2036 unsigned char out[16]; /* The encrypted block. */ 2037 } OWPrand_context; 2039 /* 2040 ** The array has been computed according to the formula: 2041 ** 2042 ** Q[k] = (ln2)/(1!) + (ln2)^2/(2!) + ... + (ln2)^k/(k!) 2043 ** 2044 ** as described in algorithm S. (The values below have been 2045 ** multiplied by 2^32 and rounded to the nearest integer.) 2046 ** These exact values MUST be used so that different implementation 2047 ** produce the same sequences. 2048 */ 2049 static u_int64_t Q[K] = { 2050 0, /* Placeholder - so array indices start from 1. */ 2051 0xB17217F8, 2052 0xEEF193F7, 2053 0xFD271862, 2054 0xFF9D6DD0, 2055 0xFFF4CFD0, 2056 0xFFFEE819, 2057 0xFFFFE7FF, 2058 0xFFFFFE2B, 2059 0xFFFFFFE0, 2060 0xFFFFFFFE, 2061 0xFFFFFFFF 2062 }; 2064 /* this element represents ln2 */ 2065 #define LN2 Q[1] 2067 /* 2068 ** Convert an unsigned 32-bit integer into a u_int64_t number. 2069 */ 2070 u_int64_t 2071 OWPulong2num64(u_int32_t a) 2072 { 2073 return ((u_int64_t)1 << 32) * a; 2074 } 2076 /* 2077 ** Arithmetic functions on u_int64_t numbers. 2078 */ 2080 /* 2081 ** Addition. 2082 */ 2083 u_int64_t 2084 OWPnum64_add(u_int64_t x, u_int64_t y) 2085 { 2086 return x + y; 2087 } 2089 /* 2090 ** Multiplication. Allows overflow. Straightforward implementation 2091 ** of Algorithm 4.3.1.M (p.268) from [KNUTH]. 2092 */ 2093 u_int64_t 2094 OWPnum64_mul(u_int64_t x, u_int64_t y) 2095 { 2096 unsigned long w[4]; 2097 u_int64_t xdec[2]; 2098 u_int64_t ydec[2]; 2099 int i, j; 2100 u_int64_t k, t, ret; 2102 xdec[0] = MASK32(x); 2103 xdec[1] = MASK32(x>>32); 2104 ydec[0] = MASK32(y); 2105 ydec[1] = MASK32(y>>32); 2107 for (j = 0; j < 4; j++) 2108 w[j] = 0; 2110 for (j = 0; j < 2; j++) { 2111 k = 0; 2112 for (i = 0; ; ) { 2113 t = k + (xdec[i]*ydec[j]) + w[i + j]; 2114 w[i + j] = t%EXP2POW32; 2115 k = t/EXP2POW32; 2116 if (++i < 2) 2117 continue; 2118 else { 2119 w[j + 2] = k; 2120 break; 2121 } 2122 } 2123 } 2125 ret = w[2]; 2126 ret <<= 32; 2127 return w[1] + ret; 2128 } 2130 /* 2131 ** Seed the random number generator using a 16-byte quantity 'seed' 2132 ** (== the session ID in OWAMP). This function implements step U1 2133 ** of algorithm Unif. 2134 */ 2136 void 2137 OWPrand_context_init(OWPrand_context *next, unsigned char *seed) 2138 { 2139 int i; 2141 /* Initialize the key */ 2142 rijndaelKeyInit(next->key, seed); 2144 /* Initialize the counter with zeros */ 2145 memset(next->out, 0, 16); 2146 for (i = 0; i < 16; i++) 2147 next->counter[i] = 0UL; 2148 } 2150 /* 2151 ** Random number generating functions. 2152 */ 2154 /* 2155 ** Generate and return a 32-bit uniform random value (saved in the less 2156 ** significant half of the u_int64_t). This function implements steps 2157 ** U2-U4 of the algorithm Unif. 2158 */ 2159 u_int64_t 2160 OWPunif_rand64(OWPrand_context *next) 2161 { 2162 int j; 2163 u_int8_t *buf; 2164 u_int64_t ret = 0; 2166 /* step U2 */ 2167 u_int8_t i = next->counter[15] & (u_int8_t)3; 2168 if (!i) 2169 rijndaelEncrypt(next->key, next->counter, next->out); 2171 /* Step U3. Increment next.counter as a 16-octet single 2172 quantity in network byte order for AES counter mode. */ 2173 for (j = 15; j >= 0; j--) 2174 if (++next->counter[j]) 2175 break; 2177 /* Step U4. Do output. The last 4 bytes of ret now contain the 2178 random integer in network byte order */ 2179 buf = &next->out[4*i]; 2180 for (j=0; j<4; j++) { 2181 ret <<= 8; 2182 ret += *buf++; 2183 } 2184 return ret; 2185 } 2187 /* 2188 ** Generate an exponential deviate with mean 1. 2189 */ 2190 u_int64_t 2191 OWPexp_rand64(OWPrand_context *next) 2192 { 2193 unsigned long i, k; 2194 u_int32_t j = 0; 2195 u_int64_t U, V, J, tmp; 2197 /* Step S1. Get U and shift */ 2198 U = OWPunif_rand64(next); 2200 while ((U & BIT31) && (j < 32)) { /* Shift until first 0. */ 2201 U <<= 1; 2202 j++; 2203 } 2204 /* Remove the 0 itself. */ 2205 U <<= 1; 2207 U = MASK32(U); /* Keep only the fractional part. */ 2208 J = OWPulong2num64(j); 2210 /* Step S2. Immediate acceptance? */ 2211 if (U < LN2) /* return (j*ln2 + U) */ 2212 return OWPnum64_add(OWPnum64_mul(J, LN2), U); 2214 /* Step S3. Minimize. */ 2215 for (k = 2; k < K; k++) 2216 if (U < Q[k]) 2217 break; 2218 V = OWPunif_rand64(next); 2219 for (i = 2; i <= k; i++) { 2220 tmp = OWPunif_rand64(next); 2221 if (tmp < V) 2222 V = tmp; 2223 } 2225 /* Step S4. Return (j+V)*ln2 */ 2226 return OWPnum64_mul(OWPnum64_add(J, V), LN2); 2227 } 2229 10. Appendix B: Test Vectors for Exponential Deviates 2231 It is important that the test schedules generated by different 2232 implementations from identical inputs be identical. The non-trivial 2233 part is the generation of pseudo-random exponentially distributed 2234 deviates. To aid implementors in verifying interoperability, several 2235 test vectors are provided. For each of the four given 128-bit values 2236 of SID represented as hexadecimal numbers, 1,000,000 exponentially 2237 distributed 64-bit deviates are generated as described above. As 2238 they are generated, they are all added to each other. The sum of all 2239 1,000,000 deviates is given as a hexadecimal number for each SID. An 2240 implementation MUST produce exactly these hexadecimal numbers. To 2241 aid in the verification of the conversion of these numbers to values 2242 of delay in seconds, approximate values are given (assuming 2243 lambda=1). An implementation SHOULD produce delay values in seconds 2244 that are close to the ones given below. 2246 SID = 0x2872979303ab47eeac028dab3829dab2 2247 SUM[1000000] = 0x000f4479bd317381 (1000569.739036 seconds) 2249 SID = 0x0102030405060708090a0b0c0d0e0f00 2250 SUM[1000000] = 0x000f433686466a62 (1000246.524512 seconds) 2252 SID = 0xdeadbeefdeadbeefdeadbeefdeadbeef 2253 SUM[1000000] = 0x000f416c8884d2d3 (999788.533277 seconds) 2255 SID = 0xfeed0feed1feed2feed3feed4feed5ab 2256 SUM[1000000] = 0x000f3f0b4b416ec8 (999179.293967 seconds) 2258 11. Normative References 2260 [AES] Advanced Encryption Standard (AES), 2261 http://csrc.nist.gov/encryption/aes/ 2263 [RFC1321] R. Rivest, `The MD5 Message-Digest Algorithm', RFC 1321, 2264 April 1992. 2266 [RFC2026] S. Bradner, `The Internet Standards Process -- Revision 3', 2267 RFC 2026, October 1996. 2269 [RFC2119] S. Bradner, `Key words for use in RFCs to Indicate 2270 Requirement Levels', RFC 2119, March 1997. 2272 [RFC2330] V. Paxon, G. Almes, J. Mahdavi, M. Mathis, `Framework for 2273 IP Performance Metrics' RFC 2330, May 1998. 2275 [RFC2474] K. Nichols, S. Blake, F. Baker, D. Black, `Definition of 2276 the Differentiated Services Field (DS Field) in the IPv4 and 2277 IPv6 Headers', RFC 2474, December 1998. 2279 [RFC2679] G. Almes, S. Kalidindi, and M. Zekauskas, `A One-way Delay 2280 Metric for IPPM', RFC 2679, September 1999. 2282 [RFC2680] G. Almes, S. Kalidindi, and M. Zekauskas, `A One-way Packet 2283 Loss Metric for IPPM', RFC 2680, September 1999. 2285 [RFC2836] S. Brim, B. Carpenter, F. Le Faucheur, `Per Hop Behavior 2286 Identification Codes', RFC 2836, May 2000. 2288 12. Informative References 2290 [APAN-OWAMP] Z. Shu and K. Kobayashi, HOTS: An OWAMP-Compliant 2291 Hardware Packet Timestamper, In Proceedings of PAM 2005, 2292 http://www.pam2005.org/PDF/34310360.pdf 2294 [BRIX] Brix Networks, http://www.brixnet.com/ 2296 [ZIGG] G. Marsaglia, M. Sibuya, and J. H. Ahrens, Communications of 2297 ACM, 15 (1972), 876-877. 2299 [MENEZES] A. J. Menezes, P. C. van Oorschot, and S. A. Vanstone, 2300 Handbook of Applied Cryptography, CRC Press, revised reprint 2301 with updates, 1997. 2303 [KNUTH] D. Knuth, The Art of Computer Programming, vol.2, 3rd 2304 edition, 1998. 2306 [Abilene-OWAMP] One-way Latency Measurement (OWAMP), 2307 http://e2epi.internet2.edu/owamp/ 2309 [RIJN] Reference ANSI C Implementation of Rijndael 2310 http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndaelref.zip 2312 [RIPE] RIPE NCC Test-Traffic Measurements home, 2313 http://www.ripe.net/test-traffic/. 2315 [RIPE-NLUUG] H. Uijterwaal and O. Kolkman, `Internet Delay 2316 Measurements Using Test-Traffic', Spring 1998 Dutch Unix User 2317 Group Meeting, 2318 http://www.ripe.net/test-traffic/Talks/9805_nluug.ps.gz. 2320 [SURVEYOR] Surveyor Home Page, http://www.advanced.org/surveyor/. 2322 [SURVEYOR-INET] S. Kalidindi and M. Zekauskas, `Surveyor: An 2323 Infrastructure for Network Performance Measurements', 2324 Proceedings of INET'99, June 1999. 2325 http://www.isoc.org/inet99/proceedings/4h/4h_2.htm 2327 [RFC1305] D. Mills, `Network Time Protocol (Version 3) Specification, 2328 Implementation and Analysis', RFC 1305, March 1992. 2330 [RFC2246] T. Dierks, C. Allen, `The TLS Protocol Version 1.0', 2331 January 1999. 2333 [RFC2401] S. Kent, R. Atkinson, `Security Architecture for the 2334 Internet Protocol', November 1998. 2336 [RFC3546] S. Blake-Wilson, M. Nystrom, D. Hopwood, J. Mikkelsen, T. 2337 Wright, `Transport Layer Security (TLS) Extensions', June 2003. 2339 [RFC4086] D. Eastlake 3rd, J. Schiller, S. Crocker, `Randomness 2340 Recommendations for Security', June 2005. 2342 13. Authors' Addresses 2344 Stanislav Shalunov 2345 Internet2 2346 1000 Oakbrook Drive, Suite 300 2347 Ann Arbor, MI 48104 2348 Email: shalunov@internet2.edu 2349 SIP: shalunov@internet2.edu 2351 Benjamin Teitelbaum 2352 Internet2 2353 1000 Oakbrook Drive, Suite 300 2354 Ann Arbor, MI 48104 2355 Email: ben@internet2.edu 2356 SIP: ben@internet2.edu 2358 Anatoly Karp 2359 4710 Regent St, Apt 81B 2360 Madison, WI 53705 2361 Telephone: +1-608-347-6255 2362 Email: ankarp@charter.net 2364 Jeff W. Boote 2365 Internet2 2366 1000 Oakbrook Drive, Suite 300 2367 Ann Arbor, MI 48104 2368 Email: boote@internet2.edu 2369 SIP: boote@internet2.edu 2371 Matthew J. Zekauskas 2372 Internet2 2373 1000 Oakbrook Drive, Suite 300 2374 Ann Arbor, MI 48104 2375 Email: matt@internet2.edu 2376 SIP: matt@internet2.edu 2378 Intellectual Property 2379 The IETF takes no position regarding the validity or scope of any 2380 Intellectual Property Rights or other rights that might be claimed to 2381 pertain to the implementation or use of the technology described in 2382 this document or the extent to which any license under such rights 2383 might or might not be available; nor does it represent that it has 2384 made any independent effort to identify any such rights. Information 2385 on the procedures with respect to rights in RFC documents can be found 2386 in BCP 78 and BCP 79. 2388 Copies of IPR disclosures made to the IETF Secretariat and any 2389 assurances of licenses to be made available, or the result of an 2390 attempt made to obtain a general license or permission for the use of 2391 such proprietary rights by implementers or users of this 2392 specification can be obtained from the IETF on-line IPR repository at 2393 http://www.ietf.org/ipr. 2395 The IETF invites any interested party to bring to its attention any 2396 copyrights, patents or patent applications, or other proprietary 2397 rights which may cover technology that may be required to implement 2398 this standard. Please address the information to the IETF at 2399 ietf-ipr@ietf.org. 2401 Disclaimer of Validity 2403 This document and the information contained herein are provided on an 2404 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 2405 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 2406 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 2407 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 2408 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 2409 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 2411 Copyright Statement 2413 Copyright (C) The Internet Society (2005). This document is subject 2414 to the rights, licenses and restrictions contained in BCP 78, and 2415 except as set forth therein, the authors retain all their rights. 2417 Acknowledgments 2419 We would like to thank Guy Almes, Mark Allman, Jari Arkko, Hamid 2420 Asgari, Steven Van den Berghe, Eric Boyd, Robert Cole, Joan 2421 Cucchiara, Stephen Donnelly, Susan Evett, Sam Hartman, Kaynam 2422 Hedayat, Petri Helenius, Scott Hollenbeck, Russ Housley, Kitamura 2423 Yasuichi, Daniel H. T. R. Lawson, Will E. Leland, Bruce A. Mah, 2424 Allison Mankin, Al Morton, Attila Pasztor, Randy Presuhn, Matthew 2425 Roughan, Andy Scherrer, Henk Uijterwaal, and Sam Weiler for their 2426 comments, suggestions, reviews, helpful discussion and proof-reading. 2428 Expiration date: May 2006