Re: [rtcweb] STUN for keep-alive

Magnus Westerlund <> Wed, 14 September 2011 15:19 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C48F521F8CEB for <>; Wed, 14 Sep 2011 08:19:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.498
X-Spam-Status: No, score=-106.498 tagged_above=-999 required=5 tests=[AWL=0.101, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Lax5SK-FnyL9 for <>; Wed, 14 Sep 2011 08:19:28 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id AA70C21F8CEA for <>; Wed, 14 Sep 2011 08:19:27 -0700 (PDT)
X-AuditID: c1b4fb39-b7bfdae000005125-cb-4e70c6808314
Received: from (Unknown_Domain []) by (Symantec Mail Security) with SMTP id 1B.41.20773.086C07E4; Wed, 14 Sep 2011 17:21:36 +0200 (CEST)
Received: from [] ( by ( with Microsoft SMTP Server id; Wed, 14 Sep 2011 17:21:35 +0200
Message-ID: <>
Date: Wed, 14 Sep 2011 17:21:34 +0200
From: Magnus Westerlund <>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version: 1.0
To: Jonathan Lennox <>
References: <> <> <> <C3759687E4991243A1A0BD44EAC8230339CA72C234@BE235.mail.lan>
In-Reply-To: <C3759687E4991243A1A0BD44EAC8230339CA72C234@BE235.mail.lan>
X-Enigmail-Version: 1.3.1
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Brightmail-Tracker: AAAAAA==
Cc: "" <>
Subject: Re: [rtcweb] STUN for keep-alive
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 14 Sep 2011 15:19:28 -0000

On 2011-09-14 16:45, Jonathan Lennox wrote:
> Christer Holmberg writes:
>> Well, it depends on the amount of outgoing media traffic, but in
>> cases where you only receive media you would still need to send
>> keep-alives.
> Remember, RTCWeb is (probably) mandating RTP/RTCP mux.  I'd need to
> do some math to be certain, but I'm pretty sure that in almost all
> normal circumstances, the RTCP regular reporting interval should be
> significantly smaller than the STUN keepalive interval.

You don't need to do the math, I have already done it and it got
included into RFC 6263 and quoted below.

But, my personal view is that for all reasonable configurations of RTCP
you are in fact transmitting RTCP in each direction more often than the
ICE default of 15 seconds.

---- Quote Start Here ----

8.  RTCP Flow Keepalive

   RTCP packets are sent periodically and can thus normally keep the NAT
   mappings open as long as they are sent frequently enough.  There are
   two conditions for that.  First, RTCP needs to be used
   bidirectionally and in a symmetric fashion, as described in
   [RFC4961].  Secondly, RTCP needs to be sent frequently enough.
   However, there are certain configurations that can break this latter

   There are two factors that need to be considered to ensure that RTCP
   is sent frequently enough.  First, the RTCP bandwidth needs to be
   sufficiently large so that transmission will occur more frequently
   than the longest acceptable packet transmission interval (Tr).  The
   worst-case RTCP interval (Twc) can be calculated using this formula
   by inserting the max value of the following parameters:

   o  Maximum RTCP packet size (avg_rtcp_size_max)

   o  Maximum number of participants (members_max)

   o  RTCP receiver bandwidth (rtcp_bw)

   The RTCP bandwidth value to use here is for a worst case, which will
   be the receiver proportion when all members except one are not
   senders.  This can be approximated to be all members.  Thus, for
   sessions where RR and RS values [RFC3556] are used, then rtcp_bw
   shall be set to RR.  For sessions where the [RFC3550]-defined
   proportions of RTCP bandwidth are used (i.e., 1/4 of the bandwidth
   for senders and 3/4 of the bandwidth for receivers), then rtcp_bw
   will be 5% of 3/4 of the AS value [RFC4566] in bits per second.

   Twc = 1.5 / 1.21828 * members_max * rtcp_bw / avg_rtcp_size_max * 8

   The second factor is the minimum RTCP interval Tmin defined in
   [RFC3550].  Its base value is 5 seconds, but it might also be scaled
   to 360 divided by the session bandwidth in kbps.  The Extended RTP
   Profile for Real-time Transport Control Protocol (RTCP)-Based
   Feedback (RTP/AVPF) [RFC4585] also allows for the setting of a
   trr-int parameter, which is a minimal RTCP interval for regular RTCP
   packets.  It is also used as the Tmin value in the regular Td
   calculation.  An analysis of the algorithm shows that the longest
   possible regular RTCP interval is:

   RTCP_int_max = trr-int * 1.5 + Td * 1.5 / 1.21828

   And as long as there is sufficient bandwidth according to criteria 1
   below, then the algorithm can be simplified by setting Td = trr-int,

   RTCP_int_max = trr-int * (1.5 + 1.5 / 1.21828) = 2.73123 * trr-int

   Thus, the requirements for the RTCP parameters are as follows for
   functioning keepalive:

   1.  Ensure that sufficient RTCP bandwidth is provided by calculating
       Twc, and ensure that the resulting value is less than or equal
       to Tr.

   2.  If AVP or SAVP [RFC3711] is used, the Tmin value can't be greater
       than Tr divided by 1.5 / (e-3/2).

   3.  If AVPF or SAVPF [RFC5124] is to be used, trr-min must not be set
       to a value greater than Tr / 3.

----- End of Quote ----


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: