1 / 267

SCTP

A detailed overview of the protocol and a examination of the socket API. SCTP. Course Objectives: What You Should Get. To come away with an understanding of the nuts and bolts of SCTP

qamar
Download Presentation

SCTP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A detailed overview of the protocol and a examination of the socket API SCTP

  2. Course Objectives: What You Should Get To come away with an understanding of the nuts and bolts of SCTP To know where in the course materials (the SCTP book and the RFC's) you can find information you may need when looking at an SCTP implementation To be able to understand the user interface to SCTP stacks (e.g. the SCTP sockets API) To know where the updates to the specification (and book) are (e.g. the I-G)

  3. Prerequisites A basic understanding of IP and transport protocols Some knowledge of TCP may be helpful, but is not strictly required. Willingness to put up with engineers that are attempting to teach a tutorial:-D

  4. Course Strategy We will first do a detailed look at the actual protocol mechanisms We will point out reference material along the way as appropriate (i.e. RFC's and Internet-Drafts etc.) We expect YOU to ask questions if you get lost. We will cover a lot of ground in a limited time so hold on to your seats :-D

  5. Reference Materials [SCTP reference book] Stream Control Transmission Protocol (SCTP): A Reference Guide, R. Stewart and Q. Xie, Addison-Wesley, 2002, ISBN 0-201-72186-4 RFC 2960: Stream Control Transmission Protocol, October 2000 RFC 3309: SCTP Checksum Change, September 2002 [I-G] draft-ietf-tsvwg-sctpimpguide-10: SCTP Implementer's Guide

  6. SCTP Programming References [sockets API] draft-ietf-tsvwg-sctpsocket-07: Sockets API Extensions for SCTP UNIX Network Programming, Volume 1, Third Edition, Stevens-Fenner-Rudoff, Addison-Wesley, 2004, ISBN 0-13-141155-1

  7. SCTP Extensions Drafts [PR-SCTP] RFC 3758 [Add-IP] draft-ietf-tsvwg-addip-sctp-08: SCTP Dynamic Address Reconfiguration [Pkt-Drop] draft-stewart-sctp-pktdrprep-00: SCTP Packet Drop Reporting [Auth] draft-tuexen-sctp-auth-chunk-00: Authenticated Chunks for SCTP

  8. Online References http://www.sctp.org Also reachable with HTTP over SCTP! http://www.ietf.org/html.charters/tsvwg-charter.html All current work on SCTP is done in the IETF TSVWG sctp-impl onmailer.cisco.com

  9. Features of SCTP Reliable data transfer w/SACK Congestion control and avoidance Message boundary preservation PMTU discovery and message fragmentation Message bundling Multi-homing support Multi-stream support Unordered data delivery option Security cookie against connection flood attack (SYN flood) Built-in heartbeat (reachability check) Extensibility

  10. IP Multi-homing The following figure depicts a typical multi-homed host. Keep this picture in mind when we discuss multi-homing. App-3 App-2 App-1 OS NI-1 NI-2 NI-3 160.15.82.20 10.1.61.11 161.10.8.221

  11. Of Endpoints and Associations Two fundamental concepts in SCTP Endpoints (communicating parties) Associations (communication relationships) These two concepts are key to understanding the protocol and its basic operation We start by defining an “SCTP Transport Address”

  12. An SCTP Transport Address Each transport protocol defines a transport level header The transport level header helps demultiplex data coming to a host to the correct applications Applications in TCP and UDP bind to a “port” which forms the core method for demultiplexing data

  13. SCTP Transport Address (cont.) SCTP also defined the same byte positions in its transport header for the two 16 bit port fields We term the combination of an SCTP port and an IP address an “SCTP Transport Address” The IP address in an SCTP Transport Address MUST be a routeable unicast address i.e. multicast and broadcast addresses are invalid

  14. An SCTP Endpoint An SCTP endpoint is the logical end of the SCTP transport protocol - a communicating party An SCTP endpoint may have MORE than one IP address but it always has one and only one port number An application typically will open an SCTP socket and bind one address, a set of addresses, or all addresses to that socket This socket can then be thought of as an SCTP endpoint

  15. SCTP Endpoints II An SCTP endpoint can be represented as a list of SCTP transport addresses with the same port: endpoint = [10.1.4.2, 10.1.5.3 : 80] An SCTP transport address can only be bound to one single SCTP endpoint

  16. SCTP Endpoint III [161.10.8.221 : 2223] Application-1 NI-1 NI-2 NI-3 10.1.61.11 160.15.82.20 161.10.8.221

  17. SCTP Endpoint IV Application-1 has bound one IP address of the host with the port 2223. If a new application is started Application-2, it may legally bind [160.15.82.20 : 2223] or [10.1.61.11 : 2223] or even [160.15.82.20, 10.1.61.11 : 2223] The new application will NOT be able to bind the existing SCTP Transport address that Application-1 has bound I.e: [161.10.8.221 : 2223]

  18. SCTP Associations Like TCP, SCTP is connection-oriented A connection-oriented protocol is one that requires a setup procedure to establish the communication relationship (and state) between two parties To establish this state, both sides go through a specific set of exchanges TCP uses a 3-way handshake (SYN, SYN/ACK, ACK) SCTP uses a 4-way handshake (we examine this later)

  19. SCTP Association II In TCP, the communication relationship between two endpoints is called a “connection” In SCTP, this is called an “association” this is because it is a broader concept than a single connection (i.e. multi-homing) An SCTP association can be represented as a pair of SCTP endpoints: assoc = { [10.1.61.11 : 2223], [161.10.8.221, 120.1.1.5 : 80]}

  20. SCTP Association III An SCTP endpoint may have multiple associations Only one association may be established between any two SCTP endpoints

  21. Operation of SCTP Associations An SCTP association provides reliable data transfer of messages Messages are sent within a stream, which is identified by a stream identifier (SID) Messages can be ordered or un-ordered: Each ordered message sent within a stream is also assigned a stream sequence number (SSN) Unordered messages have no SSN and are delivered with no respect to ordering

  22. SCTP Streams We will discuss further details in Data Transfer section later Sd-queue Ro-queue Ro-queue Sd-queue

  23. SCTP States I [Rcv INIT] Gen Cookie Send INIT-ACK CLOSED COOKIE_WAIT [ASSOCIATE] Create TCB Send INIT Start init timer [rcv valid COOKIE-ECHO] Create TCB Send COOKIE-ACK [rcv INIT-ACK] Send COOKIE-ECHO Stop init timer Start cookie timer COOKIE_ECHOED ESTABLISHED [rcv COOKIE-ACK] Stop cookie timer Page 31 of the SCTP book

  24. SCTP States II ESTABLISHED [SHUTDOWN] Check outstanding data chunks [rcv SHUTDOWN] Check outstanding data chunks SHUTDOWN- PENDING SHUTDOWN- PENDING [No More Outstanding data chunks] Send SHUTDOWN Start shutdown timer [No More Outstanding data chunks] Send SHUTDOWN-ACK Start shutdown- timer NEXT-SLIDE NEXT-SLIDE Page 32 of the SCTP book

  25. SCTP States III FROM STATES-2 FROM STATES-2 SHUTDOWN- SENT SHUTDOWN- ACK-SENT [rcv SHUTDOWN-ACK] send SHUTDOWN_COMPETE Stop shutdown timer Delete TCB [rcv SHUTDOWN-COMPLETE] Stop shutdown timer delete TCB CLOSED Page 32 of the SCTP book

  26. Questions Here we pause for any questions?? Do you have any?

  27. Bits, Bytes, and Chunks We will now turn our attention to the on-the-wire bits and bytes of SCTP An SCTP packet has a common header that appears in each packet, followed by one or more chunks SCTP chunks use a self-describing Tag-Length-Value (TLV) format Note: all figures used are always 32-bits wide

  28. SCTP Packet With IP Header IP Header SCTP Common Header Chunk 1 ... Chunk N

  29. SCTP Common Header Source Port Destination Port Verification Tag CRC-32c Checksum

  30. SCTP Common Header Fields Source and Destination Port: 16-bit port values Verification Tag: 32-bit random value selected by each endpoint in an association during setup Discriminates between two successive associations Protection mechanism against blind attackers CRC32c Checksum: 32-bit CRC covering the entire SCTP packet (SCTP common header and all chunks) Note that RFC 3309 (CRC32c) supercedes the Adler-32 checksum defined in RFC 2960 (SCTP)

  31. SCTP Chunks Chunk Type Chunk Length Chunk Flags Chunk Data

  32. SCTP Chunk Header Fields Chunk Type: 8-bit value indicating the type of chunk Chunk Flags: 8-bit flags, defined on per chunk type basis Chunk Length: 16-bit length in bytes, including the chunk type, chunk flags, and chunk length fields. Note that chunks are padded to 32-bit boundaries within an SCTP packet. Any padding bytes (0x00) used are NOT included in the chunk length

  33. List of Chunk Types I There are 20 chunk types currently defined in SCTP (including non-RFC/Internet Draft extensions): (1) DATA (0x00) (2) INITIATION [INIT] (0x01) (3) INITIATION-ACKNOWLEDGMENT [INIT-ACK] (0x02) (4) SELECTIVE-ACKNOWLEDGMENT [SACK] (0x03) (5) HEARTBEAT (0x04)

  34. List of Chunk Types II (6) HEARTBEAT-ACKNOWLEDGMENT [HEARTBEAT-ACK] (0x05) (7) ABORT (0x06) (8) SHUTDOWN (0x07) (9) SHUTDOWN-ACKNOWLEGMENT [SHUTDOWN-ACK] (0x08) (10) OPERATIONAL-ERROR [ERROR] (0x09) (11) COOKIE-ECHO (0x0A) (12) COOKIE-ACKNOWLEDGMENT [COOKIE-ACK] (0x0B)

  35. List of Chunk Types III (13) EXPLICIT CONGESTION NOTIFICATION ECHO [ECNE] (0x0C) (14) CONGESTION WINDOW REDUCE [CWR] (0x0D) (15) SHUTDOWN-COMPLETE (0x0E)

  36. List of Chunks Types: Extensions PR-SCTP - RFC 3758 (16) FORWARD-TSN (0xC0) ADD-IP draft (17) ADDRESS-CONFIGURATION [ASCONF] (0xC1) (18) ADDRESS-CONFIGURATION-ACKNOWLEDGMENT [ASCONF-ACK] (0x80) Packet-Drop draft (19) SCTP-PACKET-DROP-REPORT [PKT-DROP] (0x81) Authentication draft (20) AUTHENTICATION [AUTH] (0x82) - about to undergo drastic changes and will probably add 2-3 chunks.

  37. General Chunk Processing In any SCTP packet, control chunks always come before DATA chunks Some chunks must be singletons: INIT or INIT-ACK Chunk type number assignments are not linear The chunk type upper two bits have specific meanings used for processing unrecognized chunks

  38. Chunk Type Processing A bit pattern of 00xxxxxx in the chunk type indicates that if this chunk is unknown by the receiver, silently drop it and stop processing the rest of the packet A bit pattern of 01xxxxxx in the chunk type indicates that if this chunk is unknown by the receiver, drop it, send an ERROR chunk in reply, and stop processing the rest of the packet

  39. Chunk Type Processing II A bit pattern of 10xxxxxx in the chunk type indicates that if this chunk is unknown by the receiver, silently skip this chunk but continue to process the rest of the chunks in the packet A bit pattern of 11xxxxxx in the chunk type indicates that if this chunk is unknown by the receiver, skip this chunk but send an ERROR chunk in reply and continue to process the rest of the chunks in the packet

  40. Pop Quiz To see if you are paying attention: Assume you have an SCTP implementation that understands NONE of the extensions mentioned earlier. What will the implementation do with: - FORWARD-TSN (0xC0) - ASCONF (0xC1) - ASCONF-ACK (0x80) - PKT-DROP (0x81) - AUTHENTICATION (0x82)

  41. SCTP Chunk Parameters Some chunks have parameters within them Examples: INIT, INIT-ACK, HEARTBEAT A parameter also has a TLV format A parameter has a similar format to a chunk but slightly different (see the next slide). Processing rules for unknown parameters are similar to those for the chunk processing with slightly different connotations

  42. Parameters Format Note 16 bit length Including the header Note 16 bit Parameter Type Type = 0x0033 Length = 8 4 Octets of Data The Variable Length Data goes here

  43. Parameter Handling Rules I The upper 2 bits of the 16 bit parameter is again used to tell an implementation what to do with an unknown parameter 00xxxxxx-xxxxxxxx : indicates to stop processing the parameter and silently discard this chunk 01xxxxxx-xxxxxxxx : indicates to stop processing the parameter, report this in an ERROR (or INIT-ACK) chunk, and discard this chunk

  44. Parameter Handling Rules II 10xxxxxx-xxxxxxxx : indicates silently skip this parameter, and continue processing the rest of this chunk 11xxxxxx-xxxxxxxx : indicates skip this parameter, report this in an ERROR (or INIT-ACK) chunk, and continue processing the rest of this chunk Note that no matter what results from processing each individual parameter, the rest of the chunks in the packet are always processed

  45. Chunk Details We now turn our attention to the individual chunk details. We will examine each chunk in the order it would appear in a typical association setup, data exchange and shutdown. Extension chunks will be left up to the reader to explore in the individual drafts.

  46. INIT Chunk Type=1 Flags=0 Length=variable Initiation Tag Receiver window credit # Out Streams Max # In Streams Initial TSN Optional/Variable length parameters

  47. INIT (and INIT-ACK) Chunk Fields Initiation Tag: non-zero random 32-bit nonce value Receiver Window Credit: initial rwnd used for flow control # of Outbound Streams: number of streams the sender wishes to use Max # of Inbound Streams: maximum number of streams the sender supports Initial TSN: initial 32-bit TSN used for data transfer which is also a random value (it may be copied from the initiation tag)

  48. INIT / INIT-ACK Chunk Summary INIT / INIT-ACK chunks have fixed and variable parts The variable part is made up of parameters The parameters specify options and features supported by the sender Most parameters are valid for both the INIT and the INIT-ACK

  49. INIT-ACK Chunk Type=2 Flags=0 Length=variable Initiation Tag Receiver window credit # Out Streams Max # In Streams Initial TSN Optional/Variable length parameters

  50. INIT and INIT-ACK Parameters PARAMETER TYPE INIT INIT-ACK IPv4 Address 0x0005 YES YES IPv6 Address 0x0006 YES YES Cookie Preservative 0x0009 YES NO ECN Capable 0x8000 YES YES Hostname Address 0x000B YES YES Supported Address Types 0x000C YES YES Unrecognized Parameters 0x0008 NO YES State Cookie 0x0007 NO YES PR-SCTP Supported 0xC001 YES YES Set Primary Address 0xC004 YES YES Adaption Layer Indication 0XC006 YES YES

More Related