Вы находитесь на странице: 1из 65

Chapter 13

Stream Control
Transmission Protocol
Objectives
Upon completion you will be able to:
Be able to name and understand the services offered by SCTP
Understand SCTPs flow and error control and congestion control
Be familiar with the fields in a SCTP segment
Understand the phases in an SCTP association
Understand the SCTP state transition diagram
TCP/IP Protocol Suite

Figure 13.1

TCP/IP Protocol Suite

TCP/IP protocol suite

SCTP combines the better features of UDP and TCP


SCTP is reliable, message-oriented (preserves the message
boundaries and at the same time detects lost data, duplicate
data and out of order data)
It also has congestion control and flow control mechanisms.
SCTP uses all well-known ports in the TCP space.
Table 13.1 lists some extra port numbers used by SCTP.

Table 13.1 Some SCTP applications

TCP/IP Protocol Suite

Figure 13.2

Multiple-stream concept

In TCP, each connection between a client and a server involve


a single stream and is called an association in SCTP.
SCTP allows multiple streams. If one stream is blocked, the
other streams can still deliver data. Very useful for real-time
applications.

TCP/IP Protocol Suite

Note:
SCTP association allows multiple IP
addresses for each end.

TCP/IP Protocol Suite

Figure 13.3

Multihoming concept

Multiple sources and multiple receivers allows


for a fault-tolerant approach

TCP/IP Protocol Suite

Note:
In SCTP, a data chunk is numbered
using a TSN.

TCP/IP Protocol Suite

Note:
To distinguish between different
streams, SCTP uses a SI.

TCP/IP Protocol Suite

Note:
To distinguish between different data
chunks belonging to the same stream,
SCTP uses SSNs.

TCP/IP Protocol Suite

Figure 13.4

TCP/IP Protocol Suite

Comparison between a TCP segment and an SCTP packet

10

Figure 13.4

Comparison between a TCP segment and an SCTP packet

An association may send many packets, a packet may contain


several chunks, and chunks may belong to different streams.
SCTP control info is in the Control chunk.
Data chunks can carry data from multiple streams.
No options section. Options in SCTP are handled by defining n
Chunk types.
SCTP header is smaller only 12 bytes
SCTP uses a 32-bit checksum

TCP/IP Protocol Suite

11

Note:
TCP has segments;
SCTP has packets.

TCP/IP Protocol Suite

12

Note:
In SCTP, control information and data
information are carried in separate
chunks.

TCP/IP Protocol Suite

13

Figure 13.5

TCP/IP Protocol Suite

Packet, data chunks, and streams

14

Note:

Transmission Sequence Number (TSN)


Stream Identifier (SI)
Stream Sequence Number (SSN)

Data chunks are identified by three


identifiers: TSN, SI, and SSN.
TSN is a cumulative number
identifying the association; SI defines
the stream; SSN defines the chunk in
a stream.
TCP/IP Protocol Suite

15

Note:
In SCTP, acknowledgment numbers
are used to acknowledge only data
chunks; control chunks are
acknowledged by other control chunks
if necessary.

TCP/IP Protocol Suite

16

13.3 PACKET FORMAT


We show the format of a packet and different types of chunks. An SCTP
packet has a mandatory general header and a set of blocks called
chunks. There are two types of chunks: control chunks and data chunks.

The topics discussed in this section include:


General Header
Chunks

TCP/IP Protocol Suite

17

Figure 13.6

TCP/IP Protocol Suite

SCTP packet format

18

Note:
In an SCTP packet, control chunks
come before data chunks.

TCP/IP Protocol Suite

19

Figure 13.7 General header


General header always comes first.
Verification tag: a number that matches a packet to an
association.
There is a verification used for each direction in the
association.
CRC-32 checksum.

TCP/IP Protocol Suite

20

Figure 13.8

Common layout of a chunk

Control chunks come before data chunks.


Type: can define up to 256 types of chunks (only a few
have been defined so far; the rest are reserved for
future use.
Flag: define special flags that a particular chunk may
need. Each bit has a different meaning depending on
the type of the chunk.

Length: is needed because the size of the information


section is dependent on the type of the chunk.
Defines the total size of the chunk, in bytes, including the
type, flag, and length fields.
TCP/IP Protocol Suite

21

Note:
Chunks need to terminate on a 32-bit
(4 byte) boundary.

TCP/IP Protocol Suite

22

Table 13.2 Different type of Chunks

TCP/IP Protocol Suite

23

Note:
The number of padding bytes are not
included in the value of
the length field.

TCP/IP Protocol Suite

24

Figure 13.9

DATA chunk

To indicate which
protocol the SCTP is
carrying

U bit: a 1 signals unordered data(SSN is ignored); 0 is ordered data (d


The message carrying the chunk is delivered to the application
without waiting for the other messages (even if it is out of order)
B=1 and E=1? No fragmentation, whole message in one chunk
B=1 and E=0? First fragment, B=0 and E=1? Last fragment
B=0 and E=0? Middle fragment
TCP/IP Protocol Suite

25

Note:
A DATA chunk cannot carry data belonging
to more than one message, but a message
can be split into several chunks.
The data field of the DATA chunk must carry
at least one byte of data, which means the
value of length field cannot be
less than 17.
TCP/IP Protocol Suite

26

Figure 13.10

INIT chunk (initiation chunk)

INIT chunk is the first chunk sent by an end point to


establish an association.
TCP/IP Protocol Suite

27

Initiation tag

Defines the value of the verification tag for


packets travelling in the opposite direction.
This tag is the same for all packets travelling in
one direction in an association.
Is determined during association
establishment.
random number -> (1 and 2 32 1).
0 -> no association -> permitted only by the
general header of the INIT chunk.

Advertised receiver window credit

Used in flow control and defines the initial


amount of data in bytes the sender of INIT
chunk can allow.
In SCTP, sequence numbers are in terms of
chunks.

TCP/IP Protocol Suite

28

Outbound stream

Maximum inbound stream

Defines the maximum number of streams that the


initiator of the association can support in the inbound
direction.
Cant be increased by the other end.

Initial TSN

Defines the number of streams that the initiator of the


association suggests for streams in the outbound
direction.

Initializes the TSN in the outbound direction.


< 232.

Variable length parameters

Optional parameters that may be added to define the IP


address of sending end point, the number of IP
addresses the end point can support (multihome) and
other parameters.
For example, Parameter type = 5. This parameter lists
all the IPV4 addresses used at the sending endpoint.

TCP/IP Protocol Suite

29

Note:
No other chunk can be carried in a
packet that carries an INIT chunk.

TCP/IP Protocol Suite

30

Figure 13.11 INIT ACK chunk

The INIT ACK


chunk is the
second packet
sent during
association
establishment.

TCP/IP Protocol Suite

Parameter type: defines the state cookie


sent by the sender of this chunk.

31

Note:
No other chunk can be carried in a
packet that carries an
INIT ACK chunk.

TCP/IP Protocol Suite

32

Figure 13.12

COOKIE ECHO chunk

The COOKIE ECHO chunk is the third chunk sent


during association establishment.
It is sent by the end point that receives an INIT ACK
chunk.
Can also carry user data.

TCP/IP Protocol Suite

33

Figure 13.13

COOKIE ACK

The COOKIE ACK chunk is the fourth and last chunk


sent during association establishment.
It is sent by the end point that receives a COOKIE
ECHO chunk.
Can also carry user data.

TCP/IP Protocol Suite

34

Figure 13.14

TCP/IP Protocol Suite

SACK chunk

35

Cumulative TSN acknowledgement

Advertised receiver window credit

Is the updated value for the receiver window


size.

Number of gap ACK blocks

Defines the TSN of the last data chunk


received in sequence.

Defines the number of gaps in the data


chunk received after the cumulative TSN.
The gap defines the sequence of received
chunks, not the missing chunks.

Number of duplicates

Defines the number of duplicate chunks


following the cumulative TSN.

TCP/IP Protocol Suite

36

Gap ACK block start offset

Gap ACK block end offset

For each gap block, it gives the starting


TSN relative to the cumulative TSN.
For each gap block, it gives the ending
TSN relative to the cumulative TSN.

Duplicate TSN

For each duplicate chunk, it gives the


TSN of the chunk.

TCP/IP Protocol Suite

37

Figure 13.15

HEARTBEAT and HEARTBEAT ACK chunks

Heartbeat: probes the peer for liveliness.


Heartbeat ACK: Acknowledges heartbeat chunk.

Sender-specific information: includes the local


time and the IP address of the sender.
It is copied without change into the heartbeat
ACK chunk.
TCP/IP Protocol Suite

38

Figure 13.16

SHUTDOWN, SHUTDOWN ACK, and SHUTDOWN


COMPLETE chunks

The T flag shows that the sender does not have


Transmission control block (TCB) table which holds info
about each connection.

TCP/IP Protocol Suite

39

Figure 13.17

ERROR chunk

The error chunk is sent when an end point finds some


error in a received packet.
The sending of an error chunk does not imply the
aborting of the association.
TCP/IP Protocol Suite

40

Table 13.3 Errors

TCP/IP Protocol Suite

41

Figure 13.18

ABORT chunk

The abort chunk is sent when an end point finds a fatal


error and needs to abort the association.
One or more error cause: 1-Invalid Stream Identifier, 2Missing Mandatory Parameter, 9- No User Data
TCP/IP Protocol Suite

42

13.4 AN SCTP ASSOCIATION


SCTP, like TCP, is a connection-oriented protocol. However, a
connection in SCTP is called an association to emphasize multihoming

The topics discussed in this section include:


Association Establishment
Data Transfer
Association Termination
Association Abortion

TCP/IP Protocol Suite

43

Figure 13.19

TCP/IP Protocol Suite

Four-way handshaking

44

Note:
No other chunk is allowed in a packet
carrying an INIT or INIT ACK chunk.
A COOKIE ECHO or a COOKIE ACK
chunk can carry DATA chunks.

TCP/IP Protocol Suite

45

Note:
In SCTP, only DATA chunks consume
TSNs;
DATA chunks are the only chunks that
are acknowledged.

TCP/IP Protocol Suite

46

Figure 13.20

Simple data transfer

Note: cumTSN
does not point
to next TSN
expected!

TCP/IP Protocol Suite

47

Note:
The acknowledgment in SCTP defines
the cumulative TSN, the TSN of the
last DATA chunk received in order.

TCP/IP Protocol Suite

48

Figure 13.21

Association termination

SCTP does not allow a half-closed


association.

TCP/IP Protocol Suite

49

Figure 13.22

TCP/IP Protocol Suite

Association abortion

50

13.5 STATE TRANSITION DIAGRAM


To keep track of all the different events happening during association
establishment, association termination, and data transfer, the SCTP
software, like TCP, is implemented as a finite state machine.

The topics discussed in this section include:


Scenarios
Simultaneous Close

TCP/IP Protocol Suite

51

Figure 13.23

TCP/IP Protocol Suite

State transition diagram

52

Table 13.4 States for SCTP

TCP/IP Protocol Suite

53

Figure 13.24

TCP/IP Protocol Suite

A common scenario of states

54

Figure 13.25

TCP/IP Protocol Suite

Simultaneous open

55

Figure 13.26

TCP/IP Protocol Suite

Simultaneous close

56

13.6 FLOW CONTROL


Flow control in SCTP is similar to that in TCP. In SCTP, we need to
handle two units of data, the byte and the chunk.

The topics discussed in this section include:


Receiver Site
Sender Site
A Scenario

TCP/IP Protocol Suite

57

Figure 13.27

TCP/IP Protocol Suite

Flow control, receiver site

58

Figure 13.28

TCP/IP Protocol Suite

Flow control, sender site

59

Figure 13.29

Flow control scenario

rwnd and winSize agreed upon during init phase to be 20

TCP/IP Protocol Suite

60

13.7 ERROR CONTROL


SCTP uses a SACK chunk to report the state of the receiver buffer to the
sender. Each implementation uses a different set of entities and timers
for the receiver and sender sites.

The topics discussed in this section include:


Receiver Site
Sender Site
Sending Data Chunks
Generating SACK Chunks

TCP/IP Protocol Suite

61

Figure 13.30

TCP/IP Protocol Suite

Error control, receiver site

62

Figure 13.31

TCP/IP Protocol Suite

Error control, sender site

63

Figure 13.32

TCP/IP Protocol Suite

New state at the sender site after receiving a SACK chunk

64

13.8 CONGESTION CONTROL


SCTP uses the same strategies for congestion control as TCP. SCTP uses
slow start, congestion avoidance, and congestion detection phases.

TCP/IP Protocol Suite

65

Вам также может понравиться