Investigating Stream ControlTransmission Protocol
Author: Nie SenNokia Networks/Mobile Packet Core
Supervisor: Professor Timo Korhonen
Content
■ Framework of SIGTRAN■ Introduction of SCTP
– Multi-homing Feature– Multi-streaming Feature
■ Introduction of IPv6■ Introduction of Linux kernel implemtation of SCTP
– OpenSS7– lksctp
■ Test network configuration■ Test Result Analysis■ Conclusion
Framework of SIGTRAN
SG
MGC
MG
SG
MGC
MG
SIGTRAN
SIGTRAN SIGTRAN
SCN Signal
SCN Signal
MediaStream
MediaStream
■ SG : Signaling Gateway
■ MGC : Media Gateway Controller■ MG : Media Gateway
■ SCN : Switched Circuit Network
Where is the SCTP?
Standard IP transport (IPv4 or IPv6)
Stream Control Transmission Protocol
SCN Adaptation Module
Examples of SIGTRAN Protocol Stack
7 & $ 3
6 & & 3
0 7 3 �
0 7 3 �
0 7 3 �
0 7 3 �
0 7 3 �
0 7 3 �
0 � 8 $
6 & 7 3
,3
7 & $ 3
6 & & 3
0 � 8 $
6 & 7 3
,3
,: ) �6 & & 3
S G /S T P M G CS E P
S S 7 IP
Examples of SIGTRAN Protocol Stack
6 � 8 3
0 7 3 �
0 7 3�
0 7 3�
0 � 8 $
6 & 7 3
,3
6 � 8 3
0 7 3 �
0 � 8 $
6 & 7 3
,3
,: )
S G /S T P M G CS E P
S S 7 IP
0 7 3 �
0 7 3 �
Multi-homing Feature of SCTP
IP path 1
IP path 2
IP path N
… ...
An Association
Host AHost B
■ Both peers of an SCTP association support multiple IP address
■ A client informs the server about all its IP addresses with the INITchunk’s address parameters.
■ One of the IP paths is set as primary path, others are backup path■ The path state can be probed by sending HEARTBEAT message.
Multi-streaming Feature of SCTP
Stream 0
Stream N
Stream 1
… ...
An Association
Data 1/1Data 2/1
Data 3/1Data 4/1
Data 5/1Data 6/1
SCTP user
Data 1/1
Data 2/1
Data 3/1
Data 4/1
Data 5/1
Data 6/1
Stream 0 Stream 1 Stream N
Buffered Buffered Buffered
SCTP user
Multi-streaming Feature of SCTP (continue)
■ Within an association the reliable transfer of datagrams is assured byusing a checksum, a sequence number and a selective retransmissionmechanism. Without taking the initial sequence into account, everycorrectly received data chunk is delivered to a second, independentlevel. The sequence number is called TSN, Transport SequenceNumber
■ The second level realizes a flexible delivery mechanism which is basedon the notion of several independent streams of datagrams within anassociation, by giving each chunk a SSN, Stream Sequence Number.The SSN numbers are used at the receiver to determine the sequenceof delivery. SCTP performs in-sequence delivery per stream (for alldatagrams which are not marked for out-of-order delivery). Thismechanism avoids head-of-line blocking between independent streamsof datagrams within one association.
Functions of SCTP
Association
startup
and
takedown
Sequenced deliverywithin streams
User Data Fragmentation
Acknowledgementand
Congestion Avoidance
Chunk Bundling
Packet Validation
Path Management
SCTP User Adaptation
IP Network Service
SCTPLayer
Introduction of IPv6
■ Larger address space. IPv6 has 128-bit address space, which is 4times wider in bits in compared to IPv4’s 32-bit address space.
■ Better performance. IPv6 has simplified header , which can reduce theprocessing effort on hosts or routers.
■ Better security . IPv6 includes security in the basic spec. It includesencryption of packets (ESP: Encapsulated Security Payload) andauthentication of the sender of packets (AH: Authentication Header).
■ Better support for real time traffic . IPv6 includes flowlabel in the spec,with which routers can recognize to which end-to-end flow the packetsbelongs.
IPv6 Address AllocationAllocation Prefix (binary)
Reserved 0000 0000 Unassigned 0000 0001 Reserved for NSAP Allocation 0000 001 Reserved for IPX Allocation 0000 010 Unassigned 0000 011 Unassigned 0000 1 Unassigned 1 Aggregatable Global Unicast Addresses 1 Unassigned 10 Unassigned 11 Unassigned 100 Unassigned 101 Unassigned 110 Unassigned 1110 Unassigned 1111 0 Unassigned 1111 10 Unassigned 1111 110 Unassigned 1111 1110 0 Link-Local Unicast Addresses 1111 1110 10 Site-Local Unicast Addresses 1111 1110 11 Multicast Addresses 1111 1111
IPv6 Address Allocation
■ The IPv6 address has 128 bits, usually written in 8 16bits’ hexadecimalformat. The preferred form is x:x:x:x:x:x:x:x, where the 'x's are thehexadecimal values of the eight 16-bit pieces of the address.
– Unicast: An identifier for a single interface. A packet sent to aunicast address is delivered to the interface identified by thataddress.
– Anycast: An identifier for a set of interfaces (typically belonging todifferent nodes). A packet sent to an anycast address is deliveredto one of the interfaces identified by that address (the "nearest"one, according to the routing protocols' measure of distance).
– Multicast: An identifier for a set of interfaces (typicallybelonging to different nodes). A packet sent to a multicastaddress is delivered to all interfaces identified by thataddress.
IPv6 Address Allocation
■ A host is required to recognize the following addresses as identifyingitself:
• Its Link-Local Address for each interface
• Assigned Unicast Address• Loopback Address• All-Nodes Multicast Addresses
• Solicited-Node Multicast Address for each of its assigned unicast andanycast addresses
• Multicast Addresses of all other groups to which the host belongs.
■ The procedure of enabling IPv6 support in Linux Kernel is introduced inmy thesis, based on the instructions of http://linuxdoc.org/HOWTO/Linux+IPv6-HOWTO/
Linux Kernel Implementation of SCTP
■ OpenSS7– Download from www.openss7.org
– Red Hat Linux kernel 2.2.12-2
■ lksctp– Download from http://sourceforge.net/projects/lksctp/
– Linux kernel 2.4.1 and 2.4.17
■ Both of them are based on :– RFC2960 Stream Control Transmission Protocol– Internet Draft : draft-ietf-tsvwg-sctpsocket-02.txt
Linux Kernel Implementation of SCTP
socket ( )
sendmsg ( )
recvmsg ( )
listen ( )
bind ( )
socket ( )
close ( )
close ( )
Connection Setup
( SCTP four way handshake)
Data 1
Data N
ConnectionShutdown
repeat
repeat
sendmsg ( )
sendmsg ( )
recvmsg ( )recvmsg ( )
recvmsg ( )
recvmsg ( )Get COMMUNICATION_UP
notification
Get COMMUNICATION_UP
notification
Get the NthData
Get SHUTDOWN_COMPLETE
notification
Data N
recvmsg ( ) Get the First Data
Get the NthData
Process on Host 1 Process on Host 2
bind ( )
Linux Kernel Implementation of SCTP
■ socket() :– sd = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); /*
for IPv4 */
– sd = socket(PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP);/* for IPv6*/
■ sendmsg() and recvmsg()– ssize_t sendmsg(int socket, const struct msghdr *message, int
flags);
– ssize_t recvmsg(int socket, struct msghdr *message, int flags);
– The structure msghdr is introduced in detail in my thesis.
Test Network Configuration
■ Host1,host2 and the router are PCs running Linuxwith SCTP patch
■ Three connections shown in above figure areconfigured to different network segments.
start
test
0 12
1
i
Initiate remote addressInitiate local address
Creat socket sk1Bind sk1 to local address
Initiate outmessageInitiate inmessage
sendmsg
If inmessageis notification
If notification isSCTP_ASSOC_CHANGE
printf printf
repeat =1 repeat =0loopbreak = 1
repeat = 0
Get ending timeCalculate RTT
If repeat ==1
Save RTT into file
shutdown=0loopbreak=0
exit
=SHUTDOWN_COMPLETE=COMMUNICATION_UP
T
F
TF
Initiate messagesize array
SCTP Process
on Host 1
i
1 REPEAT
1
Get start time
recvmsg
If sac_state is
printf
repeat =1
If loopbreak ==1
close socket sk1
test
T
F
start
test
0 12
1
test
Initiate remote addressInitiate local address
Creat socket sk2Bind sk2 to local address
Initiate outmessageInitiate inmessage
recvmsg
If inmessageis notification
If sac_state is
printf printf
shutdown=0 shutdown=1
sendmsg
outmessage = inmessage
If shutdown==0
close socket sk2
shutdown=0
exit
=SHUTDOWN_COMPLETE=COMMUNICATION_UP
T
F
TF
If notification isSCTP_ASSOC_CHANGE
shutdown=0
printf
T F
SCTP Process
on Host 2
Listen sk2
Result Analysis - lksctp
SCTP IPv6 Performance Test Result
802900 931
993 10291088 1134 1170 1202 1242 1286
1355 1393
0
200
400
600
800
1000
1200
1400
1600
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Package Size (in bytes)
Mea
n R
ound
Trip
Tim
e (in
mic
rose
cond
s)
Mean RTT
Result Analysis - lksctp
SCTP IPv4 PerformanceTest Result
810
911961
10031047
1109 11331176 1208
12621312 1345
1402
0
200
400
600
800
1000
1200
1400
1600
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Packet Size (in bytes)
Mea
n R
ound
Trip
Tim
e (in
mic
rose
cond
s)
Mean RTT
Result Analysis - lksctp
TCP IPv6 Performance Test Result
225259
298335
373411
447486
523560
599635
674
0
100
200
300
400
500
600
700
800
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Packet Size (in Bytes)
Mea
n R
ou
nd
Tri
p T
ime
(in
mic
rose
con
ds)
MEAN RTT
Result Analysis - lksctpTCP IPv4 Performance Test Result
227259
297333
368406
442482
515551
589625
660
0
100
200
300
400
500
600
700
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Packet Size (in Bytes)
Me
an
Ro
un
d T
rip
Tim
e
(in
mic
rose
con
ds)
MEAN RTT
Conclusion
■ Both of two implementations are not stable. TheOpenSS7 version is too unstable to work, test failed.
■ Both of two implementations are not completed.Some of important features , such as multi-homing,are still missing.
■ The performance of SCTP is far lower than TCP, butstill matches the need for SS7 signalling.
■ IPv6 gives more performance than IPv4.■ As the packet size increases towards the MTU size,
the performance gap of the SCTP and TCP begins tobe narrower.