Subject: RTSP over UDP

From: "Anders Klemets (VXtreme)" <[email-masked]>
Date: Wed, 3 Sep 1997 14:34:38 -0700

Section 9.2 of the RTSP spec talks about how to do retransmissions of
RTSP messages when they are sent over UDP.  There are a lot of "TBD"
notes in this section.  In earlier versions of the spec, there was an
attempt to overload the use of the RTSP sequence number.  The sequence
number was supposed to protect against packet loss and reordering, but
it was also to be used for round-trip-time estimations. 

As is pointed out in the TBD sections, there is a problem with this.  In
order to get a proper RTT estimate, the sequence number has to be
incremented each time a packet is retransmitted.  But now the server
can't know for sure that it has received all of the packets if it sees a
gap in the sequence number space.  Was the missing packet retransmitted
by the client, or is it simply delayed and still on its way?

I think the right way of handling this is to treat the RTSP sequence
number in the same way for UDP as for TCP.  If the client needs to
estimate the RTT to the server, it can send a timestamp in a "Timestamp:
" header line.  The server would echo the timestamp in a reply, also
stating how long it waited before it sent the reply.  This is the same
way RTT measurement is done in RTP.  (But one can't rely on RTP always
being used for the data transfer.)

One of the nice things about this is that it allows the application to
control when and how often it wants to do a RTT measurement.  Such
measurements may be useful for things other than just calculating the
retransmission delay of RTSP messages.  (In software that I have
written, I use the RTT between the client and the server for a variety
of different things.)  Using a separate header line for the timestamp
decouples it from UDP and it now becomes possible to measure the RTT
over TCP connections as well.

Since the timestamps "piggy-back" on RTSP commands, it might be useful
to define a NOOP command, that can be used to make an RTT measurement
without sending a real command.

Anders