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 (7)

  1. I don't know where this argument is really getting you. No matter how you want to rationalize it, building a new protocol directly on top of IP costs you at least 2 things:

    * The protocol can't easily be programmed from userland on mainstream operating systems.

    * Most middleboxes (as opposed to "some" middleboxes, which is also a huge problem) will drop those packets.

    In exchange, you win... nothing.

    The engineering decision here seems straightforward. Like you could see this being a more spicy debate if SCTP had mainstream use cases? But it's nowhere; it's like frame relay, a cursed protocol you have to know about if you work in a cursed industry.

    The comparison to QUIC is instructive.

    Replies (1)
    1. I have no objections to user-space UDP-based SCTP/etc. I understand and [mostly; see below] concede the point about difficulty of coding user-space ULPs. The point though is that SCTP should have been workable, and still could be some day, as a) an IP ULP, b) implemented in kernel space on general purpose OSes. I'm griping about the middleboxes, and the point of that is not merely to gripe but to make it easier for middlebox engineers to find out that they really should not be filtering unkown ULPs.

      As to why not just give up and always use UDP, one reason is that the UDP port numbers complicate the picture, at least for ULPs that were designed to run over IP. Another is that UDP does add a bit of overhead, and, sure, as time passes the cost of that overhead gets smaller, so this one may be asymptotically irrelevant. A third reason is that IP was designed to have more ULPs, so let us have that, dammit :) Now, the matter of the difficulty of implementing ULPs-over-IP in user-land, that could be made a lot simpler if we had a shim ULP with a tiny header for the purpose of allowing a modicum of multiplexing, but even without that people do have user-space TCP and what not running over NICs that are delegated to user-spaces processes, and the difficulty of implementing such things is also asymptotically irrelevant in the age of AI.

      Replies (1)
      1. How do port numbers complicate the picture? In the worst case you just allocate a fixed port number and run the whole protocol as if it was riding IP instead of UDP. Someone else complained about the wire encoding waste, but come on, we're in Bernstein's "Modest Proposal" territory here. Other than the 1-3 bytes you spend (3-5 if you want to count the UDP sum against the design because you're going to do a better checksum), you lose nothing. Riding on IP gets you nothing.
        Replies (1)
        1. > How do port numbers complicate the picture?

          If they can vary then discovery is made more complex. If you fix the port number then discovery is not made more complex, but you lose the multiplexing you advertised as a feature earlier.

          We're broadly in agreement except that you don't care to tell middlebox engineers to cut the shit, and I do. That's basically the only daylight between us here, I think. Fighting every little point serves to obscure my message to middlebox engineers.

          Replies (1)
          1. No, you don't lose the multiplexing. This is simple. IP has an 8 bit multiplexing ID and you pay heavily in deployability (not just from middleboxes) to use it. UDP has a 16-32 bit multiplexer ID, depending on how you choose to encode and interpret it, and you can use it freely. It costs you nothing but a (very few) bits on the wire to fix a UDP port number, forever carving a path for your upper-layer protocol, and then do whatever other multiplexing you want.

            That's what every protocol already does! That's what a URL is, or a channel identifier, or a path, or a session identifier. The worst protocols in the world are the ones that use UDP/TCP port numbers directly as a multi-application multiplexing ID.

            Replies (1)
            1. We're going in circles. I believe readers can see that you've contradicted yourself (if ports complicate discovery then fix the ports, but also ports give you multiplexing if you're running over UDP, and you don't want to multiplex at the IP layer because middleboxes and API issues), but also that it's not super critical. My point as to what I want stands. I see no point continuing this sub-thread.

              Continue this thread (1 replies) →