380 likes | 981 Vues
Stream Control Transmission Protocol (SCTP). Chia-Tai Tsai 2003.06.26. Motivation. Many applications need reliable message delivery – they do so by delineating a TCP stream TCP provides both strict-ordering and reliability – many applications may not need both. RDM. Framing. SCTP.
E N D
Stream Control Transmission Protocol (SCTP) Chia-Tai Tsai 2003.06.26
Motivation • Many applications need reliable message delivery – they do so by delineating a TCP stream • TCP provides both strict-orderingand reliability – many applications may not need both
RDM Framing SCTP TCP IP Data Link Layer What is SCTP? • Originally designed to support PSTN signaling messages over IP Networks • It is a reliable transport protocol operating on top of a connectionless packet network such as IP (same level as TCP)
Comparisons With TCP • SCTP has a lot of similarities with TCP • Both are uni-cast • Both are connection-orientated– maintain a state • Both are reliable (will retransmit lost data) • Both implement flow control
Major Differences from TCP • SCTP is message oriented as opposed to being byte stream oriented • SCTP has the concept of an association instead of a connection • Each association can have multiple streams • SCTP supports multi-homing • Connection Setup
Multi-streaming App 1 App 2 App 3 App 4 App 4 App 3 App 2 App 1 Stream Buffers SCTP IP PHY Stream Association
Multi-homing Support TCP single-homed session Internet A1 B1 Host A Host B X SCTP multi-homing session Internet B1 A1 X SCTP Endpoint A SCTP Endpoint B A2 B2 A3 B3
INIT chunk INIT-ACK chunk COOKIE-ECHO chunk COOKIE-ACK chunk DATA chunk SACK chunk HEARTBEAT chunk HEARTBEAT-ACK chunk SHUTDOWN chunk SHUTDOWN-ACK chunk SHUTDOWN-COMPLETE chunk ERROR chunk ABORT chunk Basic Chunk
Similarities to TCP • Slow Start and Congestion Avoidance phases • Selective Acknowledgement • Fast Retransmit
Flow Control in TCP & SCTP • Data received is acknowledged • If not acknowledged, it is re-send • Both endpoints maintain a ‘window’ • The receiver window (rwnd) indicates how much the buffer can receive • The sender keeps a congestion window (cwnd) • Starts small and increases expontially (slow start) • Then increases slowly – congestion avoidance • Use fast retransmit and recovery techniques
SCTP Initiation - Four Way Handshake • TCP: 3 way handshake-DoS Attack • SCTP: 4 way handshake + Cookie more mitigate to DoS SCTP Initiation TCP Initiation INIT INIT-ACK: Cookie included INIT Cookie-Echo INIT-ACK Cookie-ACK ACK
SCTP Data Transfer - Packet Format Common Header of Packet Common Header of Chunk Elements of Data Chunk • Chunk: control chunk and data chunk • Packet: one common header+one/more chunks • Support of bundling : Multiple Data and Control chunks in a single message, to improve transport efficiency.
SCTP Data Transfer(Continued) • How to achieve Reliable and ordered delivery • TCP: through Packet Sequence Number • SCTP achieve reliable and ordered or partial ordered delivery independently through TSN and SSN
SCTP Data TransferSCTP Message Exchange SCTP-B SCTP-A Data • An SCTP host sends Selective Acknowledgment to every other SCTP packets carrying DATA Chunks. • 2. SACK fully describes the receiver’s state, so that the sender can make retransmission decisions based on what has been received. Data SACK Data SACK & Data Data SACK
SCTP Shutdown Data • Three Steps for SCTP Shutdown: • Shutdown_Pending State • ( Sender side) • 3. Shutdown_Sent State • (Sender side) • Shutdown_received State • (Receiver side) • Important Feature: • No Half-Close: both sides are prohibited from sending new data by their upper layer once a graceful showdown sequence is initiated. Data SACK Shutdown Data Shutdown Shutdown --ACK Shutdown --CMPL
Client Server Request file 0 Fork child Send file 0 Request file 1..N Send file 1,2,…N Multiple File Transfer (Embedded files) - TCP Child process
SCTP Packet Format streams
Client Server Request file 0 Fork child Send file 0 – stream 0 Request files 1..N Send file 1 – stream 1 Send file N – stream N Multiple Files Transfer (Embedded Files) - SCTP Child process
Retransmit (TCP) • Packet Arrives out of sequence • A duplicate ACK is send • After the sender receives a 2(+) Duplicates, it retransmits the packet • CWND is decreased (fast recovery) • Hopefully an ACK should arrive, and this is the transmission can continue, not resending any more • If the ACK times out, then slow start is used
SCTP Retransmits • SCTP makes more use of Selective Acknowledgements (SACK’s) • These contain more information about the packets that were received successfully • Generally, this improves performance • SCTP can transmit on a lost packet using a different IP address • This provides redundancy • It reduces congestion
snd_una=26 26 26 rcv_ntx=27 26 27 26 27 28 26 28 snd_una=27 27 28 29 26 28 29 27 28 29 30 27 28 29 30 31 27 28 29 30 31 32 26 28 29 31 27 28 29 30 31 32 33 26 28 29 31 32 27 28 29 30 31 32 33 26 28 29 31 32 33 27 28 29 30 31 32 33 26 27 28 29 31 32 33 rcv_ntx=30 27 28 29 30 31 32 33 26 27 28 29 30 31 32 33 rcv_ntx=34 30 31 32 33 snd_una=30 SACK Sender’s Retransmission Buffer Receiver Buffer 26 27 ACK=27 28 29 30 ACK=27,(28,29) ACK=27,(28,30) 31 32 ACK=27,(31,32),(28,30) 33 ACK=27,(31,33),(28,30) 27 ACK=27,(31,34),(28,30) 30 ACK=30,(31,34)) ACK=34
Server Client 3 2 1 3 2 3 2 1 3 2 1 1 File 3 File 2 TCP Send buffer in kernel TCP Receive buffer in kernel
Server Client 3 3 2 2 3 2 1 3 2 1 1 1 File 3 File 2 SCTP Receive buffer in kernel SCTP Receive buffer in kernel
SCTP Summary • Important features of SCTP • Message- Oriented (Message boundarypreservation) • Multi-homing • Multi-stream • Partial ordering • Security Mechanism (Cookie)