<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:696202556;
        mso-list-type:hybrid;
        mso-list-template-ids:-604714646 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I’ve been wanting something like this too.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We have a WebRTC server that similarly has a stable external address (which is not easily visible to libnice). The server is never on the same local network as the client. So the whole ICE negotiation dance is slow and includes many wasteful
 tests.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In contrast, the ICE candidates emitted by Chrome are stunningly few and precise. I understand that the ICE protocols and the libnice implementation were/are meant to be general case. But they miss obvious efficiencies that can be provided
 by additional external information. STUN servers facilitate some of that additional information, but introduce a dependency and more latency.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My knowledge of libnice internals is not great, but I kind of wish we could<o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Feed some particular IP candidate addresses to it,<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Tell it to skip a bunch of other candidate generation and testing<o:p></o:p></li></ol>
<p class="MsoNormal">I believe there’s a compilation flag to turn of ipv6, but I haven’t seen other mechanisms to disable some of the candidate generation and testing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Juan, to further answer your question: we’re using libnice for our server. However, I had to upgrade the libnice to a private build from the tip of libnice master. The default libnice on Ubuntu 18.04 had a bunch of bugs that prevented ICE
 negotiation from working well. The latest libnice seems to work well (albeit a bit slowly), but you may not be able to use the standard ones that come with your distro. I haven’t checked the version of libnice in Ubuntu 20.04. I think it was updated, but not
 sure if it has all the recent(ish) bugfixes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Stuart<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">nice <nice-bounces@lists.freedesktop.org> on behalf of Juan Navarro <juan.navarro@gmx.es><br>
<b>Date: </b>Wednesday, October 14, 2020 at 7:11 AM<br>
<b>To: </b>"nice@lists.freedesktop.org" <nice@lists.freedesktop.org><br>
<b>Subject: </b>[libnice] Force an external address (srflx) candidate?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Hi,<br>
<br>
I'd like to allow setting a static external IP address to my WebRTC SFU server config, and have libnice generate a "fake" server-reflexive candidate without needing STUN or TURN. Is this possible to do with libnice?<br>
<br>
This is useful for cloud deployments where the server has a well known address, to skip the need for STUN on the server and also minimize the time needed for ICE. At the same time, any WebRTC peer would transparently work by receiving the fake srflx candidate,
 thus knowing where to connect with the server. This is an important one for me: not needing to touch anything else about the signaling or the implementation at the client.<br>
<br>
To be honest I already have this feature working (see <a href="https://doc-kurento.readthedocs.io/en/latest/_static/client-javadoc/org/kurento/client/WebRtcEndpoint.html#setExternalAddress-java.lang.String-">
WebRtcEndpoint.setExternalAddress</a>) but it is a VERY ugly hack, which modifies _all_ candidates to replace their IP address with the external one specified in this setting. This works, because remote peers receive then all those host candidates with the
 correct IP, and they are able to connect with the server. But I'd like to have a "cleaner" solution, if there is one for this scenario. So I thought that a better thing to do would be to tell libnice to forge a srflx candidate.<br>
<br>
BTW, what are people doing for this? I think letting a server know of its own external address is a pretty common thing (e.g. "external-ip" setting in Coturn).<br>
<br>
Thanks and regards,<br>
Juan<br>
<br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>