Why is SCTP not much used/known
Asked Answered
B

11

216

I recently checked out the book "UNIX Network Programming, Vol. 1" by Richards Stevens and I found that there is a third transport layer standard besides TCP and UDP: SCTP.

Summary: SCTP is a transport-level protocol that is message-driven like UDP, but reliable like TCP. Here is a short introduction from IBM DeveloperWorks.

Honestly, I have never heard of SCTP before. I can't remember reading about it in any networking books or hearing about it in classes I had taken. Reading other stackoverflow questions that mentions SCTP suggests that I'm not alone with this lack of knowledge.

Why is SCTP so unknown? Why is it not much used?

Blaeberry answered 23/7, 2009 at 13:2 Comment(6)
Anyone care to compare SCTP to ZeroMQ (besides that one is a protocol, the other a library - look at them as a tool for solving problems).Coppice
I am just curious: What is wrong/different on 3/1/2013? Why so many votes on this one day?Blaeberry
@dmeister: Because I put you on Reddit. Greetings from Darmstadt.Vellum
Please don't write 3/1/2013. Any of "March 1st 2013", "1-Mar-2013", "Mar 1st '13".. is preferable. Just don't write month and day-of-month in a way that can be misinterpreted.Geranial
There are actually a bunch of standard transport-layer protocols, and a myriad of proprietary ones.Beverleybeverlie
Just in case, you can find the RFC for SCTP hereMargalit
T
109

Indeed, SCTP is used mostly in the telecom area. Traditionally, telecom switches use SS7 (Signaling System No. 7) to interconnect different entities in the telecom network. For example - the telecom provider's subscriber data base(HLR), with a switch (MSC), the subscriber is connected too (MSC).

The telecom area is moving to higher speeds and more reachable environment. One of these changes is to replace SS7 protocol by some more elegant, fast and flexible IP-based protocol.

The telecom area is very conservative. The SS7 network has been used here for decades. It is very a reliable and closed network. This means a regular user has no access to it.

The IP network, in contrast, is open and not reliable, and telecoms will not convert to it if it won't handle at least the load that SS7 handles. This is why SCTP was developed. It tries:

  • to mimic all advantages of the SS7 network accumulated over the decades.
  • to create a connection-oriented protocol better than TCP in speed, security, and redundancy

The latest releases of Linux already have SCTP support.

Tempa answered 23/7, 2009 at 14:27 Comment(6)
specifically you should look at the output from the IETF's "SIGTRAN" working group which wrote up the mapping between SS7 and SCTP.Glendon
Probably the main reason SCTP isn't used much on the public Internet is that residential IPv4/NAT gateways need to become SCTP-aware to support multiplexing associations between multiple simultaneous private endpoints and exterior hosts. Look for SCTP to become more useful once the IPv6 transition starts to pick up more steam.Bombazine
@jameswoodyatt there are library implementations of SCTP over UDP. It solves some of the issues with consumer-grade routers.Illumination
This does not answer the question at all. James' response contains more information than the answer actually does.Cnossus
@jameswoodyatt The consumer-grade routers I've messed with all have support for it, even some pretty old ones. The problem is that it's not exposed through the regular UI, so you have to do some horrible things to the system to get in where you can configure it. Something of an oversight in my opinion.Zeus
UPD: SCTP is now widely used for WebRTC data channels.Authorship
A
76

We have been deploying SCTP in several applications now, and encountered significant problem with SCTP support in various home routers. They simply don't handle SCTP correctly. I believe this is primarily a performance issue (the SCTP protocol specification require checksums for the whole packets to be recalculated and not just for headers).

Like many other promising protocols SCTP is sadly dead in the water until D-link and Netgear fixes their broken NAT boxes.

Anabaptist answered 9/9, 2011 at 9:9 Comment(7)
Wow, I wasn't aware of this barrier to entry. You are completely right -- see tools.ietf.org/html/draft-ietf-behave-sctpnat-05 for a proposed way around this. This is the 3rd set of Internet Drafts on the same topic...Chrysoprase
You sound pretty pessimistic - for home routers at least. Assuming routers used in professional production environments do support it, SCTP still looks very useful. There are lots of use cases where network topologies don't leave the premises of the data center, in which case SCTP should be perfect.Barbican
@EugeneBeresovksy: It's a few years since I posted that answer. My impression is that SCTP has not made significant headway since then. It is still used in a few specialized applications in controlled environments, but rarely seen in the wild. Windows and Mac OS X still lack SCTP support out of the box. The lack of familiarity and the brittleness of a protocol broken by most firewalls and NAT boxes make people reluctant to use it.Anabaptist
@Anabaptist I'd like to use it within a data center, so no NATs involved, and no firewalls, except tho OS-builtin ones. In a Linux server environment, I hope it just works. But even using Windows, there are SCTP libraries - and I believe without having to tinker with the OS.Barbican
SCTP isn't usually enabled in Linux because of its lack of adoption, but even on my Ubuntu Precise (old) system it is available as a loadable module. Providing an application that wishes to use SCTP but will fall back to TCP (for example) is a problem akin to dual-stacking, but more painful.Cnossus
The real problem is NAT, specifically, the NAPT variant of NAT, which only supports TCP, UDP, and ICMP. RFC 3022, Traditional IP Network Address Translator (Traditional NAT), Section 2.2. Overview of NAPT spells it out: "Sessions other than TCP, UDP and ICMP query type are simply not permitted from local nodes, serviced by a NAPT router."Beverleybeverlie
The answer is IPv6.Deadradeadweight
T
66

SCTP is not very much known and not used/deployed a lot because:

  • Widespread: Not widely integrated in TCP/IP stacks (in 2013: still missing natively in latest Mac OSX and Windows. 2020 update: still not in Windows nor Mac OS X)
  • Libraries: Few high level bindings in easy to use languages (Disclaimer: i'm maintainer of pysctp, SCTP easy stack support for Python)
  • NAT: Doesn't cross NAT very well/at all (less than 1% internet home & enterprise routers do NAT on SCTP).
  • Popularity: No general public app use it
  • Programming paradigm: it changed a bit: it's still a socket, but you can connect many hosts to many hosts (multihoming), datagram is ordered and reliable, erc...
  • Complexity: SCTP stack is complex to implement (due to above)
  • Competition: Multipath TCP is coming and should address multihoming needs / capabilities so people refrain from implementing SCTP if possible, waiting for MTCP
  • Niche: Needs SCTP fills are very peculiar (ordered reliable datagrams, multistream) and not needed by much applications
  • Security: SCTP evades security controls (some firewalls, most IDSes, all DLPs, does not appear on netstat except CentOS/Redhat/Fedora...)
  • Audit-ability: Something like 3 companies in the world routinely do audits of SCTP security (Disclaimer: I work in one of them)
  • Learning curve: Not much toolchain to play with SCTP (check the excellent withsctp that combines nicely with netcat or use socat, 2020 edit: nmap supports it for a few years now )
  • Under the hood: Used mostly in telecom and everytime you send SMS, start surfing the net on your mobile or make phone calls, you're often triggering messages that flow over SCTP (SIGTRAN/SS7 with GSM/UMTS, Diameter with LTE/IMS/RCS, S1AP/X2AP with LTE), so you actually use it a lot but you never know about it ;-) 2020 edit: it's being removed from the core 5G network (no more Diameter, HTTP/2 instead) and will be only used in the 5G radio access network between antennas and core.
Tightlipped answered 29/11, 2013 at 17:20 Comment(4)
Re: "Niche / not needed by much applications". Web browsers would benefit from it, see HTTP2 and its attempts to implement, on top of TCP, some of what SCTP gives away for free. Most HTTP optimization techniques (spriting, sharding, inlining, concatenation) would be made (almost completely - HTTP1's wasteful headers remain unsolved) redundant by SCTP. same is true for applications that have a connection pool to enable concurrent access to a DB or any other service. In other words: There's great need by lots of apps for some of SCTP's features.Barbican
"No general public app use it": Not true anymore as SCTP is used by WebRTC. "Security: SCTP evades security controls " - that's more of problem of 'security' controls. If it does avoid those checks then it would be wonderful protocol for malware to stay under the radar.Doloresdolorimetry
DId you say SCTP is being replaced by HTTP/2? Has anyone there heard of the concept of "Layering violation"?Deadradeadweight
I think situations where a message-based systems are needed is pretty common. So the ability to segregate traffic into individual datagrams and know when a message is complete is very useful. UDP can provide that, but the payload size is too limited and it is not reliable. With TCP, you end up tagging on your own message terminators or separators, instead of using a common reliable method. Too bad it never really took off.Boss
C
59

SCTP requires more design within the application to get the best use of it. There are more options than TCP, the Sockets-like API came later, and it is young. However I think most people that take the time to understand it (and who know the shortcomings of TCP) appreciate it -- it is a well designed protocol that builds on our ~30 years of knowledge of TCP and UDP.

One of the aspects that requires some thought is that of streams. Streams provide (usually, I think you can turn it off) an order guarantee within them (much like a TCP connection) but there can be multiple streams per SCTP connection. If your application's data can be sent over multiple streams then you avoid head-of-line blocking where the receiver starves due to one mislaid packet. Effectively different conversations can be had over the same connection without impacting each other.

Another useful addition is that of multi-homing support -- one connection can be across multiple interfaces on both ends and it copes with failures. You can emulate this in TCP, but at the application layer.

Proper link heartbeating, which is the first thing any application using TCP for non-transient connections implements, is there for free.

My personal summary of SCTP is that it doesn't do anything you couldn't do another way (in TCP or UDP) with substantial application support. The thing it provides is the ability to not have to implement that code (badly) yourself.

FYI, SCTP is mandated as supported for Diameter (cf RADIUS next gen). see RFC 3588

   Diameter clients MUST support either TCP or SCTP, while agents and
   servers MUST support both.  Future versions of this specification MAY
   mandate that clients support SCTP.
Chrysoprase answered 14/9, 2009 at 11:25 Comment(0)
B
16

p1. SCTP mapped directly over IPv4 requires support in NAT gateways, which has never been widely deployed anywhere, and without it the typical NAT gateway will only permit one private host per public address to be using SCTP at a time.

p2. SCTP mapped over UDP/IPv4 allows more private hosts per public address, but UDP mappings in IPv4/NAT gateways are notoriously tricky to establish and keep maintained, due to the fact that UDP is a connectionless transport without any explicit state for a NAT to track.

p3. SCTP mapped directly over IPv6 requires... well... IPv6. Have you tried to deploy IPv6? If so, have you tried to buy an IPv6 firewall? Does it support SCTP? How about a load balancer? A SSL accelerator?

p4. Finally, a lot of the Internet is pretty much constrained to what can fit through TCP port 80 and port 443, so SCTP of any flavor tends to lose there. Hence, you see efforts like the MPTCP working group in IETF.

Bombazine answered 1/3, 2013 at 20:31 Comment(2)
"have you tried to buy an IPv6 firewall? Does it support SCTP" — the usual freely distributed iptables supports them just fine. I'm not a network guy though, so I can't say for the rest.Cahoon
10 years later IPv6 and SCTP firewalling on Linux via GUI is smooth.Deadradeadweight
C
15

Many of us will be using SCTP soon, since it's used by WebRTC datachannels to create a TCP-like reliable layer on top of UDP -- SCTP over DTLS over UDP: https://datatracker.ietf.org/doc/html/draft-ietf-rtcweb-data-channel-13#section-6

Caruthers answered 2/3, 2013 at 13:6 Comment(1)
Forgot to mention that WebRTC primary focus is combined video and audio streaming. It is not meant to be used as a message relay. turn/ice/stun services are another part of the technology WebRTC run on top of. But these are technologies WebRTC uses. Those technologies are not WebRTC.Nedi
C
7

Reading the SCTP Wikipedia page I'd say that the main reason is that SCTP is a very young protocol (proposed in 2000) that is currently unsupported by the mainstream OSs (Windows, OS X, Linux).

If "very young" seems inappropriate to you, think about IPV6: "in December 2008, despite marking its 10th anniversary as a Standards Track protocol, IPv6 was only in its infancy in terms of general worldwide deployment."

Chipboard answered 23/7, 2009 at 13:16 Comment(2)
According to the Wikipedia article you linked to, SCTP is implemented in Linux, Solaris, FreeBSD, HP-UX and others.Pentheam
The linked article now says also that it runs on OS X and Windows.Blaeberry
E
5

SCTP is used extensively in the 4G LTE network where Diameter is used for AAA.

Empale answered 20/5, 2014 at 21:52 Comment(0)
G
3

In reference to all of the comments about commercial routers being broken or lacking SCTP support, the issue is that SCTP with NAT is still in draft form with the IETF. So there is no RFC specification for them to implement it.

https://datatracker.ietf.org/doc/html/draft-ietf-behave-sctpnat-09

Gerber answered 19/11, 2014 at 16:19 Comment(0)
C
2

It might not be well known, but it's not unused. Quite recently there was a draft published at the IETF about Using SCTP as a Transport Layer Protocol for HTTP.

Cathartic answered 23/7, 2009 at 13:17 Comment(1)
When you said “not unused” I thought of actual usage of the protocol. But then you only gave an example of a draft document, that may potentially lead to real usage in the future.Godthaab
N
-2

Sctp is born too late, and for many situation TCP is enough.

Also, as I know most of its usage is on telecommunication area.

Nabokov answered 23/7, 2009 at 13:21 Comment(1)
That didn't stop QUICDeadradeadweight

© 2022 - 2024 — McMap. All rights reserved.