Re: [rtcweb] SIP Glare - Re: Minimal SDP negotiation mechanism

Magnus Westerlund <> Thu, 22 September 2011 15:09 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 56EB621F8B2E for <>; Thu, 22 Sep 2011 08:09:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.525
X-Spam-Status: No, score=-106.525 tagged_above=-999 required=5 tests=[AWL=0.074, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id RAAK34c5jjg9 for <>; Thu, 22 Sep 2011 08:09:16 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 22BCA21F8B4E for <>; Thu, 22 Sep 2011 08:09:15 -0700 (PDT)
X-AuditID: c1b4fb39-b7bfdae000005125-aa-4e7b503309a0
Received: from (Unknown_Domain []) by (Symantec Mail Security) with SMTP id 4E.78.20773.3305B7E4; Thu, 22 Sep 2011 17:11:47 +0200 (CEST)
Received: from [] ( by ( with Microsoft SMTP Server id; Thu, 22 Sep 2011 17:11:46 +0200
Message-ID: <>
Date: Thu, 22 Sep 2011 17:11: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: Cullen Jennings <>
References: <> <> <> <> <>
In-Reply-To: <>
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] SIP Glare - Re: Minimal SDP negotiation mechanism
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: Thu, 22 Sep 2011 15:09:17 -0000


Here is an analysis of what happens including Cullen's SIP side
optimization if one uses a random value attached to the offer as
tiebreaker and interop with SIP.

Lets start with the general scenario.


So lets look at the glare conditions that can occur.

a) Initially in regards to the creation of a PeerConnection/call where
both sides attempt to create a session with its peer.

b) During a re-Offer/re-inivite in an existing session.

However, I don't think this really matters for the glare resolution
mechanism. It might effect which SIP messages are sent in which case.

Secondly the glare condition will be detected in various cases depending
on in what state of signalling the glare occurs.

1) If A sends an offer that left A, but not arrived at the GW, while B's
are on its way between the GW and A.
2) IF A sends an offer that has passed the GW, while B's are on its way
between B and the GW.
3) Both A and Bs Offers are at the GW while neither has been forwarded.
4) Like 2) but B supports Cullen's behavior.

In case 1, entity A (a RTCWEB browser) will receive the Offer from B
when itself has an outstanding offer. It perform the local tie-breaking
of the SDP and determine that either A or Bs Offer is the winning. If A
wins it just discards B, alternatively send an error (but that doesn't
appear necessary). If B wins it abandons its Offer and process B's.

In case 1, the GW when A's Offer arrive at the GW, it has already sent
B's offer with its tie-breaking value. It immediately determine who won
the tie-breaking and then continue acting according to it. If A's won
then it sends a 491 with a significant large delay value. Then it sends
A's offer with some small delay just as it got lucky with a low value.
If B won, then it just discards A's Offer and waits for A's answer to
B's offer.

In case 2) the GW could look for a tie-breaker value according to
Cullen's proposal and if present then determine the winner. Considering
that the quickest way to resolve the tie-breaking towards the RTCWEB
client if the value isn't present is to fold for the RTCWEB client's
behalf. Thus set B's tie-breker value to max. Then respond with a 491
with delay 0 to B. When B come back with an new offer it assigns this
the highest tie-breaker value and send it to A. A will then abort its
offer and accept B's.

In case 2) in B, it will be completely in the SIP domain and it will
respond with a 491 with a random delay value back to the GW. The GW will
consume this message when it arrives.

In case 3) the GW can avoid having the SIP UA (B) know there was any
glare at all. This by setting the tie-breaking value for B's offer to
MAX assuring it wins over A, and then send it to A to replace the offer.

In case 4) the GW will have sent a tie-breaker value with A's offer to B
in the SDP. B's offer with a tie-breaker value arrives at the GW. The GW
determine who wins. If B wins it forwards B's offer to A. If A wins it
will do something to make B's offer being canceled. Maybe a 491 answer
is the simplest. Except that it will not be retired.

In case 4) the UA (B) will have sent an invite with a tie-breaker value.
When A's Invite with a tie-breaking value arrive it can perform the
tie-breaking. If A wins then it immediately process it as if no
outstanding Invite exist. (Question: how will the proxies react on that
B responds immediately?). If B wins it sends a 491 for A's Invite. Then
it continues waiting for the response.

So independent of the optimization this can work as long as a GW is
allowed to override a random selection mechanism in cases where the
other protocol will resolve quicker if it does.

I think the optimization makes sense, but is more a question of fixing
SIP than really being needed for RTCWEB. I also wonder why not a SIP
header for the tie-breaking? There appear also to be some more cases to
analyze in detail and to figure out if the scheme breaks with some


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: