通过 UDP 建立的 SIP 对话 - 通过 TCP 发送大型 SIP 请求后的传输是什么?

SIP dialog established via UDP - what is the transport AFTER a large SIP request has been sent via TCP?

假定已通过 UDP 建立 SIP 对话(INVITE、200 OK、ACK);并且发送了一条需要 TCP 作为传输的大消息。 在为所有其他后续(和正常大小)消息发送大消息后应用的传输协议是什么?

协议是否为所有进一步的 request/responses 切换到 TCP,还是继续使用最初协商的传输 - UDP - 用于标准大小(非大)消息?


我发现了什么(基于 RFC 3261):

All SIP elements MUST implement UDP and TCP. SIP elements MAY
implement other protocols. - from rfc3261#18

The ACK MUST be sent to the same address, port, and transport to which the original request was sent. - from rfc3261#18

好吧,并不是所有请求(尤其是 ACK)都能够独立选择传输方式。

Making TCP mandatory for the UA is a substantial change from RFC 2543. It has arisen out of the need to handle larger messages, which MUST use TCP, as discussed below. Thus, even if an element never sends large messages, it may receive one and needs to be able to handle them. - from rfc3261#18

在已建立的对话中,UAS/UAC 永远不知道是否需要大消息 - 从 UDP 切换到 TCP 就可以了(没有任何 RE-INVITE 会提前将传输更改为实际请求).

A 301 (Moved Permanently) or 302 (Moved Temporarily) response may also give the same location and username that was targeted by the initial request but specify additional transport parameters such as a different server or multicast address to try, or a change of SIP transport from UDP to TCP or vice versa. - from rfc3261#8.3

不太相关——UAS 可能想要更改 UAC 建议的传输;但这仅基于对某些 INVITE(或 RE-INVITE)的反应

The destination address, port, and transport for the CANCEL MUST be identical to those used to send the original request. - from rfc3261#9.1

好的 CANCEL(如 ACK)也不能单独选择传输。

If a request is within 200 bytes of the path MTU, or if it is larger than 1300 bytes and the path MTU is unknown, the request MUST be sent using an RFC 2914 [43] congestion controlled transport protocol, such as TCP. If this causes a change in the transport protocol from the one indicated in the top Via, the value in the top Via MUST be changed.

也就是说,如果 SIP 对话是通过 UDP 建立的,它还必须能够接收 TCP 请求。

For any port and interface that a server listens on for UDP, it MUST listen on that same port and interface for TCP. This is because a message may need to be sent using TCP, rather than UDP, if it is too large. As a result, the converse is not true. A server need not listen for UDP on a particular address and port just because it is listening on that same address and port for TCP. There may, of course, be other reasons why a server needs to listen for UDP on a particular address and port.

好的,这解释了如何从 UDP 无缝切换到 TCP。 - 而对于另一个方向,它只是不需要,但是(我的理解是:它仍然可以工作)。

此时 TCP 和 UDP 都可用,传输层负责选择。 SIP 独立于传输,两者同时处于活动状态。