#64 SCTP reports error, unusable.

ns-2 (62)
Lloyd Wood

Attempted to use SCTP agent in script. Got error:
SCTP ERROR: number of unreliable streams (24407) > total (17742)
this was previously reported in 2005. SCTP appears unusable.

set ns [new Simulator]

set f [open lloyd-out-sctp.tr w]
$ns trace-all $f
set nf [open lloyd-out-sctp.nam w]
$ns namtrace-all $nf

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 64kb 250ms DropTail

Agent/SCTP set debugMask_ -1

set sctp0 [new Agent/SCTP]
$ns attach-agent $n0 $sctp0
$sctp0 set packetSize_ 500

# all this to work around a bug - but doesn't work
# SCTP ERROR: number of unreliable streams (24407) > total (17742)
# http://mailman.isi.edu/pipermail/ns-users/2005-February/047222.html
# reported by Ali Raza Jafri in 2005.
$sctp0 set debugMask_ 0
$sctp0 set numUnrelStreams_ 0

set e0 [new Application/Traffic/Exponential]
$e0 attach-agent $sctp0
$e0 set burst_time_ 500ms
$e0 set idle_time_ 500ms
$e0 set rate_ 16k
$e0 set packetSize_ 799

$e0 attach-agent $sctp0

set sink0 [new Agent/SCTP]
$ns attach-agent $n1 $sink0
$sink0 listen
# all this to work around a bug
# SCTP ERROR: number of unreliable streams (24407) > total (17742)
$sink0 set numUnrelStreams_ 0

$ns connect $sctp0 $sink0
$ns at 1.0 "$e0 start"
$ns at 50.0 "finish"

proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf

exit 0


$ns run


  • Tom Henderson

    Tom Henderson - 2011-11-04

    Comment from Nasif Ekiz (with proposed fix):

    Lloyd uses a Application/Traffic/Exponential application on top of SCTP agent.
    SCTP agent expects the SCTP-aware application (in that case Application/Traffic/Exponential) to fill AppData_S structure and pass
    it to the SCTP transport as shown in ns-allinone-2.34/ns-2.34/apps/sctp_app1.cc. Also ns-allinone-2.34/ns-2.34/sctp/sctp.README
    explains the use of SCTP-aware applications. The bug is caused since the variables of AppData_S such as usNumUnreliable,
    usStreamId, usReliability, eUnordered, uiNumBytes are not filled appropriately before the


    is called in ns-allinone-2.34/ns-2.34/tools/expoo.cc (Application/Traffic/Exponential).

    In Application/Traffic/Exponential, there should be a statement to check if agent is of SCTP type
    and fill the AppData_S accordingly and pass it to the sendmsg function.

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here


    Anonymous - 2011-11-06

    In fact , when Im tried to run this script I got the same error msg:

    " SCTP ERROR: number of unreliable streams (24407) > total (17742) "

    Why Im not get nam and graph as a results?

    Last edit: Anonymous 2016-12-30

Log in to post a comment.