400 likes | 429 Views
Stream Control Transmission Protocol. Presented by – Viren Mahajan mahajan@cis.udel.edu 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.
E N D
Stream Control Transmission Protocol Presented by – Viren Mahajan mahajan@cis.udel.edu 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
Outline of today’s talk ! • Multistreaming • Framing • Chunk Bundling • Data Transfer • Fragmentation/Reassembly
voice video file transfer text Yahoo! Instant Messenger Shall we talk SCTP?
file transfer text voice video TCP multiple connections sender receiver file transfer text voice video TCP buffers TCP buffers transport IP data link physical 4 independent connections
file transfer text voice video SCTP multistreaming sender receiver file transfer text voice video transport streambuffers streambuffers IP data link physical 1 association w/4 streams
Init chunk Type: 1 Flag: 0 Length Initiation Tag Advertised receiver window credit Outbound Streams Maximum inbound streams Initial TSN Optional/Variable length parameters
Init ack chunk Type: 2 Flag: 0 Length Initiation Tag Advertised receiver window credit Outbound Streams Maximum inbound streams Initial TSN Optional/Variable length parameters Parameter Length Parameter Type: 7 State Cookie
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
Data transfer using TCP delivered to application sent from application HOL blocking! objects in send buffer receive buffer retransmission loss persistent, pipelined TCP connection Web client Web server
The multistreaming advantage sent from application delivered to application objects in send buffer receive buffer retransmission loss stream 1 stream 2 stream 3 SCTP association Web client Web server
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.
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
TCP does not preserve message boundaries bytes 1 – 75 Message 3 bytes 201 - 300 bytes 76 – 175 Message 2 bytes 101 - 200 bytes 176 – 230 Message 1 bytes 1 - 100 bytes 231 – 300 TCP connection Web client Web server
SCTP preserves message boundaries Message 3 bytes 201 - 300 Message 1 bytes 1 - 100 Message 2 Message 2 bytes 101 - 200 bytes 101 - 200 Message 1 Message 3 bytes 1 - 100 bytes 201 - 300 SCTP association Web client Web server
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
Without bundling Application Application A-PDUs A-PDUs SCTP association SCTP-PDUs SCTP-PDUs SCTP Association end pt A end pt B
With bundling Application Application A-PDUs A-PDUs SCTP association SCTP-PDUs SCTP-PDUs SCTP Association end pt A end pt B
Bundling of Chunks in SCTP Control chunks bundled before data chunks Chunk boundary cannot cross SCTP PDU boundary Common Header SCTP PDU Bundling
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
SCTP Chunk Format • Type – Data, Init, SACK, … • Flags – bit meanings depend on type • Length – includes type, flags, length, and data/parameters
Data Chunk used for ordering within a stream used for ordering, reassembly and retransmission 0 31 Type = 0x00 Flags = UBE Length Transmission Sequence Number (TSN) Stream Identifier (SID) Stream Seq Num (SSN) User supplied Payload Protocol Identifier Data used by the application and network monitoring equipment to understand the type of data being transmitted identifies the stream to which the data chunk belongs
SACKChunk highest cumulative TSN no. of Duplicate TSN reports included number of Gap Ack Blocks included start offset for a range of consecutive TSNs received end offset for a range of consecutive TSNs received TSN received more than once
Data transfer TSN: 1 SID: 1SSN: 1 TSN: 3 SID: 1SSN: 2 ACK 4 TSN: 2 SID: 2SSN: 1 TSN: 4 SID: 2SSN: 2 TSN: 1 SID: 1 SSN: 1 ACK 1 end A end B
Data transfer TSN: 14 SID: 1SSN: 3 TSN: 13 SID: 1SSN: 4 TSN: 10 SID: 1SSN: 1 TSN: 15 SID: 2SSN: 3 TSN: 16 SID: 2SSN: 4 TSN: 11 SID: 2SSN: 1 TSN: 12 SID: 1SSN: 2 ACK 12 a_rwnd TSN: 13 SID: 2SSN: 2 TSN: 17 SID: 1SSN: 5 ACK 12 a_rwnd #Gaps: 1 #Dup: 0 Gap1_start: 2 Gap1_end: 3 ACK 12 a_rwnd #Gaps: 2 #Dup: 0 Gap1_start: 2 Gap1_end: 3 Gap2_start: 5 Gap2_end: 5 end A end B
SCTP fragmentation/reassembly A-PDU A-PDU SCTP association SCTP-PDUs SCTP-PDUs Web client Web server
Data Chunk 0 31 Type = 0x00 Reserved U B E Length Transmission Sequence Number (TSN) Stream Identifier (SID) Stream Seq Num (SSN) User supplied Payload Protocol Identifier Data
Fragmentation/Reassembly Flags • U set to 1 specifies unordered message • Note: Fragmentation requires sequential TSNs
A fragmentation example U=0, B=1, E=0 TSN=6 SID=2 SSN=1 First data fragment second fragment E.g. app A-PDU for Stream 2 exceeds Path-MTU Part of Data Chunk Header SID=2 SSN=1 U=0, B=0, E=0 TSN=7 TSN=8 U=0, B=0, E=1 SID=2 SSN=1
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
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
A Large Message Transfer data data (2760 octets) sent from application delivered to application data to be sent receive buffer (6) TSN 6² TSN 5 TSN 4 TSN 3 TSN 2 TSN 1¹ TSN 6² TSN 5 TSN 4 TSN 3 TSN 2 TSN 1¹ A1 B1 TSN 6² TSN 5 TSN 1¹ TSN 4 TSN 3 TSN 2 TSN 4 TSN 1¹ TSN 2 TSN 6² TSN 5 TSN 3 Path MTU = 512 octets A2 B2 1 - B bit set to 1 2 - E bit set to 1
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
SCTP Vocabulary • Association • Chunk • PMTU – Path Maximum Transfer Unit • SSN – Stream Sequence Number • SID – Stream identifier • TSN - Transmission Sequence Number • TCB – Transmission Control Block