RFC 4168

The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP)

๐Ÿ“… published October 2005, from ietf

RFC 4168: The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP) ๐ŸŽ€

Okay bestie, this is RFC 4168, and it's a Standards Track document from the IETF Network Working Group ๐ŸŒธ It was written by J. Rosenberg (Cisco Systems), H. Schulzrinne (Columbia University), and G. Camarillo (Ericsson), and it's dated October 2005. The header doesn't list any RFCs that it obsoletes or updates, so it's standing on its own โœจ

Status of This Memo ๐Ÿ“ฎ

This document is an Internet standards track protocol for the Internet community, and it's asking everyone for discussion and suggestions for improvements ๐Ÿ’ฌ If you want the current standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited, so share it with your whole group chat ๐Ÿฆ‹

Copyright (C) The Internet Society (2005).

Abstract ๐Ÿซถ

This doc is all about a way to use SCTP (the Stream Control Transmission Protocol) as the transport between SIP (Session Initiation Protocol) entities ๐Ÿงš SCTP is a newer protocol with a bunch of features that could be super helpful for SIP entities that send a LOT of messages to each other, like gateways and proxies. And since SIP doesn't care what transport it runs on, supporting SCTP is pretty straightforward. It's almost identical to supporting TCP, which is honestly iconic ๐Ÿ‘‘

Table of Contents ๐Ÿ—‚๏ธ

1. Introduction ....................................................2
2. Terminology .....................................................2
3. Potential Benefits ..............................................2
   3.1. Advantages over UDP ........................................3
   3.2. Advantages over TCP ........................................3
4. Transport Parameter .............................................5
5. SCTP Usage ......................................................5
   5.1. Mapping of SIP Transactions into SCTP Streams ..............5
6. Locating a SIP Server ...........................................6
7. Security Considerations .........................................7
8. IANA Considerations .............................................7
9. References ......................................................7
   9.1. Normative References .......................................7
   9.2. Informative References .....................................8

1. Introduction โœจ

Okay so SCTP [4] was designed as a brand-new transport protocol for the Internet (or intranets), sitting at the same layer as TCP and UDP ๐Ÿ’… It was built with transporting legacy SS7 signaling messages in mind. The vibe we noticed is that a lot of the features made for that signaling are also useful for SIP (the Session Initiation Protocol) [5], which is what starts and manages interactive sessions on the Internet ๐Ÿ“ž

SIP itself doesn't care about transport. It can run over any reliable or unreliable message or stream transport ๐ŸŒˆ The catch is that the procedures are only defined for UDP and TCP. This document defines how to carry SIP over SCTP, and I'm obsessed ๐Ÿ”ฅ

2. Terminology ๐Ÿ“–

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 [1]. Read those carefully, they're the rules of the whole vibe ๐Ÿ’œ

3. Potential Benefits ๐Ÿ’Ž

RFC 3257 lays out some of the key benefits of SCTP [10]. This section sums up a few of them and looks at how they relate to SIP. If you want the deeper dive, it's in [12] ๐Ÿ“

3.1. Advantages over UDP ๐ŸŒธ

Honestly, every advantage SCTP has over UDP for SIP transport is also shared by TCP. Below is a list of general advantages that a connection-oriented transport like TCP or SCTP has over a connection-less transport like UDP ๐Ÿฆ‹

Fast Retransmit: SCTP can spot a lost packet really quickly. It does this with SACK, plus a mechanism that sends SACK messages faster than normal when losses are detected. The result is that lost SIP messages get detected way faster than when SIP runs over UDP (detection takes at least 500 ms, if not more) ๐Ÿ˜ญ TCP has SACK too, and TCP also has a fast retransmit option. Over an existing connection, this means faster call setup times when packets are lost, which is so desirable. Honestly, this is probably the biggest advantage of SCTP for SIP transport ๐Ÿ‘‘

Congestion Control: SCTP keeps congestion control over the entire association. For SIP, that means the aggregate rate of messages between two entities can be controlled ๐Ÿ’… When SIP runs over TCP, you get the same advantages. But over UDP, SIP gives you less effective congestion control. That's because congestion state (measured by the UDP retransmit interval) is computed transaction by transaction, not across all transactions. So the congestion control ends up looking like opening N parallel TCP connections, instead of sending N messages over one TCP connection ๐Ÿ™ˆ

Transport-Layer Fragmentation: SCTP and TCP both do transport-layer fragmentation. If a SIP message is bigger than the MTU size, it gets fragmented at the transport layer. With UDP, the fragmentation happens at the IP layer instead. IP fragmentation makes packet losses more likely and makes NAT and firewall traversal hard, if not impossible ๐Ÿ’€ This feature is going to matter if SIP messages grow a lot ๐Ÿงš

3.2. Advantages over TCP ๐ŸŒˆ

We've already covered the advantages of SCTP and TCP over UDP. Now let's look at what SCTP has over TCP โœจ

Head of the Line: SCTP is message-based, while TCP is stream-based. That lets SCTP separate different signaling messages at the transport layer. TCP only understands bytes, so putting received bytes together into signaling messages happens at the application layer. That means TCP always delivers an ordered stream of bytes to the application. SCTP, on the other hand, can hand signaling messages to the application as soon as they arrive (when using the unordered service). Losing one signaling message doesn't hold up the rest. This avoids the head-of-line blocking problem in TCP, which happens when multiple higher-layer connections are multiplexed over a single TCP connection ๐ŸŽ€ A SIP transaction can be thought of as an application-layer connection, and there are lots of transactions running between proxies. Losing a message in one transaction should not adversely effect a different transaction's ability to send its message. So if SIP runs between entities with lots of transactions happening in parallel, SCTP can perform better than SIP over TCP (but not SIP over UDP, which isn't ideal from a congestion control standpoint, see above) ๐Ÿ”ฅ

Easier Parsing: Message-based protocols like SCTP and UDP are nicer than stream-based protocols like TCP because they make parsing messages at the application layer easier. There's no need to set up boundaries between messages (usually with Content-Length headers) ๐Ÿ“ Still, this advantage is almost negligible ๐Ÿ™ˆ

Multihoming: An SCTP connection can be associated with multiple IP addresses on the same host. Data always goes over one of those addresses, but if it becomes unreachable, the data can migrate to a different address. That improves fault tolerance, so a network failure that takes one interface of the server offline doesn't stop the service from running ๐Ÿ’– SIP servers are likely to have serious fault tolerance requirements. It's worth noting that because SIP is message-oriented and not stream-oriented, the existing SRV (Service Selection) procedures defined in [5] can do the same job, even when SIP runs over TCP. In fact, SRV records let the "connection" fail over to a separate host. Since SIP proxies can run statelessly, failover can happen without data synchronization between the primary and its backups ๐Ÿซถ So honestly, the multihoming capabilities of SCTP only give marginal benefits ๐Ÿคทโ€โ™€๏ธ

It's really important to note that most of SCTP's benefits for SIP show up under loss conditions. So under a zero-loss condition, SCTP transport of SIP should perform on par with TCP transport ๐ŸŒธ Research is still needed to figure out under which loss conditions the improvements in setup times and throughput will actually be observed ๐Ÿ”ฌ

4. Transport Parameter ๐ŸŽ€

Via header fields carry a transport protocol identifier. RFC 3261 defines the value "SCTP" for SCTP, but it doesn't define a value for the transport parameter for TLS over SCTP. Also, the value "TLS", which RFC 3261 defines, is meant for TLS over TCP ๐Ÿ™ˆ

So here we define the value "TLS-SCTP" for the transport part of the Via header field, to be used for requests sent over TLS over SCTP [8] โœจ The updated augmented BNF (Backus-Naur Form) [2] for this parameter is below. The original BNF for this parameter can be found in RFC 3261 ๐Ÿงš

transport         =  "UDP" / "TCP" / "TLS" / "SCTP" / "TLS-SCTP"
                     / other-transport

Here are some examples of Via header fields using "SCTP" and "TLS-SCTP" ๐Ÿ’…

Via: SIP/2.0/SCTP ws1234.example.com:5060
Via: SIP/2.0/TLS-SCTP ws1234.example.com:5060

5. SCTP Usage ๐Ÿฆ‹

The rules for sending a request over SCTP are identical to TCP ๐Ÿ’– The only difference is that an SCTP sender has to choose a particular stream within an association before it sends the request (see Section 5.1) ๐ŸŒˆ

Note that no SCTP identifier needs to be defined for SIP messages. So the Payload Protocol Identifier in SCTP DATA chunks that carry SIP messages MUST be set to zero ๐Ÿ”ฅ

The SIP transport layers of both peers are responsible for managing the persistent SCTP connection between them ๐Ÿซถ On the sender side, the core or a client (or server) transaction generates a request (or response) and passes it to the transport layer. The transport sends the request to the peer's transaction layer. The peer's transaction layer is responsible for delivering the incoming request (or response) to the proper existing server (or client) transaction. If no server (or client) transaction exists for the incoming message, the transport layer passes the request (or response) up to the core, which may decide to construct a new server (or client) transaction ๐Ÿ‘‘


To be continued in part 2 ๐Ÿ’œ Don't go anywhere, the references, IANA stuff, and security considerations are coming next ๐ŸŒˆ๐ŸŽ€

5.1. Mapping of SIP Transactions into SCTP Streams ๐Ÿงš

okay so SIP transactions need to get mapped into SCTP streams in a way that avoids Head Of the Line (HOL) blocking ๐Ÿ’… Out of all the ways that do this, we picked the simplest one: a SIP entity SHOULD send every SIP message (request or response) over stream zero with the unordered flag set โœจ On the receiving side, a SIP entity MUST be ready to receive SIP messages over any stream ๐Ÿซถ

In the past, it was proposed that SCTP stream IDs be used as lightweight SIP transaction identifiers. That proposal was withdrawn because SIP now provides (as defined in RFC 3261 [5]) a transaction identifier in the branch parameter of the Via entries. This transaction identifier, missing in the previous SIP spec [9], makes it unnecessary to use the SCTP stream IDs to demultiplex SIP traffic. ๐Ÿ™ˆ

In lots of situations SIP needs TLS [3], like when routing a SIPS URI [5] ๐Ÿ” As defined in RFC 3436 [8], TLS running over SCTP MUST NOT use the SCTP unordered delivery service. ๐Ÿ’€ Also, any SIP use of an extra layer between the transport layer and SIP that needs ordered delivery of messages MUST NOT use the SCTP unordered delivery service either. no exceptions, bestie ๐Ÿšซ

SIP apps that need ordered delivery from the transport layer (like TLS) SHOULD send SIP messages from the same SIP transaction over the same SCTP stream ๐Ÿงต They SHOULD also send messages from different SIP transactions over different SCTP streams, as long as there are enough streams available ๐ŸŒˆ

A common scenario where the mechanism above should be used is two proxies swapping SIP traffic over a TLS connection that uses SCTP as the transport protocol. This works because all of the SIP transactions between the two proxies can be set up inside one SCTP association. ๐Ÿฆ‹

Also, if both sides of the association follow this recommendation, then when a request shows up over a particular stream, the server is free to send its responses back over a different stream ๐Ÿ‘‘ This way, both sides manage their available streams in the sending direction on their own, no matter which streams the other side picked for a particular SIP message. That avoids annoying collisions when grabbing a specific stream ๐Ÿ’…


6. Locating a SIP Server ๐Ÿ”

The main question when sending a request is figuring out whether the next hop server supports SCTP so an association can be opened ๐Ÿซฃ SIP entities just follow the normal SIP procedures to discover [6] a server that supports SCTP โœจ

BUT (lowkey a plot twist ๐Ÿ˜ญ) to use TLS on top of SCTP, we need an extra definition. RFC 3263 defines the NAPTR (Naming Authority Pointer) [7] service value SIP+D2S for SCTP, but it doesn't define a value for TLS over SCTP. So here we define the NAPTR service value SIPS+D2S for servers that support TLS over SCTP [8] ๐ŸŽ€


7. Security Considerations ๐Ÿ›ก๏ธ

The security issues raised in RFC 3261 [5] don't get any worse because of SCTP, as long as the advice in Section 5.1 is followed and TLS over SCTP [8] is used wherever TLS would be required in RFC 3261 [5] or in RFC 3263 [6] ๐Ÿฅน So, the mechanisms described in RFC 3436 [8] MUST be used when SIP runs on top of TLS [3] and SCTP.

This part is serious, bestie. If you skip the TLS-over-SCTP mechanisms when SIP is running on TLS and SCTP, you're opening the door to the security problems this section is warning about. Don't be that person. ๐Ÿšจ๐Ÿ˜ค

8. IANA Considerations ๐Ÿ“‹

This document defines a new NAPTR service field value (SIPS+ D2S). The IANA has registered this value under the "Registry for the SIP SRV Resource Record Services Field". The resulting entry is as follows:

Services Field        Protocol  Reference
--------------------  --------  ---------
SIPS+D2S              SCTP      [RFC4168]

9. References ๐Ÿ“š

9.1. Normative References

[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[2] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[3] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999.

[4] Stewart, R., Xie, Q., Morneault, K., Sharp, C., Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., Zhang, L., and V. Paxson, "Stream Control Transmission Protocol", RFC 2960, October 2000.

[5] 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.

[6] Rosenberg, J. and H. Schulzrinne, "Session Initiation Protocol (SIP): Locating SIP Servers", RFC 3263, June 2002.

[7] Mealling, M., "Dynamic Delegation Discovery System (DDDS) Part Three: The Domain Name System (DNS) Database", RFC 3403, October 2002.

[8] Jungmaier, A., Rescorla, E., and M. Tuexen, "Transport Layer Security over Stream Control Transmission Protocol", RFC 3436, December 2002.

9.2. Informative References

[9] Handley, M., Schulzrinne, H., Schooler, E., and J. Rosenberg, "SIP: Session Initiation Protocol", RFC 2543, March 1999.

[10] Coene, L., "Stream Control Transmission Protocol Applicability Statement", RFC 3257, April 2002.

[11] Camarillo, G., "The Internet Assigned Number Authority (IANA) Uniform Resource Identifier (URI) Parameter Registry for the Session Initiation Protocol (SIP)", BCP 99, RFC 3969, December 2004.

[12] Camarillo, G., Schulrinne, H., and R. Kantola, "Evaluation of Transport Protocols for the Session Initiation Protocol", IEEE, Network vol. 17, no. 5, 2003.


Authors' Addresses ๐ŸŒธ

Jonathan Rosenberg Cisco Systems 600 Lanidex Plaza Parsippany, NJ 07054 US

Phone: +1 973 952-5000 EMail: jdrosen@cisco.com URI: http://www.jdrosen.net

Henning Schulzrinne Columbia University M/S 0401 1214 Amsterdam Ave. New York, NY 10027-7003 US

EMail: schulzrinne@cs.columbia.edu

Gonzalo Camarillo Ericsson Hirsalantie 11 Jorvas 02420 Finland

EMail: Gonzalo.Camarillo@ericsson.com


Copyright (C) The Internet Society (2005).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Intellectual Property ๐Ÿ”

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.


Acknowledgement ๐Ÿ’œ

Funding for the RFC Editor function is currently provided by the Internet Society. ๐Ÿซถ๐ŸŒˆ

๐Ÿ“ฆ where this page comes from