Internet Engineering Task Force (IETF) R. Sparks Request for Comments: 6026 Tekelec Updates: 3261 T. Zourzouvillys Category: Standards Track Skype ISSN: 2070-1721 September 2010
Internet Engineering Task Force (IETF) R. Sparks Request for Comments: 6026 Tekelec Updates: 3261 T. Zourzouvillys Category: Standards Track Skype ISSN: 2070-1721 September 2010
Correct Transaction Handling for 2xx Responses to Session Initiation Protocol (SIP) INVITE Requests
对会话启动协议(SIP)INVITE请求的2xx响应的正确事务处理
Abstract
摘要
This document normatively updates RFC 3261, the Session Initiation Protocol (SIP), to address an error in the specified handling of success (2xx class) responses to INVITE requests. Elements following RFC 3261 exactly will misidentify retransmissions of the request as a new, unassociated request. The correction involves modifying the INVITE transaction state machines. The correction also changes the way responses that cannot be matched to an existing transaction are handled to address a security risk.
本文档规范性地更新了会话启动协议(SIP)RFC 3261,以解决对INVITE请求的成功(2xx类)响应的指定处理中的错误。RFC 3261之后的元素将准确地将请求的重新传输错误地识别为新的、未关联的请求。修正涉及修改INVITE事务状态机。修正还改变了处理无法与现有交易匹配的响应以解决安全风险的方式。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6026.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6026.
Copyright Notice
版权公告
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2010 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
Table of Contents
目录
1. Introduction ....................................................3 2. Conventions and Definitions .....................................3 3. Reason for Change ...............................................3 4. Summary of Change ...............................................4 5. Consequences if Not Implemented .................................4 6. The Change ......................................................4 7. Change Details ..................................................5 7.1. Server Transaction Impacts .................................5 7.2. Client Transaction Impacts .................................9 7.3. Proxy Considerations ......................................10 8. Exact Changes to RFC 3261 ......................................11 8.1. Page 85 ...................................................11 8.2. Page 107 ..................................................11 8.3. Page 114 ..................................................11 8.4. Pages 126 through 128 .....................................12 8.5. Pages 134 to 135 ..........................................15 8.6. Page 136 ..................................................15 8.7. Page 137 ..................................................17 8.8. Page 141 ..................................................17 8.9. Page 144 ..................................................18 8.10. Page 146 .................................................18 8.11. Page 265 .................................................18 9. IANA Considerations ............................................18 10. Security Considerations .......................................19 11. Acknowledgments ...............................................20 12. Normative References ..........................................20
1. Introduction ....................................................3 2. Conventions and Definitions .....................................3 3. Reason for Change ...............................................3 4. Summary of Change ...............................................4 5. Consequences if Not Implemented .................................4 6. The Change ......................................................4 7. Change Details ..................................................5 7.1. Server Transaction Impacts .................................5 7.2. Client Transaction Impacts .................................9 7.3. Proxy Considerations ......................................10 8. Exact Changes to RFC 3261 ......................................11 8.1. Page 85 ...................................................11 8.2. Page 107 ..................................................11 8.3. Page 114 ..................................................11 8.4. Pages 126 through 128 .....................................12 8.5. Pages 134 to 135 ..........................................15 8.6. Page 136 ..................................................15 8.7. Page 137 ..................................................17 8.8. Page 141 ..................................................17 8.9. Page 144 ..................................................18 8.10. Page 146 .................................................18 8.11. Page 265 .................................................18 9. IANA Considerations ............................................18 10. Security Considerations .......................................19 11. Acknowledgments ...............................................20 12. Normative References ..........................................20
This document describes an essential correction to the Session Initiation Protocol (SIP), defined in [RFC3261]. The change addresses an error in the handling of 2xx class responses to INVITE requests that leads to retransmissions of the INVITE being treated as new requests and forbids forwarding stray INVITE responses.
本文档描述了对[RFC3261]中定义的会话启动协议(SIP)的基本更正。此更改解决了在处理INVITE请求的2xx类响应时出现的一个错误,该错误导致INVITE被视为新请求重新传输,并禁止转发错误的INVITE响应。
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 RFC 2119 [RFC2119].
本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[RFC2119]中所述进行解释。
One use of the INVITE method in SIP is to establish new sessions. These "initial" INVITEs may fork at intermediaries, and more than one receiving endpoint may choose to accept the request. SIP is designed such that the requester receives all of these success responses.
SIP中INVITE方法的一个用途是建立新会话。这些“初始”邀请可能在中间人处分叉,并且多个接收端点可能选择接受请求。SIP的设计使得请求者接收所有这些成功响应。
Two sets of requirements in [RFC3261] work together to allow multiple 2xx responses to be processed correctly by the requester. First, all elements are required to immediately destroy any INVITE client transaction state upon forwarding a matching 2xx class response. This requirement applies to both UAs (user agents) and proxies (proxies forward the response upstream, the transaction layer at user agents forwards the response to its "UA core"). Second, all proxies are required to statelessly forward upstream any 2xx class responses that do not match an existing transaction, also called stray responses. The transaction layer at user agents is required to forward these responses to its UA core. Logic in the UA core deals with acknowledging each of these responses.
[RFC3261]中的两组需求协同工作,允许请求者正确处理多个2xx响应。首先,所有元素都需要在转发匹配的2xx类响应时立即销毁任何INVITE客户端事务状态。此要求适用于UAs(用户代理)和代理(代理将响应转发到上游,用户代理处的事务层将响应转发到其“UA核心”)。其次,所有代理都需要无状态地向上游转发与现有事务不匹配的任何2xx类响应,也称为杂散响应。用户代理的事务层需要将这些响应转发到其UA核心。UA核心中的逻辑处理确认每个响应。
This technique for specifying the behavior was chosen over adjusting INVITE client transaction state machines as a simpler way to specify the correct behavior.
选择这种指定行为的技术,而不是调整邀请客户端事务状态机,作为指定正确行为的更简单方法。
Over time, implementation experience demonstrated the existing text is in error. Once any element with a server transaction (say, a proxy in the path of the INVITE) deletes that transaction state, any retransmission of the INVITE will be treated as a new request, potentially forwarded to different locations than the original. Many implementations in the field have made proprietary adjustments to their transaction logic to avoid this error.
随着时间的推移,实施经验表明现有文本存在错误。一旦具有服务器事务的任何元素(例如,INVITE路径中的代理)删除该事务状态,INVITE的任何重新传输都将被视为新请求,可能会转发到与原始请求不同的位置。该领域的许多实现都对其事务逻辑进行了专有调整,以避免此错误。
The requirement to statelessly forward stray responses has also been identified as a security risk. Through it, elements compliant to [RFC3261] are compelled to do work (forward packets) that is not protected by the admission policies applied to requests. This can be leveraged to, for instance, use a SIP proxy as an anonymizing forwarder of packets in a distributed denial-of-service attack. General Internet endpoints can also collude to tunnel non-SIP content through such proxies by wrapping them in an SIP response envelope.
无状态转发错误响应的要求也被确定为安全风险。通过它,符合[RFC3261]的元素被强制执行不受应用于请求的许可策略保护的工作(转发数据包)。例如,这可以被用来在分布式拒绝服务攻击中使用SIP代理作为数据包的匿名转发器。通过将非SIP内容封装在SIP响应信封中,通用Internet端点还可以通过此类代理串通隧道传输非SIP内容。
Additionally, [RFC3261] requires that if an unrecoverable transport error is encountered while sending a response in a client transaction, that the transaction moves immediately into the "Terminated" state. This will result in any retransmitted INVITE requests received after such an error was encountered to be processed as a new request instead of being absorbed as a retransmission.
此外,[RFC3261]要求,如果在客户端事务中发送响应时遇到不可恢复的传输错误,则该事务立即进入“终止”状态。这将导致在遇到此类错误后收到的任何重新传输的INVITE请求作为新请求处理,而不是作为重新传输处理。
This correction document updates [RFC3261], adding a state and changing the transitions in the INVITE client state machine such that the INVITE client transaction remains in place to receive multiple 2xx responses. It adds a state to the INVITE server state machine to absorb retransmissions of the INVITE after a 2xx response has been sent. It modifies state transitions in the INVITE server state machine to absorb retransmissions of the INVITE request after encountering an unrecoverable transport error when sending a response. It also forbids forwarding stray responses to INVITE requests (not just 2xx responses), which RFC 3261 requires.
此更正文档更新[RFC3261],添加状态并更改INVITE客户端状态机中的转换,以便INVITE客户端事务保持原位以接收多个2xx响应。它向INVITE服务器状态机添加一个状态,以在发送2xx响应后吸收INVITE的重新传输。它修改INVITE服务器状态机中的状态转换,以便在发送响应时遇到不可恢复的传输错误后吸收INVITE请求的重新传输。它还禁止将杂散响应转发到邀请请求(而不仅仅是2xx响应),这是RFC3261所要求的。
Implementations strictly conformant to [RFC3261] will process retransmitted initial INVITE requests as new requests. Proxies may forward them to different locations than the original. Proxies may also be used as anonymizing forwarders of bulk traffic. Implementations will process any retransmitted INVITE request as a new request after an attempt to send a response results in an unrecoverable error.
严格遵守[RFC3261]的实现将把重新传输的初始INVITE请求作为新请求处理。代理可以将它们转发到与原始文件不同的位置。代理还可以用作批量流量的匿名转发器。在尝试发送响应导致无法恢复的错误后,实现将把任何重新传输的INVITE请求作为新请求处理。
An element sending or receiving a 2xx to an INVITE transaction MUST NOT destroy any matching INVITE transaction state. This state is necessary to ensure correct processing of retransmissions of the request and the retransmission of the 2xx and ACK that follow.
向INVITE事务发送或接收2xx的元素不得破坏任何匹配的INVITE事务状态。此状态对于确保正确处理请求的重传以及随后的2xx和ACK的重传是必要的。
An element encountering an unrecoverable transport error when trying to send a response to an INVITE request MUST NOT immediately destroy the associated INVITE server transaction state. This state is necessary to ensure correct processing of retransmissions of the request.
在尝试发送对INVITE请求的响应时遇到不可恢复传输错误的元素不得立即销毁关联的INVITE服务器事务状态。此状态对于确保正确处理请求的重新传输是必需的。
When receiving any SIP response, a transaction-stateful proxy MUST compare the transaction identifier in that response against its existing transaction state machines. The proxy MUST NOT forward the response if there is no matching transaction state machine.
当接收任何SIP响应时,事务状态代理必须将该响应中的事务标识符与其现有的事务状态机进行比较。如果没有匹配的事务状态机,则代理不能转发响应。
When receiving an ACK that matches an existing INVITE server transaction and that does not contain a branch parameter containing the magic cookie defined in RFC 3261, the matching transaction MUST be checked to see if it is in the "Accepted" state. If it is, then the ACK must be passed directly to the transaction user instead of being absorbed by the transaction state machine. This is necessary as requests from RFC 2543 clients will not include a unique branch parameter, and the mechanisms for calculating the transaction ID from such a request will be the same for both INVITE and ACKs.
当接收到与现有INVITE服务器事务匹配且不包含包含RFC 3261中定义的magic cookie的分支参数的ACK时,必须检查匹配事务是否处于“已接受”状态。如果是,则ACK必须直接传递给事务用户,而不是被事务状态机吸收。这是必要的,因为来自RFC 2543客户端的请求将不包括唯一的分支参数,并且从此类请求计算事务ID的机制对于INVITE和ACK都是相同的。
These changes impact requirements in several sections of RFC 3261. The exact effect on that text is detailed in Section 8. This section describes the details of the change, particularly the impact on the INVITE state machines, more succinctly to facilitate review and simplify implementation.
这些变更影响RFC 3261中几个章节的要求。对该文本的确切影响详见第8节。本节将更简洁地描述更改的细节,特别是对INVITE状态机的影响,以便于审查和简化实现。
To allow a SIP element to recognize retransmissions of an INVITE as retransmissions instead of new requests, a new state, "Accepted", is added to the INVITE server transaction state machine. A new timer, Timer L, is also added to ultimately allow the state machine to terminate. A server transaction in the "Proceeding" state will transition to the "Accepted" state when it issues a 2xx response and will remain in that state just long enough to absorb any retransmissions of the INVITE.
为了允许SIP元素将INVITE的重新传输识别为重新传输,而不是新请求,向INVITE服务器事务状态机添加了一个新状态“Accepted”。还添加了一个新的计时器,即计时器L,以最终允许状态机终止。处于“正在进行”状态的服务器事务在发出2xx响应时将转换为“已接受”状态,并将保持该状态的时间刚好足以吸收INVITE的任何重新传输。
If the SIP element's TU (Transaction User) issues a 2xx response for this transaction while the state machine is in the "Proceeding" state, the state machine MUST transition to the "Accepted" state and set Timer L to 64*T1, where T1 is the round-trip time estimate defined in Section 17.1.1.1 of [RFC3261].
如果SIP元素的TU(事务用户)在状态机处于“继续”状态时对此事务发出2xx响应,则状态机必须转换到“接受”状态,并将计时器L设置为64*T1,其中T1是[RFC3261]第17.1.1节中定义的往返时间估计。
While in the "Accepted" state, any retransmissions of the INVITE received will match this transaction state machine and will be absorbed by the machine without changing its state. These retransmissions are not passed onto the TU. RFC 3261 requires the TU to periodically retransmit the 2xx response until it receives an ACK. The server transaction MUST NOT generate 2xx retransmissions on its own. Any retransmission of the 2xx response passed from the TU to the transaction while in the "Accepted" state MUST be passed to the transport layer for transmission. Any ACKs received from the network while in the "Accepted" state MUST be passed directly to the TU and not absorbed.
当处于“已接受”状态时,接收到的INVITE的任何重新传输都将与此事务状态机匹配,并且将被机器吸收,而不改变其状态。这些重传不会传递到TU。RFC 3261要求TU定期重传2xx响应,直到收到ACK。服务器事务不能自行生成2xx重传。当处于“已接受”状态时,从TU传递到事务的2xx响应的任何重传都必须传递到传输层进行传输。当处于“已接受”状态时,从网络接收的任何ACK必须直接传递给TU,而不是被吸收。
When Timer L fires and the state machine is in the "Accepted" state, the machine MUST transition to the "Terminated" state. Once the transaction is in the "Terminated" state, it MUST be destroyed immediately. Timer L reflects the amount of time the server transaction could receive 2xx responses for retransmission from the TU while it is waiting to receive an ACK.
当定时器L启动且状态机处于“已接受”状态时,机器必须转换到“已终止”状态。一旦事务处于“终止”状态,必须立即销毁。计时器L反映了服务器事务在等待接收ACK时可以从TU接收2xx响应以便重新传输的时间量。
A server transaction MUST NOT discard transaction state based only on encountering a non-recoverable transport error when sending a response. Instead, the associated INVITE server transaction state machine MUST remain in its current state. (Timers will eventually cause it to transition to the "Terminated" state). This allows retransmissions of the INVITE to be absorbed instead of being processed as a new request.
服务器事务不能仅基于在发送响应时遇到不可恢复的传输错误而放弃事务状态。相反,关联的INVITE服务器事务状态机必须保持其当前状态。(计时器最终将使其转换到“终止”状态)。这允许重新传输INVITE,而不是将其作为新请求处理。
Figures 1 and 2 show the parts of the INVITE server state machine that have changed. The entire new INVITE server state machine is shown in Figure 5.
图1和图2显示了INVITE服务器状态机中已更改的部分。整个新的INVITE服务器状态机如图5所示。
BEFORE AFTER
前后
+-----------+ +-----------+ | | | | | Proceeding| | Proceeding| | | | | | | | | | | | | | | | | +-----------+ +-----------+ |2xx from TU |2xx from TU |send response |send response +-------------->+ +------->+ | | | | | | | | Transport | INVITE | Error | - | Inform TU | +-----+ | +--+ | | | V | v | | +------------+ | | | |<--+ | +->| Accepted | | ACK | | |---+ to TU | +------------+ | | ^ | | +--+ | | | | +-----+ | | 2xx from TU | | send response | | | | Timer L fires | | - | | | V +-----------+ | +------------+ | | | | | | Terminated|<-----------+ | Terminated | | | | | +-----------+ +------------+
+-----------+ +-----------+ | | | | | Proceeding| | Proceeding| | | | | | | | | | | | | | | | | +-----------+ +-----------+ |2xx from TU |2xx from TU |send response |send response +-------------->+ +------->+ | | | | | | | | Transport | INVITE | Error | - | Inform TU | +-----+ | +--+ | | | V | v | | +------------+ | | | |<--+ | +->| Accepted | | ACK | | |---+ to TU | +------------+ | | ^ | | +--+ | | | | +-----+ | | 2xx from TU | | send response | | | | Timer L fires | | - | | | V +-----------+ | +------------+ | | | | | | Terminated|<-----------+ | Terminated | | | | | +-----------+ +------------+
Figure 1: Changes to the INVITE server transaction state machine when sending 2xx
图1:发送2xx时对INVITE服务器事务状态机的更改
BEFORE AFTER
前后
+-----------+ +------------+ | | | | | Proceeding| | Proceeding | Transport Err. | | | | Inform TU | | Transport Err. | |----------+ | | Inform TU | | | | |--------------->+ | |<---------+ +-----------+ | +------------+ | | | | | Transport Err. +-----------+ | +-----------+ Inform TU | | | | |---------+ | Completed | | | Completed | | | | | | |<--------+ +-----------+ | +-----------+ | | | | +------------------>+ Transport Err.| Inform TU | | | | | | | | | | +-----------+ | | | | | Terminated|<---------------+ | | +-----------+
+-----------+ +------------+ | | | | | Proceeding| | Proceeding | Transport Err. | | | | Inform TU | | Transport Err. | |----------+ | | Inform TU | | | | |--------------->+ | |<---------+ +-----------+ | +------------+ | | | | | Transport Err. +-----------+ | +-----------+ Inform TU | | | | |---------+ | Completed | | | Completed | | | | | | |<--------+ +-----------+ | +-----------+ | | | | +------------------>+ Transport Err.| Inform TU | | | | | | | | | | +-----------+ | | | | | Terminated|<---------------+ | | +-----------+
Figure 2: Changes to the INVITE server transaction state machine on encountering transport error
图2:遇到传输错误时对INVITE server事务状态机的更改
In order to correctly distinguish retransmissions of 2xx responses from stray 2xx responses, the INVITE client state machine is modified to not transition immediately to "Terminated" on receipt of a 2xx response. Instead, the machine will transition to a new "Accepted" state, and remain there just long enough, determined by a new timer M, to receive and pass to the TU any retransmissions of the 2xx response or any additional 2xx responses from other branches of a downstream fork of the matching request. If a 2xx response is received while the client INVITE state machine is in the "Calling" or "Proceeding" states, it MUST transition to the "Accepted" state, pass the 2xx response to the TU, and set Timer M to 64*T1. A 2xx response received while in the "Accepted" state MUST be passed to the TU and the machine remains in the "Accepted" state. The client transaction MUST NOT generate an ACK to any 2xx response on its own. The TU responsible for the transaction will generate the ACK.
为了正确区分2xx响应的重传和杂散2xx响应,INVITE客户端状态机被修改为在收到2xx响应时不会立即转换为“终止”。相反,机器将转换到新的“已接受”状态,并在那里停留足够长的时间(由新定时器M确定),以接收并向TU传递来自匹配请求下游分支的2xx响应或任何附加2xx响应的任何重传。如果在客户端邀请状态机处于“正在调用”或“正在进行”状态时收到2xx响应,则它必须转换到“已接受”状态,将2xx响应传递给TU,并将计时器M设置为64*T1。在“已接受”状态下收到的2xx响应必须传递给TU,并且机器保持在“已接受”状态。客户端事务不得自行生成对任何2xx响应的确认。负责事务的TU将生成ACK。
When Timer M fires and the state machine is in the "Accepted" state, the machine MUST transition to the "Terminated" state. Once the transaction is in the "Terminated" state, it MUST be destroyed immediately.
当定时器M触发且状态机处于“已接受”状态时,机器必须转换到“已终止”状态。一旦事务处于“终止”状态,必须立即销毁。
Any response received that does not match an existing client transaction state machine is simply dropped. (Implementations are, of course, free to log or do other implementation-specific things with such responses, but the implementer should be sure to consider the impact of large numbers of malicious stray responses.)
接收到的任何与现有客户机事务状态机不匹配的响应都将被丢弃。(当然,使用这些响应可以自由地记录或执行其他实现特定的事物,但是实现者应该确保考虑大量恶意杂散响应的影响。)
Note that it is not necessary to preserve client transaction state upon the detection of unrecoverable transport errors. Existing requirements ensure the TU has been notified, and the new requirements in this document ensure that any received retransmitted response will be dropped since there will no longer be any matching transaction state.
请注意,在检测到不可恢复的传输错误时,没有必要保留客户端事务状态。现有要求确保已通知TU,本文档中的新要求确保将删除任何接收到的重新传输响应,因为不再存在任何匹配的事务状态。
Figure 3 shows the part of the INVITE client state machine that has changed. The entire new INVITE client state machine is shown in Figure 5.
图3显示了INVITE客户机状态机中已更改的部分。整个新的INVITE客户机状态机如图5所示。
+-----------+ +-----------+ | | | | | Calling | | Calling | | |----------->+ | |-----------+ +-----------+ 2xx | +-----------+ 2xx | 2xx to TU | 2xx to TU | | | | | | | | | +-----------+ | +-----------+ | | | | | | | |Proceeding |----------->| |Proceeding |---------->| | | 2xx | | | 2xx | +-----------+ 2xx to TU | +-----------+ 2xx to TU | | | | | | | | V | +-----------+ | | | | | Accepted | | +---| | | 2xx | +-----------+ | 2xx to TU | ^ | | | | | | +-----+ | | | | +-----------------+ | | Timer M fires | | - | V +-----------+ | +-----------+ | | | | | | Terminated|<-----------+ | Terminated| | | | | +-----------+ +-----------+
+-----------+ +-----------+ | | | | | Calling | | Calling | | |----------->+ | |-----------+ +-----------+ 2xx | +-----------+ 2xx | 2xx to TU | 2xx to TU | | | | | | | | | +-----------+ | +-----------+ | | | | | | | |Proceeding |----------->| |Proceeding |---------->| | | 2xx | | | 2xx | +-----------+ 2xx to TU | +-----------+ 2xx to TU | | | | | | | | V | +-----------+ | | | | | Accepted | | +---| | | 2xx | +-----------+ | 2xx to TU | ^ | | | | | | +-----+ | | | | +-----------------+ | | Timer M fires | | - | V +-----------+ | +-----------+ | | | | | | Terminated|<-----------+ | Terminated| | | | | +-----------+ +-----------+
Figure 3: Changes to the INVITE client transaction state machine
图3:INVITE客户端事务状态机的更改
This document changes the behavior of transaction-stateful proxies to not forward stray INVITE responses. When receiving any SIP response, a transaction-stateful proxy MUST compare the transaction identifier in that response against its existing transaction state machines. The proxy MUST NOT forward the response if there is no matching transaction state machine.
本文档将事务状态代理的行为更改为不转发错误的邀请响应。当接收任何SIP响应时,事务状态代理必须将该响应中的事务标识符与其现有的事务状态机进行比较。如果没有匹配的事务状态机,则代理不能转发响应。
This section describes exactly the same changes as above, but shows exactly which text in RFC 3261 is affected. This document intentionally does not contain a Figure 4 or Figure 6 so that the labels for Figures 5 and 7 are identical to the labels of the figures they are replacing in RFC 3261.
本节描述了与上述完全相同的更改,但确切显示了RFC 3261中的哪些文本受到影响。本文件有意不包含图4或图6,以便图5和图7的标签与RFC 3261中替换的图的标签相同。
Section 13.3.1.4, paragraph 4, is replaced entirely by:
第13.3.1.4节第4段完全替换为:
Once the response has been constructed, it is passed to the INVITE server transaction. In order to ensure reliable end-to-end transport of the response, it is necessary to periodically pass the response directly to the transport until the ACK arrives. The 2xx response is passed to the transport with an interval that starts at T1 seconds and doubles for each retransmission until it reaches T2 seconds (T1 and T2 are defined in Section 17). Response retransmissions cease when an ACK request for the response is received. This is independent of whatever transport protocols are used to send the response.
构造响应后,将其传递给INVITE服务器事务。为了确保响应的可靠端到端传输,有必要定期将响应直接传递给传输,直到ACK到达。2xx响应以从T1秒开始的间隔传递给传输,每次重传的间隔加倍,直到达到T2秒(T1和T2在第17节中定义)。当接收到响应的ACK请求时,响应重传停止。这与用于发送响应的任何传输协议无关。
Section 16.7, paragraphs 1 and 2, are replaced entirely by:
第16.7节第1段和第2段完全替换为:
When a response is received by an element, it first tries to locate a client transaction (Section 17.1.3) matching the response. If a transaction is found, the response is handed to the client transaction. If none is found, the element MUST NOT forward the response.
当元素收到响应时,它首先尝试定位与响应匹配的客户端事务(第17.1.3节)。如果找到事务,则将响应传递给客户端事务。如果未找到响应,则元素不得转发响应。
Section 16.7, part 9, first paragraph. Replace this sentence:
第16.7节,第9部分,第一段。替换这句话:
If the server transaction is no longer available to handle the transmission, the element MUST forward the response statelessly by sending it to the server transport.
如果服务器事务不再可用于处理传输,则元素必须通过将响应发送到服务器传输来无状态转发响应。
with
具有
If the server transaction is no longer available to handle the transmission, the response is simply discarded.
如果服务器事务不再可用于处理传输,响应将被丢弃。
Section 17.1.1.2. Replace paragraph 7 (starting "When in either") through the end of the section with:
第17.1.1.2节。将本节末尾的第7段(从“任何一个”开始)替换为:
When in either the "Calling" or "Proceeding" states, reception of a response with status code from 300-699 MUST cause the client transaction to transition to "Completed". The client transaction MUST pass the received response up to the TU, and the client transaction MUST generate an ACK request, even if the transport is reliable (guidelines for constructing the ACK from the response are given in Section 17.1.1.3), and then pass the ACK to the transport layer for transmission. The ACK MUST be sent to the same address, port, and transport to which the original request was sent.
当处于“呼叫”或“继续”状态时,收到状态代码为300-699的响应必须导致客户端事务转换为“已完成”。客户端事务必须将接收到的响应传递给TU,并且客户端事务必须生成ACK请求,即使传输是可靠的(第17.1.1.3节给出了从响应构造ACK的指南),然后将ACK传递给传输层进行传输。ACK必须发送到原始请求发送到的相同地址、端口和传输。
The client transaction MUST start Timer D when it enters the "Completed" state for any reason, with a value of at least 32 seconds for unreliable transports, and a value of zero seconds for reliable transports. Timer D reflects the amount of time that the server transaction can remain in the "Completed" state when unreliable transports are used. This is equal to Timer H in the INVITE server transaction, whose default is 64*T1, and is also equal to the time a UAS core will wait for an ACK once it sends a 2xx response. However, the client transaction does not know the value of T1 in use by the server transaction or any downstream UAS cores, so an absolute minimum of 32 s is used instead of basing Timer D on T1.
客户端事务必须在出于任何原因进入“完成”状态时启动计时器D,对于不可靠的传输,其值至少为32秒,对于可靠的传输,其值为零秒。计时器D反映了当使用不可靠的传输时,服务器事务可以保持在“完成”状态的时间量。这等于INVITE服务器事务中的计时器H,其默认值为64*T1,也等于UAS核心发送2xx响应后等待ACK的时间。但是,客户端事务不知道服务器事务或任何下游UAS核心使用的T1值,因此使用绝对最小值32秒,而不是基于T1的计时器D。
Any retransmissions of a response with status code 300-699 that are received while in the "Completed" state MUST cause the ACK to be re-passed to the transport layer for retransmission, but the newly received response MUST NOT be passed up to the TU.
在“完成”状态下接收的状态代码为300-699的响应的任何重传必须导致ACK重新传递到传输层进行重传,但新接收的响应不得传递到TU。
A retransmission of the response is defined as any response that would match the same client transaction based on the rules of Section 17.1.3.
响应的重新传输定义为根据第17.1.3节的规则匹配同一客户机事务的任何响应。
If Timer D fires while the client transaction is in the "Completed" state, the client transaction MUST move to the "Terminated" state.
如果在客户端事务处于“已完成”状态时触发计时器D,则客户端事务必须移动到“已终止”状态。
When a 2xx response is received while in either the "Calling" or "Proceeding" states, the client transaction MUST transition to the "Accepted" state, and Timer M MUST be started with a value of 64*T1. The 2xx response MUST be passed up to the TU. The client transaction MUST NOT generate an ACK to the 2xx response -- its handling is delegated to the TU. A UAC core will send an ACK to
当在“调用”或“继续”状态下收到2xx响应时,客户端事务必须转换到“已接受”状态,并且计时器M必须以64*T1的值启动。2xx响应必须向上传递给TU。客户端事务不得生成对2xx响应的ACK——其处理委托给TU。UAC核心将向TU发送ACK
the 2xx response using a new transaction. A proxy core will always forward the 2xx response upstream.
使用新事务的2xx响应。代理核心将始终向上游转发2xx响应。
The purpose of the "Accepted" state is to allow the client transaction to continue to exist to receive, and pass to the TU, any retransmissions of the 2xx response and any additional 2xx responses from other branches of the INVITE if it forked downstream. Timer M reflects the amount of time that the transaction user will wait for such messages.
“已接受”状态的目的是允许客户端事务继续存在,以接收并传递给TU 2xx响应的任何重传,以及来自INVITE的其他分支的任何附加2xx响应(如果它分叉到下游)。计时器M反映事务用户等待此类消息的时间量。
Any 2xx responses that match this client transaction and that are received while in the "Accepted" state MUST be passed up to the TU. The client transaction MUST NOT generate an ACK to the 2xx response. The client transaction takes no further action.
任何与此客户端事务匹配且在“已接受”状态下收到的2xx响应都必须传递给TU。客户端事务不得生成对2xx响应的确认。客户端事务不采取进一步的操作。
If Timer M fires while the client transaction is in the "Accepted" state, the client transaction MUST move to the "Terminated" state.
如果在客户端事务处于“已接受”状态时触发计时器M,则客户端事务必须移动到“已终止”状态。
The client transaction MUST be destroyed the instant it enters the "Terminated" state.
客户机事务必须在进入“终止”状态时立即销毁。
Replace Figure 5 with:
将图5替换为:
|INVITE from TU Timer A fires |INVITE sent Timer B fires Reset A, V or Transport Err. INVITE sent +-----------+ inform TU +---------| |--------------------------+ | | Calling | | +-------->| |-----------+ | 300-699 +-----------+ 2xx | | ACK sent | | 2xx to TU | | resp. to TU | |1xx | | +-----------------------------+ |1xx to TU | | | | | | | 1xx V | | | 1xx to TU +-----------+ | | | +---------| | | | | | |Proceeding | | | | +-------->| | | | | +-----------+ 2xx | | | 300-699 | | 2xx to TU | | | ACK sent, +--------+ +---------------+ | | resp. to TU| | | | | | | | V V | | +-----------+ +----------+ | +------------->| |Transport Err. | | | | Completed |Inform TU | Accepted | | +--| |-------+ | |-+ | 300-699 | +-----------+ | +----------+ | | ACK sent| ^ | | | ^ | | | | | | | | | | +----+ | | | +-----+ | |Timer D fires | Timer M fires| 2xx | |- | - | 2xx to TU | +--------+ | +-----------+ | NOTE: V V V | Transitions +------------+ | are labeled | | | with the event | Terminated |<-----------------------+ over the action | | to take. +------------+
|INVITE from TU Timer A fires |INVITE sent Timer B fires Reset A, V or Transport Err. INVITE sent +-----------+ inform TU +---------| |--------------------------+ | | Calling | | +-------->| |-----------+ | 300-699 +-----------+ 2xx | | ACK sent | | 2xx to TU | | resp. to TU | |1xx | | +-----------------------------+ |1xx to TU | | | | | | | 1xx V | | | 1xx to TU +-----------+ | | | +---------| | | | | | |Proceeding | | | | +-------->| | | | | +-----------+ 2xx | | | 300-699 | | 2xx to TU | | | ACK sent, +--------+ +---------------+ | | resp. to TU| | | | | | | | V V | | +-----------+ +----------+ | +------------->| |Transport Err. | | | | Completed |Inform TU | Accepted | | +--| |-------+ | |-+ | 300-699 | +-----------+ | +----------+ | | ACK sent| ^ | | | ^ | | | | | | | | | | +----+ | | | +-----+ | |Timer D fires | Timer M fires| 2xx | |- | - | 2xx to TU | +--------+ | +-----------+ | NOTE: V V V | Transitions +------------+ | are labeled | | | with the event | Terminated |<-----------------------+ over the action | | to take. +------------+
Figure 5: INVITE client transaction
图5:邀请客户端事务
Section 17.2.1, paragraph 4, is replaced with:
第17.2.1节第4段替换为:
If, while in the "Proceeding" state, the TU passes a 2xx response to the server transaction, the server transaction MUST pass this response to the transport layer for transmission. It is not retransmitted by the server transaction; retransmissions of 2xx responses are handled by the TU. The server transaction MUST then transition to the "Accepted" state.
如果在“继续”状态下,TU将2xx响应传递给服务器事务,则服务器事务必须将该响应传递给传输层进行传输。它不会被服务器事务重新传输;2xx响应的重新传输由TU处理。然后,服务器事务必须转换为“已接受”状态。
Replace Figure 7 with:
将图7替换为:
|INVITE |pass INV to TU INVITE V send 100 if TU won't in 200 ms send response+------------+ +--------| |--------+ 101-199 from TU | | | | send response +------->| |<-------+ | Proceeding | | |--------+ Transport Err. | | | Inform TU | |<-------+ +------------+ 300-699 from TU | |2xx from TU send response | |send response +--------------+ +------------+ | | INVITE V Timer G fires | send response +-----------+ send response | +--------| |--------+ | | | | | | +------->| Completed |<-------+ INVITE | Transport Err. | | - | Inform TU +--------| |----+ +-----+ | +---+ | +-----------+ | ACK | | v | v | ^ | | - | +------------+ | | | | | | |---+ ACK +----------+ | | +->| Accepted | | to TU Transport Err. | | | |<--+ Inform TU | V +------------+ | +-----------+ | ^ | | | | | | | | | Confirmed | | +-----+ | | | | 2xx from TU Timer H fires | +-----------+ | send response - | | | | | Timer I fires | | | - | Timer L fires | V | - | +------------+ | | | |<----+ +------->| Terminated | | | +------------+
|INVITE |pass INV to TU INVITE V send 100 if TU won't in 200 ms send response+------------+ +--------| |--------+ 101-199 from TU | | | | send response +------->| |<-------+ | Proceeding | | |--------+ Transport Err. | | | Inform TU | |<-------+ +------------+ 300-699 from TU | |2xx from TU send response | |send response +--------------+ +------------+ | | INVITE V Timer G fires | send response +-----------+ send response | +--------| |--------+ | | | | | | +------->| Completed |<-------+ INVITE | Transport Err. | | - | Inform TU +--------| |----+ +-----+ | +---+ | +-----------+ | ACK | | v | v | ^ | | - | +------------+ | | | | | | |---+ ACK +----------+ | | +->| Accepted | | to TU Transport Err. | | | |<--+ Inform TU | V +------------+ | +-----------+ | ^ | | | | | | | | | Confirmed | | +-----+ | | | | 2xx from TU Timer H fires | +-----------+ | send response - | | | | | Timer I fires | | | - | Timer L fires | V | - | +------------+ | | | |<----+ +------->| Terminated | | | +------------+
Figure 7: INVITE server transaction
图7:邀请服务器事务
In Section 17.2.1, replace the last paragraph (starting "Once the transaction") with:
在第17.2.1节中,将最后一段(从“一旦交易”开始)替换为:
The purpose of the "Accepted" state is to absorb retransmissions of an accepted INVITE request. Any such retransmissions are absorbed entirely within the server transaction. They are not passed up to the TU since any downstream UAS cores that accepted the request have taken responsibility for reliability and will already retransmit their 2xx responses if necessary.
“已接受”状态的目的是吸收已接受邀请请求的重传。任何此类重传都完全在服务器事务中进行。它们不会传递给TU,因为接受请求的任何下游UAS内核都已承担可靠性责任,并将在必要时重新传输其2xx响应。
While in the "Accepted" state, if the TU passes a 2xx response, the server transaction MUST pass the response to the transport layer for transmission.
在“已接受”状态下,如果TU通过2xx响应,则服务器事务必须将响应传递给传输层进行传输。
When the INVITE server transaction enters the "Accepted" state, Timer L MUST be set to fire in 64*T1 for all transports. This value matches both Timer B in the next upstream client state machine (the amount of time the previous hop will wait for a response when no provisionals have been sent) and the amount of time this (or any downstream) UAS core might be retransmitting the 2xx while waiting for an ACK. If an ACK is received while the INVITE server transaction is in the "Accepted" state, then the ACK must be passed up to the TU. If Timer L fires while the INVITE server transaction is in the "Accepted" state, the transaction MUST transition to the "Terminated" state.
当INVITE服务器事务进入“已接受”状态时,对于所有传输,必须将计时器L设置为64*T1启动。该值与下一个上游客户端状态机中的计时器B(前一跳在没有发送临时数据时等待响应的时间量)和该UAS核心(或任何下游)在等待ACK时可能重新传输2xx的时间量相匹配。如果在邀请服务器事务处于“已接受”状态时收到ACK,则必须将ACK传递给TU。如果在邀请服务器事务处于“已接受”状态时触发计时器L,则事务必须转换为“已终止”状态。
Once the transaction is in the "Terminated" state, it MUST be destroyed immediately.
一旦事务处于“终止”状态,必须立即销毁。
In Section 17.2.4, replace the second paragraph with:
在第17.2.4节中,将第二段替换为:
First, the procedures in [4] are followed, which attempt to deliver the response to a backup. If those should all fail, based on the definition of failure in [4], the server transaction SHOULD inform the TU that a failure has occurred, and MUST remain in the current state.
首先,遵循[4]中的过程,尝试将响应传递给备份。如果这些都失败了,根据[4]中失败的定义,服务器事务应该通知TU发生了故障,并且必须保持当前状态。
In Section 18.1.2, replace the second paragraph with:
在第18.1.2节中,将第二段替换为:
The client transport uses the matching procedures of Section 17.1.3 to attempt to match the response to an existing transaction. If there is a match, the response MUST be passed to that transaction. Otherwise, any element other than a stateless proxy MUST silently discard the response.
客户端传输使用第17.1.3节中的匹配程序,尝试将响应与现有事务匹配。如果存在匹配项,则必须将响应传递给该事务。否则,除无状态代理之外的任何元素都必须以静默方式放弃响应。
In Section 18.2.1, replace the last paragraph with:
在第18.2.1节中,将最后一段替换为:
Next, the server transport attempts to match the request to a server transaction. It does so using the matching rules described in Section 17.2.3. If a matching server transaction is found, the request is passed to that transaction for processing. If no match is found, the request is passed to the core, which may decide to construct a new server transaction for that request.
接下来,服务器传输尝试将请求与服务器事务相匹配。它使用第17.2.3节中描述的匹配规则进行匹配。如果找到匹配的服务器事务,则将请求传递给该事务进行处理。如果没有找到匹配项,请求将传递给核心,核心可能决定为该请求构造一个新的服务器事务。
Add to Table 4:
在表4中添加:
Timer L 64*T1 Section 17.2.1 Wait time for accepted INVITE request retransmits
计时器L 64*T1第17.2.1节接受邀请请求重传的等待时间
Timer M 64*T1 Section 17.1.1 Wait time for retransmission of 2xx to INVITE or additional 2xx from other branches of a forked INVITE
定时器M 64*T1第17.1.1节重新传输2xx到INVITE或从分叉INVITE的其他分支额外传输2xx的等待时间
IANA has updated the SIP Parameters: Method and Response Codes registry as follows:
IANA已更新SIP参数:方法和响应代码注册表,如下所示:
OLD:
旧的:
Methods Reference ------- --------- INVITE [RFC3261]
Methods Reference ------- --------- INVITE [RFC3261]
NEW:
新的:
Methods Reference ------- --------- INVITE [RFC3261][RFC6026]
Methods Reference ------- --------- INVITE [RFC3261][RFC6026]
This document makes two changes to the Session Initiation Protocol to address the error discussed in Section 3. It changes the behavior of both the client and server INVITE transaction state machines, and it changes the way "stray" responses (those that don't match any existing transaction) are handled at transaction-stateful elements.
本文档对会话启动协议进行了两次更改,以解决第3节中讨论的错误。它改变了客户端和服务器INVITE事务状态机的行为,并改变了在事务状态元素中处理“游离”响应(与任何现有事务都不匹配的响应)的方式。
The changes to the state machines cause elements to hold onto each accepted INVITE transaction state 32 seconds longer than what was specified in RFC 3261. This will have a direct impact on the amount of work an attacker that is leveraging state exhaustion will have to exert against the system. However, this additional state is necessary to achieve correct operation. There is some discussion of avoiding state exhaustion and other denial-of-service attacks in RFC 3261, Section 26.3.2.4.
对状态机的更改导致元素在每个接受的INVITE事务状态上的保留时间比RFC 3261中指定的时间长32秒。这将直接影响攻击者利用状态耗尽对系统进行攻击的工作量。但是,此附加状态是实现正确操作所必需的。RFC 3261第26.3.2.4节对避免状态耗尽和其他拒绝服务攻击进行了一些讨论。
RFC 3261 required SIP proxies to forward any stray 2xx class responses to an INVITE request upstream statelessly. As a result, conformant proxies can be forced to forward packets (that look sufficiently like SIP responses) to destinations of the sender's choosing. Section 3 discusses some of the malicious behavior this enables. This document reverses the stateless forwarding requirement, making it a violation of the specification to forward stray responses.
RFC 3261要求SIP代理无状态地向上游INVITE请求转发任何2xx类响应。结果,一致性代理可以被强制将数据包(看起来很像SIP响应)转发到发送方选择的目的地。第3节讨论了由此导致的一些恶意行为。本文档撤销了无状态转发要求,使得转发错误响应违反了规范。
RFC 3261 defines a "stateless proxy", which forwards requests and responses without creating or maintaining any transaction state. The requirements introduced in this document do not change the behavior of these elements in any way. Stateless proxies are inherently vulnerable to the abuses discussed in Section 3. One way operators might mitigate this vulnerability is to carefully control which peer elements can present traffic to a given stateless proxy.
RFC3261定义了一个“无状态代理”,它在不创建或维护任何事务状态的情况下转发请求和响应。本文档中介绍的要求不会以任何方式改变这些元素的行为。无状态代理天生容易受到第3节中讨论的滥用。运营商缓解此漏洞的一种方法是仔细控制哪些对等元素可以向给定的无状态代理提供流量。
The changes introduced by this document are backward-compatible. Transaction behavior will be no less correct, and possibly more correct, when only one peer in a transaction implements these changes. Except for the considerations mentioned earlier in this section, introducing elements implementing these changes into deployments with RFC 3261 implementations adds no additional security concerns.
本文档引入的更改是向后兼容的。当一个事务中只有一个对等方实现这些更改时,事务行为的正确性不会降低,甚至可能更正确。除了本节前面提到的注意事项外,将实现这些更改的元素引入带有RFC 3261实现的部署中不会增加额外的安全问题。
Pekka Pessi reported the improper handling of INVITE retransmissions. Brett Tate performed a careful review uncovering the need for the "Accepted" state and Timer M in the client transaction state machine. Jan Kolomaznik noticed that a server transaction should let a TU know about transport errors when it attempts to send a 2xx class response. Michael Procter corrected several nits.
Pekka Pessi报告了对INVITE重传的不当处理。Brett Tate进行了仔细的审查,发现客户机事务状态机中需要“已接受”状态和计时器M。Jan Kolomaznik注意到服务器事务在试图发送2xx类响应时应该让TU知道传输错误。迈克尔·普罗克特纠正了几个错误。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002.
[RFC3261]Rosenberg,J.,Schulzrinne,H.,Camarillo,G.,Johnston,A.,Peterson,J.,Sparks,R.,Handley,M.,和E.Schooler,“SIP:会话启动协议”,RFC 3261,2002年6月。
Authors' Addresses
作者地址
Robert Sparks Tekelec 17210 Campbell Road Suite 250 Dallas, Texas 75252 USA
美国德克萨斯州达拉斯市坎贝尔路250号Robert Sparks Tekelec 17210套房,邮编75252
EMail: RjS@nostrum.com
EMail: RjS@nostrum.com
Theo Zourzouvillys Skype 3rd Floor 8000 Marina Blvd Brisbane, California 84005 US
美国加利福尼亚州布里斯班Marina大道8000号西奥·佐维利Skype三楼84005
EMail: theo@crazygreek.co.uk
EMail: theo@crazygreek.co.uk