SlideShare ist ein Scribd-Unternehmen logo
1 von 31
SCTP introduction

   Richard Xiong
      2013/2/8
Motivations
• Provide reliable transfer without sequence
  maintenance.
• The stream-oriented nature of TCP is
  often an inconvenience. SCTP provides
  message based transfer.
• TCP is relatively vulnerable to denial-of-
  service attacks, such as SYN attacks.
• …
History
• First implementation on 1991
• submitted to IETF on 1998. RFC 4960 defines
  the protocol. RFC 3286 provides an introduction.
  (RFC2960 and RFC3309 are obsoleted).
• Designed for telecom signaling transfer at first,
  and used on other applications
• supported by Cisco, Linux, HP, Solaris, Alcatel-
  Lucent,…

           Âť refrence
Network layers

      Upper layer applications

TCP           UDP            SCTP


                IP


            Link Layer


          Physical Layer
Features
•   Message-based
•   Multi-homing
•   Multi-stream
•   Reliable transfer
•   Robust and safety ( four way
    handshake ,heartbeat, three way
    shutdown )
Multi-homing

                 SW                           HUB
                  1                            1
      10.0.0.1
                      Alternate Path                10.0.0.3
End-point
   A                                                            End-point
                                                                   Z
     10.0.0.65
                                                    10.0.0.68
                 SW                           HUB
                  2                            2


                               Primary path
Multi-stream

                        Strm1   Strm2   Strm3
  End-point             SSN 1   SSN 1   SSN 1                     End-point
     A                                                               Z



Strm1   Strm2   Strm3
SSN 2   SSN 2   SSN 2



Strm1   Strm2   Strm3
SSN 3   SSN 3   SSN 3




                                                SSN: Stream Sequence Number
Multi-stream


  End-point                                                     End-point
     A                                                             Z
                        Strm2   Strm3
                                        Strm1   Strm2   Strm3
                        SSN 2   SSN 2
                                        SSN 1   SSN 1   SSN 1



Strm1
SSN 2



Strm1   Strm2   Strm3
SSN 3   SSN 3   SSN 3
Multi-stream


  End-point                                            End-point
     A                                                    Z
                        Strm2   Strm3
                        SSN 2   SSN 2



                                               Strm1    Strm2   Strm3
Strm1
                                               SSN 1    SSN 1   SSN 1
SSN 2



Strm1   Strm2   Strm3
SSN 3   SSN 3   SSN 3
Multi-stream


  End-point                                             End-point
     A                                                     Z
                                Strm2   Strm3
              Strm2    Strm1
                                SSN 2   SSN 2
              SSN 3    SSN 2



                                                Strm1    Strm2   Strm3
                                                SSN 1    SSN 1   SSN 1



Strm1          Strm3
SSN 3          SSN 3
Multi-stream


  End-point                                             End-point
     A                                                     Z
                                Strm2   Strm3
                                SSN 2   SSN 2



                        Strm2   Strm1
                                                Strm1    Strm2   Strm3
                        SSN 3   SSN 2
                                                SSN 1    SSN 1   SSN 1



Strm1         Strm3
SSN 3         SSN 3
Multi-stream


  End-point                                     End-point
     A                                             Z


                        Strm2   Strm1
                                        Strm1    Strm2   Strm3
                        SSN 3   SSN 2
                                        SSN 1    SSN 1   SSN 1



                                                 Strm2   Strm3
Strm1         Strm3
                                                 SSN 2   SSN 2
SSN 3         SSN 3
Multi-stream


End-point                                           End-point
   A                                                   Z
            Strm3   Strm1
            SSN 3   SSN 3



                            Strm2   Strm1
                                            Strm1    Strm2   Strm3
                            SSN 3   SSN 2
                                            SSN 1    SSN 1   SSN 1



                                                     Strm2   Strm3
                                                     SSN 2   SSN 2
Multi-stream


End-point                             End-point
   A                                     Z


              Strm2   Strm1
                              Strm1    Strm2   Strm3
              SSN 3   SSN 2
                              SSN 1    SSN 1   SSN 1



                                       Strm2   Strm3
                                       SSN 2   SSN 2


                              Strm1
                                               Strm3
                              SSN 3
                                               SSN 3
Multi-stream


End-point                              End-point
   A                                      Z



                               Strm1    Strm2   Strm3
Strm2   Strm1                  SSN 1    SSN 1   SSN 1
SSN 3   SSN 2


                                        Strm2   Strm3
                                        SSN 2   SSN 2


                               Strm1
                                                Strm3
                               SSN 3
                                                SSN 3
Multi-stream

             Strm2   Strm1
End-point    SSN 3   SSN 2           End-point
   A                                    Z



                             Strm1    Strm2   Strm3
                             SSN 1    SSN 1   SSN 1



                                      Strm2   Strm3
                                      SSN 2   SSN 2


                             Strm1
                                              Strm3
                             SSN 3
                                              SSN 3
Multi-stream


End-point                          End-point
   A                                  Z



                           Strm1    Strm2   Strm3
                           SSN 1    SSN 1   SSN 1



                           Strm1    Strm2   Strm3
                           SSN 2    SSN 2   SSN 2


                           Strm1
                                    Strm2   Strm3
                           SSN 3
                                    SSN 3   SSN 3
Status of Association
  CLOSED               COOKIE_WAIT



                                     COOKIE_ECHOED
           SHUTDOWN-
            ACK-SENT

                SHUTDOWN-
                 RECIEVED
                                 ESTABLISHED
SHUTDOWN-
   SENT


            SHUTDOWN-
             PENDING
SCTP messages
• Data -- SACK
• INIT -- INIT ACK -- COOKIE ECHO --
  COOKIE ACK
• Heartbeat -- Heartbeat ACK
• Shutdown – Shutdown ACK --
  SHUTDOWN COMPLETE
• Abort
Setting Up
      Endpoint A                                Endpoint Z
     CLOSED                                     CLOSED
                            INIT
                                                         1
   COOKIE-WAIT
                                   INIT-ACK



                         COOKIE-ECHO     *
COOKIE-ECHOED                                            2
                             *     COOKIE-ACK


ESTABLISHED                                       ESTABLISHED



              * -- User data can be attached
Transfer data
Close
                Endpoint A                            Endpoint Z

Shutdown from application

SHUTDOWN-PENDING
                            Transfer remaining data


                                SHUTDOWN
    SHUTDOWN-SENT                               SHUTDOWN-RECEIVED
                              SHUTDOWN ACK


                                                SHUTDOWN-ACK-SENT


                             SHUTDOWN COMPLETE
            CLOSED                                         CLOSED
Packet Structure




    Refer to wikipedia
Chunk structure--DATA chunk
Chunk structure--SACK chunk
Fault management
• Primary/alternate Path detection
• Resend mechanism
• Congestion control (RFC2581)
Installation on Linux (lksctp)
• Check if SCTP is installed
  – grep SCTP /proc/net/protocols
  – checksctp


• Download code from
  http://lksctp.sourceforge.net/
SCTP socket API
• One-to-many style and one-to-one style are supported.
• Please read the API standard before programming, there
  are lots of different features comparing to TCP socket.
• One-to-many server
   –   socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)
   –   bind(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr))
   –   setsockopt(m_fds[i].fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
   –   listen(sock, 2);
   –   sctp_recvmsg(sock, buffer, BUFFER_SIZE, NULL, 0, NULL, &flags)
   –   close(sock)
• One-to-many client
   –   socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP))
   –   connect(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr)
   –   send(sock, buffer, MSG_SIZE, 0)
   –   close(sock)
                    Âť Refer SCTP API
Others
• shortages
  – http://datatag.web.cern.ch/datatag/WP3/sctp/tests.


• New research
  – Concurrent multipath transfer
Reference
•   http://en.wikipedia.org/wiki/Stream_Control_Transmission_Pro
•   RFC4960
•   RFC 2581
•   http://www.youtube.com/watch?v=dIPwN-z6lVA
•   http://www.sctp.org/
•   http://www.sourceforge.net/projects/lksctp
•   http://linux.die.net/man/7/sctp
•   http://www.ibm.com/developerworks/library/l-sctp/
• http://www.linuxjournal.com/article/9784
Q&A

Weitere ähnliche Inhalte

Andere mochten auch (10)

VLAN
VLANVLAN
VLAN
 
Networking devices
Networking devicesNetworking devices
Networking devices
 
Chapter 1 : INTRODUCTION TO MULTIMEDIA
Chapter 1 : INTRODUCTION TO MULTIMEDIAChapter 1 : INTRODUCTION TO MULTIMEDIA
Chapter 1 : INTRODUCTION TO MULTIMEDIA
 
Multimedia
MultimediaMultimedia
Multimedia
 
Electronic mail
Electronic mailElectronic mail
Electronic mail
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 
Tunnelling
TunnellingTunnelling
Tunnelling
 
Network security
Network securityNetwork security
Network security
 
Chapter 4 - Digital Transmission
Chapter 4 - Digital TransmissionChapter 4 - Digital Transmission
Chapter 4 - Digital Transmission
 
Study of tunnel engineering
Study of tunnel engineeringStudy of tunnel engineering
Study of tunnel engineering
 

KĂźrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂźrzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

SCTP introduction

  • 1. SCTP introduction Richard Xiong 2013/2/8
  • 2. Motivations • Provide reliable transfer without sequence maintenance. • The stream-oriented nature of TCP is often an inconvenience. SCTP provides message based transfer. • TCP is relatively vulnerable to denial-of- service attacks, such as SYN attacks. • …
  • 3. History • First implementation on 1991 • submitted to IETF on 1998. RFC 4960 defines the protocol. RFC 3286 provides an introduction. (RFC2960 and RFC3309 are obsoleted). • Designed for telecom signaling transfer at first, and used on other applications • supported by Cisco, Linux, HP, Solaris, Alcatel- Lucent,… Âť refrence
  • 4. Network layers Upper layer applications TCP UDP SCTP IP Link Layer Physical Layer
  • 5. Features • Message-based • Multi-homing • Multi-stream • Reliable transfer • Robust and safety ( four way handshake ,heartbeat, three way shutdown )
  • 6. Multi-homing SW HUB 1 1 10.0.0.1 Alternate Path 10.0.0.3 End-point A End-point Z 10.0.0.65 10.0.0.68 SW HUB 2 2 Primary path
  • 7. Multi-stream Strm1 Strm2 Strm3 End-point SSN 1 SSN 1 SSN 1 End-point A Z Strm1 Strm2 Strm3 SSN 2 SSN 2 SSN 2 Strm1 Strm2 Strm3 SSN 3 SSN 3 SSN 3 SSN: Stream Sequence Number
  • 8. Multi-stream End-point End-point A Z Strm2 Strm3 Strm1 Strm2 Strm3 SSN 2 SSN 2 SSN 1 SSN 1 SSN 1 Strm1 SSN 2 Strm1 Strm2 Strm3 SSN 3 SSN 3 SSN 3
  • 9. Multi-stream End-point End-point A Z Strm2 Strm3 SSN 2 SSN 2 Strm1 Strm2 Strm3 Strm1 SSN 1 SSN 1 SSN 1 SSN 2 Strm1 Strm2 Strm3 SSN 3 SSN 3 SSN 3
  • 10. Multi-stream End-point End-point A Z Strm2 Strm3 Strm2 Strm1 SSN 2 SSN 2 SSN 3 SSN 2 Strm1 Strm2 Strm3 SSN 1 SSN 1 SSN 1 Strm1 Strm3 SSN 3 SSN 3
  • 11. Multi-stream End-point End-point A Z Strm2 Strm3 SSN 2 SSN 2 Strm2 Strm1 Strm1 Strm2 Strm3 SSN 3 SSN 2 SSN 1 SSN 1 SSN 1 Strm1 Strm3 SSN 3 SSN 3
  • 12. Multi-stream End-point End-point A Z Strm2 Strm1 Strm1 Strm2 Strm3 SSN 3 SSN 2 SSN 1 SSN 1 SSN 1 Strm2 Strm3 Strm1 Strm3 SSN 2 SSN 2 SSN 3 SSN 3
  • 13. Multi-stream End-point End-point A Z Strm3 Strm1 SSN 3 SSN 3 Strm2 Strm1 Strm1 Strm2 Strm3 SSN 3 SSN 2 SSN 1 SSN 1 SSN 1 Strm2 Strm3 SSN 2 SSN 2
  • 14. Multi-stream End-point End-point A Z Strm2 Strm1 Strm1 Strm2 Strm3 SSN 3 SSN 2 SSN 1 SSN 1 SSN 1 Strm2 Strm3 SSN 2 SSN 2 Strm1 Strm3 SSN 3 SSN 3
  • 15. Multi-stream End-point End-point A Z Strm1 Strm2 Strm3 Strm2 Strm1 SSN 1 SSN 1 SSN 1 SSN 3 SSN 2 Strm2 Strm3 SSN 2 SSN 2 Strm1 Strm3 SSN 3 SSN 3
  • 16. Multi-stream Strm2 Strm1 End-point SSN 3 SSN 2 End-point A Z Strm1 Strm2 Strm3 SSN 1 SSN 1 SSN 1 Strm2 Strm3 SSN 2 SSN 2 Strm1 Strm3 SSN 3 SSN 3
  • 17. Multi-stream End-point End-point A Z Strm1 Strm2 Strm3 SSN 1 SSN 1 SSN 1 Strm1 Strm2 Strm3 SSN 2 SSN 2 SSN 2 Strm1 Strm2 Strm3 SSN 3 SSN 3 SSN 3
  • 18. Status of Association CLOSED COOKIE_WAIT COOKIE_ECHOED SHUTDOWN- ACK-SENT SHUTDOWN- RECIEVED ESTABLISHED SHUTDOWN- SENT SHUTDOWN- PENDING
  • 19. SCTP messages • Data -- SACK • INIT -- INIT ACK -- COOKIE ECHO -- COOKIE ACK • Heartbeat -- Heartbeat ACK • Shutdown – Shutdown ACK -- SHUTDOWN COMPLETE • Abort
  • 20. Setting Up Endpoint A Endpoint Z CLOSED CLOSED INIT 1 COOKIE-WAIT INIT-ACK COOKIE-ECHO * COOKIE-ECHOED 2 * COOKIE-ACK ESTABLISHED ESTABLISHED * -- User data can be attached
  • 22. Close Endpoint A Endpoint Z Shutdown from application SHUTDOWN-PENDING Transfer remaining data SHUTDOWN SHUTDOWN-SENT SHUTDOWN-RECEIVED SHUTDOWN ACK SHUTDOWN-ACK-SENT SHUTDOWN COMPLETE CLOSED CLOSED
  • 23. Packet Structure Refer to wikipedia
  • 26. Fault management • Primary/alternate Path detection • Resend mechanism • Congestion control (RFC2581)
  • 27. Installation on Linux (lksctp) • Check if SCTP is installed – grep SCTP /proc/net/protocols – checksctp • Download code from http://lksctp.sourceforge.net/
  • 28. SCTP socket API • One-to-many style and one-to-one style are supported. • Please read the API standard before programming, there are lots of different features comparing to TCP socket. • One-to-many server – socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP) – bind(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr)) – setsockopt(m_fds[i].fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); – listen(sock, 2); – sctp_recvmsg(sock, buffer, BUFFER_SIZE, NULL, 0, NULL, &flags) – close(sock) • One-to-many client – socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) – connect(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr) – send(sock, buffer, MSG_SIZE, 0) – close(sock) Âť Refer SCTP API
  • 29. Others • shortages – http://datatag.web.cern.ch/datatag/WP3/sctp/tests. • New research – Concurrent multipath transfer
  • 30. Reference • http://en.wikipedia.org/wiki/Stream_Control_Transmission_Pro • RFC4960 • RFC 2581 • http://www.youtube.com/watch?v=dIPwN-z6lVA • http://www.sctp.org/ • http://www.sourceforge.net/projects/lksctp • http://linux.die.net/man/7/sctp • http://www.ibm.com/developerworks/library/l-sctp/ • http://www.linuxjournal.com/article/9784
  • 31. Q&A

Hinweis der Redaktion

  1. 1: generate cookie by MAC, timestamp and lifespan and … Don’t create TCB to avoid DOS 2: compare the cookie received with the cookie send on INIT-ACK