Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

An easier way to go: SCTP over UDP in the Linux kernel

June 4, 2021
Long Xin
Related topics:
LinuxOpen source
Related products:
Red Hat Enterprise Linux

    Stream Control Transmission Protocol over User Datagram Protocol (SCTP over UDP, also known as UDP encapsulation of SCTP) is a feature defined in RFC6951 and implemented in the Linux kernel space since 5.11.0. It is planned to be supported by Red Hat Enterprise Linux (RHEL) 8.5.0 and 9.0.

    This article is a quick introduction to SCTP over UDP in the Linux kernel.

    Why we need SCTP over UDP

    As described in the Internet Engineering Task Force Request for Comments (RFC), there are two main reasons that we need SCTP over UDP:

    To allow SCTP traffic to pass through legacy NATs, which do not
    provide native SCTP support as specified in [BEHAVE] and
    [NATSUPP].
    
    To allow SCTP to be implemented on hosts that do not provide
    direct access to the IP layer. In particular, applications can
    use their own SCTP implementation if the operating system does not
    provide one.

    The first reason will solve the middlebox issues that have brought many troubles to users and prevented SCTP’s wide use. The second reason is to allow user space applications to develop their own SCTP implementation based on the UDP protocol.

    How SCTP over UDP works

    With this feature enabled, all SCTP packets are encapsulated into UDP packets. SCTP over UDP is implemented with kernel UDP tunnel APIs that have previously been used by the VXLAN, GENEVE, and TIPC protocols.

    For receiving encapsulated packets, the kernel listens on one specific UDP port on all local interfaces. The default port is 9899. This port also acts as the UDP packet src port for this host as a sender. As you might anticipate, the dest port should be the listening port of the peer, which also defaults to 9899. The src and dest addresses bound to by SCTP would still be used in IP headers:

        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    IP(v6) Header      (addresses bound by SCTP) |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    UDP Header         (src: 9899, dest: 9899)   |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    SCTP Common Header (SCTP ports)              |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    SCTP Chunk #1                                |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    ...                                          |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |    SCTP Chunk #n                                |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    

    Note: SCTP also considers the UDP header while calculating the fragmentation point.

    How to use SCTP over UDP

    When programming, you don't need to do anything different: All the standard SCTP features still apply, and all the APIs are available to use as before. Old applications will work well without any changes or recompilation. The only adjustment is to set up a UDP port (a local listening port or src port) and an encapsulation port (a remote listening or dest port), which could be done globally for the network namespace by sysctl:

        # sysctl -w net.sctp.encap_port=9899
        # sysctl -w net.sctp.udp_port=9899

    Alternatively, you could set the encapsulation port per socket, association, or transport, using sockopt:

            setsockopt(SCTP_REMOTE_UDP_ENCAPS_PORT, port);

    On the server side, the encapsulation port normally doesn’t need to be set explicitly, as detailed in the next section.

    The UDP encapsulation port

    The UDP encapsulation port allows for very flexible usage. On the sender side, the global encapsulation port only provides a default value:

    • The per-socket encapsulation port can be used when another socket on one host connects to a different host on which a different UDP port is used.
    • The per-association encapsulation port can be used when the same socket connects to a different host on which a different UDP port is used.
    • The per-transport encapsulation port can be used when the same association wants to send UDP-encapsulated SCTP packets on one transport.

    On the receiver side, the encapsulation port normally doesn’t need to be set:

    • The encapsulation port of one association would be learned from the first INIT packet. Other INITs with different UDP src ports would then be discarded.
    • The encapsulation port of each transport would be learned from the incoming packets on the corresponding path, and can be updated anytime.
    • Plain SCTP packets can still be processed even if the encapsulation ports of the association and its transports are set.

    Conclusion

    If you’re using SCTP and enjoying its features, like multi-homing, multi-streaming, and partial-reliability, but having issues with middleboxes, the Linux kernel now provides an easier way to get around them.

    Last updated: August 24, 2022

    Related Posts

    • The need for speed and the kernel datapath - recent improvements in UDP packets processing

    • SCTP Stream Schedulers and User Message Interleaving

    Recent Posts

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.