One document matched: draft-ietf-rtcweb-stun-consent-freshness-03.xml
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc='yes'?>
<?rfc tocdepth="3"?>
<?rfc compact="yes"?>
<?rfc tocdepth="yes"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline ="yes"?>
<?rfc subcompact="no"?>
<?rfc tocompact="yes"?>
<rfc category="std" docName="draft-ietf-rtcweb-stun-consent-freshness-03"
ipr="trust200902">
<front>
<title abbrev="STUN Usage for Consent Freshness">STUN Usage for Consent
Freshness</title>
<author fullname="Muthu Arul Mozhi Perumal" initials="M."
surname="Perumal">
<organization>Cisco Systems</organization>
<address>
<postal>
<street>Cessna Business Park</street>
<street>Sarjapur-Marathahalli Outer Ring Road</street>
<city>Bangalore</city>
<region>Karnataka</region>
<code>560103</code>
<country>India</country>
</postal>
<email>mperumal@cisco.com</email>
</address>
</author>
<author fullname="Dan Wing" initials="D" surname="Wing">
<organization>Cisco Systems</organization>
<address>
<postal>
<street>821 Alder Drive</street>
<city>Milpitas</city>
<region>California</region>
<code>95035</code>
<country>USA</country>
</postal>
<email>dwing@cisco.com</email>
</address>
</author>
<author fullname="Ram Mohan Ravindranath" initials="R"
surname="Ravindranath">
<organization>Cisco Systems</organization>
<address>
<postal>
<street>Cessna Business Park</street>
<street>Sarjapur-Marathahalli Outer Ring Road</street>
<city>Bangalore</city>
<region>Karnataka</region>
<code>560103</code>
<country>India</country>
</postal>
<email>rmohanr@cisco.com</email>
</address>
</author>
<author fullname="Tirumaleswar Reddy" initials="T." surname="Reddy">
<organization>Cisco Systems</organization>
<address>
<postal>
<street>Cessna Business Park, Varthur Hobli</street>
<street>Sarjapur Marathalli Outer Ring Road</street>
<city>Bangalore</city>
<region>Karnataka</region>
<code>560103</code>
<country>India</country>
</postal>
<email>tireddy@cisco.com</email>
</address>
</author>
<author fullname="Martin Thomson" initials="M." surname="Thomson">
<organization>Mozilla</organization>
<address>
<postal>
<street>Suite 300</street>
<street>650 Castro Street</street>
<city>Mountain View</city>
<region>California</region>
<code>94041</code>
<country>US</country>
</postal>
<email>martin.thomson@gmail.com</email>
</address>
</author>
<date />
<area>RAI</area>
<workgroup>RTCWEB</workgroup>
<abstract>
<t>To prevent sending excessive traffic to an endpoint, periodic consent
needs to be obtained from that remote endpoint.</t>
<t>This document describes a consent mechanism using a new STUN usage.
This same mechanism can also determine connection loss ("liveness") with
a remote peer.</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>To prevent attacks on peers, RTP endpoints have to ensure the remote
peer wants to receive traffic. This is performed both when the session
is first established to the remote peer using ICE connectivity checks,
and periodically for the duration of the session using the procedures
defined in this document.</t>
<t>When a session is first established, WebRTC implementations are
required to perform STUN connectivity checks as part of <xref
target="RFC5245">ICE</xref>. That initial consent is not described
further in this document and it is assumed that ICE is being used for
that initial consent.</t>
<t>Related to consent is loss of connectivity ("liveness"). Many
applications want notification of connection loss to take appropriate
actions (e.g., alert the user, try switching to a different
interface).</t>
<t>This document describes a new STUN usage with a request and response
messages which verifies the remote peer's consent to receive traffic,
and can also detect loss of liveness.</t>
</section>
<section anchor="sec-term" title="Terminology">
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <xref
target="RFC2119"></xref>.</t>
<t><list style="hanging">
<t hangText="Consent:">It is the mechanism of obtaining
permission to send traffic to a certain transport address.
This is the initial consent to send traffic, which is
obtained by ICE or a TCP handshake.</t>
<t hangText="Consent Freshness:">Permission to continue sending
traffic to a certain transport address. This is performed by the
procedure described in this document.</t>
<t hangText="Session Liveness:">Detecting loss of connectivity to a
certain transport address. This is performed by the procedure
described in this document.</t>
<t hangText="Transport Address:">The remote peer's IP address and
(UDP or TCP) port number.</t>
</list></t>
</section>
<section title="Design Considerations">
<t>Although ICE requires periodic keepalive traffic to keep NAT bindings
alive (Section 10 of <xref target="RFC5245"></xref>, <xref
target="RFC6263"></xref>), those keepalives are sent as STUN Indications
which are send-and-forget, and do not evoke a response. A response is
necessary both for consent to continue sending traffic, as well as to
verify session liveness. Thus, we need a request/response mechanism for
consent freshness. ICE can be used for that mechanism because ICE
already requires ICE agents continue listening for ICE messages, as
described in section 10 of <xref target="RFC5245"></xref>.</t>
</section>
<section title="Solution Overview">
<t>There are two ways consent to send traffic is revoked: expiration
of consent and immediate revocation of consent, which are discussed in
the following sections.</t>
<section title="Expiration of Consent">
<t>A WebRTC browser performs a combined consent freshness and session
liveness test using STUN request/response as described below:</t>
<t>An endpoint MUST NOT send application data (e.g., RTP, RTCP,
SCTP, DTLS) on an ICE-initiated connection unless the receiving
endpoint consents to receive the data. After a successful ICE
connectivity check on a particular transport address, subsequent
consent MUST be obtained following the procedure described in
this document. The consent expires after a fixed amount of
time.</t>
<t>Explicit consent to send is indicated by sending an ICE
binding request to the remote peer's Transport Address and
receiving a matching and authenticated ICE binding response from
the inverted remote peer's Transport Address. These ICE binding
requests and responses are authenticated using the same
short-term credentials as the initial ICE exchange, but using a
new (fresh) transaction-id each time consent needs to be
refreshed. Implementations MUST obtain fresh consent before
their existing consent expires. If an ICE binding response is
not received within 1.5 times the previous round trip time,
another ICE binding request is sent using the a new (fresh)
transaction-id (so that round-trip time can be calculated), and
re-transmissions MUST NOT be sent more frequently than every
500ms or the smoothed round-trip time (from previous consent
freshness checks or RTP round-trip time), whichever is less. For
the purposes of this document, receipt of an ICE response with
the matching transaction-id of its request with a valid
MESSAGE-INTEGRITY is considered a consent response.</t>
<t>The initial Consent to send traffic is obtained by ICE. Consent
expires after 30 seconds. That is, if a valid STUN
binding response corresponding to one of the STUN requests sent
in the last 30 seconds has not been received from the inverted
5-tuple, the endpoint MUST cease transmission on that
5-tuple.</t>
<!--
<t>Although receiving authenticated ICE packets is sufficient for consent,
it is still RECOMMENDED to send messages to keep NAT or firewall
bindings alive (see Section 10 of <xref target="RFC5245"></xref> and
<xref target="RFC6263"></xref>).</t>
-->
<t>To meet the security needs of consent, an untrusted
application (e.g., JavaScript) MUST NOT be able to obtain or control
the ICE transaction-id, because that enables spoofing STUN responses,
falsifying consent</t>
<t>An endpoint that is only receiving application traffic (recvonly)
does not need to obtain consent which can slightly conserve its
resources. However, the endpoint needs to ensure its NAT or firewall
mappings persist which can be done using keepalive or other techniques
(see Section 10 of <xref target="RFC5245"></xref> and
see <xref target="RFC6263"></xref>). If the endpoint wants send
application traffic, it needs to first obtain consent if its consent
expired.</t>
</section>
<section title="Immediate Revocation of Consent">
<t>The previous section explained how consent expires due to a
timeout. In some cases it is useful to signal a connection is
terminated, rather than relying on a timeout. This is done by
immediately revoking consent.</t>
<t>Consent for sending traffic on the media or data channel is
revoked by receipt of a an authenticated message that closes
the connection (for instance, a TLS fatal alert).</t>
<t>Receipt of an unauthenticated message that closes a
connection (e.g., TCP FIN) does not indicate revocation of
consent. Thus, an endpoint receiving an unauthenticated
end-of-session message SHOULD continue sending media (over
connectionless transport) or attempt to re-establish the
connection (over connection-oriented transport) until consent
expires or it receives an authenticated message revoking
consent.</t>
</section>
</section>
<!--
<t>Consent freshness serves as a circuit breaker (so that if the
path or remote peer fails the WebRTC browser stops sending all
traffic to that remote peer), determining session liveness
serves the purpose of notifying the application of connectivity
failure so that the application can take appropriate action. For
the rest of the document, peer is the sink for the traffic
originated from the sender for that flow (5 tuple). If a browser
uses different 5 tuple for each stream(Audio, video e.t.c) then
it has to do consent for each flow. Consent has to be done for
each component of a media stream when they use different
tuple. For example if RTCP uses different port then consent has
to be done for that as well. </t>
<t>Every Tc seconds, the WebRTC browser sends a STUN Binding Request to
the peer. This request MUST use a new, cryptographically random
Transaction ID <xref target="RFC4086"></xref>, and is formatted as for
an <xref target="RFC5245">ICE connectivity check</xref>. A valid STUN
Binding Response is also formatted as for an <xref target="RFC5245">ICE
connectivity check</xref>. The STUN Binding Request and STUN Binding
Response are validated as for an <xref target="RFC5245">ICE connectivity
check</xref>. The difference from ICE connectivity check is that there is no exponential back off for retransmissions.</t>
<t>If a valid STUN Binding Response is received, the consent timer is
reset to the time of receiving the response and fires again Tc seconds later. Multiple response on the same Transaction ID MUST reset the Tc timer.</t>
<t>If a valid STUN Binding Response is not received after Tret milliseconds, the
STUN Binding Request is retransmitted (with the same Transaction ID and
all other fields). As long as a valid STUN Binding Response is not
received, this retransmission is repeated every Tret milliseconds until Tf seconds
have elapsed or a valid response is received. If no valid response is
received after Tf seconds, the WebRTC browser MUST quit transmitting
traffic to this remote peer. The streams that are being sent on a flow(5 tuple) for which a consent has failed will be stopped. Considering the default value of Tf=15 seconds, this means transmission will stop after 30 consent check
packets have resulted in no response.</t>
<t>Liveness timer: If no packets have been received on the local port in
Tr seconds, the WebRTC browser MUST inform the JavaScript that
connectivity has been lost. The JavaScript application will use this
notification however it desires (e.g., cease transmitting to the remote
peer, provide a notification to the user, etc.). Note the definition of
a received packet is liberal, and includes an SRTP packet that fails
authentication, a STUN Binding Request with an invalid USERNAME or
PASSWORD, or any other packet.</t>
</section>
-->
<section anchor="liveness" title="Connection Liveness">
<t>A connection is considered "live" if packets are received from a
remote endpoint within an application-dependent period. An application
can request a notification when there are no packets received for a
certain period (configurable).</t>
<t>Similarly, if packets haven't been received within a certain period,
an application can request a consent check (heartbeat) be generated.
These two time intervals might be controlled by the same configuration
item.</t>
<t>Sending consent checks (heartbeats) at a high rate could allow a
malicious application to generate congestion, so applications MUST NOT
be able to send heartbeats faster than 1 per second.</t>
</section>
<section anchor="DSCP-consent"
title="DiffServ Treatment for Consent packets">
<t>It is RECOMMENDED that STUN consent checks use the same Diffserv
Codepoint markings as the media packets sent on that transport address.
This follows the recommendation of ICE connectivity check described in
section 7.1.2.4 of <xref target="RFC5245"></xref>.</t>
<t>Note: It is possible that different Diffserv Codepoints are used by
different media over the same transport address <xref
target="I-D.ietf-tsvwg-rtcweb-qos"></xref>. In that case, what should
this document recommend as the Codepoint for STUN consent packets ?</t>
</section>
<section title="W3C API Implications">
<t>For the consent freshness and liveness test the W3C specification
should provide APIs as described below: <list style="numbers">
<t>Ability for the browser to notify the JavaScript that a consent
freshness transaction has failed for a media stream and the browser
has stopped transmitting for that stream.</t>
<t>Ability for the JavaScript to start and stop liveness test and
set the liveness test interval.</t>
<t>Ability for the browser to notify the JavaScript that a liveness
test has failed for a media stream.</t>
</list></t>
</section>
<section title="Security Considerations">
<t>This document describes a security mechanism.</t>
<t>The security considerations discussed in <xref
target="RFC5245"></xref> should also be taken into account.</t>
<t>SRTP is encrypted and authenticated with symmetric keys; that is,
both sender and receiver know the keys. With two party sessions, receipt
of an authenticated packet from the single remote party is a strong
assurance the packet came from that party. However, when a session
involves more than two parties, all of whom know each others keys, any
of those parties could have sent (or spoofed) the packet. Such shared
key distributions are possible with some <xref
target="RFC3830">MIKEY</xref> modes, <xref target="RFC4568">Security
Descriptions</xref>, and <xref
target="I-D.ietf-avtcore-srtp-ekt">EKT</xref>. Thus, in such shared
keying distributions, receipt of an authenticated SRTP packet is not
sufficient.</t>
</section>
<section anchor="sec.iana-considerations" title="IANA Considerations">
<t>This document does not require any action from IANA.</t>
</section>
<section title="Acknowledgement">
<t>Thanks to Eric Rescorla, Harald Alvestrand, Bernard Aboba, Magnus
Westerland, Cullen Jennings and Simon Perreault for their valuable
inputs and comments.</t>
</section>
</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.5245"?>
<?rfc include="reference.RFC.6263"?>
</references>
<references title="Informative References">
<?rfc include="reference.RFC.3830"?>
<?rfc include="reference.RFC.4568"?>
<?rfc include="reference.I-D.ietf-tsvwg-rtcweb-qos"?>
<?rfc include="reference.I-D.ietf-avtcore-srtp-ekt"?>
</references>
<section title="Example Implementation">
<t>This section describes one possible implementation algorithm
of consent. This section is non-normative and provided for
reference only.</t>
<t>The solution uses three values:</t>
<t><list style="numbers">
<t>A consent timer, Tc, whose value is set to 30 seconds.</t>
<t>A packet receipt timer, Tr, whose value is determined by the
application. Tr can be greater than 1 but less than 30 seconds and
has a default value of 5 seconds.</t>
<t>A consent timeout, Tf, which is how many seconds elapse without a
consent response before the browser ceases transmission of media.
Its value is be 30 seconds or less.</t>
<t>A retransmission Timer, Tret, whose value is determined by the
RTT of a given path. The duration of this timer is set to 1.5 times of (500 ms or
the smoothened round-trip time (from previous consent freshness checks
or RTP round-trip time)), whichever is less.</t>
</list></t>
<t>A WebRTC browser performs a combined consent freshness and session
liveness test using STUN request/response as described below:</t>
<t>Every Tc seconds, the WebRTC browser sends a STUN Binding Request to
the peer. The difference from ICE connectivity check is that there is no
exponential back off for retransmissions.</t>
<t>If a valid STUN Binding Response is received, the consent timer is
reset to the time of receiving the response and fires again Tc seconds
later.</t>
<t>If a valid STUN Binding Response is not received after Tret
milliseconds, the STUN Binding Request is retransmitted (with a new
Transaction ID). As long as a valid STUN Binding
Response is not received, this retransmission is repeated every Tret
milliseconds until Tf seconds have elapsed or a valid response is
received. If no valid response is received after Tf seconds, the WebRTC
browser quits transmitting traffic to this remote peer. The streams that
are being sent on a flow(5-tuple) for which a consent has failed will be
stopped. If the default value of Tf is 30 seconds then media
transmission will stop Consent (Tf) expires.</t>
</section>
</back>
</rfc>| PAFTECH AB 2003-2026 | 2026-04-24 02:57:34 |