Hi
I tried to simulate sctp on ns-2.28.
I have readed the paper on
http://www.lib.ncsu.edu/theses/available/etd-05162005-094333/.
According to The FAQS of the paper , I modified two parts.
1.$ns_ node-config -wiredRouting OFF
2.commented out the line
//Tcl::instance().evalf(\%s no-slot \%ld, name(), cl)
in classifier.cc
I created multihoming nodes(mobile node) in WLAN .
while i execute ... it can not work.
Then I configure the mobilenode using $ns_ node-config -multihome-core \
and
$MH addif $MH_if0
$MH addif $MH_if1
instead of
#$ns_ multihome-add-interface $MH $MH_if0
#$ns_ multihome-add-interface $MH $MH_if1
But Segmentation fault(core dump) occur.
Before I have successed ... when use mobilenode without multihoming .
But when add multihoming,the data can't be transfer.
Please help me.
Thank you very much.
My script is as following.
#
Mac/802_11 set dataRate_ 11Mb ;# 802.11b data rate
==
# Define options
#
==
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 1 ;# number of mobilenodes
set opt(adhocRouting) DSDV ;# routing protocol
set opt(x) 670 ;# x coordinate of topology
set opt(y) 670 ;# y coordinate of topology
set opt(seed) 0.0 ;# random seed
set opt(ftp-start) 100.0
set opt(cbr-start) 150.0
set opt(stop) 250 ;# time to stop simulation
# create simulator instance
set ns_ [new Simulator]
# set up for hierarchical routing
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 3
lappend cluster_num 2 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 2 1
AddrParams set nodes_num_ $eilastlevel
set tracefd [open msctp-out.tr w]
set namtrace [open msctp-out.nam w]
$ns_ use-newtrace
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)
# Here the topography object define
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
create-god [expr $opt(nn) + 2]
#Here wired nodes
set temp {0.0.0 0.1.0}
for {set i 0} {$i $num_wired_nodes} {incr i} {
set W($i) [$ns_ node [lindex $temp $i]]
}
# Configure for ForeignAgent and HomeAgent nodes
$ns_ node-config -mobileIP ON \
-adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channelType $opt(chan) \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace ON
set HA [$ns_ node 1.0.0]
$HA random-motion 0
# Position (fixed) for base-station nodes (HA FA).
$HA set X_ 1.
$HA set Y_ 2.
$HA set Z_ 0.
# Configure a mobilenode
$ns_ node-config -multihome-core \
-wiredRouting OFF \
-mobileIP OFF \
-macTrace ON
set MH [$ns_ node 0.0.0]
set MH_if0 [$ns_ node 1.0.1]
$MH addif $MH_if0
#$ns_ multihome-add-interface $MH $MH_if0
set fid_ 2
set HAaddress [AddrParams addr2id [$HA node-addr]]
[$MH_if0 set regagent_] set home_agent_ $HAaddress
# movement of the Mobile Node
$MH set Z_ 0.
$MH set Y_ 2.
$MH set X_ 2.
# links between wired and BaseStation nodes
$ns_ duplex-link $W(0) $W(1) 10Mb 5ms DropTail
$ns_ duplex-link $W(1) $HA 5Mb 2ms DropTail
$ns_ duplex-link-op $W(0) $W(1) orient down
$ns_ duplex-link-op $W(1) $HA orient left-down
# setup SCTP connections between a wired node and the MobileHost
$ns_ node-config -mobileIP OFF
set sctp1 [new Agent/SCTP]
$sctp1 set class_ 2
$ns_ multihome-attach-agent $MH_if0 $sctp1
set sink1 [new Agent/SCTP]
$ns_ attach-agent $W(0) $sink1
$ns_ connect $sctp1 $sink1
$sctp1 force-source $MH_if0
$ns_ at 200.0 $sctp1 force-source $MH_if0
$sctp1 set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $sctp1
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
$ns_ at $opt(ftp-start) $ftp start
$ns_ at $opt(stop).0 $HA reset;
$ns_ at $opt(stop).0002 puts \NS EXITING...\ ; $ns_ halt
$ns_ at $opt(stop).0001 stop
$ns_ run
--
電腦與通訊網路實驗室 網路郵局
Open WebMail
--- End of Forwarded Message ---