Network Working Group Stanislav Shalunov Internet Draft Benjamin Teitelbaum Expiration Date:JanuaryFebruary 2005 Anatoly Karp Jeff W. Boote Matthew J. Zekauskas Internet2JulyAugust 2004 A One-way Active Measurement Protocol (OWAMP)<draft-ietf-ippm-owdp-09.txt> 1.<draft-ietf-ippm-owdp-10.txt> Status of this MemoThis document is an Internet-DraftBy submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, andisany of which I become aware will be disclosed, infull conformanceaccordance withall provisions of Section 10 of RFC2026.RFC 3668. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents asInternet- Drafts.Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draftshadow directoriesShadow Directories can be accessed athttp://www.ietf.org/shadow.html This memo provides information for the Internet community. This memo does not specify anhttp://www.ietf.org/shadow.html. Copyright Notice Copyright (C) The Internetstandard of any kind. Distribution of this memo is unlimited. 2.Society 2004. All Rights Reserved. Abstract With growing availability of good time sources to network nodes, it becomes increasingly possible to measure one-way IP performance metrics with high precision. To do so in an interoperable manner, a common protocol for such measurements is required. The One-Way Active Measurement Protocol (OWAMP) can measure one-way delay, as well as other unidirectional characteristics, such as one-way loss.3. Motivation and Goals The IETF IP Performance Metrics (IPPM) working group has proposed draft standard metrics for one-way packet delay [RFC2679] and loss [RFC 2680] across Internet paths. Although there are now several measurement platforms that implement collection of these metrics [SURVEYOR], [RIPE], there is not currently a standard that would permit initiation of test streams or exchange of packets to collect singleton metrics in an interoperable manner. With the increasingly wide availability of affordable global positioning system (GPS) and CDMA based time sources, hosts increasingly have available to them very accurate time sources--either directly or through their proximity to NTP primary (stratum 1) time servers. By standardizing a technique for collecting IPPM one-way active measurements, we hope to create an environment where IPPM metrics may be collected across a far broader mesh of Internet paths than is currently possible. One particularly compelling vision is of widespread deployment of open OWAMP servers that would make measurement of one-way delay as commonplace as measurementTable ofround-trip time using an ICMP-based tool like ping. Additional design goalsContents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Relationship ofOWAMP include being hard to detectTest and Control Protocols . . . . . . 4 1.2. Logical Model . . . . . . . . . . . . . . . . . . . . 4 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . 6 3. OWAMP-Control . . . . . . . . . . . . . . . . . . . . . . . 7 3.1. Connection Setup . . . . . . . . . . . . . . . . . . . 7 3.2. OWAMP-Control Commands . . . . . . . . . . . . . . . . 10 3.3. Creating Test Sessions . . . . . . . . . . . . . . . . 11 3.4. Send Schedules . . . . . . . . . . . . . . . . . . . . 16 3.5. Starting Test Sessions . . . . . . . . . . . . . . . . 17 3.6. Stop-Sessions . . . . . . . . . . . . . . . . . . . . 19 3.7. Fetch-Session . . . . . . . . . . . . . . . . . . . . 21 4. OWAMP-Test . . . . . . . . . . . . . . . . . . . . . . . . 24 4.1. Sender Behavior . . . . . . . . . . . . . . . . . . . 24 4.1.1. Packet Timings . . . . . . . . . . . . . . . . . 24 4.1.2. Packet Format and Content . . . . . . . . . . . . 25 4.2. Receiver Behavior . . . . . . . . . . . . . . . . . . 28 5. Computing Exponentially Distributed Pseudo-Random Numbers . 30 5.1. High-Level Description of the Algorithm . . . . . . . 30 5.2. Data Types, Representation and Arithmetic . . . . . . 31 5.3. Uniform Random Quantities . . . . . . . . . . . . . . 32 6. Security Considerations . . . . . . . . . . . . . . . . . . 33 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . 33 6.2. Preventing Third-Party Denial of Service . . . . . . . 34 6.3. Covert Information Channels . . . . . . . . . . . . . 34 6.4. Requirement to Include AES in Implementations . . . . 34 6.5. Resource Use Limitations . . . . . . . . . . . . . . . 34 6.6. Use of Cryptographic Primitives in OWAMP . . . . . . . 35 6.7. Required Properties of MD5 . . . . . . . . . . . . . . 36 6.8. The Use of AES-CBC-MAC . . . . . . . . . . . . . . . . 38 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . 39 8. Internationalization Considerations . . . . . . . . . . . . 39 9. Appendix A: Sample C Code for Exponential Deviates . . . . 39 10. Appendix B: Test Vectors for Exponential Deviates . . . . 44 11. Normative References . . . . . . . . . . . . . . . . . . . 45 12. Informative References . . . . . . . . . . . . . . . . . . 45 13. Authors' Addresses . . . . . . . . . . . . . . . . . . . . 46 1. Introduction The IETF IP Performance Metrics (IPPM) working group has proposed draft standard metrics for one-way packet delay [RFC2679] and loss [RFC2680] across Internet paths. Although there are now several measurement platforms that implement collection of these metrics [SURVEYOR], [RIPE], there is not currently a standard that would permit initiation of test streams or exchange of packets to collect singleton metrics in an interoperable manner. With the increasingly wide availability of affordable global positioning system (GPS) and CDMA based time sources, hosts increasingly have available to them very accurate time sources--either directly or through their proximity to NTP primary (stratum 1) time servers. By standardizing a technique for collecting IPPM one-way active measurements, we hope to create an environment where IPPM metrics may be collected across a far broader mesh of Internet paths than is currently possible. One particularly compelling vision is of widespread deployment of open OWAMP servers that would make measurement of one-way delay as commonplace as measurement of round-trip time using an ICMP-based tool like ping. Additional design goals of OWAMP include being hard to detect and manipulate, security, logical separation of control and testfunctionality,functionality, and support for small test packets. OWAMP test traffic is hard to detect, because it is simply a stream of UDP packets from and to negotiated port numbers with potentially nothing static in the packets (size is negotiated, too). Additionally, OWAMP supports an encrypted mode, that further obscures the traffic, at the same time making it impossible to alter timestamps undetectably. Security features include optional authentication and/or encryption of control and test messages. These features may be useful to prevent unauthorized access to results or man-in-the-middle attackers who attempt to provide special treatment to OWAMP test streams or who attempt to modify sender-generated timestamps to falsify test results. The key words "MUST", "REQUIRED", "SHOULD", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in [RFC2119]. 1.1. Relationship of Test and Control Protocols OWAMP actually consists of two inter-related protocols: OWAMP-Control and OWAMP-Test. OWAMP-Control is used to initiate, start and stop test sessions and fetch their results, while OWAMP-Test is used to exchange test packets between two measurement nodes. Although OWAMP-Test may be used in conjunction with a control protocol other than OWAMP-Control, the authors have deliberately chosen to include both protocols in the same draft to encourage the implementation and deployment of OWAMP-Control as a common denominator control protocol for one-way active measurements. Having a complete and open one-way active measurement solution that is simple to implement and deploy is crucial to assuring a future in which inter-domain one-way active measurement could become as commonplace as ping. We neither anticipate nor recommend that OWAMP-Control form the foundation of a general-purpose extensible measurement and monitoring control protocol. OWAMP-Control is designed to support the negotiation of one-way active measurement sessions and results retrieval in a straightforward manner. At session initiation, there is a negotiation of sender and receiver addresses and port numbers, session start time, session length, test packet size, the mean Poisson sampling interval for the test stream, and some attributes of the very general RFC 2330 notion of `packet type', including packet size and per-hop behavior (PHB) [RFC2474], which could be used to support the measurement of one-way active across diff-serv networks. Additionally, OWAMP-Control supports per-session encryption and authentication for both test and control traffic, measurement servers which may act as proxies for test stream endpoints, andsupportthe exchange of a seed value forsmall test packets. OWAMPthe pseudo-random Poisson process that describes the testtraffic is hard to detect, because it is simply astream generated by the sender. We believe that OWAMP-Control can effectively support one-way active measurement in a variety ofUDP packetsenvironments, fromandpublicly accessible measurement `beacons' running on arbitrary hosts tonegotiated port numbersnetwork monitoring deployments within private corporate networks. If integration withpotentially nothing staticSNMP or proprietary network management protocols is required, gateways may be created. 1.2. Logical Model Several roles are logically separated to allow for broad flexibility in use. Specifically, we define: Session-Sender thepackets (sizesending endpoint of an OWAMP-Test session; Session-Receiver the receiving endpoint of an OWAMP-Test session; Server an end system that manages one or more OWAMP-Test sessions, isnegotiated, too). Additionally, OWAMP supportscapable of configuring per-session state in session endpoints, and is capable of returning the results of a test session; Control-Client anencrypted mode,end system thatfurther obscuresinitiates requests for OWAMP-Test sessions, triggers thetraffic, atstart of a set of sessions, and may trigger their termination; Fetch-Client an end system that initiates requests to fetch the results of completed OWAMP-Test sessions; One possible scenario of relationships between these roles is shown below. +----------------+ +------------------+ | Session-Sender |--OWAMP-Test-->| Session-Receiver | +----------------+ +------------------+ ^ ^ | | | | | | | +----------------+<----------------+ | | Server |<-------+ | +----------------+ | | ^ | | | | | OWAMP-Control OWAMP-Control | | | v v v +----------------+ +-----------------+ | Control-Client | | Fetch-Client | +----------------+ +-----------------+ (Unlabeled links in thesame time making it impossible to alter timestamps undetectably. Security features include optional authentication and/or encryption of controlfigure are unspecified by this draft andtest messages. These featuresmay beuseful to prevent unauthorized access to results or man-in-the-middle attackers who attempt to provide special treatment to OWAMP test streams or who attempt to modify sender-generated timestamps to falsify test results. 3.1. Relationshipproprietary protocols.) Different logical roles can be played by the same host. For example, in the figure above, there could actually be only two hosts: one playing the roles ofTestControl-Client, Fetch-Client, andControl Protocols OWAMP actually consistsSession-Sender, and the other playing the roles oftwo inter-related protocols: OWAMP-ControlServer andOWAMP-Test. OWAMP-ControlSession-Receiver. This isused to initiate, startshown below. +-----------------+ +------------------+ | Control-Client |<--OWAMP-Control-->| Server | | Fetch-Client | | | | Session-Sender |---OWAMP-Test----->| Session-Receiver | +-----------------+ +------------------+ Finally, because many Internet paths include segments that transport IP over ATM, delay andstop test sessionsloss measurements can include the effects of ATM segmentation andfetch their results, while OWAMP-Test is usedreassembly (SAR). Consequently, OWAMP has been designed toexchangeallow for small test packetsbetween two measurement nodes. Although OWAMP-Test may be used in conjunction with a control protocol other than OWAMP-Control,that would fit inside theauthors have deliberately chosen to include both protocolspayload of a single ATM cell (this is only achieved inthe same draft to encourage the implementationunauthenticated anddeploymentencrypted modes). 2. Protocol Overview As described above, OWAMP consists ofOWAMP-Control as a common denominator control protocol for one-way active measurements. Having a completetwo inter-related protocols: OWAMP-Control andopen one-way active measurement solution thatOWAMP-Test. The former issimple to implementlayered over TCP anddeployiscrucialused toassuring a future in which inter-domain one-way active measurement could become as commonplace as ping. We neither anticipate nor recommend that OWAMP- Control form the foundation of a general purpose extensible measurementinitiate andmonitoringcontrolprotocol. OWAMP-Controlmeasurement sessions and to fetch their results. The latter protocol isdesignedlayered over UDP and is used tosupportsend singleton measurement packets along thenegotiationInternet path under test. The initiator ofone-way activethe measurementsessions and results retrieval in a straightforward manner. Atsessioninitiation, there isestablishes anegotiation of sender and receiver addresses andTCP connection to a well-known portnumbers, session start time, session length, test packet size,on themean Poisson sampling intervaltarget point and this connection remains open for thetest stream, and some attributesduration of thevery general RFC 2330 notion of `packet type', including packet size and per-hop behavior (PHB) [RFC2474], which couldOWAMP-Test sessions. IANA will beusedrequested tosupportallocate a well-known port number for OWAMP-Control sessions. An OWAMP server SHOULD listen to this well-known port. OWAMP-Control messages are transmitted only before OWAMP-Test sessions are actually started and after they complete (with themeasurementpossible exception ofone-way active across diff-serv networks. Additionally,an early Stop-Sessions message). The OWAMP-Controlsupports per-session encryptionandauthentication for both testOWAMP-Test protocols support three modes of operation: unauthenticated, authenticated, andcontrol traffic, measurement servers which may actencrypted. The authenticated or encrypted modes require endpoints to possess a shared secret. All multi-octet quantities defined in this document are represented asproxies for test stream endpoints, and the exchangeunsigned integers in network byte order unless specified otherwise. 3. OWAMP-Control Each type of OWAMP-Control message has aseed value for the pseudo-random Poisson process that describes the test stream generated byfixed length. The recipient will know thesender. We believe that OWAMP-Control can effectively support one-way active measurement infull length of avarietymessage after examining first 16 octets ofenvironments, from publicly accessible measurement `beacons' running on arbitrary hosts to network monitoring deployments within private corporate networks.it. No message is shorter than 16 octets. Ifintegration with SNMP or proprietary network management protocolsthe full message isrequired, gateways maynot received within 30 minutes after it is expected, connection SHOULD becreated. 3.2. Logical Model Several roles are logically separateddropped. 3.1. Connection Setup Before either a Control-Client or a Fetch-Client can issue commands of a Server, it must establish a connection toallow for broad flexibility in use. Specifically, we define: Session-Senderthesending endpointserver. First, a client opens a TCP connection to the server on a well-known port. The server responds with a server greeting: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Unused (12 octets) | | | |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Modes | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Challenge (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The following mode values are meaningful: 1 for unauthenticated, 2 for authenticated, 4 for encrypted. The value ofan OWAMP-Test session; Session-Receiverthereceiving endpointModes field sent by the server is the bit-wise OR ofan OWAMP-Test session; Server an end systemthe mode values thatmanages one or more OWAMP-Test sessions,it iscapablewilling to support during this session. Thus, last three bits ofconfiguring per-session statethe Modes 32-bit value are used. The first 29 bits MUST be zero. A client MUST ignore the values insession endpoints, and is capable of returningtheresultsfirst 29 bits ofa test session; Control-Client an end system that initiates requeststhe Modes value. (This way, the bits are available forOWAMP-Test sessions, triggersfuture protocol extensions. This is thestart ofonly intended extension mechanism.) Challenge is asetrandom sequence ofsessions,octets generated by the server; it is used subsequently by the client to prove possession of a shared secret in a manner prescribed below. If Modes value is zero, the server doesn't wish to communicate with the client andmay trigger their termination; Fetch-Client an end system that initiates requestsMAY close the connection immediately. The client SHOULD close the connection if it gets a greeting with Modes equal tofetchzero. The client MAY close theresults of completed OWAMP-Test sessions; One possible scenario of relationships between these rolesconnection if the client's desired mode isshown below. +----------------+ +------------------+ | Session-Sender |--OWAMP-Test-->| Session-Receiver | +----------------+ +------------------+ ^ ^ | | | | | | | +----------------+<----------------+ | | Server |<-------+ | +----------------+unavailable. Otherwise, the client MUST respond with the following message: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Mode |^+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Username (16 octets) . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |OWAMP-Control OWAMP-Control| . . . Token (32 octets) . . . | |v v v +----------------+ +-----------------++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Control-Client| . . . Client-IV (16 octets) . . . |Fetch-Client|+----------------+ +-----------------+ (Unlabeled links in the figure are unspecified by this draft and may be proprietary protocols.) Different logical roles can be played by the same host. For example, in the figure above, there could actually be only two hosts: one playing the roles of Control-Client, Fetch-Client, and Session- Sender, and the other playing the roles of Server and Session- Receiver. This+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Here Mode isshown below. +-----------------+ +------------------+ | Control-Client |<--OWAMP-Control-->| Server | | Fetch-Client | | | | Session-Sender |---OWAMP-Test----->| Session-Receiver | +-----------------+ +------------------+ Finally, because many Internet paths include segmentsthe mode thattransport IP over ATM, delay and loss measurements can includetheeffects of ATM segmentation and reassembly (SAR). Consequently, OWAMP has been designedclient chooses toallowuse during this OWAMP-Control session. It will also be used forsmall test packets that would fit inside the payload of a single ATM cell (this is only achieved in unauthenticated and encrypted modes). 4. Protocol Overview As described above, OWAMP consistsall OWAMP-Test sessions started under control oftwo inter-related protocols:this OWAMP-Controland OWAMP-Test.session. In Mode, one or zero bits MUST be set within last three bits. Theformer is layered over TCPfirst 29 bits of Mode MUST be zero. A server MUST ignore the values of the first 29 bits. In unauthenticated mode, Username, Token, and Client-IV are unused. Otherwise, Username isuseda 16-octet indicator of which shared secret the client wishes toinitiate and control measurement sessions anduse tofetch their results. The latter protocol is layered over UDPauthenticate or encrypt and Token isused to send singleton measurement packets alongtheInternet path under test. The initiatorconcatenation ofthe measurement session establishesaTCP connection to16-octet challenge and awell-known port on16-octet Session-key, encrypted using thetarget pointAES (Advanced Encryption Standard) [AES] in Cipher Block Chaining (CBC). Encryption MUST be performed using an Initialization Vector (IV) of zero andthis connection remains open fora key value that is theduration ofshared secret associated with Username. (Both theOWAMP-Test sessions. IANA will be requested to allocate a well-known port number for OWAMP-Control sessions. An OWAMPserverSHOULD listen to this well-known port. OWAMP-Control messages are transmitted only before OWAMP-Test sessions are actually startedandafter they complete (withthepossible exception of an early Stop-Session message). The OWAMP-Control and OWAMP-Test protocols support three modes of operation: unauthenticated, authenticated, and encrypted. The authenticated or encrypted modes require endpointsclient use the same mappings from user names topossesssecret keys; the server, being prepared to conduct sessions with more than one client, uses user names to choose the appropriate secret key; ashared secret. All multi-octet quantities defined in this documentclient would typically have different secret keys for different servers. The situation is analogous to that of passwords, except that secret keys, rather than being the typical low-entropy passwords, arerepresentedsuitable for use asunsigned integers in network byte order unless specified otherwise. 5. OWAMP-Control Each type of OWAMP-Control message has a fixed length.AES keys.) Therecipientshared secret willknowtypically be provided as a passphrase; in this case, thefull lengthMD5 sum [RFC1321] ofa message after examining first 16 octetsthe passphrase (without possible newline character(s) at the end ofit. No message is shorter than 16 octets. Ifthefull message is not received within 30 minutes after it is expected, connectionpassphrase) SHOULD bedropped. 5.1. Connection Setup Before either a Control-Client orused as aFetch-Client can issue commandskey for encryption by the client and decryption by the server (the passphrase also SHOULD NOT contain newlines in the middle). Session-key and Client-IV are generated randomly by the client. Session-key MUST be generated with sufficient entropy not to reduce the security ofa Server,the underlying cipher. Client-IV merely needs to be unique (i.e., itmust establishMUST never be repeated for different sessions using the same secret key; aconnectionsimple way to achieve that without the use of cumbersome state is to generate theserver. First, a client opensClient-IV strings using aTCP connectioncryptographically secure pseudo-random number source: if this is done, the first repetition is unlikely to occur before 2^64 sessions with theserver on a well-known port.same secret key are conducted). The serverrespondsMUST respond witha server greeting:the following message: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | |Unused (12Unused, MBZ (15 octets) | | | | +-+-+-+-+-+-+-+-+ | | Accept | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Server-IV (16 octets) | | ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|Modes| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Uptime (Timestamp) | |Challenge (16 octets)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Integrity Zero Padding (8 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Thefollowing mode values are meaningful: 1 for unauthenticated, 2 for authenticated, 4 for encrypted.Unused 15-octet part MUST be zero. Thevalueclient MUST ignore its value. MBZ (MUST be zero) fields here and hereafter have the same semantics: the party that sends the message MUST set the field to a string of zero bits; the party that interprets the message MUST ignore the value. (This way theModesfieldsentcould be used for future extensions.) Server-IV is generated randomly by theserverserver. In unauthenticated mode, Server-IV is unused. A zero value in thebit-wise OR ofAccept field means that themode valuesserver accepts the authentication and is willing to conduct further transactions. A value of 1 means thatitthe server does not accept the authentication provided by the client or, for some other reason, is not willing tosupport duringconduct further transactions in this OWAMP-Control session.Thus, last three bits of the Modes 32-bit valueAll other values areused.reserved. Thefirst 29 bits MUST be zero. Aclient MUSTignore theinterpret all valuesin the first 29 bitsofthe Modes value. (ThisAccept other than 0 and 1 as 1. This way,the bitsother values are available for futureprotocolextensions.This is the only intended extension mechanism.) Challenge is a random sequence of octets generated by the server; it is used subsequently by the client to prove possession of a shared secret in a manner prescribed below.IfModes valuea negative response iszero,sent, the serverdoesn't wish to communicate with the client andMAYcloseand theconnection immediately. Theclient SHOULD close the connectionif it getsafter this message. Uptime is agreeting with Modes equal to zero. The client MAY close the connection iftimestamp representing theclient's desired mode is unavailable. Otherwise,time when theclient MUST respond withcurrent instantiation of thefollowing message: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Mode | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Username (16 octets) . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Token (32 octets) . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Client-IV (16 octets) . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Here Mode isserver started operating. (For example, in a multi-user general purpose operating system, it could be themode thattime when theclient chooses to use during this OWAMP-Control session. It will alsoserver process was started.) If Accept is non-zero, Uptime SHOULD beused for all OWAMP-Test sessions started under controlset to a string ofthis OWAMP-Control session.zeros. InMode, one or zero bits MUSTauthenticated and encrypted modes, Uptime is encrypted as described in the next section, unless Accept is non-zero. (authenticated and encrypted mode can not beset within last three bits. The first 29 bits of Mode MUSTentered unless the control connection can bezero. Ainitialized.) Timestamp format is described in `Sender Behavior' section below. The same instantiation of the serverMUST ignoreSHOULD report thevalues ofsame exact Uptime value to each client in each session. Integrity Zero Padding is treated thefirst 29 bits. In unauthenticated mode, Username, Token,same way as Integrity Zero Padding in the next section andClient-IVbeyond. The previous transactions constitute connection setup. 3.2. OWAMP-Control Commands In authenticated or encrypted mode (which areunused. Otherwise, Usernameidentical as far as OWAMP-Control isa 16-octet indicator of which shared secret the client wishes to use to authenticate or encryptconcerned, andToken isonly differ in OWAMP-Test) all further communications are encrypted with theconcatenation of a 16-octet challenge and a 16-octetSession-key,encryptedusingthe AES (Advanced Encryption Standard) [AES] in Cipher Block Chaining (CBC). Encryption MUST be performedCBC mode. The client encrypts its stream usingan Initialization Vector (IV) of zero and a key value thatClient-IV. The server encrypts its stream using Server-IV. The following commands are available for the client: Request-Session, Start-Sessions, Stop-Sessions, Fetch-Session. The command Stop-Sessions is available to both theshared secret associated with Username. (Bothclient and the server. (The server can also send other messages in response to commands it receives.) After Start-Sessions is sent/received by the client/server, and before it both sends and receives Stop-Sessions (order unspecified), it is said to be conducting active measurements. While conducting active measurements, the only command available is Stop-Sessions. These commands are described in detail below. 3.3. Creating Test Sessions Individual one-way active measurement sessions are established using a simple request/response protocol. An OWAMP clientuse the same mappings from user namesMAY issue zero or more Request-Session messages tosecret keys; thean OWAMP server,being preparedwhich MUST respond toconduct sessionseach withmore than one client, uses user names to choose the appropriate secret key;an Accept-Session message. An Accept-Session message MAY refuse aclient would typically have different secret keys for different servers.request. Thesituation is analogous to thatformat ofpasswords, except that secret keys, rather than being the typical low-entropy passwords, are suitable for use as AES keys.) The shared secret will typically be providedRequest-Session message is asa passphrase; in this case, the MD5 sum [RFC1321]follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1 | MBZ | IPVN | Conf-Sender | Conf-Receiver | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number ofthe passphrase (without possible newline character(s) at the endSchedule Slots | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number ofthe passphrase) SHOULD be used as a key for encryption by the client and decryptionPackets | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender Port | Receiver Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Sender Address (cont.) or MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Receiver Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Receiver Address (cont.) or MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Padding Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Start Time | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timeout | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type-P Descriptor | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This is immediately followed bythe serverone or more schedule slot descriptions (thepassphrase also SHOULD NOT contain newlines in the middle). Session-key and Client-IV are generated randomly by the client. Session-key MUST be generated with sufficient entropy not to reduce the security of the underlying cipher. Client-IV merely needs to be unique (i.e., it MUST never be repeated for different sessions using the same secret key; a simple way to achieve that without the use of cumbersome state is to generate the Client-IV strings using a cryptographically secure pseudo-randomnumbersource: if this is done, the first repetitionof schedule slots isunlikely to occur before 2^64 sessions with the same secret key are conducted). The server MUST respond withspecified in thefollowing message:`Number of Schedule Slots' field above): 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ || | Unused, MBZ (15 octets) | |Slot Type | | +-+-+-+-+-+-+-+-+ MBZ | |Accept| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ || | Server-IV (16 octets) | |Slot Parameter (Timestamp) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Uptime (Timestamp) |These are immediately followed by Integrity Zero Padding: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Integrity Zero Padding(8(16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The Unused 15-octet partAll these messages comprise one logical message: the Request-Session command. Above, the first octet (1) indicates that this is Request-Session command. IPVN is the IP version numbers for Sender and Receiver. In the case of IP version number being 4, twelve octets follow the four-octet IPv4 address stored in Sender Address and Receiver address. These octets MUST bezero. Theset to zero by the client and MUSTignore its value. MBZ (MUSTbezero) fields hereignored by the server. Currently meaningful IPVN values are 4 andhereafter have6. Conf-Sender and Conf-Receiver MUST be set to 0 or 1 by thesame semantics:client. The server MUST interpret any non-zero value as 1. If theparty that sendsvalue is 1, themessageserver is being asked to configure the corresponding agent (sender or receiver). In this case, the corresponding Port value SHOULD be disregarded by the server. At least one of Conf-Sender and Conf-Receiver MUSTsetbe 1. (Both can be set, in which case thefieldserver is being asked to perform astringsession between two hosts it can configure.) Number ofzero bits;Schedule Slots, as mentioned before, specifies thepartynumber of slot records thatinterprets the message MUST ignore the value. (This waygo between thefield could be used for future extensions.) Server-IVtwo blocks of Integrity Zero Padding. It isgenerated randomlyused by theserver. In unauthenticated mode, Server-IVsender to determine when to send test packets (see next section). Number of Packets isunused. A zero value intheAccept field meansnumber of active measurement packets to be sent during this OWAMP-Test session (note thattheboth serveraccepts the authenticationand client can abort the session early). If Conf-Sender is not set, Sender Port is the UDP port OWAMP-Test packets will be sent from. If Conf-Receiver is not set, Receiver Port iswillingthe UDP port OWAMP-Test packets are requested toconduct further transactions. A value of 1 means thatbe sent to. The Sender Address and Receiver Address fields contain respectively theserver does not acceptsender and receiver addresses of theauthentication provided byend points of theclient or, for some other reason,Internet path over which an OWAMP test session isnot willing to conduct further transactionsrequested. SID is the session identifier. It can be used inthis OWAMP-Control session. All other values are reserved. The client MUST interpret all values of Accept other than 0 and 1later sessions as1.an argument for Fetch-Session command. It is meaningful only if Conf-Receiver is 0. This way,other values are available for future extensions. If a negative responsethe SID issent,always generated by theserver MAY andreceiving side. See theclient SHOULD closeend of theconnection after this message. Uptime is a timestamp representingsection for information on how thetime whenSID is generated. Padding length is thecurrent instantiationnumber ofthe server started operating. (For example, in a multi-user general purpose operating system, it couldoctets to be appended to normal OWAMP-Test packet (see more on padding in discussion of OWAMP-Test). Start Time is the time when theserver process was started.) If Acceptsession isnon-zero, Uptime SHOULD be setto be started (but not before Start-Sessions command is issued). This timestamp is in the same format as OWAMP-Test timestamps. Timeout (or astring of zeros. In authenticated and encrypted modes, Uptimeloss threshold) isencryptedan interval of time (expressed asdescribed ina timestamp). A packet belonging to thenext section, unless Accepttest session that isnon-zero. (authenticated and encrypted mode can not be entered unlessbeing set up by thecontrol connection cancurrent Request-Session command will beinitialized.) Timestamp formatconsidered lost if it isdescribed in `Sender Behavior' section below. The same instantiationnot received during Timeout seconds after it is sent. Type-P Descriptor covers only a subset of (very large) Type-P space. If theserver SHOULD reportfirst two bits of Type-P Descriptor are 00, then subsequent 6 bits specify thesame exact Uptimerequested Differentiated Services Codepoint (DSCP) valueto each client in each session. Integrity Zero Padding is treated the same wayof sent OWAMP-Test packets asIntegrity Zero Paddingdefined in RFC 2474. If thenext section and beyond. The previous transactions constitute connection setup. 5.2. OWAMP-Control Commands In authenticated or encrypted mode (whichfirst two bits of Type-P descriptor areidentical as far01, then subsequent 16 bits specify the requested Per Hop Behavior Identification Code (PHB ID) asOWAMP-Control is concerned, and only differdefined inOWAMP-Test) all further communications are encrypted with the Session-key, using CBC mode. The client encrypts its stream using Client-IV. The server encrypts its stream using Server-IV. The following commands are available for the client: Request-Session, Start-Sessions, Stop-Session, Fetch-Session. The command Stop- Session is available to bothRFC 2836. Therefore, theclient andvalue of all zeros specifies theserver. (The server can also send other messages in response to commands it receives.) After Start-Sessionsdefault best-effort service. If Conf-Sender issent/received by the client/server, and before it both sends and receives Stop-Session (order unspecified), itset, Type-P Descriptor issaidto beconducting active measurements. While conducting active measurements,used to configure theonly command available is Stop-Session. These commands are described in detail below. 5.3. Creating Test Sessions Individual one-way active measurement sessions are established using a simple request/response protocol. An OWAMP client MAY issue zero or more Request-Session messagessender toan OWAMP server, which MUST respondsend packets according toeach with an Accept-Session message. An Accept-Session message MAY refuseits value. If Conf-Sender is not set, Type-P Descriptor is arequest. The formatdeclaration ofRequest-Session message is as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1 | MBZ | IPVN |how the sender will be configured. If Conf-Sender| Conf-Receiver | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Schedule Slots | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Packets | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender Port | Receiver Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Sender Address (cont.) or MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Receiver Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Receiver Address (cont.)is set and the server doesn't recognize Type-P Descriptor, cannot orMBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Padding Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Start Time | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timeout | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |does not wish to set the corresponding attributes on OWAMP-Test packets, it SHOULD reject the session request. If Conf-Sender is not set, the server SHOULD accept the session regardless of the value of Type-PDescriptor | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | |Descriptor. Integrity Zero Padding(16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ThisMUST be all zeros in this and all subsequent messages that use zero padding. The recipient of a message where zero padding isimmediately followednot zero MUST reject the message as it is an indication of tampering with the content of the message byone or more schedule slot descriptions (the numberan intermediary (or brokenness). If the message is part ofschedule slotsOWAMP-Control, the session MUST be terminated and results invalidated. If the message isspecifiedpart of OWAMP-Test, it MUST be silently ignored. This will ensure data integrity. In unauthenticated mode, Integrity Zero Padding is nothing more than a simple check. In authenticated and encrypted modes, however, it ensures, inthe `Numberconjunction with properties ofSchedule Slots' field above): 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Slot Type | | +-+-+-+-+-+-+-+-+ MBZ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Slot Parameter (Timestamp) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ These are immediately followed byCBC chaining mode, that everything received before was not tampered with. For this reason, it is important to check the Integrity ZeroPadding:Padding Field as soon as possible, so that bad data doesn't get propagated. To each Request-Session message, an OWAMP server MUST respond with an Accept-Session message: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Accept | Unused | Port |Integrity Zero Padding+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+All these messages comprise one logical message: the Request-Session command. Above, the first octet (1) indicates that this is Request-Session command. IPVN is the IP version numbers for Sender and Receiver.| | | Integrity Zero Padding (12 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Inthe case of IP version number being 4, twelve octets follow the four-octet IPv4 address stored in Sender Address and Receiver address. These octets MUST be set tothis message, zeroby the client and MUST be ignored by the server. Currently meaningful IPVN values are 4 and 6. Conf-Sender and Conf-Receiver MUST be set to 0 or 1 by the client. The server MUST interpret any non-zero value as 1. Ifin thevalue is 1,Accept field means that the server isbeing askedwilling toconfigure the corresponding agent (sender or receiver). In this case,conduct thecorresponding Portsession. A valueSHOULD be disregarded by the server. At least oneofConf-Sender and Conf-Receiver MUST be 1. (Both can be set, in which case1 indicates rejection of the request. All other values are reserved. If the serveris being asked to performrejects asession between two hostsRequest-Session command, itcan configure.) Number of Schedule Slots, as mentioned before, specifies the number of slot records that go between the two blocks of Integrity Zero Padding. It is used bySHOULD not close thesender to determine when to send test packets (see next section). NumberTCP connection. The client MAY close it if it gets negative response to Request-Session. The meaning ofPackets isPort in thenumberresponse depends on the values ofactive measurement packets to be sent during this OWAMP-Test session (note that both serverConf-Sender andclient can abortConf-Receiver in thesession early).query that solicited the response. IfConf-Senderboth were set, Port field isnotunused. If only Conf-Sender was set,SenderPort is theUDPport to expect OWAMP-Test packetswill be sentfrom. If only Conf-Receiveris notwas set,ReceiverPort is theUDPport to send OWAMP-Test packetsare requested to be sentto.The Sender Address and Receiver Address fields contain respectively the sender and receiver addresses of the end points ofIf only Conf-Sender was set, SID field in theInternet path over which an OWAMP test sessionresponse isrequested.unused. Otherwise, SID isthea unique server-generated session identifier. It can be usedinlatersessionsasan argumenthandle to fetch the results of a session. SIDs SHOULD be constructed by concatenation of 4-octet IPv4 IP number belonging to the generating machine, 8-octet timestamp, and 4-octet random value. To reduce the probability of collisions, if the generating machine has any IPv4 addresses (with the exception of loopback), one of them SHOULD be used forFetch-Session command. It is meaningful onlySID generation, even ifConf-Receiverall communication is0.IPv6-based. If it has no IPv4 addresses at all, the last 4 octets of an IPv6 address MAY be used instead. Note that SID is always chosen by the receiver. If truly random values are not available, it is important that SID be made unpredictable as knowledge of SID might be used for access control. 3.4. Send Schedules The sender and the receiver need to both know the same send schedule. This way, when packets are lost, theSIDreceiver knows when they were supposed to be sent. It isalways generated bydesirable to compress common schedules and still to be able to use an arbitrary one for thereceiving side. Seetest sessions. In many cases, theendschedule will consist of repeated sequences of packets: this way, thesection for information on howsequence performs some test, and theSID is generated. Padding lengthtest istherepeated a number ofoctets to be appendedtimes tonormal OWAMP-Test packet (see more on padding in discussiongather statistics. To implement this, we have a schedule with a given number ofOWAMP-Test). Start Time is the time when the session is to be started (but not before Start-Sessions command is issued). This timestamp`slots'. Each slot has a type and a parameter. Two types are supported: exponentially distributed pseudo-random quantity (denoted by a code of 0) and a fixed quantity (denoted by a code of 1). The parameter isin the same formatexpressed asOWAMP-Test timestamps. Timeout (oraloss threshold) is an interval oftimestamp and specifies a time(expressed asinterval. For atimestamp). A packet belonging to the test session thattype 0 slot (exponentially distributed pseudo-random quantity) this interval isbeing set up bythecurrent Request-Session command will be considered lostmean value (or 1/lambda ifit is not received during Timeout seconds after itthe distribution density function issent. Type-P Descriptor covers only a subsetexpressed as lambda*exp(-lambda*x) for positive values of(very large) Type-P space. Ifx). For a type 1 slot, the parameter is thefirst two bits of Type-P Descriptor are 00, then subsequent 6 bits specifydelay itself. The sender starts with therequested Differentiated Services Codepoint (DSCP) valuebeginning ofsent OWAMP-Test packets as defined in RFC 2474. Ifthefirst two bits of Type-P descriptor are 01, then subsequent 16 bits specifyschedule, and `executes' therequested Per Hop Behavior Identification Code (PHB ID) as definedinstructions inRFC 2836. Therefore,thevalueslots: for a slot of type 0, wait exponentially distributed time with mean ofall zeros specifiesthedefault best-effort service. If Conf-Sender is set, Type-P Descriptor is to be usedspecified parameter and then send a test packet (and proceed toconfigurethesender tonext slot); for a slot of type 1, wait the specified time and sendpackets accordinga test packet (and proceed toits value. If Conf-Sender is not set, Type-P Descriptorthe next slot). The schedule isa declaration of howcircular: when there are no more slots, the senderwill be configured. If Conf-Sender is setreturns to the first slot. The sender and theserver doesn't recognize Type-P Descriptor, cannot or does not wishreceiver must be able toset the corresponding attributes on OWAMP-Test packets, it SHOULD rejectreproducibly execute thesession request. If Conf-Senderentire schedule (so if a packet isnot set, the server SHOULD acceptlost, thesession regardlessreceiver can still attach a send timestamp to it). Slots ofthe valuetype 1 are trivial to reproducibly execute. To reproducibly execute slots ofType-P Descriptor. Integrity Zero Padding MUSTtype 0, we need to beall zerosable to generate pseudo-random exponentially distributed quantities inthis and all subsequent messages that use zero padding. The recipient ofamessage where zero paddingreproducible manner. The way this isnot zero MUST reject the message as itaccomplished isan indicationdiscussed later. Using this mechanism one can easily specify common testing scenarios. Some examples include: + Poisson stream: a single slot oftamperingtype 0; + Periodic stream: a single slot of type 1; + Poisson stream of back-to-back packet pairs: two slots -- type 0 with a non-zero parameter and type 1 with a zero parameter. Further, a completely arbitrary schedule can be specified (albeit inefficiently) by making thecontentnumber of test packets equal to themessage by an intermediary (or brokenness). Ifnumber of schedule slots. In this case, themessagecomplete schedule isparttransmitted in advance ofOWAMP- Control, the session MUST be terminatedan OWAMP-Test session. 3.5. Starting Test Sessions Having requested one or more test sessions andresults invalidated. Ifreceived affirmative Accept-Session responses, an OWAMP client may start themessage is partexecution ofOWAMP-Test, it MUST be silently ignored. This will ensure data integrity. In unauthenticated mode, Integrity Zero Padding is nothing more thanthe requested test sessions by sending asimple check. In authenticated and encrypted modes, however, it ensures, in conjunction with propertiesStart-Sessions message to the server. The format ofCBC chaining mode, that everything received before was not tampered with. Forthisreason, itmessage isimportant to check theas follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 2 | | +-+-+-+-+-+-+-+-+ | | Unused (15 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero PaddingField as soon as possible, so that bad data doesn't get propagated. To each Request-Session message, an OWAMP(16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The server MUST respond with anAccept-Session message:Control-Ack message (which SHOULD be sent as quickly as possible). Control-Ack messages have the following format: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Accept |Unused | Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|| +-+-+-+-+-+-+-+-+ | |SID (16Unused (15 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding(12(16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+In this message, zero in theIf Acceptfield means that the serveriswilling to conduct1, thesession. A value of 1 indicates rejection ofStart-Sessions request was rejected; zero means that therequest.command was accepted. All other values are reserved.If the server rejects a Request-Session command, it SHOULD not close the TCP connection. The client MAY close it if it gets negative response to Request-Session.Themeaning of Port in the response depends on the values of Conf- Sender and Conf-Receiver in the query that solicited the response. If both were set, Port field is unused. If only Conf-Sender was set, Port is the port to expect OWAMP-Test packets from. If only Conf- Receiver was set, Port is the port to send OWAMP-Test packets to. If only Conf-Sender was set, SID field in the response is unused. Otherwise, SID is a unique server-generated session identifier. It can be used later as handle to fetch the results of a session. SIDs SHOULD be constructed by concatenation of 4-octet IPv4 IP number belonging to the generating machine, 8-octet timestamp,server MAY and4-octet random value. To reducetheprobability of collisions, ifclient SHOULD close thegenerating machine has any IPv4 addresses (withconnection in theexception of loopback), onecase ofthema rejection. The server SHOULDbe used for SID generation, even ifstart allcommunicationOWAMP-Test streams immediately after it sends the response or immediately after their specified start times, whichever isIPv6-based.later. If the client represents a Sender, the client SHOULD start its OWAMP-Test streams immediately after ithas no IPv4 addresses at all,sees thelast 4 octets of an IPv6 address can be used instead. Note that SIDControl-Ack response from the Server (if the Start-Sessions command was accepted) or immediately after their specified start times, whichever isalways chosenlater. See more on OWAMP-Test sender behavior in a separate section below. 3.6. Stop-Sessions The Stop-Sessions message may be issued by either thereceiver. If truly random values are not available, itControl-Client or the Server. The format of this command isimportant that SID be made unpredictableasknowledgefollows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 3 | Accept | Unused | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number ofSID might be used for access control. 5.4. Send Schedules The sender and the receiver need to both know the same send schedule. This way, whenSessions | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused (8 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This is immediately followed by 0 or more session packetsare lost, the receiver knows when they were supposed to be sent. Itsent descriptions (the number of session packets sent records isdesirable to compress common schedules and still to be able to use an arbitrary one for the test sessions. In many cases,specified in theschedule will consist of repeated sequences'Number ofpackets: this way,Sessions' field above): 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Session Packets Sent | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (12 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ All these messages comprise one logical message: thesequence performs some test, andStop-Sessions command. Above, thetestfirst octet (3) indicates that this isrepeated a numberthe Stop-Sessions command. Accept values oftimes to gather statistics. To implement this, we have a schedule with1 indicate agiven numberfailure of`slots'. Each slots has a type and a parameter. Two typessome sort. Zero values indicate normal (but possibly premature) completion. All other values aresupported: exponentially distributed pseudo-random quantity (denoted by a code of 0) and a fixed quantity (denoted by a code of 1). The parameter is expressed as a timestamp and specifies a time interval. Forreserved. If Accept had atype 0 slot (exponentially distributed pseudo-random quantity) this interval is the meannon-zero value(or 1/lambda(from either party) results of all OWAMP-Test sessions spawned by this OWAMP-Control session SHOULD be considered invalid, even ifthe distribution density function is expressed as lambda*exp(-lambda*x)a Fetch-Session with SID from this session works forpositive values of x). Foratype 1 slot, the parameter isdifferent OWAMP-Control session. If Accept was not transmitted at all (for whatever reason, including thedelay itself. The sender starts withTCP connection used for OWAMP-Control breaking), thebeginningresults of all OWAMP-Test sessions spawned by this OWAMP-control session MAY be considered invalid. Number of Sessions indicates theschedule, and `executes'number of session packets sent records that immediately follow theinstructions inStop-Sessions message. Number of Sessions MUST contain theslots: for a slotnumber oftype 0, wait exponentially distributed time with meansend sessions started by the local side of thespecified parameter and then sendcontrol connection that have not been previously terminated by atest packet (and proceed toStop-Sessions command (i.e., thenext slot);Control-Client MUST account fora slot of type 1, waiteach accepted Request-Session where Conf-Receiver was set. The Control-Server MUST account for each accepted Request-Session where Conf-Sender was set). If the Stop-Sessions message does not account for all thespecified time andsenda test packet (and proceedsessions controlled by that side, then it is to be considered invalid and the connection SHOULD be closed and any results obtained considered invalid. Each session packets sent record represents one OWAMP-Test session and contains the session identifier (SID) and the number of packets sent in that session. For completed sessions, Session Packets Sent will equal NumPackets from thenext slot). The schedule is circular: when there are no more slots,Request-Session. Session Packets Sent MAY be all ones (0xFFFFFFFF); in this case, the senderreturns toof thefirst slot. The sender andStop-Sessions command could not determine thereceiver must be ablenumber of packets sent (perhaps, due toreproducibly executesome internal error such as a process crash); this special value SHOULD NOT be sent under normal operating conditions. If theentire schedule (soOWAMP-Control connection associated with an OWAMP-Test receiver receives the (0xFFFFFFFF) special value for the Session Packets Sent, or ifa packetthe OWAMP-Control connection breaks when the Stop-Sessions command islost,sent, the receivercan still attach a send timestamp to it). Slots of type 1 are trivial to reproducibly execute. To reproducibly execute slots of type 0, we need to be able to generate pseudo-random exponentially distributed quantities in a reproducible manner. The way this is accomplished is discussed later. Using this mechanism one can easily specify common testing scenarios: + Poisson stream: a single slot of type 0; + Periodic stream: a single slot of type 1; + Poisson stream of back-to-back packet pairs: two slots -- type 0 with a non-zero parameter and type 1 with a zero parameter. AMAY not completelyarbitrary schedule can be specified (albeit inefficiently) by makinginvalidate thenumbersession results. It MUST discard any records oftestlost packetsequal tothat follow (in other words, have greater sequence number than) the last packet that was actually received. This will help differentiate between packet losses that occurred in the network and thenumber of schedule slots. In this case,sender crashing. When thecomplete schedule is transmitted in advanceresults of such an OWAMP-Testsession. 5.5. Starting Test Sessions Having requested onesession ormore test sessions and received affirmative Accept-Session responses,anOWAMP client may startOWAMP-Test session that was prematurely aborted successfully (with confirmation) are later fetched using Fetch-Session, theexecutionoriginal number of packets MUST be supplied in therequested test sessions by sending a Start-Sessions message toreproduction of theserver. The formatRequest-Session command. If a receiver ofthis message is as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 2 | | +-+-+-+-+-+-+-+-+ | | Unused (15 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The server MUST respond withanControl-AckOWAMP-Test session learns through OWAMP-Control Stop-Sessions message(which SHOULD be sent as quickly as possible). Control-Ack messages havethat thefollowing format: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Accept | | +-+-+-+-+-+-+-+-+ | | Unused (15 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ If AcceptOWAMP-Test sender's last sequence number is1,lower than any sequence number actually received, theStart-Sessions request was rejected; zero meansresults of the complete OWAMP-Test session MUST be invalidated. A receiver of an OWAMP-Test session, upon receipt of an OWAMP-Control Stop-Sessions command, MUST discard any packet records -- including lost packet records -- with a (computed) send time that falls between thecommand was accepted. All other values are reserved. The server MAYcurrent time minus Timeout and theclient SHOULD closecurrent time. This ensures statistical consistency for theconnectionmeasurement of loss and duplicates in thecaseevent that the Timeout is greater than the time it takes for the Stop-Sessions command to take place. To effect complete sessions, each side ofa negative response. The serverthe control connection SHOULDstartwait until allOWAMP-Test streams immediately after it sendsSessions are complete before sending theresponse or immediately after their specified start times, whicheverStop-Sessions message. The completed time of each sessions islater. (Note that a client can effect an immediate start by specifying in Request-Sessiondetermined as Timeout after the scheduled time for the last sequence number. Endpoints MAY add aStart Time insmall increment to thepast.) Ifcomputed completed time for send endpoints to ensure theclient representsStop-Sessions message reaches the receiver endpoint after Timeout. To effect aSender,premature stop of sessions, theclient SHOULD startparty that initiates this command MUST stop itsOWAMP- TestOWAMP-Test send streamsimmediately after it seesto send theControl-Ack response fromSession Packets Sent values before sending this command. That party SHOULD wait until receiving theServer. 5.6.response Stop-SessionsThemessage before stopping the receiver streams so that it can use the values from the received Stop-Sessions messagemay be issued by either the Control-Client orto validate theServer.data. 3.7. Fetch-Session The format of this client command is as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |34 | | +-+-+-+-+-+-+-+-+ |Accept| Unused (7 octets) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Number of SessionsBegin Seq | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Unused (8End Seq | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ThisBegin Seq isimmediatelythe sequence number of the first requested packet. End Seq is the sequence number of the last requested packet. If Begin Seq is all zeros and End Seq is all ones, complete session is said to be requested. If a complete session is requested and the session is still in progress, or has terminated in any way other than normal, the request to fetch session results MUST be denied. If an incomplete session is requested, all packets received so far that fall into the requested range SHOULD be returned. Note that since no commands can be issued between Start-Sessions and Stop-Sessions, incomplete requests can only happen on a different OWAMP-Control connection (from the same or different host as Control-Client). The server MUST respond with a Control-Ack message. Again, 1 in the Accept field means rejection of command. Zero means that data will follow. All other values are reserved. If Accept was 0, the server then MUST send the OWAMP-Test session data in question, followed by0 or more16 octets of Integrity Zero Padding. The OWAMP-Test session data consists of the following (concatenated): + A reproduction of the Request-Session command that was used to start the session; it is modified so that actual sender and receiver port numbers that were used by the OWAMP-Test sessionpackets sent descriptions (thealways appear in the reproduction. + The number ofsession packets sentpacket recordsis specifiedthat will follow represented as an unsigned 4-octet integer. This number might be less than the Number of Packets in the'Numberreproduction ofSessions' field above): 0 1the Request-Session command because of a session that ended prematurely; or it might be greater because of duplicates. + 12 octets of Integrity Zero Padding. + Zero or more (as specified) packet records. Each packet record is 25 octets, and includes 4 octets of sequence number, 8 octets of send timestamp, 23octets of send timestamp error estimate, 8 octets of receive timestamp, and 2 octets of receive timestamp error estimate and 1 octet of TTL (or Hop Limit in IPv6): 0 1 2 34 5 6 7 8 90 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 01 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| | | | SID (16 octets) | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Session Packets Sent | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (12 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ All these messages comprise one logical message: the Stop-Session command. Above, the first octet (3) indicates that this is the Stop-Session command. Accept values of 1 indicate a failure of some sort. Zero values indicate normal (but possibly premature) completion. All other values are reserved. If Accept had a non-zero value (from either party) results of all OWAMP-Test sessions spawned by this OWAMP-Control session SHOULD be considered invalid, even if a Fetch-Session with SID from this session works for a different OWAMP-Control session. If Accept was not transmitted at all (for whatever reason, including1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00| Seq Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 04| Send Timestamp | 08| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 12| Send Error Estimate | Receive Error Estimate | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 16| Receive Timestamp | 20| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 24| TTL | +-+-+-+-+-+-+-+-+ Packet records are sent out in theTCP connection used for OWAMP-Control breaking),same order they are made when the results ofall OWAMP-Test sessions spawned by this OWAMP-control session MAY be considered invalid. Number of Sessions indicatesthenumber ofsessionpackets sent recordsare recorded. Therefore, the data is in arrival order. Note thatimmediately followlost packets (if any losses were detected during theStop-Sessions message. Number of SessionsOWAMP-Test session) MUSTcontainappear in thenumbersequence ofsend sessions started bypackets. They can appear either at thelocal side ofpoint when thecontrol connection that have not been previously terminated by a Stop-Sessions command. (i.e. The Control- Client MUST account for each accepted Request-Session where Conf- Receiver was set. The Control-Server MUST account for each accepted Request-Session where Conf-Senderloss wasset.) If the Stop-Sessions message does not account for all the send sessions controlled by that side, then it is to be considered invalid and the connection SHOULD be closed anddetected or at anyresults obtained considered invalid. Each session packets sent record represents one OWAMP-Test session and contains the session identifier (SID) and the number of packets sent in that session. For completed sessions, Session Packets Sent will equal NumPackets from the Request-Session. Session Packets Sent MAY be all ones (0xFFFFFFFF); in this case,later point. Lost packet records are distinguished as follows: + A send timestamp filled with thesender ofpresumed send time (as computed by theStop- Sessions command could not determinesend schedule). + A send error estimate filled with Multiplier=1, Scale=64, and S=0 (see thenumberOWAMP-Test description for definition ofpackets sent (perhaps, due to some internalthese quantities and explanation of timestamp format and errorsuch as a process crash); this special value SHOULD NOT be sent underestimate format). + A normaloperating conditions. Ifreceive error estimate as determined by theOWAMP-Control connection associated with an OWAMP-Test receiver receiveserror of the(0xFFFFFFFF) special value forclock being used to declare theSession Packets Sent, orpacket lost (it MUST be declared lost if it is not received Timeout after theOWAMP-Control connection breaks whenpresumed send time as determined by theStop-Sessions commandreceivers clock). + A receive timestamp consisting of all zero bits. + A TTL value of 255. The last (possibly full, possibly incomplete) block (16 octets) of data issent, the receiver MAY not completely invalidatepadded with zeros if necessary. (These zeros are simple padding and should be distinguished from thesession results. It MUST discard any records16 octets oflost packetsIntegrity Zero Padding that follow(in other words, have greater sequence number than) the last packet that was actually received. This will help differentiate between packet losses that occurred inthenetworksession data and conclude the response to Fetch-Session.) 4. OWAMP-Test This section describes OWAMP-Test protocol. It runs over UDP using sendercrashing. When the results of such anand receiver IP and port numbers negotiated during Request-Session exchange. As OWAMP-Control, OWAMP-Testsession or anhas three modes: unauthenticated, authenticated, and encrypted. All OWAMP-Test sessions spawned by an OWAMP-Control session inherit its mode. OWAMP-Control client, OWAMP-Control server, OWAMP-Test sender, and OWAMP-Test receiver can potentially all be different machines. (In a typical case we expect thatwas prematurely aborted successfully (with confirmation) are later fetched using Fetch-Session, the original number of packets MUSTthere will besuppliedonly two machines.) 4.1. Sender Behavior 4.1.1. Packet Timings Send schedules based on slots, described previously, in conjunction with scheduled session start time enable thereproduction ofsender and theRequest-Session command. If areceiver to compute the same exact packet sending schedule independently ofaneach other. These sending schedules are independent for different OWAMP-Testsession learns through OWAMP-Control Stop-Sessions message thatsessions, even if they are governed by the same OWAMP-Control session. Consider any OWAMP-Testsender's last sequence numbersession. Once Start-Sessions exchange islower than any sequence number actually received,complete, theresults ofsender is ready to start sending packets. Under normal OWAMP use circumstances, thecomplete OWAMP-Test session MUST be invalidated. A receiver of an OWAMP-Test session, upon receipt of an OWAMP-Control Stop-Sessions command, MUST discard any packet records -- including losttime to send the first packetrecords -- withis in the near future (perhaps a(computed)fraction of a second away). The sender SHOULD sendtime that falls betweenpackets as close as possible to their scheduled time, with thecurrentfollowing exception: if the scheduled timeminus Timeoutto send is in the past, and separated from thecurrent time.present by more than Timeout time, the sender MUST NOT send the packet. (Indeed, such a packet would be considered lost by the receiver anyway.) Thisensures statistical consistency forcould happen if a time in themeasurement of loss and duplicatespast was specified in theevent thatRequest-Session command, or if theTimeout is greater thanStart-Sessions exchange took unexpectedly long, or if thetime it takes forsender could not start serving theStop-Sessions commandOWAMP-Test session on time due totake place. To effect complete sessions, each sideinternal scheduling problems of thecontrol connectionOS. Packets in the past, but separated from the present by less than Timeout value, SHOULDwait until all Sessions are complete before sendingbe sent as quickly as possible. With normal test rates and timeout values, theStop- Sessions message. The completed timenumber ofeachpackets in such a burst is limited. Nevertheless, hosts SHOULD NOT intentionally schedule sessions so that such bursts of packets occur. Regardless of any scheduling delays, each packet that isdetermined as Timeout after the scheduled time for the last sequence number. Endpoints MAY add a small increment toactually sent MUST have thecomputed completedbest possible approximation of its real timefor send endpoints to ensureof departure as its timestamp (in theStop-Sessions message reachespacket). 4.1.2. Packet Format and Content The sender sends the receiverendpoint after Timeout. To effectapremature stopstream ofsessions, the party that initiates this command MUST stop its OWAMP-Test send streams to sendpackets with schedule as specified in theSession Packets Sent values before sending thisRequest-Session command.That partyThe sender SHOULDwait until receiving the response Stop-Sessions message before stopping the receiver streams so that it can useset thevalues fromTTL in IPv4 (or Hop Limit in IPv6) in thereceived Stop-Sessions messageUDP packet tovalidate the data. 5.7. Fetch-Session255. The format ofthis client command is as follows:the body of a UDP packet in the stream depends on the mode being used. For unauthenticated mode: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |4 | | +-+-+-+-+-+-+-+-+Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Unused (7 octets)Timestamp |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|Begin Seq| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |End SeqError Estimate |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |SID (16 octets)| . . . Packet Padding . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ For authenticated and encrypted modes: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding(16(12 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Estimate | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Begin Seq is the sequence number of the first requested packet. End Seq is the sequence number of the last requested packet. If Begin Seq is all zeros and End Seq is all ones, complete session is said to be requested. If a complete session is requested and the session is still in progress, or has terminated in any way other than normal, the request to fetch session results MUST be denied. If an incomplete session is requested, all packets received so far that fall into the requested range SHOULD be returned. Note that since no commands can be issued between Start-Sessions and Stop-Sessions, incomplete requests can only happen on a different OWAMP-Control connection (from the same or different host as Control-Client). The server MUST respond with a Control-Ack message. Again, 1 in the Accept field means rejection of command. Zero means that data will follow. All other values are reserved. If Accept was 0, the server then MUST send the OWAMP-Test session data in question, followed by 16 octets ofIntegrity ZeroPadding.Padding (6 octets) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Packet Padding . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ TheOWAMP-Test session data consists of the following (concatenated): + A reproductionformat of theRequest-Session command that was used to start the session; ittimestamp ismodified so that actual sender and receiver port numbers that were used bytheOWAMP-Test session always appearsame as inthe reproduction. + The number of packet records that will follow represented[RFC 1305] and is asanfollows: first 32 bits represent the unsigned4-octet integer. Thisinteger numbermight be less than the Number of Packets in the reproductionof seconds elapsed since 0h on 1 January 1900; next 32 bits represent theRequest-Session command becausefractional part of asessionsecond thatended prematurely; or it might be greater because of duplicates. + 12 octets of Integrity Zero Padding. + Zero or more (as specified) packet records. Each packet recordhas elapsed since then. So, Timestamp is25 octets, and includesrepresented as follows: 0 1 2 3 0 1 2 3 4octets of sequence number,5 6 7 8octets of send timestamp,9 0 1 2octets of send timestamp error estimate,3 4 5 6 7 8octets of receive timestamp, and 2 octets of receive timestamp error estimate and 1 octet of TTL (or Hop Limit in IPv6):9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Integer part of seconds | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Fractional part of seconds | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The Error Estimate specifies the estimate of the error and synchronization. It has the following format: 0 12 3 4 5 6 7 8 90 1 2 3 4 5 6 7 8 9 0 1 2 3 4 56 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00| Seq Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 04| Send Timestamp | 08| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 12| Send Error Estimate | |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++ 16| Receive Timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 20| | Receive Error Estimate|S|Z| Scale |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 24| TTLMultiplier |+-+-+-+-+-+-+-+-+ Packet records+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The first bit S SHOULD be set if the party generating the timestamp has a clock that is synchronized to UTC using an external source (e.g., the bit should be set if GPS hardware is used and it indicates that it has acquired current position and time or if NTP is used and it indicates that it has synchronized to an external source, which includes stratum 0 source, etc.); if there is no notion of external synchronization for the time source, the bit SHOULD NOT be set. The next bit has the same semantics as MBZ fields elsewhere: it MUST be set to zero by the sender and ignored by everyone else. The next six bits Scale form an unsigned integer; Multiplier is an unsigned integer as well. They aresent outinterpreted as follows: the error estimate is equal to Multiplier*2^(-32)*2^Scale (in seconds). [Notation clarification: 2^Scale is two to the power of Scale.] Multiplier MUST NOT be set to zero. If Multiplier is zero, the packet SHOULD be considered corrupt and discarded. Sequence numbers start with 0 and are incremented by 1 for each subsequent packet. The minimum data segment length is therefore 14 octets in unauthenticated mode, and 32 octets in authenticated mode and encrypted modes. The OWAMP-Test packet layout is the sameorder they are made whenin authenticated and encrypted modes. The encryption operations are, however, different. The difference is that in encrypted mode both theresults ofsequence number and thesessiontimestamp arerecorded. Therefore, theencrypted to provide maximum datais in arrival order. Note that lost packets (if any losses were detected during the OWAMP- Test session) MUST appearintegrity protection while in authenticated mode the sequenceof packets. They can appear either atnumber is encrypted and thepoint whentimestamp is sent in clear text. Sending theloss was detected or at any later point. Lost packet records are distinguished as follows: + A sendtimestampfilled within clear text in authenticated mode allows to reduce thepresumed sendtime(as computed by the send schedule). + A send error estimate filled with Multiplier=1, Scale=64, and S=0 (see the OWAMP-Test description for definition of these quantities and explanation of timestamp format and error estimate format). + A receivebetween a timestampconsisting of all zero bits. + A normal receive error estimate as determinedis obtained bythe error of the clock being used to declarea sender and the packetlost (it MUST be declared lost if itisnot received Timeout aftershipped out. In encrypted mode, thepresumedsender has to fetch the timestamp, encrypt it, and sendtime as determined byit; in authenticated mode, thereceivers clock). + A TTL value of 255. The last (possibly full, possibly incomplete)middle step is removed improving accuracy (the sequence number can be encrypted before the timestamp is fetched). In authenticated mode, the first block (16 octets) ofdataeach packet is encrypted using AES ECB mode. The key to use ispadded with zeros if necessary. (These zeros are simple padding and should be distinguished fromthe16 octets of Integrity Zero Padding that followsame key as is used for the corresponding OWAMP-Control sessiondata and conclude the response to Fetch-Session.) 6. OWAMP-Test This section describes(where it is used in a different chaining mode). Electronic Cookbook (ECB) mode does not involve any actual chaining; this way, lost, duplicated, or reordered packets do not cause problems with deciphering any packet in an OWAMP-Testprotocol. It runs over UDPsession. In encrypted mode, the first two blocks (32 octets) are encrypted usingsender and receiver IP and port numbers negotiated during Request- Session exchange. As OWAMP-Control, OWAMP-Test has three modes: unauthenticated, authenticated, and encrypted. All OWAMP-Test sessions spawned by an OWAMP-Control session inherit itsAES CBC mode. The key to use is the same key as is used for the corresponding OWAMP-Controlclient, OWAMP-Control server, OWAMP-Test sender, andsession. Each OWAMP-Testreceiver can potentially all be different machines. (Inpacket is encrypted as atypical case we expectseparate stream, with just one chaining operation; chaining does not span multiple packets so thatthere willlost, duplicated, or reordered packets do not cause problems. In unauthenticated mode, no encryption is applied. Packet Padding in OWAMP-Test SHOULD beonly two machines.) 6.1. Sender Behavior The sender sends the receiverpseudo-random (it MUST be generated independently of any other pseudo-random numbers mentioned in this document). However, implementations MUST provide astreamconfiguration parameter, an option, or a different means of making Packet Padding consist of all zeros. The time elapsed between packetswithis computed according to the slot schedule asspecifiedmentioned intheRequest-Sessioncommand. The sender SHOULD set the TTL in IPv4 (or Hop Limit in IPv6) in the UDP packet to 255. The format ofcommand description. At that point we skipped over thebodyissue ofa UDP packetcomputing exponentially distributed pseudo-random numbers in a reproducible fashion. It is discussed later in a separate section. 4.2. Receiver Behavior Receiver knows when thestream depends on the mode being used. For unauthenticated mode: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Estimate | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | . . . Packet Padding . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ For authenticated and encrypted modes: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Integrity Zero Padding (12 octets) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Estimate | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Integrity Zero Padding (6 octets) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Packet Padding . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The format of the timestampsender will send packets. The following parameter isthe samedefined: Timeout (from Request-Session). Packets that are delayed by more than Timeout are considered lost (or `as good asin RFC 1305 andlost'). Note that there isas follows: first 32 bits represent the unsigned integer numbernever an actual assurance of loss by the network: a `lost' packet might still be delivered at any time. The original specification for IPv4 required that packets be delivered within TTL secondselapsed since 0h on 1 January 1900; next 32 bits representor never (with TTL having a maximum value of 255). To thefractional partbest of the authors' knowledge, this requirement was never actually implemented (and of course only asecondcomplete and universal implementation would ensure thathas elapsed since then. So, Timestamp is represented as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Integer partpackets don't travel for longer than TTL seconds). In fact, in IPv6 the name ofseconds | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Fractional partthis field has actually been changed to Hop Limit. Further, IPv4 specification makes no claims about the time it takes the packet to traverse the last link ofseconds | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+the path. TheError Estimate specifieschoice of a reasonable value of Timeout is a problem faced by a user of OWAMP protocol, not by an implementor. A value such as two minutes is very safe. Note that certain applications (such as interactive `one-way ping') might wish to obtain theestimatedata faster than that. As packets are received, + Timestamp the received packet. + In authenticated or encrypted mode, decrypt first block (16 octets) of packet body. + Store theerrorpacket sequence number, send time, receive time, andsynchronization. It hasthefollowing format: 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |S|Z| Scale | Multiplier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The first bit S SHOULD be set ifTTL for IPv4 (or Hop Limit for IPv6) from theparty generatingpacket IP header for thetimestamp has a clock that is synchronizedresults toUTC using an external source (e.g., the bit shouldbeset if GPS hardware is used and it indicates that it has acquired current position andtransferred. + Packets not received within the Timeout are considered lost. They are recorded with their true seqno, presumed send time, receive timeor if NTP is usedconsisting of a string of zero bits, andit indicates that it has synchronized to an external source, which includes stratum 0 source, etc.); if there is no notionTTL (or Hop Limit) ofexternal synchronization for255. Implementations SHOULD fetch thetime source,TTL/Hop Limit value from thebit SHOULD NOT be set. The next bit hasIP header of thesame semantics as MBZ fields elsewhere:packet. If an implementation does not fetch the actual TTL value (the only good reason to not do so is inability to access the TTL field of arriving packets), it MUSTbe set to zero byrecord thesender and ignored by everyone else. The next six bits Scale form an unsigned integer; Multiplier is an unsigned integerTTL value aswell. They255. Packets that areinterpretedactually received are recorded in the order of arrival. Lost packet records serve asfollows:indications of theerror estimate is equal to Multiplier*2^(-32)*2^Scale (in seconds). [Notation clarification: 2^Scale is twosend times of lost packets. They SHOULD be placed either at the point where the receiver learns about the loss or at any later point; in particular, one MAY place all the records that correspond to lost packets at thepower of Scale.] Multipliervery end. Packets that have send time in the future MUSTNOTbesetrecorded normally, without changing their send timestamp, unless they have tozero. If Multiplier is zero, the packet SHOULDbeconsidered corrupt anddiscarded.Sequence numbers start with 0 and are incremented(Send timestamps in the future would normally indicate clocks that differ by1 for each subsequent packet. The minimummore than the delay. Some datasegment length is therefore 14 octets in unauthenticated mode, and 32 octets in authenticated mode and encrypted modes. The OWAMP-Test packet layout is-- such as jitter -- can be extracted even without knowledge of time difference. For other kinds of data, thesame in authenticated and encrypted modes. The encryption operations are, however, different. The differenceadjustment isthat in encrypted mode bothbest handled by the data consumer on the basis of the complete information in a measurement session as well as possibly external data.) Packets with a sequence numberand the timestampthat was already observed (duplicate packets) MUST be recorded normally. (Duplicate packets areencryptedsometimes introduced by IP networks. The protocol has toprovide maximum data integrity protection while in authenticated modebe able to measure duplication.) If any of thesequence numberfollowing isencrypted andtrue, the packet MUST be discarded: + Send timestamp issentmore than Timeout inclear text. Sendingthetimestamp in clear textpast or inauthenticated mode allows to reducethetime between afuture. + Send timestampis obtaineddiffers bya sender andmore than Timeout from the time when the packetis shipped out.should have been sent according to its seqno. + In authenticated or encrypted mode, any of thesender has to fetchbits of zero padding inside thetimestamp, encrypt it, and send it;first 16 octets of packet body is non-zero. 5. Computing Exponentially Distributed Pseudo-Random Numbers Here we describe the way exponential random quantities used inauthenticated mode,themiddle stepprotocol are generated. While there isremoved improving accuracy (the sequencea fair numbercan be encrypted beforeof algorithms for generating exponential random variables, most of them rely on having logarithmic function as a primitive, resulting in potentially different values, depending on thetimestampparticular implementation of the math library. We use algorithm 3.4.1.S in [KNUTH], which isfetched). In authenticated mode,free of the above mentioned problem, and guarantees the same output on any implementation. The algorithm belongs to the 'ziggurat' family developed in the 1970s by G.Marsaglia, M.Sibuya and J.H.Ahrens [ZIGG]. It replaces the use of logarithmic function by clever bit manipulation, still producing thefirst block (16 octets)exponential variates on output. 5.1. High-Level Description ofeach packet is encrypted using AES ECB mode. The key to use isthesame key as is used forAlgorithm For ease of exposition, thecorresponding OWAMP-Control session (where italgorithm isused in a different chaining mode). Electronic Cookbook (ECB) mode does not involve any actual chaining; this way, lost, duplicated, or reordered packets do not cause problemsfirst described withdeciphering any packetall arithmetic operations being interpreted inan OWAMP-Test session. In encrypted mode, the first two blocks (32 octets) are encrypted using AES CBC mode. The key to use istheir natural sense. Later, exact details on data types, arithmetic, and generation of thesame key as isuniform random variates usedforby thecorresponding OWAMP-Control session. Each OWAMP-Test packetalgorithm are given. It isencrypted asan almost verbatim quotation from [KNUTH], p.133. Algorithm S: Given aseparate stream,real positive number 'mu', produce an exponential random variate withjust one chaining operation; chaining does not span multiple packets so that lost, duplicated, or reordered packets do not cause problems. In unauthenticated mode, no encryption is applied. Packet Padding in OWAMP-Test SHOULD be pseudo-random (it MUST be generated independently of any other pseudo-random numbers mentionedmean 'mu'. First, the constants Q[k] = (ln2)/(1!) + (ln2)^2/(2!) + ... + (ln2)^k/(k!), 1 <= k <= 11 are computed inthis document). However, implementations MUST provide a configuration parameter, an option, or a different means of making Packet Padding consist of all zeros.advance. Thetime elapsed between packetsexact values which MUST be used by all implementations are given in the reference code (see Appendix A). This iscomputed accordingnecessary tothe slot schedule as mentioned in Request-Session command description. Atinsure thatpoint we skipped overexactly theissue of computing exponentially distributedsame pseudo-randomnumbers insequences are produced by all implementations. S1. [Get U and shift.] Generate areproducible fashion. 7. Receiver Behavior Receiver knows when32-bit uniform random binary fraction U = (.b0 b1 b2 ... b31) [note thesender will send packets. The following parameterdecimal point] Locate the first zero bit b_j, and shift off the leading (j+1) bits, setting U <- (.b_{j+1} ... b31) NOTE: in the rare case that the zero has not been found it isdefined: Timeout (from Request-Session). Packetsprescribed thatare delayed by more than Timeout are considered lost (or `as goodthe algorithm return (mu*32*ln2). S2. [Immediate acceptance?] If U < ln2, set X <- mu*(j*ln2 + U) and terminate the algorithm. (Note that Q[1] = ln2.) S3. [Minimize.] Find the least k >= 2 such that U < Q[k]. Generate k new uniform random binary fractions U1,...,Uk and set V <- min(U1,...,Uk). S4. [Deliver the answer.] Set X <- mu*(j + V)*ln2. 5.2. Data Types, Representation and Arithmetic The high-level algorithm operates on real numbers -- typically represented aslost'). Notefloating point numbers. This specification prescribes thatthere is never an actual assurance of lossunsigned 64-bit integers be used instead. u_int64_t integers are interpreted as real numbers by placing the decimal point after the first 32 bits. In other words, conceptually the interpretation is given by thenetwork:map: u_int64_t u; u |--> (double)u / (2**32) The algorithm produces a`lost' packet might stillsequence of such u_int64_t integers which is guaranteed to bedelivered atthe same on anytime. The original specification for IPv4 required that packets be delivered within TTL seconds or never (with TTL having a maximum valueimplementation. Any further interpretation (such as given by (1)) is done by the application, and is not part of255). Tothis specification. We specify that thebestu_int64_t representations of theauthors' knowledge, this requirement was never actually implemented (andfirst 11 values ofcourse only a complete and universal implementation would ensure that packets don't travelthe Q array in the high-level algorithm be as follows: #1 0xB17217F8, #2 0xEEF193F7, #3 0xFD271862, #4 0xFF9D6DD0, #5 0xFFF4CFD0, #6 0xFFFEE819, #7 0xFFFFE7FF, #8 0xFFFFFE2B, #9 0xFFFFFFE0, #10 0xFFFFFFFE, #11 0xFFFFFFFF For example, Q[1] = ln2 is indeed approximated by 0xB17217F8/(2**32) = 0.693147180601954; forlonger than TTL seconds). In fact,j > 11, Q[j] is 0xFFFFFFFF Small integer 'j' inIPv6thenamehigh-level algorithm is represented as u_int64_t value j * (2**32); Operation ofthis field has actually been changed to Hop Limit. Further, IPv4 specification makes no claims about the time it takes the packet to traverseaddition is done as usual on u_int64_t numbers; however, thelast linkoperation of multiplication in thepath.high-level algorithm should be replaced by (u, v) |---> (u * v) >> 32 Implementations MUST compute (u * v) exactly. For example, a fragment of unsigned 128-bit arithmetic can be implemented for this purpose (see sample implementation below). 5.3. Uniform Random Quantities Thechoice of a reasonable value of Timeout is a problem faced byprocedure for obtaining ausersequence ofOWAMP protocol, not by an implementor. A value such as two minutes is very safe. Note that certain applications32-bit random numbers (such asinteractive `one-way ping') might wish to obtain the data faster than that. As packets are received, + Timestamp'U' in algorithm S) relies on using AES encryption in counter mode. To describe thereceived packet. + In authenticated or encrypted mode, decrypt first block (16 octets)exact working ofpacket body. + Store the packet sequence number, send time, receive time, andtheTTL for IPv4 (or Hop Limit for IPv6)algorithm we introduce two primitives fromthe packet IP header for the resultsRijndael. Their prototypes and specification are given below, and they are assumed to betransferred. + Packets not received withinprovided by theTimeout are considered lost. They are recorded with their true seqno, presumed send time, receive time consisting ofsupporting Rijndael implementation, such as [RIJN]. + This function initializes astring of zero bits, and TTL (or Hop Limit) of 255. Implementations SHOULD fetch the TTL/Hop Limit valueRijndael key with bytes from 'seed' void KeyInit(unsigned char seed[16]); + This function encrypts theIP header of16-octet block 'inblock' with thepacket. If'key' returning a 16-octet encrypted block. Here 'keyInstance' is animplementation does not fetchopaque type used to represent Rijndael keys. void BlockEncrypt(keyInstance key, unsigned char inblock[16]); Algorithm Unif: given a 16-octet quantity seed, produce a sequence of unsigned 32-bit pseudo-random uniformly distributed integers. In OWAMP, theactual TTL value (the only good reason to not do so is inability to accessSID (session ID) from Control protocol plays theTTL fieldrole ofarriving packets), it MUST recordseed. U1. [Initialize Rijndael key] key <- KeyInit(seed) [Initialize an unsigned 16-octet (network byte order) counter] c <- 0 U2. [Need more random bytes?] Set i <- c mod 4. If (i == 0) set s <- BlockEncrypt(key, c) U3. [Increment theTTL valuecounter as255. Packets that are actually received are recorded inunsigned 16-octet quantity] c <- c + 1 U4. [Do output] Output theorderi_th quartet ofarrival. Lost packet records serveoctets from s starting from high-order octets, converted to native byte order and represented asindications of the send times of lost packets. They SHOULD be placed either at the point where the receiver learns about the loss or at any later point;OWPNum64 value (as inparticular, one MAY place all the records that correspond3.b). U5. [Loop] Go tolost packets at the very end. Packets that have send time in the future MUST be recorded normally, without changing their send timestamp, unless they havestep U2. 6. Security Considerations 6.1. Introduction The goal of authenticated mode tobe discarded. (Send timestamps in the future would normally indicate clocks that differlet one passphrase-protect service provided bymore than the delay. Some data -- such as jitter --a particular OWAMP-Control server. One canbe extracted even without knowledge of time difference. For other kindsimagine a variety ofdata, the adjustmentcircumstances where this could be useful. Authenticated mode isbest handled by the data consumer on the basisdesigned to prohibit theft ofthe complete information in a measurement session as well as possibly external data.) Packetsservice. Additional design objective of authenticated mode was to make it impossible for an attacker who cannot read traffic between OWAMP-Test sender and receiver to tamper with test results in asequence numberfashion thatwas already observed (duplicate packets) MUST be recorded normally. (Duplicate packets are sometimes introduced by IP networks.affects the measurements, but not other traffic. Theprotocol has to be able to measure duplication.) If anygoal ofthe following is true, the packet MUST be discarded: + Send timestampencrypted mode ismore than Timeoutquite different: To make it hard for a party in thepast or inmiddle of thefuture. + Send timestamp differs by morenetwork to make results look `better' thanTimeout from the time when the packetthey shouldhave been sent accordingbe. This is especially true if one of client and server doesn't coincide with neither sender nor receiver. Encryption of OWAMP-Control using AES CBC mode with blocks of zeros after each message aims toits seqno. + In authenticated or encrypted mode, anyachieve two goals: (i) to provide secrecy ofthe bitsexchange; (ii) to provide authentication ofzero padding inside the first 16 octetseach message. 6.2. Preventing Third-Party Denial ofpacket body is non-zero. 8. Computing Exponentially Distributed Pseudo-Random Numbers Here we describeService OWAMP-Test sessions directed at an unsuspecting party could be used for denial of service (DoS) attacks. In unauthenticated mode servers should limits receivers to hosts they control or to theway exponential random quantitiesOWAMP-Control client. 6.3. Covert Information Channels OWAMP-Test sessions could be usedin the protocolas covert channels of information. Environments that aregenerated. While thereworried about covert channels should take this into consideration. 6.4. Requirement to Include AES in Implementations Notice that AES in counter mode isa fairused for pseudo-random number generation, so implementation ofalgorithms for generating exponential random variables,AES MUST be included even in a server that only supports unauthenticated mode. 6.5. Resource Use Limitations An OWAMP server can consume resources of various kinds. The two most important kinds ofthem rely on having logarithmic function as a primitive, resulting in potentially different values, depending on the particularresources are network capacity and memory (primary or secondary) for storing test results. Any implementation of OWAMP server MUST include technical mechanisms to limit themath library. Weusealgorithm 3.4.1.S in [KNUTH], which is freeofthe above mentioned problem,network capacity andguarantees the same output on any implementation. The algorithm belongs to the 'ziggurat' family developed inmemory. Mechanisms for managing the1970sresources consumed byG.Marsaglia, M.Sibuyaunauthenticated users andJ.H.Ahrens [ZIGG]. It replacesusers authenticated with a username and passphrase SHOULD be separate. The default configuration of an implementation MUST enable these mechanisms and set the resource useof logarithmic function by clever bit manipulation, still producinglimits to conservatively low values. One way to design theexponential variates on output. 8.1. High-Level Descriptionresource limitation mechanisms is as follows: assign each session to a user class. User classes are partially ordered with ``includes'' relation, with one class (``all users'') that is always present and that includes any other class. The assignment of a session to a user class can be based on theAlgorithm For easepresence ofexposition, the algorithm is first described with all arithmetic operations being interpreted in their natural sense. Later, exact details on data types, arithmetic, and generationauthentication of theuniform random variates used bysession, thealgorithm are given. It is an almost verbatim quotation from [KNUTH], p.133. Algorithm S: Givenuser name, IP address range, time of day, and, perhaps, other factors. Each user class would have areal positive number 'mu', produce an exponential random variatelimit for usage of network capacity (specified in units of bit/second) and memory for storing test results (specified in units of octets). Along withmean 'mu'. First,theconstants Q[k] = (ln2)/(1!) + (ln2)^2/(2!) + ... + (ln2)^k/(k!), 1 <= k <= 11 are computed in advance. The exact values which MUSTlimits for resource use, current use would beusedtracked byall implementations are given inthereference code (see Appendix). Thisserver. When a session isnecessary to insure that exactly the same pseudo-random sequences are producedrequested byall implementations. S1. [Get U and shift.] Generatea32-bit uniform random binary fraction U = (.b0 b1 b2 ... b31) [note the decimal point] Locate the first zero bit b_j, and shift off the leading (j+1) bits, setting U <- (.b_{j+1} ... b31) NOTE:user in a specific user class, therare case that the zero has not been found it is prescribed that the algorithm return (mu*32*ln2). S2. [Immediate acceptance?] If U < ln2, set X <- mu*(j*ln2 + U) and terminateresources needed for this session are computed: thealgorithm. (Note that Q[1] = ln2.) S3. [Minimize.] Findaverage network capacity use (based on theleast k >= 2 such that U < Q[k]. Generate k new uniform random binary fractions U1,...,Uksending schedule) andset V <- min(U1,...,Uk). S4. [Delivertheanswer.] Set X <- mu*(j + V)*ln2. 8.2. Data Types, Representation and Arithmetic The high-level algorithm operatesmaximum memory use (based onreal numbersthe number of packets and number of octets each packet would need to be stored internally --typically represented as floating point numbers. This specification prescribesnote thatunsigned 64-bit integers be used instead. u_int64_t integersoutgoing sessions would not require any memory use). These resource use numbers areinterpreted as realadded to the current resource use numbersby placingfor thedecimal point aftergiven user class; if such addition would take thefirst 32 bits. In other words, conceptuallyresource use outside of the limits for theinterpretation isgiven user class, the session is rejected. When resources are reclaimed, corresponding measures are subtracted from the current use. Network capacity is reclaimed as soon as the session ends. Memory is reclaimed when the data is deleted. For unauthenticated sessions, memory consumed by an OWAMP-Test session SHOULD be reclaimed after themap: u_int64_t u; u |--> (double)u / (2**32) The algorithm produces a sequence of such u_int64_t integers whichOWAMP-Control connection that initiated the session isguaranteedclosed (gracefully or otherwise). For authenticated sessions, the administrator who configures the service should be able to decide the exact policy, but useful policy mechanisms that MAY be implemented are the ability tobeautomatically reclaim memory when thesame on any implementation. Any further interpretation (such as given by (1))data isdone by the application,retrieved andis not part of this specification. We specify thattheu_int64_t representationsability to reclaim memory after a certain configurable (based on user class) period of time passes after thefirst 11 valuesOWAMP-Test session terminates. 6.6. Use ofthe Q arrayCryptographic Primitives inthe high-level algorithm be as follows: #1 0xB17217F8, #2 0xEEF193F7, #3 0xFD271862, #4 0xFF9D6DD0, #5 0xFFF4CFD0, #6 0xFFFEE819, #7 0xFFFFE7FF, #8 0xFFFFFE2B, #9 0xFFFFFFE0, #10 0xFFFFFFFE, #11 0xFFFFFFFF For example, Q[1] = ln2 is indeed approximated by 0xB17217F8/(2**32) = 0.693147180601954; for j > 11, Q[j] is 0xFFFFFFFF Small integer 'j'OWAMP At an early stage in designing thehigh-level algorithm is representedprotocol, we considered using TLS and IPsec asu_int64_t value j * (2**32); Operationcryptographic security mechanisms for OWAMP. The disadvantages ofaddition is donethose are asusual on u_int64_t numbers; however, the operation of multiplication in the high-level algorithm shouldfollows (not an exhaustive list): Regarding TLS: + While TLS could bereplaced by (u, v) |---> (u * v) >> 32 Implementations MUST compute (u * v) exactly. For example, a fragment of unsigned 128-bit arithmetic canused to secure TCP-based OWAMP-Control, but difficult to use to secure UDP-based OWAMP-Test: OWAMP-Test packets, if lost, are not resent, so packets have to beimplemented for this purpose (see sample implementation below). 8.3. Uniform Random Quantities The procedure for obtaining a sequence(optionally) encrypted and authenticated while retaining individual usability. Stream-based TLS is not conducive of32-bit random numbers (such as 'U'this. + Dealing with streams, does not authenticate individual messages (even inalgorithm S) relies onOWAMP-Control). The easiest way out would be to add some known-format padding to each message and verify that the format of the padding is intact before usingAES encryption in counter mode. To describetheexact workingmessage. The solution would thus lose some of its appeal (``just use TLS''); it would also be much more difficult to evaluate thealgorithm we introduce two primitives from Rijndael. Their prototypessecurity of this scheme with the various modes andspecification are given below,options of TLS---it would almost certainly not be secure with all. The capacity of an attacker to replace parts of messages (namely, the end) with random garbage could have serious security implications andthey are assumedwould need to beprovidedanalyzed carefully: suppose, for example, that a parameter that is used in some form to control the rate were replaced by random garbage---chances are thesupporting Rijndael implementation, such as [RIJN]. + This function initializes a Rijndael key with bytes from 'seed' void KeyInit(unsigned char seed[16]);result (an unsigned integer) would be quite large. +This function encryptsDependent on the16-octet block 'inblock'mode of use, one can end up withthe 'key' returninga16-octet encrypted block. Here 'keyInstance'requirement for certificates for all users and a PKI. Even if one isan opaque type usedtorepresent Rijndael keys. void BlockEncrypt(keyInstance key, unsigned char inblock[16]); Algorithm Unif: givenaccept that PKI is desirable, there just isn't a16-octet quantity seed, produceusable one today. + TLS requires asequencefairly large implementation. OpenSSL, for example, is larger than our implementation ofunsigned 32-bit pseudo-random uniformly distributed integers. In OWAMP, the SID (session ID) from Control protocol plays the roleOWAMP as a whole. This can matter for embedded implementations. Regarding IPsec: + What we now call authenticated mode would not be possible (in IPsec you can't authenticate part of a packet). + The deployment paths of IPsec and OWAMP could be separate if OWAMP does not depend on IPsec. After nine years of IPsec, only 0.05% of traffic on an advanced backbone network such as Abilene uses IPsec (for comparison purposes with encryption above layer 4, SSH use is at 2-4% and HTTPS use is at 0.2-0.6%). It is desirable to be able to deploy OWAMP on as large ofseed. U1. [Initialize Rijndael key] key <- KeyInit(seed) [Initialize an unsigned 16-octet (network byte order) counter] c <- 0 U2. [Need more random bytes?] Set i <- c mod 4. If (i == 0) set s <- BlockEncrypt(key, c) U3. [Increment the countera number of different platforms asunsigned 16-octet quantity] c <- cpossible. +1 U4. [Do output] OutputThe deployment problems of a protocol dependent on IPsec would be especially acute in thei_th quartetcase ofoctets from s startinglightweight embedded devices. Ethernet switches, DSL ``modems,'' and other such devices mostly do not support IPsec. + The API for manipulation IPsec fromhigh-order octets, convertedan application is currently poorly understood. Writing a program that needs tonative byte orderencrypt some packets, authenticate some packets, andrepresented as OWPNum64 value (asleave some open---for the same destination---would become more of an exercise in3.b). U5. [Loop] GoIPsec rather than IP measurement. For the enumerated reasons, we decided tostep U2. 9. Security Considerationsuse a simple cryptographic protocol (based on a block cipher in CBC mode) that is different from TLS and IPsec. 6.7. Required Properties of MD5 Thegoalprotocol makes use ofauthenticated modethe MD5 hash function tolet one passphrase-protect service provided byconvert aparticular OWAMP-Control server. One can imagineuser-supplied passphrase into avariety of circumstances where this couldkey that will beuseful. Authenticated mode is designedused toprohibit theftencrypt a short piece ofservice. Additional design objectiverandom data (the session key). In this document we use cryptographic terminology ofauthenticated mode was to make it impossible for an attacker who cannot read traffic between OWAMP-Test sender[MENEZES]. It has long been suspected, andreceiver to tamper with test results in a fashionhas been conclusively shown recently thataffects the measurements, butMD5 is not a collision-resistant hash function. Since collision resistance was one of design goals of MD5, this casts strong suspicion on the othertraffic.design goals of MD5, namely preimage resistance and 2nd preimage resistance. OWAMP does not rely on any of these properties. Thegoalproperties ofencrypted mode is quite different: To make it hard forMD5 that are necessary are as follows: (1) it's apartyfunction that maps arbitrary length inputs into 128-bit outputs [fixed-length hash function], (2) a change inthe middleany bit of thenetwork to makeinput usually resultslook `better' than they should be. This is especially true if onein a change ofclient and server doesn't coincide with neither sender nor receiver. Encryptiona few bits ofOWAMP-Control using AES CBC mode with blocksoutput [weakened avalanche property], (3) many 128-bit strings have preimages [almost surjective], and (4) the visible special structure ofzerosnatural-language text possibly present in the passphrase is concealed aftereach message aimsapplication of the function. These are very weak requirements that many functions satisfy. Something resembling CRC-128 would work just as well. We chose MD5 here because it has the required properties and is widely implemented, understood, and documented. Alternatives would include (1) a non-cryptographic primitive, such as CRC-128, (2) SHA-1 truncated toachieve two goals: (i)128 bits, or (3) a hash function based on AES (using Matyas-Meyer-Oseas, Davies-Meyer, or Miyaguchi-Preneel constructions; we would probably gravitate towards the last one if a block-cipher- based cryptographically secure hash function were required). Note that option 1 would not have any cryptographically relevant properties. We chose not toprovide secrecyuse it because ofexchange; (ii) to provide authenticationlack ofeach message. OWAMP-Test sessions directed atwell-documented 128-bit checksums; this specification would incur anunsuspecting party could be used for denial of service (DoS) attacks. In unauthenticated mode servers should limits receivers to hosts they control orunnecessary burden precisely defining one, providing test vectors, etc., with no advantage over MD5. Option 2, SHA-1, belongs to theOWAMP-Control client. OWAMP-Test sessions couldMD4 family that appears to beused as covert channelsunder suspicion in light ofinformation. Environments that are worried about covert channels should take this into consideration. Noticerecent developments. To avoid creating an impression thatAESany potential future changes incounter mode is used for pseudo-random number generation, so implementationthe status ofAES MUST be included evenSHA-1 can affect the status of OWAMP we chose not to use it. Option 3 would result in aserver that only supports unauthenticated mode. 9.1. An OWAMP server can consume resourceshash function that, with the current state ofvarious kinds. The two most important kindsknowledge, would probably be one ofresources are network capacity and memory (primary or secondary)the most cryptographically sound. Our requirements 1-4 from the preceding paragraph, however, do not call forstoring test results. Any implementation of OWAMP server MUST include technical mechanismsa cryptographically sound hash function. Just as with CRC-128, this specification would need tolimitdefine theuse of network capacityhash function andmemory. Mechanismsprovide test vectors (and perhaps sample code); we see no advantage in this approach versus using MD5. (Note that the performance advantages of MD5 are irrelevant formanagingthis application, as theresources consumed by unauthenticated users and users authenticated withhash is computed on ausername and passphrase SHOULD be separate.relatively short human-supplied string only once per OWAMP-Control session, so if the Miyaguchi-Preneel construction were documented in an RFC, we might just as well have used that.) 6.8. Thedefault configurationUse ofan implementation MUST enable these mechanisms and setAES-CBC-MAC OWAMP relies on AES-CBC-MAC for message authentication. Random IV choice is important for prevention of a codebook attack on theresource use limits to conservatively low values. One way to designfirst block, it is unimportant for theresource limitation mechanismspurposes of CBC-MAC authentication (it should also be noted that with its 128-bit block size, AES isas follows: assign each sessionmore resistant toa user class. User classes are partially ordered with ``includes'' relation,codebook attacks than ciphers withone class (``all users'') thatshorter blocks; we use random IV anyway). Integrity zero padding, when decrypted, MUST be zero. It isalways present and that includes any other class.crucial to check for this before using the message, otherwise existential forgery becomes possible. Theassignment of a sessioncomplete message for which integrity zero padding is decrypted toa user class cannon-zero MUST bebased on the presence of authenticationdiscarded (for both short messages consisting of a few blocks and potentially long messages, such as a response to thesession, the user name, IP address range, time of day, and, perhaps, other factors. Each user class wouldFetch-Session command). Since OWAMP messages can havea limit for usagedifferent numbers ofnetwork capacity (specifiedblocks, existential forgery attack described inunitsexample 9.62 ofbit/second) and memory for storing test results (specified in units[MENEZES] becomes a concern. To prevent it (and to simplify implementation), the length ofoctets). Along withany message becomes known after decrypting thelimits for resource use, current use would be trackedfirst block of it. A special case is the first (fixed-length) message sent by theserver. When a sessionclient. There, the token isrequested byauserconcatenation of the 128-bit challenge (transmitted by the server ina specific user class,theresources needed for thisclear) and a 128-bit sessionare computed:key (generated randomly by theaverage network capacity use (based onclient, encrypted with AES-CBC with IV=0. Since IV=0, thesending schedule) andchallenge (a single cipher block) is simply encrypted with themaximum memory use (basedsecret key. Therefore, we rely onthe number of packets and numberresistance ofoctets each packet would needAES to chosen plaintext attacks (as the challenge could bestored internally -- notesubstituted by an attacker). It should be noted thatoutgoing sessions would not require any memory use). These resource use numbers are added tothecurrent resource use numbers fornumber of blocks of chosen plaintext an attacker can have encrypted with thegiven user class; if such addition would takesecret key is limited by theresource use outsidenumber of sessions thelimits forclient wants to initiate. An attacker who knows thegiven user class,encryption of a server's challenge can produce an existential forgery of the sessionis rejected. When resources are reclaimed, corresponding measures are subtracted from the current use. Network capacity is reclaimed as soon askey and thus disrupt the session; however, any attacker can disrupt a sessionends. Memoryby corrupting the protocol messages in an arbitrary fashion, therefore no new threat isreclaimed whencreated here; nevertheless, we require that thedataserver never issues the same challenge twice (if challenges are generated randomly, a repetition would occur, on average, after 2^64 sessions; we deem this satisfactory as this isdeleted. For unauthenticated sessions, memory consumed byenough even for anOWAMP-Test session SHOULD be reclaimed after the OWAMP-Control connectionimplausibly busy server thatinitiatedparticipates in 1,000,000 sessions per second to go without repetitions for more than 500 centuries). With respect to the second part of the token, an attacker can produce an existential forgery of the sessionis closed (gracefully or otherwise). For authenticated sessions,key by modifying theadministrator who configuressecond half of theservice should be able to decideclient's token while leaving theexact policy, but useful policy mechanisms that MAYfirst part intact. This forgery, however, would beimplemented areimmediately discovered by theability to automatically reclaim memoryclient when thedata is retrieved and the ability to reclaim memory after a certain configurable (basedintegrity zero padding onuser class) periodthe server's next message (acceptance or rejection oftime passes aftertheOWAMP-Test session terminates. 10.connection) does not verify. 7. IANA Considerations IANA is requested to allocate a well-known TCP port number forOWAMP- Controlthe OWAMP-Control part of the OWAMP protocol.11.8. Internationalization Considerations Theprotocol does not carry any information in a natural language. 12. Appendix A: Sample Implementationprotocol does not carry any information in a natural language. 9. Appendix A: Sample C Code for Exponential Deviates The values in array Q[] are the exact values that MUST be used by all implementations. The rest ofExponential Deviate Computationthis appendix only serves for illustrative purposes. /* ** Example usage: generate a stream of exponential (mean 1) ** random quantities (ignoring error checking during initialization). ** If a variate with some mean mu other than 1 is desired, the output ** of this algorithm can be multiplied by mu according to the rules ** of arithmetic we described. ** Assume that a 16-octet 'seed' has been initialized ** (as the shared secret in OWAMP, for example) ** unsigned char seed[16]; ** OWPrand_context next; ** (initialize state) ** OWPrand_context_init(&next, seed); ** (generate a sequence of exponential variates) ** while (1) { ** u_int64_t num = OWPexp_rand64(&next); <do something with num here> ... ** } */ #include <stdlib.h> typedef u_int64_t u_int64_t; /* (K - 1) is the first k such that Q[k] > 1 - 1/(2^32). */ #define K 12 #define BIT31 0x80000000UL /*seeSee if first bit in the lower 32 bits iszerozero. */ #define MASK32(n) ((n) & 0xFFFFFFFFUL) #define EXP2POW32 0x100000000ULL typedef struct OWPrand_context { unsigned char counter[16]; /*16-octet counterCounter (network byteorder)order). */ keyInstance key; /*key usedKey to encrypt the counter. */ unsigned char out[16]; /*theThe encryptedblock is kept there.block. */ } OWPrand_context; /* ** The array has been computed according to the formula: ** ** Q[k] = (ln2)/(1!) + (ln2)^2/(2!) + ... + (ln2)^k/(k!) ** ** as described in algorithm S. (The values below have been ** multiplied by 2^32 and rounded to the nearest integer.) ** These exact values MUST be used so that different implementation ** produce the same sequences. */ static u_int64_t Q[K] = { 0, /* Placeholder - so array indices start from 1. */ 0xB17217F8, 0xEEF193F7, 0xFD271862, 0xFF9D6DD0, 0xFFF4CFD0, 0xFFFEE819, 0xFFFFE7FF, 0xFFFFFE2B, 0xFFFFFFE0, 0xFFFFFFFE, 0xFFFFFFFF }; /* this element represents ln2 */ #define LN2 Q[1] /* ** Convert an unsigned 32-bit integer into a u_int64_tnumber..number. */ u_int64_t OWPulong2num64(u_int32_t a) { return ((u_int64_t)1 << 32) * a; } /* ** Arithmetic functions on u_int64_t numbers. */ /* ** Addition. */ u_int64_t OWPnum64_add(u_int64_t x, u_int64_t y) { return x + y; } /* ** Multiplication. Allows overflow. Straightforward implementation ** of Algorithm 4.3.1.M (p.268) from[KNUTH][KNUTH]. */ u_int64_t OWPnum64_mul(u_int64_t x, u_int64_t y) { unsigned long w[4]; u_int64_t xdec[2]; u_int64_t ydec[2]; int i, j; u_int64_t k, t, ret; xdec[0] = MASK32(x); xdec[1] = MASK32(x>>32); ydec[0] = MASK32(y); ydec[1] = MASK32(y>>32); for (j = 0; j < 4; j++) w[j] = 0; for (j = 0; j < 2; j++) { k = 0; for (i = 0; ; ) { t = k + (xdec[i]*ydec[j]) + w[i + j]; w[i + j] = t%EXP2POW32; k = t/EXP2POW32; if (++i < 2) continue; else { w[j + 2] = k; break; } } } ret = w[2]; ret <<= 32; return w[1] + ret; } /* ** Seed the random number generator using a 16-byte quantity 'seed' ** (== the session ID in OWAMP). This function implements step U1 ** of algorithm Unif. */ void OWPrand_context_init(OWPrand_context *next, unsigned char *seed) { int i; /* Initialize the key */ rijndaelKeyInit(next->key, seed); /* Initialize the counter with zeros */ memset(next->out, 0, 16); for (i = 0; i < 16; i++) next->counter[i] = 0UL; } /* ** Random number generating functions. */ /* ** Generate and return a 32-bit uniform random string (saved in the less ** significant half of the u_int64_t). This function implements stepsU2-U4** U2-U4 of the algorithm Unif. */ u_int64_t OWPunif_rand64(OWPrand_context *next) { int j; u_int8_t *buf; u_int64_t ret = 0; /* step U2 */ u_int8_t i = next->counter[15] & (u_int8_t)3; if (!i) rijndaelEncrypt(next->key, next->counter, next->out); /* Step U3. Increment next.counter as a 16-octet single quantity in network byte order for AES counter mode. */ for (j = 15; j >= 0; j--) if (++next->counter[j]) break; /* Step U4. Do output. The last 4 bytes of ret now contain the random integer in network byte order */ buf = &next->out[4*i];for(j=0;j<4;j++){for (j=0; j<4; j++) { ret <<= 8; ret += *buf++; } return ret; } /* ** Generatea mean 1an exponentialdeviate.deviate with mean 1. */ u_int64_t OWPexp_rand64(OWPrand_context *next) { unsigned long i, k; u_int32_t j = 0; u_int64_t U, V, J, tmp; /* Step S1. Get U and shift */ U = OWPunif_rand64(next); while ((U & BIT31) && (j <32)){32)) { /*shiftShift untilfindfirst'0'0. */ U <<= 1; j++; } /*removeRemove the'0' itself0 itself. */ U <<= 1; U = MASK32(U); /* Keep only the fractional part. */ J = OWPulong2num64(j); /* Step S2. Immediate acceptance? */ if (U < LN2) /* return (j*ln2 + U) */ return OWPnum64_add(OWPnum64_mul(J, LN2), U); /* Step S3. Minimize. */ for (k = 2; k < K; k++) if (U < Q[k]) break; V = OWPunif_rand64(next); for (i = 2; i <= k;i++){i++) { tmp = OWPunif_rand64(next); if (tmp < V) V = tmp; } /* Step S4. Return (j+V)*ln2 */ return OWPnum64_mul(OWPnum64_add(J, V), LN2); }13.10. Appendix B: Test Vectors for Exponential Deviates It is important that the test schedules generated by different implementations from identical inputs be identical. The non-trivial part is the generation of pseudo-random exponentially distributed deviates. To aid implementors in verifying interoperability, several test vectors are provided. For each of the four given 128-bit values of SID represented as hexadecimal numbers, 1,000,000 exponentially distributed 64-bit deviates are generated as described above. As they are generated, they are all added to each other. The sum of all 1,000,000 deviates is given as a hexadecimal number for each SID. An implementation MUST produce exactly these hexadecimal numbers. To aid in the verification of the conversion of these numbers to values of delay in seconds, approximate values are given (assuming lambda=1). An implementation SHOULD produce delay values in seconds that are close to the ones given below. SID = 0x2872979303ab47eeac028dab3829dab2 SUM[1000000] = 0x000f4479bd317381 (1000569.739036 seconds) SID = 0x0102030405060708090a0b0c0d0e0f00 SUM[1000000] = 0x000f433686466a62 (1000246.524512 seconds) SID = 0xdeadbeefdeadbeefdeadbeefdeadbeef SUM[1000000] = 0x000f416c8884d2d3 (999788.533277 seconds) SID = 0xfeed0feed1feed2feed3feed4feed5ab SUM[1000000] = 0x000f3f0b4b416ec8 (999179.293967 seconds)14.11. Normative References [AES] Advanced Encryption Standard (AES), http://csrc.nist.gov/encryption/aes/ [RFC1305] D. Mills, `Network Time Protocol (Version 3) Specification, Implementation and Analysis', RFC 1305, March 1992. [RFC1321] R. Rivest, `The MD5 Message-Digest Algorithm', RFC 1321, April 1992. [RFC2026] S. Bradner, `The Internet Standards Process -- Revision 3', RFC 2026, October 1996. [RFC2119] S. Bradner, `Key words for use in RFCs to Indicate Requirement Levels', RFC 2119, March 1997. [RFC2330] V. Paxon, G. Almes, J. Mahdavi, M. Mathis, `Framework for IP Performance Metrics' RFC 2330, May 1998. [RFC2474] K. Nichols, S. Blake, F. Baker, D. Black, `Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers', RFC 2474, December 1998. [RFC2679] G. Almes, S. Kalidindi, and M. Zekauskas, `A One-way Delay Metric for IPPM', RFC 2679, September 1999. [RFC2680] G. Almes, S. Kalidindi, and M. Zekauskas, `A One-way Packet Loss Metric for IPPM', RFC 2680, September 1999. [RFC2836] S. Brim, B. Carpenter, F. Le Faucheur, `Per Hop Behavior Identification Codes', RFC 2836, May 2000.15.12. Informative References [ZIGG] G. Marsaglia, M.SibuyaSibuya, andJ.H.J. H. Ahrens, Communications of ACM, 15 (1972),876-877876-877. [MENEZES] A. J. Menezes, P. C. van Oorschot, and S. A. Vanstone, Handbook of Applied Cryptography, CRC Press, revised reprint with updates, 1997. [KNUTH] D. Knuth, The Art of Computer Programming, vol.2, 3rd edition,19981998. [RIJN] Reference ANSI C implementation of Rijndael http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndaelref.zip [RIPE] RIPE NCC Test-Traffic Measurements home, http://www.ripe.net/test-traffic/. [RIPE-NLUUG] H. Uijterwaal and O. Kolkman, `Internet Delay Measurements Using Test-Traffic', Spring 1998 Dutch Unix User Group Meeting,http://www.ripe.net/test- traffic/Talks/9805_nluug.ps.gz.http://www.ripe.net/test-traffic/Talks/9805_nluug.ps.gz. [SURVEYOR] Surveyor Home Page, http://www.advanced.org/surveyor/. [SURVEYOR-INET] S. Kalidindi and M. Zekauskas, `Surveyor: An Infrastructure for Network Performance Measurements', Proceedings of INET'99, June 1999. http://www.isoc.org/inet99/proceedings/4h/4h_2.htm16.13. Authors' Addresses Stanislav Shalunov<shalunov@internet2.edu>Internet2 3025 Boardwalk Dr, Suite 200 Ann Arbor, MI 48108 Telephone: +1-734-995-7060 Email: shalunov@internet2.edu SIP: shalunov@internet2.edu Benjamin Teitelbaum<ben@internet2.edu>Internet2 3025 Boardwalk Dr, Suite 200 Ann Arbor, MI 48108 Email: ben@internet2.edu SIP: ben@internet2.edu Anatoly Karp<ankarp@yahoo.com>4710 Regent St Apt 81B Madison, WI 53705 Telephone: +1-608-347-6255 Email: ankarp@charter.net Jeff W. Boote<boote@internet2.edu>Internet2 3025 Boardwalk Dr, Suite 200 Ann Arbor, MI 48108 Email: boote@internet2.edu SIP: boote@internet2.edu Matthew J. Zekauskas<matt@internet2.edu>Internet2 3025 Boardwalk Dr, Suite 200 Ann Arbor, MI 48108 Email: matt@internet2.edu Intellectual Property The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2004). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgments We would like to thank Bernard Aboba, Guy Almes, Hamid Asgari, Steven Van den Berghe, Eric Boyd, Robert Cole, Joan Cucchiara, Stephen Donnelly, Kaynam Hedayat, Petri Helenius, Kitamura Yasuichi, Daniel H. T. R. Lawson, Will E. Leland, Bruce A. Mah, Allison Mankin, Al Morton, Attila Pasztor, Randy Presuhn, Matthew Roughan, Andy Scherrer, Henk Uijterwaal, and Sam Weiler for their comments, suggestions, reviews, helpful discussion and proof-reading. Expiration date:JanuaryFebruary 2005