stream control transmission protocol
DESCRIPTION
Stream Control Transmission Protocol. Presented by – Viren Mahajan [email protected] November 20, 2007. Special thanks to Dr. Paul Amer. What we have discussed !. Motivation PDU and Chunk format The ‘a’ word - ASSOCIATION Association setup & termination Multihoming. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/1.jpg)
Stream Control Transmission Protocol
Special thanks to Dr. Paul Amer
Presented by – Viren Mahajan
[email protected] 20, 2007
![Page 2: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/2.jpg)
What we have discussed !
• Motivation• PDU and Chunk format• The ‘a’ word - ASSOCIATION• Association setup & termination• Multihoming
![Page 3: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/3.jpg)
Outline of today’s talk !
• Multistreaming• Framing• Chunk Bundling• Data Transfer• Fragmentation/Reassembly
![Page 4: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/4.jpg)
Multistreaming
![Page 5: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/5.jpg)
file transfer
video
voice
textShall we talk SCTP?
Yahoo! Instant Messenger
![Page 6: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/6.jpg)
TCPmultiple
connections
physical
data link
IP
transportTCP
buffersTCP
buffers
filetransfer text voice video
filetransfer text voice video
sender receiver
4 independent connections
![Page 7: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/7.jpg)
SCTPmultistreaming
physicaldata link
IP
transport streambuffers
streambuffers
1 association w/4 streams
filetransfer text voice video
filetransfer text voice video
sender receiver
![Page 8: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/8.jpg)
Init chunk
Type: 1 Flag: 0 Length
Initiation Tag
Outbound Streams Maximum inbound streams
Optional/Variable length parameters
Advertised receiver window credit
Initial TSN
![Page 9: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/9.jpg)
Init ack chunk
Type: 2 Flag: 0 Length
Initiation Tag
Outbound Streams Maximum inbound streams
Optional/Variable length parameters
Advertised receiver window credit
Initial TSN
Parameter Type: 7 Parameter Length
State Cookie
![Page 10: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/10.jpg)
Multistreaming (cont)
• TCP: 1 stream of data per connection • SCTP: 1 or more streams of data per
association• # of streams negotiated during association
establishment• SCTP partial ordering: ordered delivery
within each stream
![Page 11: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/11.jpg)
delivered to application
Data transfer using TCP
retransmission
receive buffer
Web serverWeb client
loss
sent from application
objects in send buffer
HOL blocking!
persistent, pipelinedTCP connection
![Page 12: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/12.jpg)
stream 1
stream 2
stream 3
delivered to application
The multistreaming advantage
retransmission
receive buffer
Web server Web clientSCTP association
loss
objects in send buffer
sent from application
![Page 13: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/13.jpg)
Streams
• Streams by definition are ordered
• Unordered data may be sent in a stream (U bit = 1)
• Sequence number is ignored for U = 1
• Unordered messages should be processed first
• Unordered messages may be used for “out-of-band” signaling, as in telnet.
![Page 14: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/14.jpg)
Application work-around to mitigate HOL blocking
• How?– Multiple persistent TCP connections to transfer
independent web objects
• Problems– Aggressive (not TCP friendly)– Possible HOL blocking within one TCP connection– No shared sequence space => Less robust to loss
detection and recovery– Increased load on web server– Increased connection establishment latency during SYN
losses
![Page 15: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/15.jpg)
Message Boundaries
![Page 16: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/16.jpg)
TCP does not preserve message boundaries
Web serverWeb client
TCP connection
Message 3
Message 2
Message 1
bytes 1 - 100
bytes 101 - 200
bytes 201 - 300
bytes 1 – 75
bytes 176 – 230
bytes 231 – 300
bytes 76 – 175
![Page 17: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/17.jpg)
SCTP preserves message boundaries
Web serverWeb client
SCTP association
Message 3
Message 2
Message 1
Message 1
Message 2
Message 3
bytes 1 - 100
bytes 101 - 200
bytes 201 - 300
bytes 1 - 100
bytes 201 - 300
bytes 101 - 200
![Page 18: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/18.jpg)
Message Boundaries
• UDP honors message boundaries– Each app message becomes a datagram
• TCP does not honor message boundaries– App messages become part of a byte stream
• SCTP maintains message boundaries– Each app message is maintained as one or more data chunks– Data flags manage message boundaries
• Simpler coding of applications– no need to do buffering, framing
• Example - DNS– Response size <= 512, UDP is used– If response size > 512, TCP is used
• Application must preface the header with message length
![Page 19: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/19.jpg)
Chunk Bundling
![Page 20: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/20.jpg)
Without bundling
end pt A end pt B
SCTP association
SCTP-PDUs SCTP-PDUs
Application
Application
A-PDUs A-PDUs
SCTP Association
![Page 21: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/21.jpg)
With bundling
end pt A end pt B
SCTP association
SCTP-PDUs SCTP-PDUs
Application
Application
SCTP Association
A-PDUs A-PDUs
![Page 22: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/22.jpg)
Bundling of Chunks in SCTP
• Control chunks bundled before data chunks• Chunk boundary cannot cross SCTP PDU boundary
Source Port Destination Port
Verification Tag
Checksum
Chunk 1
…
Chunk N
Common Header
Bundling
SCTP PDU
![Page 23: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/23.jpg)
Chunk Bundling
• Multiple chunks in one SCTP PDU
• Gain in n/w bandwidth efficiency – reduces ovhd of additional sctp and IP headers
• Path MTU is the constraint
• Control Chunks are always placed first
• Chunk boundaries do not cross SCTP PDU boundaries
• These chunks cannot be bundled– init, init ack, shutdown complete
![Page 24: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/24.jpg)
Data Transfer
![Page 25: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/25.jpg)
SCTP Chunk Format
Type Flags Length
Chunk Data
•Type – Data, Init, SACK, …
• Flags – bit meanings depend on type
• Length – includes type, flags, length, and data/parameters
![Page 26: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/26.jpg)
Data Chunk
Flags = UBE
Data
User supplied Payload Protocol Identifier
Stream Seq Num (SSN)Stream Identifier (SID)
Transmission Sequence Number (TSN)
LengthType = 0x00
0 31
used for ordering, reassembly and retransmission
used for ordering within a stream
identifies the stream to which the data chunk
belongs
used by the application and network monitoring
equipment to understand the type of data being
transmitted
![Page 27: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/27.jpg)
SACK Chunk
Type = 0x03 Flags (none) Length (variable)
Cumulative TSN ack
Advertised receiver window
Number of Gap ACK blocks = N Number of duplicates = X
Gap ACK blk #1 start TSN offset Gap ACK blk #1 end TSN offset
...
Gap ACK blk #N start TSN offset Gap ACK blk #N end TSN offset
Duplicate TSN 1
…
Duplicate TSN X
highest cumulative TSN
no. of Duplicate TSN reports
includednumber of Gap
Ack Blocks included
end offset for a range of
consecutive TSNs received
start offset for a range of consecutive
TSNs received
TSN received more than
once
![Page 28: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/28.jpg)
Data transferTSN: 1
SID: 1 SSN: 1
TSN: 2SID: 2 SSN: 1
TSN: 3SID: 1 SSN: 2
TSN: 4SID: 2 SSN: 2
ACK 4
TSN: 1
SID: 1 SSN: 1
ACK 1
end A
end B
![Page 29: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/29.jpg)
Data transfer
end A
end BTSN: 12
SID: 1 SSN: 2
ACK 12a_rwnd
TSN: 13SID: 2 SSN: 2TSN: 14SID: 1 SSN: 3
TSN: 15SID: 2 SSN: 3 ACK 12
a_rwnd
#Gaps: 1 #Dup: 0
Gap1_start: 2 Gap1_end: 3TSN: 13SID: 1 SSN: 4
TSN: 16SID: 2 SSN: 4
TSN: 17SID: 1 SSN: 5
ACK 12a_rwnd
#Gaps: 2 #Dup: 0
Gap1_start: 2 Gap1_end: 3
Gap2_start: 5 Gap2_end: 5
TSN: 10SID: 1 SSN: 1
TSN: 11SID: 2 SSN: 1
![Page 30: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/30.jpg)
Fragmentation / Reassembly
![Page 31: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/31.jpg)
SCTP fragmentation/reassembly
Web serverWeb client
SCTP association
A-PDU
SCTP-PDUs SCTP-PDUs
A-PDU
![Page 32: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/32.jpg)
Data Chunk
Reserved U B E
Data
User supplied Payload Protocol Identifier
Stream Seq Num (SSN)Stream Identifier (SID)
Transmission Sequence Number (TSN)
LengthType = 0x00
0 31
![Page 33: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/33.jpg)
Fragmentation/Reassembly Flags
U B E Description
* 1 0 (Begin) First Piece of fragmented A-PDU
* 0 0 Middle piece of fragmented A-PDU
* 0 1 (End) Last piece of fragmented A-PDU
* 1 1 Non-fragmented A-PDU
*U set to 1 specifies unordered message
Note: Fragmentation requires sequential TSNs
![Page 34: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/34.jpg)
A fragmentation example
A-PDU
second fragment
E.g. app A-PDU for Stream 2 exceeds Path-MTU
last fragment
First data fragmentSSN=1SID=2TSN=6U=0, B=1,
E=0
Part of Data Chunk Header
U=0, B=0, E=0
TSN=7 SID=2 SSN=1
U=0, B=0, E=1
TSN=8 SID=2 SSN=1
![Page 35: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/35.jpg)
SCTP - User Data Fragmentation
• Large A-PDU fragmented into DATA chunks
• To avoid intermediate routers having to deal with fragmentation
• Constrained by path MTU
• Unique TSN assigned to each DATA chunk
• Same SSN assigned to each DATA chunk
• B/E (Begin/End) bits identify fragments of user message
• U flag same as that in the original message
![Page 36: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/36.jpg)
Re-Assembly of Fragments
• Receiver checks B/E flags of DATA chunk
• User message reassembled using SSN, SID, B/E bits of DATA chunks.
• Number of fragments determined by the TSN of the first and the last fragments
![Page 37: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/37.jpg)
TSN
5TSN6²
TSN2
TSN4
TSN3
TSN5
TSN6²
TSN2
TSN3
TSN4
TSN1¹
TSN1¹
TSN6²
TSN5
TSN4
TSN3
TSN2
TSN1¹
A Large Message Transfer
A2
A1
B2
B1
receive buffer (6)
delivered to application
TSN1¹
TSN3
TSN2
sent from application
TSN4
TSN5
TSN6²
data
data
data to be sent
1 - B bit set to 12 - E bit set to 1
Path MTU = 512 octets
(2760 octets)
![Page 38: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/38.jpg)
Summary
• Multistreaming– multiple streams avoid HOL blocking
• Framing– message boundaries are preserved
• Chunk Bundling– better bandwidth usage
• Data Transfer– data chunks
• Fragmentation/Reassembly– B/E bits in data chunk
![Page 39: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/39.jpg)
THANKS !
![Page 40: Stream Control Transmission Protocol](https://reader036.vdocuments.us/reader036/viewer/2022062408/56813cd8550346895da67d1e/html5/thumbnails/40.jpg)
SCTP Vocabulary
• Association
• Chunk
• PMTU – Path Maximum Transfer Unit
• SSN – Stream Sequence Number
• SID – Stream identifier
• TSN - Transmission Sequence Number
• TCB – Transmission Control Block