Hacker News
A portable SCTP userland stack
Sean-Der
|next
[-]
It's such a fun/clever hack that you can run it over UDP as well. It felt the best case for both worlds.
I wrote a little bit about it here[0] I am still hoping to interview one of the protocol authors. It would be cool to hear the motivations, hopes and compromises it took to make it happen.
[0] https://webrtcforthecurious.com/docs/07-data-communication
tptacek
|root
|parent
|next
[-]
cryptonector
|root
|parent
|next
[-]
tptacek
|root
|parent
[-]
cryptonector
|root
|parent
[-]
IP has an 8-bit next protocol field. UDP has things other potential ULPs may simply not care about (checksum, port numbers). What Reed wanted UDP for and what his contemporaries wanted it for, and why IP has an 8-bit next protocol number, need not all be in agreement. There have been a fair number of ULPs, including ICMP, TCP, UDP, ESP/AH, UDP-Lite, EGP, IGP, EIGRP, OSPF, DCCP, SCTP, RSVP, PIM, VRRP, HIP, IP-in-IP, etc.
Middleboxes should really stop filtering unknown ULPs. Such filtering is pointless. That UDP exists is not license to filter other ULPs.
Sean-Der
|root
|parent
|next
|previous
[-]
You also have to double checksum, that can be disabled with SCTP selectively now!
----
I am just a hobbyist though. I would be curious to hear the take of a big network operator.
kevin_thibedeau
|root
|parent
|next
|previous
[-]
IP is designed to handle more than two data transport protocols. It's such a weird decision that the power that be won't let us use the internet as intended.
tptacek
|root
|parent
[-]
Veserv
|root
|parent
[-]
And just to clarify a potential line of argument, arguing that we have ossification and thus running over UDP is the only practical solution for adoption, while correct, is not a benefit to disallowing other protocols to run directly on top of IP. It is a consequence.
tptacek
|root
|parent
[-]
Arguably, TCP should have been built atop UDP.
The thing to notice is that, apart from the checksum field --- which SCTP has as well, albeit with a different checksum --- UDP doesn't do anything but multiplex. It has no practically no mechanism that IP itself lacks, and vice versa.
Veserv
|root
|parent
|next
[-]
UDP is just a length, checksum, source, and destination application routing address. IPv4 has a length, checksum, source, and destination machine routing address. IPv6 has a length, source, and destination machine routing address (having determined computing the checksum at this layer is a waste).
They hold the same class of information except that layering UDP gives you a additional 16-bits of routing on top of your IP routing which is somewhat relevant for IPv4, but meaningless for IPv6. And the additional routing bits for IPv4 should have always been resolved at the IP routing layer anyways which is exactly what IPv6 did (though done poorly in my opinion, but at least solved the need for more bits).
Flexible usage of UDP for higher level protocols effectively uses the destination port as the “Next Header” field present in IP protocols. The only advantage there is it is a 16-bit format identifier instead of 8-bit, but now the field is doing double duty as a application-level routing address and a format identifier. Placing a subsequent format identifier in the UDP payload then extends your format identifier further, but at least mostly preserves the application-level routing model of the destination port. If you actually need the extra formats then IP can easily reserve a few format values to indicate a even wider format identifier immediately afterward.
tptacek
|root
|parent
[-]
Veserv
|root
|parent
[-]
The only compelling argument is deployability, but, as I clearly pointed out above, that is a invalid argument because it is a consequence of the decision to ban anything other than TCP and UDP. Arguing that using UDP is the best choice because using anything else is banned is circular reasoning at its finest. As I also acknowledged above it is the state of the world right now and it is what you need to do to get deployed, but it is not a technical argument in favor of that technical decision. It is a terrible technical decision being propped up by ossification.
tptacek
|root
|parent
[-]
You also skated past half the deployability argument. It's not just that basically every middlebox on the Internet, old and new, will refuse to forward martian IPPROTO datagrams. It's also that every mainstream operating system prevents normal programs from programming IP directly.
All this drama... to save, like, 3-6 bytes? Yeah, seems like a pretty bad trade.
garaetjjte
|root
|parent
|next
[-]
Well yes, because transport is typically handled by the kernel. Do you think UDP should be the only protocol handled by kernel and kernel TCP stack shouldn't exist?
Veserv
|root
|parent
|previous
[-]
atribecalledqst
|root
|parent
|previous
[-]
I can't be the only one who knows it for this exact reason...
valorzard
|next
|previous
[-]
I’d recommend Pion’s SCTP library instead if you okay with Go, since they try to incorporate the latest research as best they can: https://github.com/pion/sctp
If rust is more your speed, there is also SCTP-proto that’s used by a couple of other WebRTC implementations , but that lacks some of more recent RFCs for SCTP: https://github.com/webrtc/dcsctp
There is also an official Google rewrite in rust for their SCTP library that will eventually be included in libwebrtc (though I don’t think anyone actually uses it yet): https://github.com/webrtc/dcsctp
Orphis
|root
|parent
[-]
Also, fair warning for those wanting to use dcsctp for regular SCTP purposes, the library aims to only implement the WebRTC focused subset. It's a great library for that purpose, whether you use the original C++ version or newer experimental Rust version.
joshuanapoli
|next
|previous
[-]
> SCTP was originally designed to transport Public Switched Telephone Network (PSTN) signaling messages over IP networks. It is also suited to be used for other applications, for example, WebRTC.
https://www.rfc-editor.org/info/rfc9260/
It looks meant for applications that don’t need TCP’s strict in-order delivery and want to avoid its head-of-line blocking.
tptacek
|root
|parent
|next
[-]
kevin_nisbet
|root
|parent
|previous
[-]
throw0101d
|next
|previous
[-]
commandersaki
|root
|parent
|next
[-]
Sean-Der
|root
|parent
|previous
[-]
I am curious if QUIC will hit a wall with requiring UDP. You have some network operators that refuse to support anything but TCP on set ports.
gspr
|root
|parent
|next
|previous
[-]
cryptonector
|root
|parent
|next
[-]
kbolino
|root
|parent
|previous
[-]
gspr
|root
|parent
[-]
kbolino
|root
|parent
|next
[-]
IT answers to the management of the organization, not to the IETF. Most orgs are not IT shops, and their management considers IT to be an unfortunately necessary burden, not a valuable enhancer of productivity. They hire and manage IT accordingly.
Internet engineers who want to improve things could decide to leave these organizations behind, using more aggressive changes to protocols that break the stagnant middleboxes. But then they would be fighting an uphill battle for adoption. This is precisely the issue which prevented the widespread use of native SCTP; Microsoft, in particular, never adopted it, because they (probably correctly) felt that most of their enterprise customers didn't want it and would just disable it as a "security precaution".
adinisom
|root
|parent
|previous
[-]
happyPersonR
|next
|previous
[-]
maybe we’ve rolled out enough ipv6 to make this work?
This is particularly a challenge in public cloud hosted Kubernetes environments, CNI's with ipv4 just arent SCTP friendly.
Interestingly though ... there may be some applicability for it as a part of LLM.
heyamitkumar5
|previous
[-]
Running a portable userland stack like usrsctp (and encapsulating over UDP/DTLS, as WebRTC data channels popularized) solves both problems without needing kernel modules or root privileges. For anyone who has run userland transport stacks in production: how painful are timers, congestion-control tuning, and event-loop integration compared to letting the OS kernel manage socket buffers and timers?