[ns] how to attach an iface of multifaced node to an sctp agent
Ines Kechiche
noussa.insat at gmail.com
Fri May 22 00:02:43 PDT 2009
I'm trying to simulate handover between umts and wimax through sctp
multihoming propriety.
I had to set a multifaced node to allow switching between UMTS base station
and WIMAX base station.
Unfortunately I got segment fault error while runnig the simulation.
It seems that the UMTS node_face is not proply attached to the sctp agent.
I think It's due to to $MN add_multiface-node $MN_if0 because when the
$MN_if0 is attached directly to the SCTP-agent It runs correctly.
Please can any one help me by telling me how to connect properly an iface of
a mobile node to an sctp agent.
thanks ,
below you can fing my tcl code:
global ns
Trace set show_sctphdr_ 1
set ns [new Simulator]
set f [open out.tr w]
$ns trace-all $f
set namtrace [open out.nam w]
$ns namtrace-all $namtrace
proc finish {} {
global ns namtrace
global f
$ns flush-trace
close $f
# exec nam out.nam &
#exec ./datarate out.tr datarate.res [expr $nb_mn+4] [expr $nb_mn+5]
puts " Simulation ended."
exit 0
}
$ns set debug_ 1
$ns set hsdschEnabled_ 1addr
$ns set hsdsch_rlc_set_ 1
$ns set hsdsch_rlc_nif_ 1
#$ns set dchEnabled_ 1addr
#$ns set dch_rlc_set_ 0
#$ns set dch_rlc_nif_ 0
# set up for hierarchical routing
# (needed for routing over a basestation)
$ns node-config -addressType hierarchical
AddrParams set domain_num_ 6 ;# domain number
AddrParams set cluster_num_ {1 1 1 1 1 1} ;# cluster number for each
domain
AddrParams set nodes_num_ {3 1 1 1 1 2} ;# number of nodes for each
cluster
$ns node-config -UmtsNodeType rnc \
-wiredRouting ON \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF
set rnc [$ns create-Umtsnode 0.0.0]
puts "rnc $rnc"
$ns node-config -UmtsNodeType bs\
-downlinkBW 384kbs \
-downlinkTTI 10ms \
-uplinkBW 384kbs \
-uplinkTTI 10ms \
-hs_downlinkTTI 2ms \
-hs_downlinkBW 384kbs\
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF
set bs [$ns create-Umtsnode O.O.1]
puts "bs $bs"
$ns node-config -UmtsNodeType ue \
-baseStation $bs \
-radioNetworkController $rnc
set MN_if0 [$ns create-Umtsnode 0.0.2]
puts "MN_if0 $MN_if0"
$MN_if0 set X_ 320.0
$MN_if0 set Y_ 30.0
$MN_if0 set Z_ 0.0
# Node address for sgsn0 and ggsn0 is 4 and 5, respectively.
set sgsn0 [$ns node 1.0.0]
puts "sgsn0 $sgsn0"
set sgsn0_if0 [$ns node 2.0.0]
puts "sgsn0_if0 $sgsn0_if0"
set sgsn0_if1 [$ns node 3.0.0]
puts "sgsn0_if1 $sgsn0_if1"
$ns multihome-add-interface $sgsn0 $sgsn0_if0
$ns multihome-add-interface $sgsn0 $sgsn0_if1
$ns duplex-link $rnc $sgsn0_if0 622Mbit 100ms DropTail 1000
$rnc add-gateway $sgsn0_if0
$ns setup-Iub $bs $rnc 622Mbit 622Mbit 150ms 150ms DummyDropTail 2000
#**************************************************************************************
$ns node-config -multiIf ON ;#to create
MultiFaceNode
set MN [$ns node 4.0.0]
$ns node-config -multiIf OFF ;#reset attribute
puts "MN created $MN"
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#define debug values
Mac/802_16 set debug_ 1
Mac/802_16 set rtg_ 20
Mac/802_16 set ttg_ 20
Mac/802_16 set frame_duration_ 0.008
Phy/WirelessPhy/OFDM set g_ 0.25
#define coverage area for base station: 20m coverage
Phy/WirelessPhy set Pt_ 0.025
#Phy/WirelessPhy set freq_ 2412e+6
#Phy/WirelessPhy set RXThresh_ 2.90781e-09
Phy/WirelessPhy set RXThresh_ 2.025e-12 ;#500m radius
Phy/WirelessPhy set CSThresh_ [expr 0.9*[Phy/WirelessPhy set RXThresh_]]
# Parameter for wireless nodes
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation
model
set opt(netif) Phy/WirelessPhy/OFDM ;# network interface type
set opt(mac) Mac/802_16 ;# 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(adhocRouting) DSDV ;# routing protocol
set opt(x) 1100 ;# X dimension of the topography
set opt(y) 1100 ;# Y dimension of the topography
#Mac/802_11 set basicRate_ 11Mb
#Mac/802_11 set dataRate_ 11Mb
#Mac/802_11 set bandwidth_ 11Mb
#create the topography
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
#puts "Topology created"
# Create God
create-god 9 ;# nb_mn + 2 (base station and sink node)
#puts "God node created"
#creates the Access Point (Base station)
$ns node-config -adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channel [new $opt(chan)] \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#puts "Configuration of base station"
set bstation [$ns node 5.0.0 ]
$bstation random-motion 0
puts "Base-Station(wimax) $bstation"
#provide some co-ord (fixed) to base station node
$bstation set X_ 550.0
$bstation set Y_ 550.0
$bstation set Z_ 0.0
set clas [new SDUClassifier/Dest]
[$bstation set mac_(0)] add-classifier $clas
#set the scheduler for the node. Must be changed to -shed [new $opt(sched)]
set bs_sched [new WimaxScheduler/BS]
[$bstation set mac_(0)] set-scheduler $bs_sched
[$bstation set mac_(0)] set-channel 1
$ns node-config -wiredRouting OFF \
-macTrace ON
set MN_if1 [$ns node 5.0.1]
$MN_if1 random-motion 0 ;# disable random motion
$MN_if1 base-station [AddrParams addr2id [$bstation node-addr]] ;#attach
mn to basestation
#compute position of the node
$MN_if1 set X_ 340.0
#$ns at 4.0 "$MN_if1 set X_ 80"
#$ns at 6.0 "$MN_if1 set X_ 50"
$MN_if1 set Y_ 550.0
$MN_if1 set Z_ 0.0
puts "MN_if1 $MN_if1"
$ns at 0 "$MN_if1 setdest 960.0 550.0 1.0";# debug info#
set clas [new SDUClassifier/Dest]
[$MN_if1 set mac_(0)] add-classifier $clas
#set the scheduler for the node. Must be changed to -shed [new
$opt(sched)]
set ss_sched [new WimaxScheduler/SS]
[$MN_if1 set mac_(0)] set-scheduler $ss_sched
[$MN_if1 set mac_(0)] set-channel 1
#*****************************************************************************************************
$MN add-interface-node $MN_if0
$MN add-interface-node $MN_if1
$ns duplex-link $bstation $sgsn0_if1 100MBit 15ms DropTail 1000
#******************************************************************************************************
#create source traffic
set sctp0 [new Agent/SCTP]
$ns multihome-attach-agent $sgsn0 $sctp0
$sctp0 set fid_ 0
$sctp0 set debugMask_ -1
$sctp0 set debugFileIndex_ 0
$sctp0 set mtu_ 1500
$sctp0 set dataChunkSize_ 512
$sctp0 set numOutStreams_ 1
$sctp0 set oneHeartbeatTimer_ 0 # turns off heartbeating
set trace_ch [open trace.sctp w]
$sctp0 set trace_all_ 1 # trace them all on oneline
#$sctp0 trace cwnd_
#$sctp0 trace rto_
#$sctp0 trace errorCount_
$sctp0 attach $trace_ch
set sctp1 [new Agent/SCTP]
$MN attach-agent $sctp1 $MN_if0
$sctp1 set debugMask_ -1
$sctp1 set debugFileIndex_ 1
$sctp1 set mtu_ 1500
$sctp1 set initialRwnd_ 131072
$sctp1 set useDelayedSacks_ 0
#$ns connect $sctp1 $sctp0
#Multiface node is receiver
#$MN connect-agent $sctp1 $sctp0 $MN_if0 ;# new command: specify the
interface to use
#$ns connect $sctp0 $sctp1
set ftp0 [new Application/FTP ]
$ftp0 attach-agent $sctp0
set ftp1 [new Application/FTP ]
$ftp1 attach-agent $sctp1
$MN connect-agent $sctp1 $sctp0 $MN_if0
$sctp1 listen
$ns node-config -llType UMTS/RLC/AM \
-downlinkBW 384kbs \
-uplinkBW 384kbs \
-downlinkTTI 20ms \
-uplinkTTI 20ms \
-hs_downlinkTTI 2ms \
-hs_downlinkBW 384kbs
$ns create-hsdsch $MN_if0 $sctp1
$bs trace-outlink $f 2
$MN_if0 trace-inlink $f 2
$MN_if0 trace-outlink $f 3
# we cannot start the connect right away. Give time to routing algorithm to
run
$ns color 0 Red
$ns color 1 Blue
$ns at 0.0 "$sctp0 force-source $sgsn0_if0"
$ns at 0.5 "$ftp0 start"
$ns at 10 "$ftp0 stop"
$ns at 15 "finish"
puts " Simulation is running ... please wait ..."
$ns run
>
More information about the Ns-users
mailing list