SCTP: next generation signalling protocol and FreeBSD 7 Murat Balaban Director, R & D endersys ltd. http://www.enderunix.org/murat/
Download ReportTranscript SCTP: next generation signalling protocol and FreeBSD 7 Murat Balaban Director, R & D endersys ltd. http://www.enderunix.org/murat/
SCTP: next generation signalling protocol and FreeBSD 7 Murat Balaban Director, R & D endersys ltd. http://www.enderunix.org/murat/ SCTP Intro • new IP transport protocol, existing at an equivalent level as UDP and TCP • provide transport layer functions to all of the main Internet applications • IETF standart • RFC 2960 – RFC 3758 Like TCP • • • • • provides a reliable transport service In-order delivery connection-oriented Congestion avoidance Slow start Unlike TCP • provides a number of functions that are considered critical for signaling transport • at the same time can provide transport benefits to other applications requiring additional performance and reliability. SCTP Core Features • Multi-streaming • Multi-homing Multi-streaming • Name is derived from the multi-streaming function • In contrast, TCP provides a single stream of data and ensures that delivery of that stream takes place with perfect sequence preservation • For a number of applications, this characteristic of strict sequence preservation is not truly necessary Multi-streaming contd. • Signalling Multiple streams can carry different signalls of varying importance Multiple calls can be placed on different streams whithin the same “association” Multi-streaming contd. • Web page objects Objects can be placed on different independent streams, which results in a better perceived performance. Multi-streaming: How? By creating independence between data transmission and data delivery. In particular, each DATA “chunk” (or PDU) in the protocol uses two sets of sequence numbers, a Transmission Sequence Number that governs the transmission of messages and the detection of message loss, and the Stream ID/Stream Sequence Number pair, which is used to determine the sequence of delivery of received data. Multi-homing • the ability for a single SCTP endpoint to support multiple IP addresses • Benefit: potentially greater survivability of the session in the presence of network failures • redundant LANs can be used to reinforce the local access, while various options are possible in the core network to reduce the dependency of failures for different addresses Multi-homing App-3 App-2 App-1 OS NI-1 NI-2 160.15.82.20 161.10.8.221 NI-3 10.1.61.11 Multi-homing contd. • Use of addresses with different prefixes can force routing to go through different carriers, for example, while route-pinning techniques or even redundant core networks can also be used if there is control over the network architecture and protocols. Multi-homing: load sharing? • Nope. • Only for redundancy Multi-homing: load sharing? • Nope. • Only for redundancy Multi-homing: How? • SCTP endpoints can exchange lists of addresses during initiation of the association • A single port number is used across the entire address list at an endpoint for a specific session. • to reduce the potential for security problems, it is required that some response messages be sent specifically to the source address in the message that caused the response Other features • a unicast protocol, and supports data exchange between exactly 2 endpoints, although these may be represented by multiple IP addresses. • provides reliable transmission • Full-duplex Other features contd. • message oriented and supports framing of individual message boundaries. In comparison, TCP is stream oriented and does not preserve any implicit structure within a transmitted byte stream. • Rate-adaptive • Unordered data delivery option Other features contd. • Security cookie against connection flood attack (SYN flood) • Built-in heartbeat (reachability check) • Extensibility (TLV chunks) Association Establishment • 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 • 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) Setting Up an Association Endpoint A Endpoint Z INIT INIT-ACK Association Is Up COOKIE-ECHO * * COOKIE-ACK * -- User data can be attached Association Is Up SCTP States I [Rcv INIT] Gen Cookie Send INIT-ACK CLOSED [ASSOCIATE] Create TCB Send INIT Start init timer [rcv valid COOKIE-ECHO] Create TCB Send COOKIE-ACK COOKIE_WAIT [rcv INIT-ACK] Send COOKIE-ECHO Stop init timer Start cookie timer COOKIE_ECHOED ESTABLISHED [rcv COOKIE-ACK] Stop cookie timer SCTP States II ESTABLISHED [SHUTDOWN] Check outstanding data chunks SHUTDOWNPENDING [No More Outstanding data chunks] Send SHUTDOWN Start shutdown timer NEXT-SLIDE [rcv SHUTDOWN] Check outstanding data chunks SHUTDOWNPENDING [No More Outstanding data chunks] Send SHUTDOWN-ACK Start shutdown- timer NEXT-SLIDE SCTP States III FROM STATES-2 FROM STATES-2 SHUTDOWNSENT SHUTDOWNACK-SENT [rcv SHUTDOWN-ACK] send SHUTDOWN_COMPETE Stop shutdown timer Delete TCB [rcv SHUTDOWN-COMPLETE] Stop shutdown timer delete TCB CLOSED SCTP Header with IP IP Header SCTP Common Header Chunk 1 ... Chunk N Common Header Source Port Destination Port Verification Tag CRC-32c Checksum SCTP Chunks Chunk Type Chunk Flags Chunk Length Chunk Data • 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 SCTP Chunk Types • There are 20 chunk types currently defined in SCTP (including nonRFC/Internet Draft extensions): –(1) DATA (0x00) –(2) INITIATION [INIT] (0x01) –(3) INITIATION-ACKNOWLEDGMENT [INIT-ACK] (0x02) –(4) SELECTIVE-ACKNOWLEDGMENT [SACK] (0x03) –(5) HEARTBEAT (0x04) Cookie Echo Chunk Type=a Flags=0 Length=variable State Cookie from INIT-ACK DATA Chunk Type=0x00 Flags=UBE Length=variable TSN Value Stream Identifier Stream Sequence Num Payload Protocol Identifier Variable Length User Data Flag Bits ‘UBE’ are used to indicate: –U – Unordered Data –B – Beginning of Fragmented Message –E – End of Fragmented Message • A user message that fits in one chunk would have both the B and E bits set FreeBSD ready? • Not yet. • -CURRENT • Planned for 7.0-RELEASE • Thanks to Randal Steward -- Thanks -- Q&A Murat Balaban EnderUNIX Yazılım Geliştirme Takımı [email protected] http://www.enderunix.org/murat/