[rtcweb] IP handling text

Martin Thomson <martin.thomson@gmail.com> Fri, 18 November 2016 03:07 UTC

Return-Path: <martin.thomson@gmail.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DC996129A00 for <rtcweb@ietfa.amsl.com>; Thu, 17 Nov 2016 19:07:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4sTo6DSdaHKp for <rtcweb@ietfa.amsl.com>; Thu, 17 Nov 2016 19:07:25 -0800 (PST)
Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 57B9B129784 for <rtcweb@ietf.org>; Thu, 17 Nov 2016 19:07:25 -0800 (PST)
Received: by mail-qk0-x230.google.com with SMTP id q130so247844311qke.1 for <rtcweb@ietf.org>; Thu, 17 Nov 2016 19:07:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=wp0a58VFtgw4q0FZ62i5Xx4Fl2E9IiBaz01F40TuEPU=; b=g0gmyLB4ajnx43qalJdaTXOQdSJwfSUORHYmUQk6o6uNFfk0TV+mbZkc5ioLuuLP6X Na/XrAXGdFbnwBKEF6U9CB1h/Pv144/6LSgX4MyUUxqWtIfxgNvEBc2xVhm2QVXIBXRr +8Rgf29l4w9W86LtCc2yYcBYK9fcOStzroSVUQisGV2SeGunkKXWLVdI5vzrKRJmvbQJ SBgVuhYW7ECc7PbXnKnTRwvW3/gaZlch4GCD/EAj4To4I4WhAp3JkGRUHBwHK7fSWvcJ rWHbM8acokxIb4ldfWBpaE/fWxdmcLyQAOUotxx7zz8QhWrK1TlB70keNoJNKDb2TGEE HbXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wp0a58VFtgw4q0FZ62i5Xx4Fl2E9IiBaz01F40TuEPU=; b=EpJXp+evOH9sC1uJxStTY94KHLvpsEJUhOCVrGccnCfLP7SOqW8oMbWa9SNZMlMXzg KRJPDOaFW/SaGmRhxyd2L+G+XlWDlrUbgqVw8kz9wIII7cn2rjtRKh8ALxGkNt8ZLpri iX/qfXllvVOiSFn+54rrYInDvpgn9VWeQalP7ogkbbuTtzc9cHmRI5cOyxB44OcDCJPj QYLCun2RggDV2fog4Qy5xN6+O5Vk7hbCa7nC53XgRTVcefi2ahwgTfAwjD8F/W35SibX oJmvyiLpA8Jl08K4YI9J7lIsKbPfJxTfM1g8VRzl8VflicNehHvTW4uxrWosE/wWlsv1 Aq/A==
X-Gm-Message-State: AKaTC037yBOvc3o3c08ZYw0Os7Kbmemqn/mox+EcAugt53s1g0SUSJWYuaJI9gdy7RuyI+b7qT7lvqPxWbUCRQ==
X-Received: by 10.55.12.2 with SMTP id 2mr7834123qkm.68.1479438444350; Thu, 17 Nov 2016 19:07:24 -0800 (PST)
MIME-Version: 1.0
Received: by 10.140.85.7 with HTTP; Thu, 17 Nov 2016 19:07:23 -0800 (PST)
From: Martin Thomson <martin.thomson@gmail.com>
Date: Fri, 18 Nov 2016 12:07:23 +0900
Message-ID: <CABkgnnUK2gTTxjzt0UQFe11mhHJuZ=xbiRYHxgvkYBwmM05b=A@mail.gmail.com>
To: "rtcweb@ietf.org" <rtcweb@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/Y0-IYktSSz4ZeM-FwikQ0KWK3PI>
Subject: [rtcweb] IP handling text
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 18 Nov 2016 03:07:27 -0000

4.  Detailed Design

   We define four modes of WebRTC behavior,
   reflecting different privacy/media tradeoffs:

   Mode 1:  Enumerate all addresses: WebRTC will bind to all interfaces
            individually and use them all to attempt communication with
            STUN servers, TURN servers, or peers.  This will converge on
            the best media path, and is ideal when media performance is
            the highest priority, but it discloses the most information.

   Mode 2:  Default route + the single associated local address: By
            binding solely to the wildcard address, media packets will
            follow the kernel routing table rules, which will typically
            result in the same route as the application's HTTP traffic.
            In addition, the associated private address will be
            discovered through getsockname, as mentioned above.  This
            ensures that direct connections can still be established
            even when local media access is not granted, e.g., for data
            channel applications.

   Mode 3:  Default route only: This is the the same as Mode 2, except
            that the associated private address is not provided, which
            may cause traffic to hairpin through a NAT, fall back to the
            application TURN server, or fail altogether, with resulting
            quality implications.

   Mode 4:  Force proxy: This forces all WebRTC media traffic through a
            proxy, if one is configured.  If the proxy does not support
            UDP (as is the case for all HTTP and most SOCKS [RFC1928]
            proxies), or the WebRTC implementation does not support UDP
            proxying, the use of UDP will be disabled, and TCP will be
            used to send and receive media through the proxy.  Use of
            TCP will result in reduced quality, in addition to any
            performance considerations associated with sending all
            WebRTC media through the proxy server.

   Mode 1 MUST NOT be used without user consent.  This thwarts the typical
drive-by enumeration attacks.  The details of this consent are left to
the implementation. One potential mechanism is to tie this consent to
getUserMedia consent.  User agents SHOULD
   use Mode 2 by default, though they might choose a stricter default policy
   in certain circumstances.

  The main ideas for the design are the following:

   1.  By default, WebRTC should follow normal IP routing rules, to the
       extent that this is easy to determine (i.e., not considering
       proxies).  This can be accomplished by binding local sockets to
       the wildcard addresses (0.0.0.0 for IPv4, :: for IPv6), which
       allows the OS to route WebRTC traffic the same way as it would
       HTTP traffic, and allows only the 'typical' public addresses to
       be discovered.

   2.  By default, support for direct connections between hosts (i.e.,
       without traversing a NAT or relay server) should be maintained.
       To accomplish this, the local IPv4 and IPv6 addresses of the
       interface used for outgoing STUN traffic should still be surfaced
       as candidates, even when binding to the wildcard addresses as
       mentioned above.  The appropriate addresses here can be
       discovered by the common trick of binding sockets to the wildcard
       addresses, connect()ing those sockets to some well-known public
       IP address (one particular example being "8.8.8.8"), and then
       reading the bound local addresses via getsockname().  This
       approach requires no data exchange; it simply provides a
       mechanism for applications to retrieve the desired information
       from the kernel routing table.

   4.  Determining whether a web proxy is in use is a complex process,
       as the answer can depend on the exact site or address being
       contacted.  Furthermore, web proxies that support UDP are not
       widely deployed today.  As a result, when WebRTC is made to go
       through a proxy, it typically must use TCP, either ICE-TCP
       [RFC6544] or TURN-over-TCP [RFC5766].  Naturally, this has
       attendant costs on media quality and also proxy performance.

   5.  RETURN [I-D.ietf-rtcweb-return] is a new proposal for explicit
       proxying of WebRTC media traffic.  When RETURN proxies are
       deployed, media and STUN checks will go through the proxy, but
       without the performance issues associated with sending through a
       typical web proxy.

   Note that when a RETURN proxy is configured for the interface
   associated with the default route, Mode 2 and 3 will cause any
   external media traffic to go through the RETURN proxy.  This provides
   a way to ensure the proxy is used for external traffic, but without
   the performance issues of forcing all media through said proxy.