SCTP Technical Tutorial
SCTP Technical Tutorial
SCTP Technical Tutorial
John Rumsey
Senior Systems Engineer
LongReach Networks
Page 1
Page 2
PB
X
in
all
Media Gateway
Control Protocol
gn
Si
Legacy ISDN
Subscriber
X
PB
Si
gn
al
lin
g
Softswitch or
Media Gateway Controller
PBX
PBX
IP Network
Legacy ISDN
Subscriber
Media
Gateway
Media
Gateway
Page 3
PB
X
in
all
Media Gateway
Control Protocol
gn
Si
Legacy ISDN
Subscriber
X
PB
Si
gn
al
lin
g
Softswitch or
Media Gateway Controller
PBX
PBX
IP Network
Legacy ISDN
Subscriber
Media
Gateway
Media
Gateway
Page 4
PB
X
in
all
Media Gateway
Control Protocol
gn
Si
Legacy ISDN
Subscriber
X
PB
Si
gn
al
lin
g
Softswitch or
Media Gateway Controller
PBX
PBX
IP Network
Legacy ISDN
Subscriber
Media
Gateway
Media
Gateway
Page 5
PB
X
in
all
Media Gateway
Control Protocol
gn
Si
Legacy ISDN
Subscriber
X
PB
Si
gn
al
lin
g
Softswitch or
Media Gateway Controller
IP Network
Media
Gateway
PBX
PBX
Voice Connection
Legacy ISDN
Subscriber
Media
Gateway
Page 6
PBX
signalling carried?
Media
Gateway
Voice
/ RTP
/ IP
Softswitch or
Media Gateway
Controller
Page 7
Page 8
PBX
PBX Signalling
Steam Control Transmission Protocol
Media
Gateway
Softswitch or
Media Gateway
Controller
Supports the good aspects of TCP and fixes the bad aspects of TCP
Technical Tutorial Stream Control Transmission Protocol
Page 9
PBX
SCTP
Media
Gateway
Softswitch or
Media Gateway
Controller
Page 10
PBX
PBX
PBX
PBX
Signalling Gateway
Media
Gateway
Softswitch or
Media Gateway
Controller
PBX
PBX
PBX
PBX
PBX
PBX
SCTP
Page 11
PBX
PBX
PBX
PBX
Signalling Gateway
Media
Gateway
Softswitch or
Media Gateway
Controller
PBX
PBX
PBX
PBX
PBX
PBX
xUA / SCTP
Page 12
DUA/SCTP
The transport of DASS/DPNSS messages over IP
V5UA/SCTP
The transport of V5.2 messages over IP
MTP2/SCTP
The transport of Signalling System 7 Message Transfer Part 2 (SS7 MTP2) user
signalling messages over IP
MTP3/SCTP
The transport of any SS7 MTP3 - User signalling (e.g., ISUP and SCCP messages)
over IP
SUA/SCTP
The transport of any Signalling Connection Control Part - User signalling over IP
Technical Tutorial Stream Control Transmission Protocol
Page 13
Page 14
SCTP Stream
SCTP Node A
SCTP Node B
SCTP User
Application
SCTP User
Application
SCTP
Transport
Service
Same layer as
TCP and UDP
SCTP
Transport
Service
IP Network
Service
IP Network Transport
IP Network
Service
Page 15
SCTP Packets
An SCTP packet forms the payload of an IP packet
Type
Value
Length
Flags
Type
Checksum
Verification
Tag
Destination
Port
Source
Port
Flags
SCTP Header
Length
Chunk 1
Value
Chunk N
Page 16
SCTP Header
Source Port & Destination Port
- Uses same port concept as TCP and UDP
Verification
Tag
Checksum
Verification Tag
Checksum
- Protected by 32 bit checksum (CRC32
algorithm)
Destination
Port
Source
Port
SCTP Header
Page 17
Chunks
Type
Value
Length
Flags
Type
Checksum
Verification
Tag
Destination
Port
Source
Port
Flags
SCTP Header
Length
Chunk 1
Value
Chunk N
Page 18
Chunks
Type
- Used to distinguish data chunks and different
types of control chunks
Chunk
Type
Flags
Length
Value
Flags
Length
- Required because chunks have a variable
length
Value
- Payload field
Page 19
Type
Flags
Length
Value
0
Payload Data
Chunk Types
1
Initiation
2
Initiation Acknowledgement
3
Selective Acknowledgement
4
Heartbeat Request
5
Heartbeat Acknowledgement
6
Abort
7
Shutdown
8
Shutdown Acknowledgement
Chunk
9
Operation Error
10
State Cookie
11
Cookie Acknowledgement
12
Reserved for Explicit Congestion Notification Echo
13
Reserved for Congestion Window Reduced
14
Shutdown Complete
15-62 Reserved by IETF
N
2
1 1
63
IETF-defined Chunk Extensions
64-126 Reserved by IETF
127
IETF-defined Chunk Extensions
128-190 Reserved by IETF
191
IETF-defined Chunk Extensions
192-254 Reserved by IETF
255
IETF-defined
Chunk Extensions
Technical Tutorial Stream Control
Transmission
Protocol
Page 20
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
INIT-ACK chunk (contains COOKIE)
COOKIE-ECHO chunk
COOKIE-ECHOED
ESTABLISHED
COOKIE-ACK chunk
ESTABLISHED
DATA chunk(s)
Page 21
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
Endpoint
EndpointAAsends
sendsan
anInitiation
Initiationchunk
chunkand
andenters
entersthe
theCOOKIE
COOKIE
WAIT
WAITstate
state
Page 22
Chunk Flags
Chunk Length
Initiate Tag
Advertised Receiver Window Credit (a_rwnd)
Number of Outbound Streams
Length = 8
IPv4 Address
Page 23
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
INIT-ACK chunk
Endpoint
EndpointBBreceives
receivesthe
theINIT
INITChunk
Chunkand
andanalyses
analysesthe
thedata
data
From
Fromthe
thedata
dataititgenerates
generatesaasecure
securehash
hashusing
usingaasecret
secretkey
key
The
Thevalues
valuesare
arethen
thenput
putinto
intoaaCOOKIE,
COOKIE,along
alongwith
withthe
thederived
derived
message
messageauthentication
authenticationcode
code(MAC)
(MAC)
The
TheCOOKIE
COOKIEisissent
sentto
tothe
thesender
senderof
ofthe
theINIT
INITChunk
Chunkin
inan
anINIT
INIT
ACK
ACKChunk
Chunk
Endpoint
EndpointBBremains
remainsin
inthe
theCLOSED
CLOSEDSTATE
STATE
Technical Tutorial Stream Control Transmission Protocol
Page 24
Chunk Flags
Chunk Length
Initiate Tag
Advertised Receiver Window Credit (a_rwnd)
Number of Outbound Streams
Parameter Length
Parameter Value
Page 25
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
INIT-ACK chunk (contains COOKIE)
COOKIE-ECHO chunk
COOKIE-ECHOED
Endpoint
EndpointAAtakes
takesthe
theCOOKIE
COOKIEfrom
fromthe
theINIT-ACK
INIT-ACKchunk,
chunk,places
placesititininaa
COOKIE
COOKIEECHO
ECHOchunk
chunkand
andreturns
returnsititto
toEndpoint
EndpointBB
Endpoint
EndpointAAenters
entersthe
theCOOKIE-ECHOED
COOKIE-ECHOEDSTATE
STATE
Page 26
Type = 10
Chunk Flags
Length
Cookie
Page 27
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
INIT-ACK chunk (contains COOKIE)
COOKIE-ECHO chunk
COOKIE-ECHOED
Endpoint
EndpointBBunpacks
unpacksthe
thedata
datacontained
containedininthe
theCOOKIE
COOKIEand
anduses
usesthe
the
Message
MessageAuthentication
AuthenticationCode
Code(MAC)
(MAC)to
toverify
verifywhether
whetherititwas
wasthe
theoriginator
originatorof
of
this
thisCOOKIE
COOKIE
IfIfthe
theMAC
MACcomputes
computesOK,
OK,the
thedata
datavalues
valuescontained
containedininthe
theCOOKIE
COOKIEare
are
used
usedto
toinitialise
initialisethe
theSCTP
SCTPinstance
instance
Technical Tutorial Stream Control Transmission Protocol
Page 28
INIT chunk
SCTP
Endpoint B
CLOSED STATE
COOKIE-WAIT
INIT-ACK chunk (contains COOKIE)
COOKIE-ECHO chunk
COOKIE-ECHOED
ESTABLISHED
COOKIE-ACK chunk
ESTABLISHED
Page 29
Type = 11
Chunk Flags
Length = 4
Page 30
Data Transmission
SCTP
Endpoint A
ESTABLISHED
STATE
SCTP
Endpoint B
DATA chunk(s)
ESTABLISHED
STATE
Page 31
Reserv. U B E
Length
Page 32
Data Transmission
SCTP
Endpoint A
ESTABLISHED
STATE
SCTP
Endpoint B
DATA chunk
SACK chunk
ESTABLISHED
STATE
The
TheSelective
SelectiveAcknowledgement
AcknowledgementChunk
Chunkisisused
usedto
to
acknowledge
acknowledgereceived
receivedData
DataChunks,
Chunks,and
andto
toinform
inform
of
ofgaps
gapsin
inthe
thesequence
sequenceof
ofData
DataChunks
Chunks
Page 33
Chunk Flags
Chunk Length
Page 34
SCTP
Endpoint B
DATA chunk TSN=100
DATA chunk TSN=101
DATA chunk TSN=102
DATA chunk TSN=103
DATA chunk TSN=104
DATA chunk TSN=105
DATA chunk TSN=106
DATA chunk TSN=107
DATA chunk TSN=108
SACK chunk Cumulative TSN=108
Page 35
Page 36
Page 37
DATA chunk(s)
SCTP
Endpoint B
ESTABLISHED
STATE
SACK chunk
The
Theinitiator
initiatorof
ofthe
theshutdown
shutdownenters
entersSHUTDOWN
SHUTDOWN
PENDING
PENDINGstate
stateand
andwaits
waitsfor
forall
alloutstanding
outstandingdata
datato
to
be
beacknowledged
acknowledged
ItItwill
willnot
notaccept
acceptany
anynew
newdata
datafrom
fromits
itsupper
upper
layers
layersbut
butwill
willretransmit
retransmitdata
datato
toEndpoint
EndpointBBifif
necessary
necessary
Page 38
SCTP
Endpoint B
ESTABLISHED
STATE
SACK chunk
SHUTDOWN chunk
SHUTDOWN
SENT STATE
SHUTDOWN
RECEIVED STATE
Endpoint
EndpointAAsends
sendsaaSHUTDOWN
SHUTDOWNchunk
chunkto
to
Endpoint
EndpointBBand
andenters
entersthe
theSHUTDOWN
SHUTDOWNSENT
SENTstate
state
On
Onreceipt
receiptof
ofthe
theSHUTDOWN
SHUTDOWNchunk,
chunk,Endpoint
EndpointBB
enters
entersthe
theSHUTDOWN
SHUTDOWNRECEIVED
RECEIVEDstate
state
Technical Tutorial Stream Control Transmission Protocol
Page 39
Type = 7
Chunk Flags
Length = 8
Page 40
ESTABLISHED
STATE
SACK chunk
SHUTDOWN chunk
SHUTDOWN
SENT STATE
SCTP
Endpoint B
SHUTDOWN
RECEIVED STATE
SACK chunk
Endpoint
EndpointBBwaits
waitsfor
forall
alloutstanding
outstandingdata
datato
tobe
be
acknowledged
acknowledged
ItItwill
willnot
notaccept
acceptany
anynew
newdata
datafrom
fromits
itsupper
upper
layers
layersbut
butwill
willretransmit
retransmitdata
datato
toEndpoint
EndpointAAifif
necessary
necessary
Technical Tutorial Stream Control Transmission Protocol
Page 41
ESTABLISHED
STATE
SACK chunk
SHUTDOWN chunk
SHUTDOWN
SENT STATE
SCTP
Endpoint B
SHUTDOWN
RECEIVED STATE
SACK chunk
SHUTDOWN ACK chunk
SHUTDOWN ACK
SENT STATE
Endpoint
EndpointBBsends
sendsaaSHUTDOWN
SHUTDOWNACK
ACKchunk
chunkto
to
Endpoint
EndpointAAand
andenters
entersthe
theSHUTDOWN
SHUTDOWNACK
ACKSENT
SENT
state
state
Technical Tutorial Stream Control Transmission Protocol
Page 42
Type = 8
Chunk Flags
Length = 4
Page 43
SCTP
Endpoint B
SACK chunk
SHUTDOWN chunk
SHUTDOWN
SENT STATE
SHUTDOWN
RECEIVED STATE
SACK chunk
SHUTDOWN ACK chunk
CLOSED STATE
ESTABLISHED
STATE
SHUTDOWN ACK
SENT STATE
CLOSED STATE
Page 44
Type = 14
Reserved
Length = 4
Page 45
Reserved
Length
Length
Chunk Flags
One or more Error Causes
Error Cause
Cause Code
Cause Length
Page 46
Error Causes
1. Invalid Stream Identifier
2. Missing Mandatory Parameter
3. Stale Cookie Error
4. Out of Resource
5. Unresolvable Address
6. Unrecognised Chunk Type
7. Invalid Mandatory Parameter
8. Unrecognised Parameters
9. No User Data
10. Cookie Received While Shutting Down
Page 47
Multihoming Operation
Both
Boththe
theINIT
INITand
andINIT
INITACK
ACK
chunks
chunkscontain
containlists
listsof
ofIP
IP
addresses,
addresses,which
whichare
areexchanged
exchanged
during
duringINITIATION
INITIATIONof
ofassociation
association
IP address A1
INIT ACK
SCTP
Endpoint A
IP address A2
The
TheSource
SourceIP
IPAddress
Addressin
inthe
the
INIT
INITchunk
chunkisisused
usedas
asthe
the
destination
destinationaddress
addressfor
forthe
the
INIT
INITACK
ACKresponse
response
INIT
IP address B1
SCTP
Endpoint B
IP address B2
Page 48
Multihoming Operation
Endpoints will monitor data timeouts and the number of
retransmissions to determine the suitability of the path
IP address A1
SACK
SCTP
Endpoint A
IP address A2
DATA
IP address B1
DA
SCTP
Endpoint B
IP address B2
Page 49
Multihoming Operation
Retransmitted Data chunks will be sent over both paths if the
status of one path is suspect
IP address A1
SCTP
Endpoint A
IP address A2
DATA
IP address B1
SCTP
Endpoint B
DATA
IP address B2
SACK
Page 50
Multihoming Operation
All faulty paths will be marked as Out of Service
Out of Service
IP address A1
SCTP
Endpoint A
IP address A2
IP address B1
SCTP
Endpoint B
DATA
IP address B2
DA
SACK
Page 51
Multihoming Operation
Heartbeat chunks are sent periodically to all inactive IP addresses
Non responding IP addresses will be marked as Out of Service
IP address A1
Heartbeat Ack
SCTP
Endpoint A
IP address A2
Heartbeat
IP address B1
SCTP
Endpoint B
Heartbeat
IP address B2
Heartbeat Ack
Page 52
Chunk Flags
Heartbeat Length
Chunk Flags
Page 53
Congestion Control
Basically congestion is controlled by observing the number of
packets lost and modifying the transmission rate accordingly
Congestion Control Window
Represents the senders view of network conditions
Dynamically changed to suit network conditions
Page 54
Congestion Control
The
TheCongestion
CongestionControl
ControlWindow
Window
dictates
dictateshow
howmany
manyData
DataChunks
Chunks
can
canbe
betransmitted
transmittedbefore
beforeyou
youmust
must
wait
waitfor
foran
anAcknowledgement
Acknowledgement
SCTP
Endpoint A
DATA
SCTP
Endpoint B
Page 55
Congestion Control
IfIfpackets
packetsare
arebeing
beingsuccessfully
successfullydelivered
delivered
and
andacknowledged.
acknowledged. The
TheCongestion
Congestion
Control
ControlWindow
Windowwill
willbe
beincreased.
increased.
SCTP
Endpoint A
DATA DATA
SCTP
Endpoint B
Page 56
Congestion Control
IfIflost
lostpackets
packetsare
arebeing
beingexperienced,
experienced,
the
theCongestion
CongestionControl
ControlWindow
Windowwill
will
be
bereset,
reset,and
andthe
theSlow
SlowStart
Start
Threshold
Thresholdmay
maybe
belowered.
lowered.
SCTP
Endpoint
A
SACK
SACK
DATA
SCTP
Endpoint B
Page 57
Congestion Control
Receiver Buffer Window
Slow Start
Threshold
SCTP
Endpoint
A
SACK
SACK
DATA DATA
SCTP
Endpoint B
Page 58
Security Considerations
Verification Tag and Cookie Mechanisms to stop Denial of Service
Attacks
SCTP specifies the use of IPSec if strong security is required
RFC 3436 describes the usage of the Transport Layer Security (TLS)
protocol, as defined in RFC 2246, over the Stream Control
Transmission Protocol (SCTP)
Page 59