Unofficial Hacker News companion — get notified on comment replies, and more.

A portable SCTP userland stack (opens external site)

42 points by mococa 2 days ago | github.com | 59 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (36)

  1. I have a huge soft spot for SCTP, I think it's a wonderful protocol.

    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

    Replies (2)
    1. Is it a hack, or is it an attempt to correct the fatal mistake of the protocol? Running SCTP directly off the top of IP was such a weird decision. This is literally the reason UDP exists: to make it possible to create arbitrary new IP protocols! And they eschewed it, and it became undeployable.
      Replies (4)
      1. > such a weird decision

        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.

        Replies (1)
        1. What is the virtue of a protocol running directly on top of IP, versus on top of UDP? Avoiding a checksum?
          Replies (2)
          1. What is the virtue of wasting throughput? You need to actually characterize why there is a technical benefit to the cost rather than demanding others prove the negative.

            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.

            Replies (1)
            1. What wasted throughput? You could say the same thing about any number of fields in the IP header itself. The question is "what does direct IP get you that UDP doesn't get you". This was, as I keep saying, the original design purpose of UDP.

              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.

              Continue this thread (2 replies) →

          2. UDP has a weak checksum that might be absent and makes you blend layers by including the IP pseudo-header in the checksum computation. SCTP doesn't have those problems.
            Replies (1)
            1. I don't like the IP pseudoheader checksum either. Having BPF'd a lot of UDP and TCP, I especially don't like the IP checksum. But what you're giving up for checksum purity is extremely painful. The UDP checksum is not why SCTP is an IP protocol. "Normal people were not meant to use this protocol" is why.
      2. Very small overhead putting it inside of UDP, doesn't really matter though.

        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.

        Replies (1)
        1. SCTP is widely used in telecom, i.e. SIGTRAN and the way your cell phone interoperates on the backend. The telecom industry is a parallel universe, they aren't really bothered by complexity sometimes for better sometime for worse.
      3. Is it TCP over IP, or TCP over UDP over IP? There's the answer.
        Replies (1)
        1. TCP over UDP over IP would have been a much better design. Unfortunately, TCP preceded UDP, by several years, so we missed that opportunity.
      4. No, that's not why UDP exists. Transport protocols _in principle_ should be the next layer after IP, but too many middleboxes drop packets for transport protocols they don't support. SCTP over UDP exists because of that. The fact that one can run anything over UDP merely proves that middleboxes really have no business dropping packets for ULPs they don't recognize/support. In fact, middleboxes are expected to pass these things through!
        Replies (1)
        1. My source for this is David Reed, which is pretty dispositive.
          Replies (1)
          1. That's not entirely dispositive, and I'd have to see exactly what he had to say because it's likely that there's nuance. I'd be specifically interested in whether he says that at the time he intended UDP to what one builds other ULPs on, or merely application protocols; the latter would make what he says absolutely not dispositive here.

            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.

            Replies (1)
            1. The only thing you can call UDP out for having that other protocols wouldn't want are checksums. The port numbers are protocol multiplexing. The best you could do is say that we need 1-2 fewer bytes of it.

              There is no reason for most of those protocols to run directly on top of IP. OSPF would work just as well as a UDP protocol. It's grotesque that PIM even occupies one of the ipproto numbers.

              This has nothing to do with what middleboxes should or shouldn't do. I don't like middleboxes either. But that's not the only problem with riding directly on top of IP; it also makes programming much harder, because no mainstream operating system exposes direct-on-IP in a convenient way. Multiplexing turns out to be pretty useful!

              Continue this thread (1 replies) →

    2. It prominently appears in W. Richard Stevens' "UNIX Network Programming" which I learned C and sockets programming from. So I have exercises written using SCTP - I forget what libraries I used at the time. Most of my work was on a FreeBSD VM, I think - and I might have installed a userland Linux library for it.

      I can't be the only one who knows it for this exact reason...