Draft Aranda Dispatch q4s 03 v10

Embed Size (px)

Citation preview

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    1/81

    DISPATCH Working Group J.J. Garcia ArandaJ. Perez Lajo

    Internet Draft L.M. Diaz VizcainoG. Munoz Fernandez

    Intended status: Standards Track Alcatel-LucentExpires: December 20122012 C. BarcenillaM. Cortes

    J. SalvachuaJ. Quemada

    Univ. Politecnica de Madrid

    July 16, 2012

    The Quality for Service Protocoldraft-aranda-dispatch-q4s-02.txt

    Status of this Memo

    This Internet-Draft is submitted to IETF in full conformance withthe provisions of BCP 78 and BCP 79.

    Internet-Drafts are working documents of the Internet EngineeringTask Force (IETF), its areas, and its working groups. Note thatother groups may also distribute working documents as Internet-Drafts.

    Internet-Drafts are draft documents valid for a maximum of sixmonths and may be updated, replaced, or obsoleted by other documents

    at any time. It is inappropriate to use Internet-Drafts asreference material or to cite them other than as work in progress.

    The list of current Internet-Drafts can be accessed athttp://www.ietf.org/ietf/1id-abstracts.txt

    The list of Internet-Draft Shadow Directories can be accessed athttp://www.ietf.org/shadow.html

    This Internet-Draft will expire on DecemberDecemberDecemberNovember14, 2012.

    Copyright Notice

    Copyright (c) 2012 IETF Trust and the persons identified as thedocument authors. All rights reserved.

    Garcia Aranda Expires December 16, 20122012 [Page 1]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    2/81

    Internet-Draft The Quality for Services Protocol July 2012

    This document is subject to BCP 78 and the IETF Trusts LegalProvisions Relating to IETF Documents(http://trustee.ietf.org/license-info) in effect on the date ofpublication of this document. Please review these documents

    carefully, as they describe your rights and restrictions withrespect to this document.

    Abstract

    This memo describes an application level protocol for the standardcommunication of e2e QoS compliance information using a protocolbased on Hypertext Transfer Protocol (HTTP), which forms the basisfor the World Wide Web, and Session Description Protocol (SDP).Quality for Service Protocol (Q4S) provides a mechanism for latency,jitter, bandwidth and packet loss negotiation and monitoring,alerting whenever one of the negotiated conditions is violated.

    Implementation details on the actions to be triggered uponreception/detection of QoS alerts exchanged by the protocol are outof scope of this draft, it is application dependant (e.g. increasequality, reduce bit-rate) or even network dependant (e.g. changeconnections quality profile).

    Table of Contents

    1. Introduction.................................................51.1. Motivation..............................................61.2. Summary of Features.....................................7

    2. Terminology..................................................83. Overview of Operation........................................84. Q4S messages................................................16

    4.1. Requests...............................................174.2. Responses..............................................174.3. Header Fields..........................................19

    4.3.1. Common Q4S Header Fields..........................194.3.2. Specific Q4S Request Header Fields................204.3.3. Specific Q4S Response Header Fields...............21

    4.4. Bodies.................................................214.4.1. Encoding..........................................21

    5. Q4S method definitions......................................225.1. BEGIN..................................................225.2. READY..................................................225.3. PING...................................................235.4. BWIDTH.................................................235.5. Q4S-ALERT..............................................235.6. CANCEL.................................................24

    Garcia Aranda Expires December 14, 20122012 [Page 2]

    http://trustee.ietf.org/license-infohttp://trustee.ietf.org/license-info
  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    3/81

    Internet-Draft The Quality for Services Protocol July 2012

    6. Response codes..............................................246.1. 100 Trying.............................................246.2. Success 2xx............................................25

    6.2.1. 200 OK............................................25

    6.3. Redirection 3xx .......................................256.4. Request Failure 4xx ...................................256.4.1. 400 Bad Request...................................256.4.2. 404 Not Found ....................................256.4.3. 405 Method Not Allowed ...........................256.4.4. 406 Not Acceptable ...............................266.4.5. 408 Request Timeout...............................266.4.6. 412 A precondition has not been met...............266.4.7. 413 Request Entity Too Large .....................266.4.8. 414 Request-URI Too Long .........................266.4.9. 415 Unsupported Media Type .......................266.4.10. 416 Unsupported URI Scheme ......................26

    6.5. Server Failure 5xx ....................................26

    6.5.1. 500 Server Internal Error ........................276.5.2. 501 Not Implemented ..............................276.5.3. 503 Service Unavailable ..........................276.5.4. 504 Server Time-out ..............................276.5.5. 505 Version Not Supported ........................276.5.6. 513 Message Too Large ............................27

    6.6. Global Failures 6xx ...................................286.6.1. 600 session does not exist........................286.6.2. 601 quality level not allowed ....................286.6.3. 603 Session not allowed...........................286.6.4. 604 authorization not allowed ....................28

    7. Protocol ...................................................287.1. Protocol Phases........................................287.2. SDP Structure..........................................30

    7.2.1. qos-level attribute.............................317.2.2. alerting-mode attribute.........................327.2.3. network-alert-pauseguard-time attribute.........327.2.4. The guard-time attribute specifies an interval oftime that client and server must wait without sending Q4Smessages after any Q4S alert, in order to allow network tuningoperations. After this guard time, Q4S messages may continue............................................................327.2.5. This guard time is not applicable in server alertingmode during continuity phase, in which Q4S alerts aretriggered by the server to the network policy server without

    interrupting measurements between client and server........327.2.6. app-alert-pause attribute.......................337.2.7. public-address attributes.......................337.2.8. network:latency attribute.......................337.2.9. network:jitter attribute........................347.2.10. network:bandwidth attribute....................347.2.11. network:packetloss attribute...................34

    Garcia Aranda Expires December 14, 20122012 [Page 3]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    4/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.2.12. Application attributes...........................347.2.13. flow attributes................................357.2.14. Measurement attributes...........................36

    7.3. Measurements...........................................38

    7.3.1. Latency...........................................387.3.2. Jitter............................................387.3.3. Bandwidth.........................................397.3.4. Packet loss.......................................41

    7.4. Handshake Phase........................................427.5. Negotiation phase......................................43

    7.5.1. Stage 0: Measurement of latencies and jitters.....457.5.2. Stage 1: Measurement of bandwidth and packet loss.497.5.3. Application constraints not reached...............527.5.4. Network constraints not reached...................53

    7.5.4.1. Policy server role...........................577.5.5. QoS Level changes ................................58

    7.6. Continuity phase.......................................58

    7.7. Termination Phase......................................617.8. Dynamic constraints and flows..........................627.9. Qos-level downgrade operation..........................637.10. Sanity check of Quality sessions......................64

    8. General User Agent behavior. ...............................658.1. Roles in peer to peer scenarios........................658.2. Multiple Quality sessions in parallel..................658.3. General client behavior................................65

    8.3.1. Generating requests...............................668.4. General server behavior................................67

    9. Implementation Recommendations..............................689.1. Default client constraints.............................689.2. Latency and Jitter measurements........................689.3. Bandwidth measurements.................................689.4. Packet loss measurement resolution.....................699.5. Measurements and reactions.............................699.6. Instability treatments.................................709.7. Scenarios..............................................71

    9.7.1. Client to ACP.....................................719.7.2. Client to client..................................71

    10. Security Considerations....................................7111. IANA Considerations........................................7212. Conclusions................................................7613. References.................................................77

    13.1. Normative References..................................77

    13.2. Informative References................................7814. Acknowledgments............................................7915. Authors Addresses.........................................80

    Garcia Aranda Expires December 14, 20122012 [Page 4]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    5/81

    Internet-Draft The Quality for Services Protocol July 2012

    1. Introduction

    The World Wide Web (WWW) is a distributed hypermedia system whichhas gained widespread acceptance among Internet users. Although WWW

    browsers support other, preexisting Internet application protocols,the native and primary protocol used between WWW clients and serversis the HyperText Transfer Protocol (HTTP) (RFC 2616 [1]). The easeof use of the Web has prompted its widespread employment as aclient/server architecture for many applications. Many of suchapplications require the client and the server to be able tocommunicate each other and exchange information with certain qualityconstraints.

    Quality in communications at application level consists of fourmeasurable parameters:

    o Latency: The time a message takes to travel from source to

    destination. It may be approximated to RTT/2 (Round trip time),assuming the networks are symmetrical. In this context we willconsider the statistical median formula.

    o Jitter: latency variation. There are some formulas to calculateJitter, and in this context we will consider the statisticalarithmetic meanvariance formula.

    o Bandwidth: bit rate of communication. To assure the quality, aprotocol MUST assure the availability of the bandwidth neededby the application.

    o Packet loss: The percentage of packet loss is closely relatedto bandwidth and jitter. Affects bandwidth because a highpacket loss implies sometimes retransmissions that alsoconsumes extra bandwidth, other times the retransmissions arenot achieved (for example in video streaming over UDP) and theinformation received is less than the required bandwidth. Interms of jitter, a packet loss sometimes is seen by thedestination like a larger time between arrivals, causing ajitter growth.

    Q4S provides a mechanism for quality monitoring based on an HTTPsyntax and SDP in order to be easily integrated in WWW, but it maybe used by any type of application, not only those based on HTTP.

    Quality requirements may be needed by any type of application thatcommunicates using any kind of protocol, especially those with real-time constraints. Depending on the nature of each application theconstraints may be different leading to different parameterthresholds that need to be met.

    Garcia Aranda Expires December 14, 20122012 [Page 5]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    6/81

    Internet-Draft The Quality for Services Protocol July 2012

    Q4S is an application level Client/Server protocol that continuouslymeasures session quality for a given flow (or set of flows), end-to-end and in real-time; raising alerts if quality parameters are belowa given pre-negotiated threshold. Q4S describes when these alerts

    need to be sent and the entity receiving them. The actionsundertaken by the receiver of the alert are out of scope of theprotocol.

    Q4S is session-independent from the application flows, in order tominimize the impact on them. To perform the measurements, twocontrol flows are created on both communication paths (forward andreverse directions).

    1.1. Motivation

    Monitoring quality of service (QoS) in computer networks is usefulfor several reasons:

    o Enable real-time services and applications to verify whethernetwork resources achieve a certain QoS level.

    o Monitoring helps real-time services and applications to runthrough the Internet, allowing the existence of ApplicationContent providers (ACPs) which offer guaranteed real-timeservices to the final users.

    o Monitoring may also be required by Peer to Peer (P2P) real-timeapplications for which Q4S can be used

    o Enable ISPs to offer QoS to any ACP or final user applicationin an accountable way

    o Enable e2e negotiation of QoS parameters, independently of theInternet service providers of both endpoints.

    A protocol to monitor QoS must address the following issues:

    o Must be ready to be used in conjunction with current standardprotocols and applications, without forcing a change on them.

    o Must have a formal and compact way to specify qualityconstraints of the desired application to run.

    o Must have measurement mechanisms avoiding applicationdisruption, minimizing network resources consumption.

    Garcia Aranda Expires December 14, 20122012 [Page 6]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    7/81

    Internet-Draft The Quality for Services Protocol July 2012

    o Must have specific messages to alert about the violation ofquality constraints in different directions (forward andreverse), because network routing may not be symmetrical, andof course, quality constraints may not be symmetrical.

    o Must protect the data (constrains, measurements, QoS levelsdemanded from the network) in order to avoid the injection ofmalicious data in the measurements.

    1.2. Summary of Features

    Quality for Service (Q4S) is a message-oriented communicationprotocol that can be used in conjunction with any other application-level protocol.

    The benefits in quality enhancement provided by Q4S can be used byany type of application that uses any type of protocol for datatransport. It provides a quality monitoring scheme for anycommunication that takes place between the client and the server,not only the Q4S communication itself.

    Q4S does not establish multimedia sessions and it does not transportapplication data. It monitors the fulfillment of the qualityrequirements of the communication between the client and the server,and therefore does not impose any restrictions on the type ofapplication, protocol or the type of usage of the monitored qualityconnection.

    Some applications may vary their quality requirements dynamicallyfor any given quality parameter. Q4S is able to adapt to thechanging application needs modifying the parameter thresholds to thenew values and monitoring the network quality according to the newconstraints. It will raise alerts if the new constraints areviolated.

    Q4S session lifetime is composed of four phases with differentpurposes: Handshake, Negotiation, Continuity and Termination.Negotiation and Continuity phases perform network parametermeasurements as per a negotiated measurement procedure. Differentmeasurement procedures COULD be used inside Q4S, although one

    default measurement mechanism is needed for compatibility reasonsand is the one defined in this draft. Basically, Q4S defines how totransport application quality requirements and measurement resultsbetween client and server and providing monitoring and alerting too.

    Q4S MUST be executed just before starting a client-serverapplication which needs a quality connection in terms of latency,

    Garcia Aranda Expires December 14, 20122012 [Page 7]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    8/81

    Internet-Draft The Quality for Services Protocol July 2012

    jitter, bandwidth and/or packet loss. Once client and server havesucceeded in establishing communication under quality constraints,the application can start, and Q4S continues measuring and alertingif necessary.

    The quality parameters can be suggested by the client in the firstmessage of the handshake phase, but its the server that acceptsthese parameter values or forces others. The server is in charge ofdeciding the final values of quality connection.

    2. Terminology

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT","SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" inthis document are to be interpreted as described in RFC 2119 [3].

    3. Overview of Operation

    This section introduces the basic operation of Q4S using simpleexamples. This section is of tutorial nature and does not containany normative statements.

    The first example shows the basic functions of a Q4S: communicationestablishment between a client and a server, quality requirementnegotiations for the requested application, application start andcontinuous quality parameter measurements, and finally communicationtermination.

    The client triggers the establishment of the communicationrequesting a specific service or application from the server. Thisfirst message must have a special URI (RFC 3986), which may forcethe use of the Q4S protocol if it is implemented in a standard webbrowser. This message consists of a Q4S BEGIN method, which canoptionally include initial communication quality requirements in anSDP body.

    This request is answered by the server with a Q4S 200 OK responseletting the client know that it accepts the request. This responsemessage MUST contain an SDP body with:

    o The assigned Q4S session ido The quality constraints required by the requested application

    o The measurement procedure to use.

    Garcia Aranda Expires December 14, 20122012 [Page 8]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    9/81

    Internet-Draft The Quality for Services Protocol July 2012

    o The alerting mode: there are two options different scenariosfor sending alerts that trigger actions on the network whenmeasurements identify violated quality constraints. In bothcases, Q4S alerts are triggered by the server.

    a) q4S-aware-network: the network is supposed to be Q4Saware, and reacts by itself to these alerts. Q4S alerts aresent by the server to the client.

    b) policy-server: the network is not Q4S aware and anspecific node (policy server) is supposed to be in chargeof achievingtriggering network tuning mechanisms. Q4Salerts are sent by the server to the policy server.

    Client mode: Q4S alerts are triggered by the client to theserver. In this case the network is supposed to be Q4S aware,and reacts by itself to these alerts.

    a) Server mode: Q4S alerts are triggered by the server to thenetwork policy server. In this case the network is not Q4Saware and an specific node (policy server) is supposed to bein charge of achieving network tuning mechanisms.

    o Guard time: predefined interval of time that client and servermust wait without sending Q4S messages after any Q4S alert, inorder to allow network tuning operations. After this guardtime, Q4S messages may continue.

    o network-alert-pause: the amount of time the server waitswithoutbetween consecutive sending next Q4S alerts. When itfinishes, Q4S alerts may be triggered again. Measurements arenot stopped in Negotiation or Continuity Phases, during thisperiod of time, but no alerts isare fired thougheven withviolated network quality constraints allowing networkreconfigurations are violated.

    o app-alert-pause: the amount of time Q4S stack waitswithoutbetween consecutive notifyingications to the applicationeven with violated application quality constraints. Notice thatthe Q4S client stack is in charge of notifying to the clientapplication and the Q4S server stack to the server application.

    Once the communication has been established (handshake phase isfinished), the protocol will verify that the communication pathbetween the client and the server meets the quality constraints onboth directions, from and to the server (negotiation phase). Thisnegotiation phase requires taking measurements of the quality

    Garcia Aranda Expires December 14, 20122012 [Page 9]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    10/81

    Internet-Draft The Quality for Services Protocol July 2012

    parameters: latencies, jitter, bandwidth and packet loss. This phaseis initiated with a client message containing a Q4S READY method,which will be answered by the server with a Q4S 200 OK response.

    Negotiation measurements are achieved in two sequential stages:

    o Stage 0: latency and jitter measurements

    o Stage 1: bandwidth and packet loss measurements

    Stage 0 measurements are being taken through Q4S PING messages sentboth from both the client and the server. All Q4S PING requests willbe answered by Q4S 200 OK messages to allow for bidirectionalmeasurements.

    After a pre-agreed number of measurements have been performed,determined by the measurement procedure sent by the server, two

    cases scenarios may be possible:

    a) Measurements do not meet the requirements: in this case the stage0 is repeated after sending an alert from the client server tothe server client or from the server to the network policyserver, depending on the alerting mode defined in the Handshakephase. Notice that measurements continue to be madetaken but noQ4S alert is fired during the network-alert-pause time.

    b) Measurements do meet the requirements: in this case client movesto stage 1 sending a new READY message.

    Stage 1 measurements are achieved through Q4S BWIDTH messages sentboth from the client and the server. Unlike PING messages, Q4SBWIDTH requests will not be answered.

    If Stage 0 and 1 meets the application quality constraints, theapplication may start. Q4S will enter in the continuity phasemeasuring the network quality parameters and raising alerts in caseof violation. This will be done through the Q4S PING messageexchange on both connection paths.

    Once the client wants to terminate the communication it sends a Q4SCANCEL message, which will be acknowledged by the server withanother Q4S CANCEL message.

    This figure depicts the message exchange in a successful scenario.

    Garcia Aranda Expires December 14, 20122012 [Page 10]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    11/81

    Internet-Draft The Quality for Services Protocol July 2012

    +-------------------------------------------+| || Client Server || |

    Handshake | --------- Q4S BEGIN -----------> || |

    | || || || |

    | || || || || | app end|

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    12/81

    Internet-Draft The Quality for Services Protocol July 2012

    Client and server measurements are included into PING and BWIDTHmessages, allowing that both sides of the communication to be areaware of all measurements in both directions.

    The following two examples show the behavior of the Q4S protocolwhen quality constraints are violated. The first example shows theq4S-aware-network client alerting mode scenario:

    Garcia Aranda Expires December 14, 20122012 [Page 12]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    13/81

    Internet-Draft The Quality for Services Protocol July 2012

    +-------------------------------------------+| || Client Server || |

    Handshake | --------- Q4S BEGIN -----------> || |

    | || |

    | ||

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    14/81

    Internet-Draft The Quality for Services Protocol July 2012

    | || ... || (pause expires & violated constraints) |

    | || (network-alert-pause) || --------- Q4S PING ------------> || || || | app end|

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    15/81

    Internet-Draft The Quality for Services Protocol July 2012

    +-------------------------------------------+| || Client Server Policy |

    | Server |Handshake | ----- Q4S BEGIN -----> || |

    | || || |

    | || |

    Garcia Aranda Expires December 14, 20122012 [Page 15]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    16/81

    Internet-Draft The Quality for Services Protocol July 2012

    |

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    17/81

    Internet-Draft The Quality for Services Protocol July 2012

    The start-line, each message-header line, and the empty line MUST beterminated by a carriage-return line-feed sequence (CRLF). Notethat the empty line MUST be present even if the message-body is not.

    Much of Q4S's messages and header field syntax are identical toHTTP/1.1. However, Q4S is not an extension of HTTP.

    4.1. Requests

    Q4S requests are distinguished by having a Request-Line for a start-line. A Request-Line contains a method name, a Request-URI, and theprotocol version separated by a single space (SP) character.

    The Request-Line ends with CRLF. No CR or LF are allowed except inthe end-of-line CRLF sequence. No linear whitespace (LWS) is allowedin any of the elements.

    Request-Line = Method SP Request-URI SP Q4S-Version CRLF

    Method: This specification defines six methods: BEGIN for startingand negotiate quality sessions, READY for synchronization ofmeasurements, PING and BWIDTH for quality measurementspurpose, CANCEL for terminating sessions, and Q4S-ALERT forquality violations reporting.

    Request-URI: The Request-URI is a Q4S URI (RFC 2396) as described in

    2.2.17.4. The Request-URI MUST NOT contain unescaped spacesor control characters and MUST NOT be enclosed in .

    Q4S-Version: Both request and response messages include the versionof Q4S in use. To be compliant with this specification,applications sending Q4S messages MUST include a Q4S-Versionof Q4S/1.0. The Q4S-Version string is case-insensitive,but implementations MUST send upper-case. Unlike HTTP/1.1,Q4S treats the version number as a literal string. Inpractice, this should make no difference.

    4.2. Responses

    Q4S responses are distinguished from requests by having a Status-Line as their start-line. A Status-Line consists of the protocolversion followed by a numeric Status-Code and its associated textualphrase, with each element separated by a single SP character. No CRor LF is allowed except in the final CRLF sequence.

    Garcia Aranda Expires December 14, 20122012 [Page 17]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    18/81

    Internet-Draft The Quality for Services Protocol July 2012

    Status-Line = Q4S-Version SP Status-Code SP Reason-Phrase CRLF

    The Status-Code is a 3-digit integer result code that indicates theoutcome of an attempt to understand and satisfy a request. The

    Reason-Phrase is intended to give a short textual description of theStatus-Code. The Status-Code is intended for use by automata,whereas the Reason-Phrase is intended for the human user. A clientis not required to examine or display the Reason-Phrase.

    While this specification suggests specific wording for the reasonphrase, implementations MAY choose other text, for example, in thelanguage indicated in the Accept-Language header field of therequest.

    The first digit of the Status-Code defines the class of response.The last two digits do not have any categorization role. For thisreason, any response with a status code between 100 and 199 is

    referred to as a 1xx response, any response with a status codebetween 200 and 299 as a 2xx response, and so on. Q4S/1.0 allowsfollowing values for the first digit:

    1xx: Provisional -- request received, continuing to processthe request;

    2xx: Success -- the action was successfully received,understood, and accepted;

    3xx: Redirection -- further action needs to be taken in orderto complete the request;

    4xx: Request Failure -- the request contains bad syntax orcannot be fulfilled at this server;

    5xx: Server Error -- the server failed to fulfill anapparently valid request;

    6xx: Global Failure -- the request cannot be fulfilled at anyserver.

    The status codes are the same described in HTTP (RFC 2616 [1]). Inthe same way as HTTP, Q4S applications are not required to

    understand the meaning of all registered status codes, though suchunderstanding is obviously desirable. However, applications MUSTunderstand the class of any status code, as indicated by the firstdigit, and treat any unrecognized response as being equivalent tothe x00 status code of that class.

    Garcia Aranda Expires December 14, 20122012 [Page 18]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    19/81

    Internet-Draft The Quality for Services Protocol July 2012

    The Q4S-ALERT and CANCEL requests do not have to be responded.However, after receiving a Q4S-ALERT or CANCEL request, the serverSHOULD sends a Q4S-ALERT or CANCEL request to the client

    4.3. Header Fields

    Q4S header fields are identical to HTTP header fields in both syntaxand semantics.

    Some header fields only make sense in requests or responses. Theseare called request header fields and response header fields,respectively. If a header field appears in a message not matchingits category (such as a request header field in a response), it MUSTbe ignored.

    o

    4.3.1. Common Q4S Header Fields

    These fields may appear in Request and Response messages.

    o Session-Id: the value for this header is the same session idused in SDP (embedded in o SDP parameter) and is assigned bythe server. The messages without SDP MUST include this header.If a message has and SDP body, this header is optional. Themethod of allocation is up to the creating tool,but it is suggested that a UTC timestamp be used to ensureuniqueness.

    o Sequence-Number: sequential and cyclic positive integer numberassigned to PING and BWIDTH messages, and acknowledged in 200OK responses.

    o Timestamp: this optional header contains the system time (withthe best possible accuracy). It indicates the time in which thePING request was sent. If this header is present in PINGmessages, then the 200 OK response messages include the samethisvalue.

    o Stage: this is used in clients READY requests and servers 200OK responses during the Negotiation and Continuity phases in

    order to synchronize the initiation of the measurements.Example: Stage: 0

    Garcia Aranda Expires December 14, 20122012 [Page 19]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    20/81

    Internet-Draft The Quality for Services Protocol July 2012

    4.3.2. Specific Q4S Request Header Fields

    In addition to HTTP header fields, these are the specific Q4Srequest header fields

    o User-Agent: this header contains information about theimplementation of the user agent. This is for statisticalpurposes, the tracing of protocol violations, and the automatedrecognition of user agents for the sake of tailoring responsesto avoid particular user agent limitations. User agents SHOULDinclude this field with requests. The field can containmultiple product tokens and comments identifying the agent andany sub-products which form a significant part of the useragent. By convention, the product tokens are listed in order oftheir significance for identifying the application.

    o Signature: this header contains a digital signature that can beused by the network or policy server to validate the SDP,preventing security attacks. The signature is an optionalheader generated by the server according to the pre-agreedsecurity policies of the networkbetween the Application ContentProvider and the ISP. For example, using a hash algorithm andencryption method such as MD5 (RFC 1321 [6]) and RSA (RFC 2437[7]), but it depends and based on the server certificate usedby the servercould be used. This certificate is supposed to bedelivered by a Certification Authority (CA) or policy owner tothe server. The signature is applied to the SDP body.

    Signature= RSA ( MD5 (), )

    If the signature is not present, other validation mechanism maybe implemented in order to provide assured quality withsecurity and control.

    o Measurements: this header carries the measurements of thequality parameters in PING and BWIDTH requests. The format is:

    Measurements: l= |[0..9999] , j= |[0..9999] , pl= |[0.00 .. 100.00] , bw= |[0..9999]

    Where l stands for latency followed by the measured value oran empty space, j stands for jitter followed by the measuredvalue or an empty space, pl stands for packetloss followed bythe measured value in % or an empty space and bw stands forbandwidth followed by the measured value or an empty space.

    Garcia Aranda Expires December 14, 20122012 [Page 20]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    21/81

    Internet-Draft The Quality for Services Protocol July 2012

    4.3.3. Specific Q4S Response Header Fields

    o Expires: the its purpose is to provide a sanity check and allowthe server to close inactive sessions. If the client does not

    send a new request before the expiration time, the server canMAY close the session. The value MUST be an integer and themeasurement units are milliseconds.

    In order to keep the session open the server MUST send a Q4Salert bBefore the session expiration (according to Expiresheader), server MUST send a Q4S alert with the same qualitylevels and an alert cause of keep-alive. for keeping sessionalive. Its The purpose of this alert is to avoid TCP sockets(which were opened with READY message) arefrom being closed,specially in NAT scenarios. Cause of this alert SHOULD bekeep-alive.

    4.4. Bodies

    Requests, including new requests defined in extensions to thisspecification, MAY contain message bodies unless otherwise noted.The interpretation of the body depends on the request method.

    For response messages, the request method and the response statuscode determine the type and interpretation of any message body. Allresponses MAY include a body.

    The Internet media type of the message body MUST be given by theContent-Type header field.

    4.4.1. Encoding

    The body MUST NOT be compressed. This mechanism is valid forother protocols such as HTTP and SIP (RFC 3261 [13]), buta compression/coding scheme will limit certain logicalimplementations of the way the request is parsed, thus, making theprotocol concept more implementation dependent. In addition,bandwidth calculation may not be valid if compression is used.Therefore, the HTTP request header Accept-Encoding can not be usedin Q4S with different values than identity and if it is present in

    a request, the server MUST ignore it. In addition, the responseheader Content-Encoding is optional, but if present, the uniquepermitted value is identity.

    The body length in bytes is provided by the Content-Length headerfield. The chunked transfer encoding of HTTP/1.1 MUST NOT be usedfor Q4S (Note: The chunked encoding modifies the body of a message

    Garcia Aranda Expires December 14, 20122012 [Page 21]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    22/81

    Internet-Draft The Quality for Services Protocol July 2012

    in order to transfer it as a series of chunks, each one with its ownsize indicator.)

    5. Q4S method definitions

    The Method token indicates the method to be performed on theresource identified by the Request-URI. The method is case-sensitive.

    Method = BEGIN | READY | PING | BWIDTH |Q4S-ALERT | CANCEL | extension-method

    extension-method = token

    The list of methods allowed by a resource can be specified in anAllow header field (RFC 2616 [1] section 14.7). The return code ofthe response always notifies the client when a method is currentlyallowed on a resource, since the set of allowed methods can changedynamically. Any server application SHOULD return the status code405 (Method Not Allowed) if the method is known, but not allowed forthe requested resource, and 501 (Not Implemented) if the method isunrecognized or not implemented by the server.

    5.1. BEGIN

    The BEGIN method means requests information from a resource

    identified by a Q4S URI. The semantics of this method is thestarting of a quality session.

    This method is only used during the handshake phase to retrieve theSDP containing session id and all quality and operation parametersfor the desired application to run.

    When a BEGIN message is received by the server, any current qualitysession is cancelled and a new session should be created.

    The response to a Q4S BEGIN request is not cacheable.

    5.2. READY

    The READY method is used to synchronize the starting time forsending of PING and BWIDTH messages over UDP between clients andservers. The stage header included in this method is mandatory.

    Garcia Aranda Expires December 14, 20122012 [Page 22]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    23/81

    Internet-Draft The Quality for Services Protocol July 2012

    This message is only used in negotiation and continuity phases, andonly just before making a measurement. Otherwise (out of thiscontext), the server MUST ignore this method.

    5.3. PING

    This message is used during the negotiation and continuity phases tomeasure the RTT and jitter of a session. The message MUST be sentonly over UDP ports.

    The fundamental difference between the PING and BWIDTH requests isreflected in the different measurements achieved with them. PING isa short message, and MUST be answered in order to measure RTT andjitter, whereas BWIDTH is a long message (1 Kbyte or more) and MUSTNOT be answered.

    PING is a request method that can be originated by client but also

    by server. Client MUST also answer the server PING messages,assuming a server role for these messages during measurementprocess.

    The Measurements header included in this method is mandatory, andprovides updated measurements values for latency, jitter and packetloss to the counterpart.

    5.4. BWIDTH

    This message is used only during the Negotiation phase to measurethe bandwidth and packet loss of a session. The message MUST be sentonly over UDP ports.

    BWIDTH is a request method that can be originated by the client butalso by server. Both (client and server) MUST NOT answer BWIDTHmessages.

    The Measurements header included in this method is mandatory, andprovides updated measurements values for bandwidth and packet lossto the counterpart.

    5.5. Q4S-ALERT

    This is the request message that Q4S generates when the measurementsindicate that quality constraints are being violated. It is usedduring the negotiation and continuity phases.

    This informative message indicates that the user experience is beingdegraded and includes the details of the problem (bandwidth, jitter,

    Garcia Aranda Expires December 14, 20122012 [Page 23]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    24/81

    Internet-Draft The Quality for Services Protocol July 2012

    packet loss measurements). The Q4S-ALERT message does not containany detail on the actions to be taken, which depends on theagreements between all involved parties.

    Q4S-ALERT request does not have to be answered with a responsemessage unless there is an error condition. However, after receivinga Q4S-ALERT request, the counterpart answers with a Q4S-ALERTrequest. The response to a Q4S-ALERT request is not cacheable.

    This method can be is always initiated by the client server only inclient both alerting modes. In q4s-aware-network alerting mode, theQ4S-ALERT messages are fired by the server and sent to the client,advising the network to react by itself. In policy-server alertingmode the Q4S-ALERT messages are triggered by the server and sent tonetwork policy server.

    5.6. CANCEL

    The semantics of CANCEL message is the release of the Q4S session idand the possible resources assigned to the session. This messagecould be triggered by Q4S stack or by the application using the stack(through an implementation dependant API).

    In the same way as Q4S-ALERT, CANCEL must not be answered with aresponse message. However, if the server receives a CANCEL message,it must answer with a CANCEL request message towards the client,acknowledging the reception.

    In the server policy-server alerting mode, the server MUST forwardthe Q4S CANCEL messages received from the client must be forwardedfrom server to network policy server in order to release possibleassigned resources for the session. The policy server must answerthe CANCEL message with a CANCEL request message towards the server,acknowledging the reception.

    6. Response codes

    Q4S response codes are used for TCP and UDP. However, in UDP only

    the response code 200 is used.

    6.1. 100 Trying

    This response indicates that the request has been received by thenext-hop server (the policy server) and that some unspecified actionis being taken on behalf of this request (for example, a database is

    Garcia Aranda Expires December 14, 20122012 [Page 24]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    25/81

    Internet-Draft The Quality for Services Protocol July 2012

    being consulted). This response, like all other provisionalresponses, stops retransmissions of a Q4S-ALERT by the clientduringthe network-alert-pause time.

    6.2. Success 2xx

    2xx responses give information about success of a request.

    6.2.1. 200 OK

    The request has succeeded.

    6.3. Redirection 3xx

    3xx responses give information about the user's new location, or

    about alternative services that might be able to satisfy the request.

    The requesting client SHOULD retry the request at the newaddress(es) given by the Location header field.

    6.4. Request Failure 4xx

    4xx responses are definite failure responses from a particularserver. The client SHOULD NOT retry the same request withoutmodification (for example, adding appropriate headers or SDPvalues). However, the same request to a different server might besuccessful.

    6.4.1. 400 Bad Request

    The request could not be understood due to malformed syntax. TheReason-Phrase SHOULD identify the syntax problem in more detail, forexample, Missing Sequence-Number header field.

    6.4.2. 404 Not Found

    The server has definitive information that the user does not existat the domain specified in the Request-URI. This status is alsoreturned if the domain in the Request-URI does not match any of thedomains handled by the recipient of the request.

    6.4.3. 405 Method Not Allowed

    The method specified in the Request-Line is understood, but notallowed for the address identified by the Request-URI.

    Garcia Aranda Expires December 14, 20122012 [Page 25]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    26/81

    Internet-Draft The Quality for Services Protocol July 2012

    The response MUST include an Allow header field containing a list ofvalid methods for the indicated address.

    6.4.4. 406 Not Acceptable

    The resource identified by the request is only able of generatingresponse entities that have content characteristics not acceptableaccording to the Accept header field sent in the request.

    6.4.5. 408 Request Timeout

    The server could not produce a response within a suitable amount oftime, and the client MAY repeat the request without modifications atany later time

    6.4.6. 412 A precondition has not been met

    6.4.7. 413 Request Entity Too Large

    The server is refusing to process a request because the requestentity-body is larger than the one that the server is willing orable to process. The server MAY close the connection to prevent theclient from continuing the request.

    6.4.8. 414 Request-URI Too Long

    The server is refusing to process the request because the Request-URI is longer than the one that the server accepts.

    6.4.9. 415 Unsupported Media Type

    The server is refusing to process the request because the messagebody of the request is in a format not supported by the server forthe requested method. The server MUST return a list of acceptableformats using the Accept, Accept-Encoding, or Accept-Language headerfield, depending on the specific problem with the content.

    6.4.10. 416 Unsupported URI Scheme

    The server cannot process the request because the scheme of the URIin the Request-URI is unknown to the server.

    6.5. Server Failure 5xx5xx responses are failure responses given when a server itself ishaving trouble.

    Garcia Aranda Expires December 14, 20122012 [Page 26]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    27/81

    Internet-Draft The Quality for Services Protocol July 2012

    6.5.1. 500 Server Internal Error

    The server encountered an unexpected condition that prevented itfrom fulfilling the request. The client MAY display the specific

    error condition and MAY retry the request after several seconds.

    6.5.2. 501 Not Implemented

    The server does not support the functionality required to fulfillthe request. This is the appropriate response when a Server does notrecognize the request method and it is not capable of supporting itfor any user.

    Note that a 405 (Method Not Allowed) is sent when the serverrecognizes the request method, but that method is not allowed orsupported.

    6.5.3. 503 Service Unavailable

    The server is temporarily unable to process the request due to atemporary overloading or maintenance of the server. The server MAYindicate when the client should retry the request in a Retry-Afterheader field. If no Retry-After is given, the client MUST act as ifit had received a 500 (Server Internal Error) response.

    A client receiving a 503 (Service Unavailable) SHOULD attempt toforward the request to an alternate server. It SHOULD NOT forwardany other requests to that server for the duration specified in theRetry-After header field, if present.

    Servers MAY refuse the connection or drop the request instead ofresponding with 503 (Service Unavailable).

    6.5.4. 504 Server Time-out

    The server did not receive a timely response from an external serverit accessed in attempting to process the request.

    6.5.5. 505 Version Not Supported

    The server does not support, or refuses to support, the Q4S protocolversion that was used in the request. The server is indicating that

    it is unable or unwilling to complete the request using the samemajor version as the client, other than with this error message.

    6.5.6. 513 Message Too Large

    The server was unable to process the request since the messagelength exceeded its capabilities.

    Garcia Aranda Expires December 14, 20122012 [Page 27]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    28/81

    Internet-Draft The Quality for Services Protocol July 2012

    6.6. Global Failures 6xx

    6xx responses indicate that a server has definitive informationabout a particular policy not satisfied for processing the request.

    6.6.1. 600 session does not exist

    The Session-Id is not valid

    6.6.2. 601 quality level not allowed

    The QOS level requested is not allowed for the pair client/server

    6.6.3. 603 Session not allowed

    The session is not allowed due to some policy (number of sessionsallowed for the server is exceeded, or the time band of the Q4S-

    ALERT is not allowed for the pair client/server, etc)

    6.6.4. 604 authorization not allowed

    The policy server does not authorize the Q4S-ALERT quality sessionimprovement operation because due to any internal or external reason.

    7. Protocol

    This section describes the measurement procedures, the SDP structureof the Q4S messages, the different Q4S protocol phases and themessages exchanged in them.

    7.1. Protocol Phases

    All elements of the IP network contribute to the quality in termsof latency, jitter, bandwidth and packet loss. All these elementshave their own quality policies in terms of priorities, trafficmode, etc. and each element has its own way to manage the quality.The purpose of a quality connection is to establish an end-to-endcommunication with enough quality for the application to functionflawlessly.

    To monitor quality constraints of the application, four phases aredefined and can be shown seen in the following figure:

    Garcia Aranda Expires December 14, 20122012 [Page 28]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    29/81

    Internet-Draft The Quality for Services Protocol July 2012

    +---------------------------------------------------------------+| || || Handshake ---> Negotiation -+--> Continuity ---> Termination |

    | A | (app start) (app end) || | | A || | violated | || | constraints | || | | | | || +------+ +---------------------+ || |+---------------------------------------------------------------+

    Figure 4 Session lifetime phases.

    o Handshake phase: in which the server is contacted by the clientand in the answer message the quality constraints for theapplication is communicated embedded in an SDP.

    o Negotiation phase: in which the quality of the connection ismeasured in both directions (latency, jitter, bandwidth andpacket loss), and Q4S messages may be sent in order to alert ifthe measured quality does not match meet the constraints. Thisphase is iterative until quality constraints are reached or thesession is cancelled after a number of measurement cycleswithout with consistent violation ofmeeting the qualityconstraints. Just after reaching the quality requirements, Q4Sprovides a simple optional mechanism using HTTP to start theapplication.

    o Continuity phase: in which quality is continuously measured. Inthis phase the measurements MUST avoid disturbing theapplication by consuming network resources. When If applicationquality constraints are not met, the Q4S stack will notify theapplication. If later the quality improves again, the Q4S stackwill notify the application too. If quality becomesdegradedfalls below the network parameter constraints, an a Q4Snetwork alert shall be issued. If after some alerts the qualityconstraints are unreachable, the protocol SHOULD move toTermination phase. In the other hand, if quality improves over

    time, application will be also notified by the Q4S stack.o Termination phase: in which the Q4S session is terminated. The

    application may be closed too or may not be started.

    Garcia Aranda Expires December 14, 20122012 [Page 29]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    30/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.2. SDP Structure

    The original goal of SDP was to announce necessary information forthe participants and multicast MBONE (Multicast Backbone)applications. Right now, its use has been extended to theannouncement and the negotiation of multimedia sessions. The purposeof Q4S is not to establish media stream sessions, but to monitor aquality connection. This connection may be later used to establishany type of session including media sessions; Q4S does not imposeany conditions on the type of communication requiring qualityparameters.

    SDP will be used by Q4S to exchange quality constraints and willtherefore always have all the media attributes (m) set to zero.

    The SDP embedded in the messages is the container of the qualityparameters. As these may vary depending on the direction of thecommunication (to and from the client) all quality parameters needto specify the uplink and downlink values: / .When one or both of these values are empty, it MUST be understood asneeding no constraint on thatis parameter and and/or that direction.

    The uplink direction MUST be considered as being the communicationfrom the client to the server. The downlink direction MUST beconsidered as being the communication from the server to the client.

    The SDP information can comprise all or some of the followingparameters shown in the example below.: This is an example of an SDPmessage used by Q4S that may be included in the 200 OK response to aQ4S BEGIN request.

    Garcia Aranda Expires December 14, 20122012 [Page 30]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    31/81

    Internet-Draft The Quality for Services Protocol July 2012

    v=0o=q4s-UA 53655765 2353687637 IN IP4 192.0.2.33s=Q4Si=Q4S parameters

    t=0 0a=qos-level:0/0a=alerting-mode:policy-servera=guardnetwork-alert-pause-time:5000a=app-alert-pause:25000a=public-address:client IP4 80.0.2.33a=public-address:server IP4 198.51.100.58a=network:latency:40a=network:jitter:10/10a=network:bandwidth:20/6000a=network:packetloss:0.50/0.50a=application:latency:35/30a=applicacion:jitter:8/8

    a=applicacion:bandwidth:25/7000a=applicacion:packetloss:0.30/0.30a=flow:app clientListeningPort TCP/10000-20000a=flow:app clientListeningPort UDP/15000-18000a=flow:app serverListeningPort TCP/56000a=flow:app serverListeningPort UDP/56000a=flow:q4s clientListeningPort UDP/55000a=flow:q4s clientListeningPort TCP/55001a=flow:q4s serverListeningPort UDP/56000a=flow:q4s serverListeningPort TCP/56001

    a=measurement:procedure default(50/50,75/75,5000,0,0)a=measurement:latency 10000a=measurement:jitter 10000/10000a=measurement:bandwidth 0/0a=measurement:packetloss 0.00/0.00

    Notice that in this SDP example measurements are filled with dummyvalues, because this example may be embedded into a 200 OK answer tothe BEGIN initial request.

    Notice that in this SDP example there are no measurementsattributes,: these only applywill only be included in the to SDPsbody in embedded into Q4S-ALERT messages.

    7.2.1. qos-level attributeThe qos-level attribute contains the QoS level for uplink anddownlink. Default values are 0 for both directions. The meaning ofeach level is out of scope of Q4S, but a higher level SHOULDcorrespond to a better service quality.

    Garcia Aranda Expires December 14, 20122012 [Page 31]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    32/81

    Internet-Draft The Quality for Services Protocol July 2012

    The qos-level attribute may be changed during the protocollifetime raising or lowering the value as necessary following thenetwork measurements and the application needs.

    7.2.2. alerting-mode attribute

    The alerting-mode attribute specifies the player in charge oftriggering Q4S alerts in case of constraint violation. There are twopossible values:

    a) Clientq4s-aware-network: Q4S alerts are triggered by the clientserver to the serverclient. In this case the network is supposedto be Q4S aware, and reacts by itself to these alerts.

    b) policy-server: Q4S alerts are triggered sent by the server to thenetwork policy server. In this case the network is not Q4S awareand an specific node (policy server) is is supposed to be in

    charge of achieving triggering network tuning mechanisms.

    The alerting-mode attribute is optional and if not present itsdefault value, when it is not present, is policy-server mode isassumed.

    7.2.3. network-alert-pauseguard-time attribute

    7.2.4. The guard-time attribute specifies an interval of time thatclient and server must wait without sending Q4S messages after any Q4Salert, in order to allow network tuning operations. After this guardtime, Q4S messages may continue.

    7.2.5. This guard time is not applicable in server alerting modeduring continuity phase, in which Q4S alerts are triggered bythe server to the network policy server without interruptingmeasurements between client and server.

    The network-alert-pause attribute specifies the amount of time (inmilliseconds) the server waits between consecutive Q4S alerts.Measurements are not stopped in Negotiation or Continuity Phasesduring this period of time, but no alerts are fired even withviolated network quality constraints allowing networkreconfigurations.

    The network-alert-pause attribute specifies the amount of time inmilliseconds that the server waits withoutbefore sending next Q4Salert if the alerting conditions persist. When it finishesAfter thisperiod of time, Q4S alerts may be triggered again for the sameissues. Measurements are not stoppedinterrupted during this period

    Garcia Aranda Expires December 14, 20122012 [Page 32]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    33/81

    Internet-Draft The Quality for Services Protocol July 2012

    of time in Negotiation andor Continuity Phases, during this periodof time, but no alert is fired though quality constraints areviolated.

    7.2.6. app-alert-pause attribute

    The app -alert-pause attribute specifies the amount of time (inmilliseconds) that Q4S stack waits between consecutive notificationsto the application even with violated application qualityconstraints. Notice that the Q4S client stack is in charge ofnotifying the client application and the Q4S server stack is incharge of notifying the server application. If this attribute is notpresent, the Q4S stack will never notify the application.

    The app -alert-pause attribute specifies the amount of time in

    milliseconds that the Q4S stack waits withoutbefore notifyingapplication of the degraded network conditions. Notice that the Q4Sclient stack is in charge of notifying to the client application andthe Q4S server stack to the server application.

    If this attribute is not present, the Q4S stack will never notifythe application will never be notified by Q4S stack.

    7.2.7. public-address attributes

    This attribute contains the public IP address of the client and theserver. The server fills these attributes with his own public IPaddress and the public IP address of the first message received fromthe client in the handshake phase.

    The purpose of these attributes is to make available the addressinginformation to network policy server or other external entities incharge of processing Q4S-ALERT messages.

    7.2.8. network:latency attribute

    The maximum latency (considered equal for uplink and downlink)tolerance are specified in the network:latency attribute,expressed in milliseconds. If the latency constraints are not met, aQ4S-ALERT method will be raised by client or server (depending on

    alerting-mode attribute). If the network:latency attribute is notpresent or has a 0 value, no latency constraints need to be met andno measurements MAY be taken.

    Garcia Aranda Expires December 14, 20122012 [Page 33]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    34/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.2.9. network:jitter attribute

    The maximum uplink and downlink jitter tolerance are specified inthe network:jitter attribute, expressed in milliseconds. If the

    jitter constraints are not met, a Q4S-ALERT method will be raised byclient or server (depending on alerting-mode attribute). Ifnetwork:jitter attribute is not present or has a 0 value, nojitter constraints need to be met and no measurements MAY be taken.

    7.2.10. network:bandwidth attribute

    The minimum uplink and downlink bandwidth are specified in thenetwork:bandwidth attribute, expressed in kbps. If the bandwidthconstraints are not met, a Q4S-ALERT method will be raised by clientor server (depending on alerting-mode attribute). Ifnetwork:bandwidth attribute is not present or has a 0 value, nobandwidth constraints need to be met and no measurements MAY be

    taken.

    7.2.11. network:packetloss attribute

    The maximum uplink and downlink packet loss tolerance are specifiedin the network:packetloss attribute expressed in percentage (twodecimal accuracy). If the packetloss constraints are not met, a Q4S-ALERT method will be raised by client or server (depending onalerting-mode attribute). If network:packetloss attribute is notpresent or has a 0 value, no packetloss constraints need to be metand no measurements MAY be taken.

    7.2.12. Application attributes

    These One or more of these attributes may not be present. They MUSTnot be used if the application requiring quality service does notaccept alert messages. They specify the thresholds for latency,jitter, bandwidth and packetloss in order for the Q4S stack tonotify the application from Q4S stack. The Q4S client stack willnotify the client application and the Q4S server stack will notifythe server application. The mechanisms of this notification isimplementation dependent and out of scope of this draft.

    There are four application attributes:

    a=application:latency:35a=applicacion:jitter:8/8a=applicacion:bandwidth:25/7000a=applicacion:packetloss:0.30/0.30

    Garcia Aranda Expires December 14, 20122012 [Page 34]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    35/81

    Internet-Draft The Quality for Services Protocol July 2012

    The uplink/downlink values of the application attributes SHOULD bemore restrictive than the network quality constraints. This willgive the application the possibility to react and adapt to networkissues before the network quality degrades more, for example, by

    starting the application in lower video quality requiring lessbandwidth or reducing interaction speed at multiplayer games whenlatency grows.

    Application parameters MAY be present without network qualityparameter requirements. If this is the case, no Q4S-ALERTS will betriggered but the application will be notified of any qualityparameter that falls below the application quality constraints.Therefore, in this case, app-alert-pause attribute is mandatory.

    If the app-alert-pause attribute is present but no applicationparameters are not presenthave been specified, the Q4S stack SHOULDnotify to the application all measured parameters (as specified by

    the network quality requirements)ments every app-alert-pausemillisecondstime app-alert-pause expires (if this value ispresent). This scenario is useful when application needs feedbackabout measurements periodically and not only in specific degradedconditions.

    7.2.13. flow attributes

    These attributes specify the flows (protocol, destination IP/ports)of data over TCP and UDP ports to be used in uplink and downlinkcommunications.

    Several flow attributes can be defined. These flows identify thelistening port (client or server), the protocol (TCP or UDP) (RFC761 [8] and RFC 768 [9]) with the range of ports that are going tobe used by the application and, of course, by the Q4S protocol (forquality measurements). All defined flows (app and q4s) will beconsidered within the same quality profile, which is determined bythe qos-level attribute in each direction. This allows to assumethat measurements on q4s flows are the same experimented by theapplication which is using app flows.

    During negotiation and continuity phases the specified Q4S ports inthe flow:q4s attributes of SDP will be used for Q4S messages.

    The Q4S flows comprise two UDP flows and two TCP flows (one uplinkand one downlink for each one) whereas application traffic MAYconsist of many flows, depending on its nature. The handshake phasetakes place through the Q4S Contact URI, using TCP port 80, forexample. However the negotiation and continuity phases will takeplace on the specified Q4S ports (UDP and TCP) specified in the SDP.

    Garcia Aranda Expires December 14, 20122012 [Page 35]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    36/81

    Internet-Draft The Quality for Services Protocol July 2012

    The clientListeningPort is a port in which the client listens forserver requests and MUST be used as origin port of client responses.The serverListeningPort is a port in which server is listening forincoming messages from the client. The origin port of server

    responses may be different than serverListeningPort value.

    If clientListeningPort is zero (a=flow:q4s clientListeningPortTCP/0), the client MAY choose one randomly as per OS standard rules.Client ports inside the SDP must always be matched against actualreceived port values on the server side in order to deal withNAT/NATP devices. If zero value or incorrect value is present,server must set the value to the received origin port in the nextmessage with SDP (200 OK, ALERT and CANCEL messages).

    7.2.14. Measurement attributes

    These attributes contain the measurement procedure and the resultsof the quality measurements.

    Measurement parameters are included using the session attributemeasurement. The first measurement parameter is the procedure. Q4Sprovides a default procedure for measurements, but others likeRTP/RTCP might be used and defined later. This draft will onlydefine and explain the default procedure.

    In the initial client request a set of measurement procedures can besent to the server for negotiation. One measurement procedure lineMUST be included in the SDP message for each proposed method. Theserver MUST answer with only one line with the chosen procedure.

    For each procedure, a set of values of parameters separated by ,can be included in the same attribute line. The amount and type ofparameters depends on the procedure type.

    In the following example the default procedure type is chosen:

    a=measurement:procedure default(50/50,75/75,5000,40/80,100/256)

    In the default procedure, the meaning of these parameters is:

    o The first parameter is the interval of time (in milliseconds)between PING requests during the negotiation phase. Uplink anddownlink values from the clients point of view are separatedby /. This allows having different responsiveness valuesdepending on the control resources used in each direction.

    Garcia Aranda Expires December 14, 20122012 [Page 36]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    37/81

    Internet-Draft The Quality for Services Protocol July 2012

    o The second parameter is the time interval (in milliseconds)between PING requests during the continuity phase. Uplink anddownlink values are separated by /. This allows having twodifferent responsiveness values depending on the control

    resources used in each direction.

    o The third parameter is the time interval to be used to measurebandwidth during the negotiation phase. If zero, a defaultvalue of 5000 ms MUST be assumed. Forward Uplink and reversedownlink values are separated by /.

    o

    o The fourth parameter indicates the window size for jitter andlatency calculations. If zero, a value of 256 MUST be assumed.ForwardUplink and reverse downlink values are separated by /.

    o The fifth parameter indicates the window size for packet losscalculations. If zero, a value of 256 MUST be assumed.ForwardUplink and reverse downlink values are separated by /.

    There are four more measurement attributes:

    a=measurement:latency 45a=measurement:jitter 3/12a=measurement:bandwidth 200/9800a=measurement:packetloss 0.00/1.00

    The latency, jitter, bandwidth and packetloss measurement attributescontain the values measured for each of these quality parameters inuplink and downlink directions. Notice that latency is consideredequal for uplink and downlink directions. Quality parameters valuesin these measurement attributes provide a snapshot of the qualitylevel reached in each measurement stage. and Notice that latencyis considered equal for uplink and downlink directions.

    They can be omitted during the initial protocol phases as nomeasurements have been taken, but they attributes MUST only beincluded in Q4S-ALERT messages only in the SDP body when sendingQ4S-ALERT messagessuch that they can be protected from maliciousattacks as these alerts include a signature of the SDP body in the

    header. For tThe rest of messages will include the, measurements areincluded into d values in the Measurements the headers.

    Garcia Aranda Expires December 14, 20122012 [Page 37]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    38/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.3. Measurements

    This section describes the way quality parameters are measured asdefined by the default procedure. Measurements MUST be taken for

    any quality parameter with constraints, that is, specified in theSDP attributes with non-zero values. For non-present attributesmeasurements MAY be omitted.

    7.3.1. Latency

    Latency measurements will be performed if the latency attributeand/or the application latency attribute are present and with non-zero values.

    Q4S defines a PING method in order to exchange packets between theclient and the server. Based on this PING exchange the client andthe server are able to calculate the round trip time (RTT). The RTT

    is the sum of downlink latency (normally named reverse latency)and uplink latency (normally named forward latency).

    At least 255 samples of RTT MUST be taken by the client and server.As the forward and reverse latencies are impossible to measure,client and server will assume that both latencies are identical(symmetric network assumption). The latency will therefore becalculated as the statistical average median value of all the RTTsamples divided by 2.

    7.3.2. Jitter

    Jitter measurements will be performed if the jitter attribute and/orthe application jitter attribute are present and with non-zerovalues.

    The jitter can be calculated independently by the client and by theserver. The downlink jitter is calculated by the client taking intoaccount the time interval between PING requests as defined by themeasurement procedure attribute in the first or second parameterdepending on the Q4S protocol phase. The client and the server MUSTsend these PING requests at the specified intervals. The clientmeasures the downlink jitter whereas the server measures the uplink

    jitter. Note that PING responses are not taken into account whencalculating jitter values.

    Every time a PING request message is received by an endpoint (eitherserver or client), the corresponding jitter value is updated usingthe Statistical Jitter value calculated on the first 255 packets

    Garcia Aranda Expires December 14, 20122012 [Page 38]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    39/81

    Internet-Draft The Quality for Services Protocol July 2012

    received using the arithmetic meanstatistical variance formulaof theabsolute values: of elapsed times.

    Jitter Statistical = SquareRootOf(SumOf((ElapsedTime[i]-Average)^2)/(ReceivedPacketCount-1))

    Each endpoint sends a PING periodically with a fixed interval, eachvalue of elapsed time (ET) should be very close to this interval.If a PING message is lost, the elapsed time value is doubled.Identifying lost PING messages, however, is not an issue because allPING messages are labeled with a Sequence-Number header. Thereforethe receiver can discard this elapsed time value.

    In order to have the first jitter sample, the receiver MUST waituntil it receives 3 PING requests, because each ET is the timebetween two PINGs and a Jitter needs at least two ET.

    Tthe client measures the values of RTT and downlink jitter and theserver measures RTT and uplink jitter, but all measurements areshared with the counterpart by means of Measurements header ofPING message.

    7.3.3. Bandwidth

    Bandwidth measurements will be performed if the bandwidth attributeand/or the application bandwidth attribute are is present and withnon-zero values.

    In order to measure the available bandwidth, both the client and theserver MUST start sending BWIDTH messages simultaneously using theUDP control ports exchanged during the handshake phase in the SDPmessage, at the needed rate to verify the availability of thebandwidth constraint in each direction using messages of 1 Kbyte ormore in length. The messages are sent during the period of timedefined in the third parameter of the SDP measurement defaultprocedure attribute in millisecond units. If this parameter is zero,a value of 5000 milliseconds SHOULD be used by default.

    a=measurement:procedure default(50/50,75/75,5000,0256/256,0256/256)

    Garcia Aranda Expires December 14, 20122012 [Page 39]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    40/81

    Internet-Draft The Quality for Services Protocol July 2012

    +------------------------------------------------+| Rate || A || | |

    |downlink rate-|-------------------+

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    41/81

    Internet-Draft The Quality for Services Protocol July 2012

    Client message:=========================

    BWIDTH q4s://www.example.com Q4S/1.0User-Agent: q4s-ua-experimental-1.0

    Session-Id: 53655765Sequence-Number: 0Content-Type: textContent-Length: XXXXMeasurements: l=22, j=10, pl=0.00, bw=3000

    aaaaaaaaaaaaa ( to complete 1024 bytes UDP payload length)=========================

    The client MUST send BWIDTH packets to the server to allow theserver to measure the uplink bandwidth. The server MUST send BWIDTHpackets to the client to allow the client to measure the downlink

    bandwidth.

    Sserver message:=========================

    BWIDTH q4s://www.example.com Q4S/1.0Session-Id: 53655765Sequence-Number: 0Content-Type: textContent-Length: XXXXMeasurements: l=22, j=7, pl=0.00, bw=200

    aaaaaaaaaaaaa ( to complete 1024 bytes UDP payload length)=========================

    7.3.4. Packet loss

    Packet loss and bandwidth are measured simultaneously using theBWIDTH packets sent by both the client and the server. Because theBWIDTH packets contain a Sequence-Number header incrementedsequentially with each sent packet, lost packets can be easilyidentified. The lost packets have to be counted during the

    measurement time.

    Garcia Aranda Expires December 14, 20122012 [Page 41]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    42/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.4. Handshake Phase

    The first phase consists of a Q4S BEGIN method issued from theclient to the server.

    The first Q4S message MUST have a special URI (RFC 3986 [4]), whichforces the use of the Q4S protocol if it is implemented in astandard web browser.

    This URI, named Contact URI, is used to request the start of asession. Its scheme MUST be:

    q4s: // host [: port] [path[? query]

    Optionally, the client can send the desired quality parametersenclosed in the body of the message as an SDP document. The serverMAY take them into account when building the answer message with the

    final values in the SDP body, following a request / response schema(RFC 3464 [5]).

    If the request is accepted, the server MUST answer it with a Q4S 200OK message, and which MUST contain an SDPin the body body of theanswer message, an SDP document MUST be included (RFC 4566 [2]),with the assigned session id (embedded in the o SDP parameter),the alerting modIP addresses to be usede, , the guard time andtheflow ports to be used, the measurement procedure to be followed andinformation about the required quality constraints. Additionally,the alerting-mode and alert-pause time parameters may be included.Q4S responses should use the protocol designator Q4S/1.0.

    After these two messages are exchanged, the first phase iscompleted. The quality parameters thresholds have been sent to theclient. The Next next step is to measure the actual quality of thecommunication path between the client and the server and alert ifthe SLA is being violated.

    +------------------------------------------------+| || Client Server || || ------- Q4S BEGIN ------------> || |

    |

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    43/81

    Internet-Draft The Quality for Services Protocol July 2012

    Example of Client Request and Server Answer:

    Client Request:=========================

    BEGIN q4s://www.example.com Q4S/1.0Content-Type: application/sdpUser-Agent: q4s-ua-experimental-1.0Content-Length: 142

    (SDP not shown)=========================

    Server Answer:=========================Q4S/1.0 200 OKDate: Mon, 10 Jun 2010 10:00:01 GMT

    Content-Type: application/sdpExpires: 3000Signature: 6ec1ba40e2adf2d783de530ae254acd4f3477ac4Content-Length: 131

    (SDP not shown)=========================

    The headers used are were explained in section XXXX 4.3.

    7.5. Negotiation phase

    The negotiation phase is in charge of measuring the qualityparameters and verifying that the communication paths meet therequired quality constraints on both directions as specified in theSDP body.

    The measured parameters will be compared with the application andnetwork constraints specified in the SDP body. If the qualitysession is compliant with all the quality constraints theapplication can start. If network quality constraints are met, butapplication quality constraints are not, the application will benotified of those parameters such that it can take action by, forexample, starting with lower quality or reducing quality during

    execution.If the network constraints are not met, a higher quality servicelevel will be demanded through a Q4S-ALERT method triggered by theclient or server depending on alerting-mode attribute. After theamount of milliseconds specified in the Guard-Time SDP attributehave elapsed in order to allow time for the network to react, the

    Garcia Aranda Expires December 14, 20122012 [Page 43]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    44/81

    Internet-Draft The Quality for Services Protocol July 2012

    measurements will be resumed receiving the same Q4S-ALERT from thecounterpart, no other alert will be triggered during the network-alert-pause in order to allow the network to react, butmeasurements will continue to be taken to achieve early detection of

    improved network conditions and a fast application start to detectas soon as possible network quality improvements. If after severalmeasurement repetitions cycles, determined by the lower of the twoalert-pause values (network-alert-pause and app-alert-pause), thenetwork constraints cannot be met the quality session is terminated.

    The steps to be taken in this phase depend on the measurementprocedure exchanged during the handshake phase. This document onlydescribes the default procedure, but others can be used, likeRTP/RTCP (RFC 3550 [10]).

    Measurements of latency and jitter are done calculating thedifferences in arrival times of packets and can be achieved with

    little bandwidth consumption. The bandwidth measurement, on theother hand, involves higher bandwidth consumption in both directions(uplink and downlink).

    To avoid wasting unnecessary network resources these two types ofmeasurements will be performed in two separate stages. If therequired latencies and jitters cannot be reached, it makes no senseto waste network resources measuring bandwidth. In addition, ifachieving the required latency and jitter thresholds impliesupgrading the quality session level, the chance of obtainingcompliant bandwidth measurements without retries is higher, savingnetwork traffic again. Therefore, the default procedure, determinesthat the measurements are taken in two stages:

    o Stage 0: Measurement of latencies, jitters and packet loss

    o Stage 1: Measurement of bandwidths and packet loss

    Notice that packet loss can be measured in both stages, as allmessages exchanged include a sequence-number header that allows foreasy packet loss detection.

    The client starts the negotiation phase sending a READY requestusing the TCP Q4S ports defined in the SDP. This READY requestincludes a Stage header that indicates the measurement stage.

    If either jitter, latency or both are specified, the negotiationphase begins with the measurement of latencies and jitters (stage0). If none of those attributes are specified, stage 0 is skipped.

    Garcia Aranda Expires December 14, 20122012 [Page 44]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    45/81

    Internet-Draft The Quality for Services Protocol July 2012

    7.5.1. Stage 0: Measurement of latencies and jitters

    +------------------------------------------------+| || Client Server || || ------- Q4S READY -----------> || ||

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    46/81

    Internet-Draft The Quality for Services Protocol July 2012

    Client and server MUST send PING requests to each other. TheSequence-Number header of the first PING MUST be set to 0. Clientand server will manage their own sequence numbers.

    +------------------------------------------------+| || Client Server || || --------- Q4S READY 0 ---------> || || || ||

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    47/81

    Internet-Draft The Quality for Services Protocol July 2012

    Client Request:=========================

    PING q4s://www.example.com Q4S/1.0Session-Id: 53655765

    Sequence-Number: 0User-Agent: q4s-ua-experimental-1.0Measurements: l=22, j=12, pl=0.20, bw=Content-Length: 0

    =========================

    Server Response:=========================Q4S/1.0 200 OK

    Session-Id: 53655765Sequence-Number: 0Content-Length: 0Measurements: l=20, j=13, pl=0.10, bw=

    =========================

    The function of the PING method is similar to the ICMP echo requestmessage. The server MUST answer as soon as it receives the message.

    Both endpoints MUST send Q4S PING messages with the periodicityspecified in the first parameter of SDP measurement procedureattribute, using always the same UDP ports and incrementing theSequence-Number with each message.

    In the following example, the SDP measurement procedure attribute,this value is 50 milliseconds (from the client to the server) and60ms (from the server to the client).

    a=measurement:procedure default(50/60,50/50,5000,0256/256,0256/256)

    They MUST NOT wait for a response to send the next PING request. TheSequence-Number header value is incremented sequentially and MUSTstart at zero. If this stage is repeated, the initial Sequence-Number MUST start at zero again.

    All PING requests MUST contain a Measurements header, with thevalues of the latency, jitter and packet loss measured by eachentity up to that moment. The client will send its measurements tothe server and the server his measurements to the client. Example:

    Measurements: l=22, j=13, pl=0.10, bw=

    Where l stands for latency, j for jitter, pl for packetloss and bwfor bandwidth. The bandwidth value is omitted, as it is not measuredat this stage.

    Garcia Aranda Expires December 14, 20122012 [Page 47]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    48/81

    Internet-Draft The Quality for Services Protocol July 2012

    Optionally the PING request can include a Timestamp header, withthe time in which the message has been sent. In case the header ispresent, the server MUST include the header in the response withoutchanging the value.

    A minimum number of PING messages (at least 256 are recommended)MUST be exchanged in order to be able to measure latency, jitter andpacket-loss with certain accuracy (at least 256 samples arerecommended to get a accurate packet loss measurement). Both theclient and the server calculate the respective measured parametervalues. The mechanisms to calculate the different parameters aredescribed in section 47.3.

    At the end of this stage 0, there are three possibilities:

    o The network and application latency, jitter and packet lossconstraints are reached in both directions

    o The network latency, jitter and packet loss constraints arereached in both directions but one or more parameters fallbelow the application constraints in one or both directions.

    o The network latency, jitter and packet loss constraints are notreached in one or both directions

    In the first and second cases, Stage 0 is finished. Client andserver are ready for Stage 1: bandwidth and packet loss measurement.The client moves to stage 1 by sending a READY message including theheader Stage: 1.

    If the network and application bandwidth constraints are empty orwith value zero, the negotiation phase MUST terminate and bothclient and server may initiate the Continuity Phase. In this caseclient moves to Continuity phase by sending a READY messageincluding the header Stage: 2. But notice that if only applicationconstraints were violated but network were not (second case), theanswer to the READY message for Continuity phase MAY includeoptionally the URI for triggering the application using a simpleHTTP based mechanism based on an optional Trigger-URI header. This

    URI may include specific information for the application to startunder degraded network conditions.

    Garcia Aranda Expires December 14, 20122012 [Page 48]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    49/81

    Internet-Draft The Quality for Services Protocol July 2012

    The third case, in which one or more network constraints have notbeen met, is detailed in section 7.5.4. Network constraints notreached.

    7.5.2. Stage 1: Measurement of bandwidth and packet loss

    This stage begins in a similar way to stage 0, sending a READYrequest over TCP. This READY message Stage header value is 1. Theserver answers with a Q4S 200 OK message to synchronize theinitiation of the measurements.

    +------------------------------------------------+| || Client Server |

    | || --------- Q4S READY 1 -----------> || || ||

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    50/81

    Internet-Draft The Quality for Services Protocol July 2012

    Client Request:=========================

    READY q4s://www.example.com Q4S/1.0User-Agent: q4s-ua-experimental-1.0Stage: 1Session-Id: 53655765Content-Length: 0

    =========================

    Server Response:=========================Q4S/1.0 200 OK

    Session-Id: 53655765Stage: 1

    Content-Length: 0

    =========================

    Just after receiving the 200 OK, both the client and the server MUSTstart sending BWIDTH messages simultaneously using the UDP q4sports. Section 7.3.3 describes the bandwidth measurement in detail.

    At the end of this stage 1, there are three possibilities:

    o The network and application bandwidth and packet lossconstraints are reached in both directions

    o The network bandwidth and packet loss constraints are reachedin both directions but one or more parameters fall below theapplication constraints in one or both directions.

    o The network bandwidth and packet loss constraints are notreached in one both directions.

    Garcia Aranda Expires December 14, 20122012 [Page 50]

  • 7/29/2019 Draft Aranda Dispatch q4s 03 v10

    51/81

    Internet-Draft The Quality for Services Protocol July 2012

    In the first and second cases, Stage 1 is finished. Client andserver are ready for Continuity phase. The cClient moves to thisphase by sending a READY message including the header Stage: 2.The server answer MUST be 200 OK, and MAY include optionally the URI

    for triggering the application using a simple HTTP based mechanismbased on an optional Trigger-URI header. This URI may includespecific information for the application to start under degradednetwork conditions if application constra