Re: [MMUSIC] RTSP 2.0: Section 18.20: Sequence numbering.

Magnus Westerlund <magnus.westerlund@ericsson.com> Thu, 10 October 2013 09:25 UTC

Return-Path: <magnus.westerlund@ericsson.com>
X-Original-To: mmusic@ietfa.amsl.com
Delivered-To: mmusic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6D0C721F9FA7 for <mmusic@ietfa.amsl.com>; Thu, 10 Oct 2013 02:25:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.989
X-Spam-Level:
X-Spam-Status: No, score=-104.989 tagged_above=-999 required=5 tests=[AWL=1.260, BAYES_00=-2.599, HELO_EQ_SE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 61+cahLs5WK8 for <mmusic@ietfa.amsl.com>; Thu, 10 Oct 2013 02:25:06 -0700 (PDT)
Received: from mailgw2.ericsson.se (mailgw2.ericsson.se [193.180.251.37]) by ietfa.amsl.com (Postfix) with ESMTP id 7D3B721F9FD6 for <mmusic@ietf.org>; Thu, 10 Oct 2013 02:25:05 -0700 (PDT)
X-AuditID: c1b4fb25-b7eff8e000000eda-72-5256726ff33d
Received: from ESESSHC018.ericsson.se (Unknown_Domain [153.88.253.125]) by mailgw2.ericsson.se (Symantec Mail Security) with SMTP id 3B.E6.03802.F6276525; Thu, 10 Oct 2013 11:25:04 +0200 (CEST)
Received: from [127.0.0.1] (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.74) with Microsoft SMTP Server id 14.2.328.9; Thu, 10 Oct 2013 11:25:03 +0200
Message-ID: <525672AF.1090503@ericsson.com>
Date: Thu, 10 Oct 2013 11:26:07 +0200
From: Magnus Westerlund <magnus.westerlund@ericsson.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: Elwyn Davies <elwynd@folly.org.uk>
References: <1381331780.13277.72869.camel@mightyatom>
In-Reply-To: <1381331780.13277.72869.camel@mightyatom>
X-Enigmail-Version: 1.5.2
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprALMWRmVeSWpSXmKPExsUyM+JvrW5BUViQwc4WNovjB3awW0xd/pjF gcnj68l2Fo8lS34yBTBFcdmkpOZklqUW6dslcGU87lYoaHaqmHnnKlsD4znjLkZODgkBE4kH M+ayQthiEhfurWfrYuTiEBI4zChx48gZJghnOaPE9CkfwKp4BbQlfqz5wwxiswioSvxu+csG YrMJWEjc/NEIZosKBEu0b//KBlEvKHFy5hMWEFtEQE1i89cHjCA2s4C6RM/vFrA5wgKWEkcX LgarFxIwlbjVcAOshlPATGLdpQWMENdJSmxbdIwdoldPYsrVFqg58hLNW2czQ/RqSzQ0dbBO YBSahWT1LCQts5C0LGBkXsXInpuYmZNebrSJERiqB7f8Vt3BeOecyCFGaQ4WJXHeD2+dg4QE 0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUwcs1htXrqqCuztODT0gSxpkKhS1bxi2K2z8rYE/rs 2udexzT2KfV7N4rqvGGPv9T3zbxsjtZ0k+K37XH3zhflzlL5PHdHU4FxdLCHh4+OKPds/zdW FiXaD3Yq8t6cmeq4Ien1MZPiF5tXPH3tHLo48VqSRmfaTu8fcd9ObT35Zv6kVf+bkjY0KbEU ZyQaajEXFScCAOvBovQjAgAA
Cc: "mmusic (E-mail)" <mmusic@ietf.org>
Subject: Re: [MMUSIC] RTSP 2.0: Section 18.20: Sequence numbering.
X-BeenThere: mmusic@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Multiparty Multimedia Session Control Working Group <mmusic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mmusic>, <mailto:mmusic-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/mmusic>
List-Post: <mailto:mmusic@ietf.org>
List-Help: <mailto:mmusic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mmusic>, <mailto:mmusic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 10 Oct 2013 09:25:14 -0000

Hi Elwyn,

Thanks for spotting ttis. Yes, I agree this is inconsistent, and needs
clearer text.

On 2013-10-09 17:16, Elwyn Davies wrote:
> In the proces of checking the changes from v34 to v37, I found that
> there have been some changes to the CSeq specification  (Section 18.20)
> that seem a bit garbled.
> 
> In para 1, it is stated:
>> For each new RTSP request an agent creates the CSeq value
>>    MUST be incremented by one.
> 
> Then later:
>> Agents receiving a request over a reliable transport with an in-order
>>    delivery MUST ignore how the sequence value increments, i.e. it can
>>    increment with other values than 1. 
> 

This is actually not really a contradiction to the first sentence. You
can require to send with monotonically increasing sequence numbers, and
require the receiver to not throw a fit if the received messages are not
having monotonically increasing sequence numbers. However, it doesn't
result in the effect I was after. So it needs reformulation.

> and
>> Proxies that aggregate several client sessions on the same transport
>>    will have to ensure that the requests sent towards a particular
>>    server have a joint sequence number space.  A proxy having one client
>>    with concurrent sessions with two different servers using the same
>>    client proxy connection can avoid rewriting on the proxy to server
>>    connection.  
> 
> The first requirement is contradicted by the second and third stories.

I think the way of fixing this is to clarify that the first statements
are for RTSP agents originating requests. RTSP Proxies that aggregates
requests on a transport MUST renumber to have monotonically increasing
sequence numbers on that next hop transport. However, Proxies that
aggregates responses towards an agent just maps back the (if necessary)
the sequence numbers the corresponding requests had. And there is okay
for that proxy to send responses out of order due to their potentially
different request targets. Thus, requests must be forwarded in order and
processed in order at the request's destination, the responses can
arrive out of order.

This will work even if there is unreliable transport. A lost response
will result in a retransmitted request, that the next hop that received
(and potentially cached) can retransmit the response.

> 
> We also have:
>> It also enables detecting loss of a request
>>    and await a retransmission prior to processing a sub-sequent request
>>    when using unreliable transport.  
> 
> I understood that RTSP/2.0 is only specified to run over reliable
> transports, so this either requires some usage of the subjunctive mood
> or maybe deletion.  However, having non-sequential CSeq values would
> indeed screw up any future usage of unreliable transport.
> 
> I wonder if this can be handled by changing the increment requirement so
> that it applies to requests sent down a given server connection (or
> channel).  Then if unreliable transports ever did come back, the
> sequencing would still work on a per source/destination address/port
> quadruple (or whatever), while giving unique (but not necessarily
> integer sequential) numbering on the multiplexed connections.
> 
> Anyway, I think that this section needs another pass to sort out the
> inconsistencies.

Yes, below you find a rewrite of the text. I tried writing this with
minimal exceptions for proxies. So please review it so that you think
you understand it and agrees with the rules.

18.20.  CSeq

   The CSeq general-header field specifies the sequence number for an
   RTSP request-response pair.  This field MUST be present in all
   requests and responses.  For each new RTSP request an agent
   originates on a particular RTSP message transport the CSeq value MUST
   be incremented by one.  The initial sequence number MAY be any
   number, however, it is RECOMMENDED to start at 0.  Each sequence
   number series is unique between each requester and responder, i.e.,
   the client has one series for its request to a server and the server
   has another when sending request to the client.  Each requester and
   responder is identified with its socket address (IP address and port
   number), i.e., per direction of a TCP connection.  Any retransmitted
   request MUST contain the same sequence number as the original, i.e.,
   the sequence number is not incremented for retransmissions of the
   same request.  The RTSP agent receiving requests MUST process the
   requests arriving on particular transport in the order of the
   sequence numbers.  Responses are sent in the order they are
   generated.  The RTSP response MUST have the same sequence number as
   present in the corresponding request.  A RTSP Agent receiving a
   response MAY receive the responses out of order compared to the order
   of the requests it sent.  Thus, the agent MUST use the sequence
   number in the response to pair it with the corresponding request.

      The main purpose of the sequence number is to map responses to
      requests.

      The sequence number requirement on using increment of one for each
      new request is to support any future specification of RTSP message
      transport over a protocol that don't provide in order delivery or
      is unreliable.

      The above rule regarding initial sequence number may appear
      unnecessary loose.  However, they are allowing for a behavior
      which is not uncommon.  When using multiple reliable connections
      in sequence it may still be easiest to use a single sequence
      number series for a client connecting with a particular server.
      Thus, the initial sequence number may be arbitrary depending on
      the number of previous requests.  For any unreliable transport a
      stricter definition will be required to enable detection of any
      loss of the first request.

      When using multiple sequential transport connections, there is no
      protocol mechanism to ensure in order processing as the sequence
      number is scoped on the individual transport connection and its
      five tuple.  Thus, there are potential issues with opening a new
      transport connection to the same host for which there already
      exist a transport connection with out standing requests and send
      requests related to the same RTSP session.

   RTSP Proxies also needs to follow the above rules.  This implies that
   proxies that aggregates requests from multiple clients onto a single
   transport towards a server or a next hop proxy needs to renumber
   those request to form a joint sequence number on that transport,
   fulfilling the above rules.  A proxy capable of fulfilling some
   agents request without emitting its own request, also causes a need
   to renumber as the number of received requests with a particular
   target, may not be the same as the number of emitted requests towards
   that target agent.  A proxy that needs to renumber, needs to perform
   the corresponding renumbering back to the original sequence number
   for any received response.  A proxy MUST maintain the order between
   responses related to requests originating from the same agent.

      A client connected to a proxy, and using that transport to send
      request to multiple servers creates a situation where it is quite
      likely to receive the responses out of order.  This as the proxy
      will establish different transports from the proxy to the servers
      and forward the client's requests on.  When the responses arrive
      from the different servers they will be forwarded to the client in
      the order they arrive at the proxy and can be processed, not the
      order of the sequence numbers.  This is intentional to avoid some
      sessions requests being blocked by another server's slow
      processing of requests.


Cheers


Magnus Westerlund

----------------------------------------------------------------------
Multimedia Technologies, Ericsson Research EAB/TVM
----------------------------------------------------------------------
Ericsson AB                | Phone  +46 10 7148287
Färögatan 6                | Mobile +46 73 0949079
SE-164 80 Stockholm, Sweden| mailto: magnus.westerlund@ericsson.com
----------------------------------------------------------------------