Investigating Stream Control Transmission Protocol
Download
Report
Transcript Investigating Stream Control Transmission Protocol
Investigating Stream Control
Transmission Protocol
Author: Nie Sen
Nokia 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
SCN
Signal
SG
SIGTRAN
Media
Stream
SIGTRAN
SG
SCN
Signal
SIGTRAN
MGC
MGC
MG
MG
SG : Signaling Gateway
MGC : Media Gateway Controller
MG : Media Gateway
SCN : Switched Circuit Network
Media
Stream
Where is the SCTP?
SCN Adaptation Module
Stream Control Transmission Protocol
Standard IP transport (IPv4 or IPv6)
Examples of SIGTRAN Protocol Stack
SEP
S G /S T P
MGC
TCA P
TCAP
SCC P
I W F /S C C P
SCCP
M T P3
M T P3
M 3UA
M 3UA
M T P2
M T P2
S CT P
S C TP
M T P1
IP
M T P1
SS7
IP
IP
Examples of SIGTRAN Protocol Stack
SEP
S G /S T P
MGC
S7U P
S7UP
M T P3
IW F
M T P2
M T P2
M T P1
MTP3
M 2UA
M 2UA
S CT P
S C TP
M T P1
SS7
IP
IP
IP
Multi-homing Feature of SCTP
An Association
IP path 1
IP path 2
… ...
IP path N
Host A
Host B
Both peers of an SCTP association support multiple IP address
A client informs the server about all its IP addresses with the INIT
chunk'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
An Association
Stream 0
Stream 1
Data 2/1
Data 1/1
Data 4/1
Data 3/1
… ...
Stream N
Data 6/1
Data 5/1
SCTP user
Stream 0 Stream 1
Stream N
SCTP user
Data 1/1
Data 3/1
Data 5/1
Data 2/1
Data 4/1
Data 6/1
Buffered
Buffered
Buffered
Multi-streaming Feature of SCTP (continue)
Within an association the reliable transfer of datagrams is assured by
using a checksum, a sequence number and a selective retransmission
mechanism. Without taking the initial sequence into account, every
correctly received data chunk is delivered to a second, independent
level. The sequence number is called TSN, Transport Sequence
Number
The second level realizes a flexible delivery mechanism which is based
on the notion of several independent streams of datagrams within an
association, by giving each chunk a SSN, Stream Sequence Number.
The SSN numbers are used at the receiver to determine the sequence
of delivery. SCTP performs in-sequence delivery per stream (for all
datagrams which are not marked for out-of-order delivery). This
mechanism avoids head-of-line blocking between independent streams
of datagrams within one association.
Functions of SCTP
SCTP User Adaptation
Sequenced delivery
within streams
User Data Fragmentation
Association
SCTPLayer
startup
Acknowledgement
and
Congestion Avoidance
and
takedown
Chunk Bundling
Packet Validation
Path Management
IP Network Service
Introduction of IPv6
Larger address space. IPv6 has 128-bit address space, which is 4
times wider in bits in compared to IPv4's 32-bit address space.
Better performance. IPv6 has simplified header , which can reduce the
processing effort on hosts or routers.
Better security . IPv6 includes security in the basic spec. It includes
encryption of packets (ESP: Encapsulated Security Payload) and
authentication 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 packets
belongs.
IPv6 Address Allocation
Allocation
Reserved
Unassigned
Reserved for NSAP Allocation
Reserved for IPX Allocation
Unassigned
Unassigned
Unassigned
Aggregatable Global Unicast Addresses
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Link-Local Unicast Addresses
Site-Local Unicast Addresses
Multicast Addresses
Prefix (binary)
0000 0000
0000 0001
0000 001
0000 010
0000 011
0000 1
1
1
10
11
100
101
110
1110
1111 0
1111 10
1111 110
1111 1110 0
1111 1110 10
1111 1110 11
1111 1111
IPv6 Address Allocation
The IPv6 address has 128 bits, usually written in 8 16bits’ hexadecimal
format. The preferred form is x:x:x:x:x:x:x:x, where the 'x's are the
hexadecimal values of the eight 16-bit pieces of the address.
– Unicast: An identifier for a single interface. A packet sent to a
unicast address is delivered to the interface identified by that
address.
– Anycast: An identifier for a set of interfaces (typically belonging to
different nodes). A packet sent to an anycast address is delivered
to 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 (typically
belonging to different nodes). A packet sent to a multicast
address is delivered to all interfaces identified by that
address.
IPv6 Address Allocation
A host is required to recognize the following addresses as identifying
itself:
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 and
anycast addresses
Multicast Addresses of all other groups to which the host belongs.
The procedure of enabling IPv6 support in Linux Kernel is introduced in
my 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
Process on Host 1
Process on Host 2
socket ( )
socket ( )
bind ( )
bind ( )
Connection Setup
sendmsg ( )
Get COMMUNICATION_UP
notification
( SCTP four way handshake)
Data 1
recvmsg ( )
Get COMMUNICATION_UP
recvmsg ( )
recvmsg ( )
sendmsg ( )
repeat
listen ( )
Data N
recvmsg ( )
Get the NthData
notification
Get the First Data
Get the NthData
recvmsg ( )
repeat
Data N
close ( )
Connection
Shutdown
sendmsg ( )
Get SHUTDOWN_COMPLETE
recvmsg ( )
close ( )
notification
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 Linux
with SCTP patch
Three connections shown in above figure are
configured to different network segments.
Test Network Configuration
Performance Test Plan
start
Initiate messagesize array
SCTP Process
test
0
12
1
on Host 1
Initiate remote address
Initiate local address
Creat socket sk1
Bind sk1 to local address
Initiate outmessage
Initiate inmessage
shutdown=0
loopbreak=0
i
REPEAT
1
1
sendmsg
Get start time
recvmsg
F
T
If inmessage
is notification
If notification is
SCTP_ASSOC_CHANGE
If sac_state is
=COMMUNICATION_UP
=SHUTDOWN_COMPLETE
Get ending time
Calculate RTT
printf
printf
printf
repeat =1
repeat =0
loopbreak = 1
repeat =1
repeat = 0
If repeat ==1
F
i
F
If loopbreak ==1
T
Save RTT into file
close socket sk1
test
exit
T
start
SCTP Process
test
0
12
1
on Host 2
Initiate remote address
Initiate local address
Creat socket sk2
Bind sk2 to local address
Listen sk2
Initiate outmessage
Initiate inmessage
shutdown=0
recvmsg
F
T
If inmessage
is notification
T
If notification is
SCTP_ASSOC_CHANGE
F
If sac_state is
=COMMUNICATION_UP
=SHUTDOWN_COMPLETE
outmessage = inmessage
sendmsg
If shutdown==0
F
close socket sk2
test
exit
printf
printf
printf
shutdown=0
shutdown=1
shutdown=0
T
Result Analysis - lksctp
SCTP IPv6 Performance Test Result
1600
Mean Round Trip Time
(in microseconds)
1400
1200
1000
900 931
800
993 1029
1088
1202
1134 1170
1242
1286
1355 1393
802
Mean RTT
600
400
200
0
0
100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Package Size (in bytes)
Result Analysis - lksctp
SCTP IPv4 PerformanceTest Result
1600
1400
Mean Round Trip Time
(in microseconds)
1200
1000
911
961
1003
1047
1109 1133
1176 1208
1262
1312 1345
1402
810
800
Mean RTT
600
400
200
0
0
100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Packet Size (in bytes)
Result Analysis - lksctp
TCP IPv6 Performance Test Result
800
700
674
Mean Round Trip Time
(in microseconds)
635
600
599
560
523
500
486
447
411
400
373
335
300
298
259
225
200
100
0
0
100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Packet Size (in Bytes)
MEAN RTT
Result Analysis - lksctp
TCP IPv4 Performance Test Result
700
660
625
600
589
Mean Round Trip Time
(in microseconds)
551
515
500
482
442
406
400
368
MEAN RTT
333
300
297
259
227
200
100
0
0
100
200
300
400
500
600
700
800
Packet Size (in Bytes)
900
1000 1100 1200 1300 1400
Conclusion
Both of two implementations are not stable. The
OpenSS7 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, but
still 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 to
be narrower.