Dear all:
I have a script that implements traffic UDP over a topology that involves
satellital, terminal, fixed and wireless nodes together. However, I haven't
found the error that is causing a "Segmentation fault (core dumped)". The
script is the following:
#---------------------------------------------
global ns
set ns [new Simulator]
# Global configuration parameters
# We'll set these global options for the satellite geo
global opt
set opt(chan) Channel/Sat
set opt(bw_up) 2Mb
set opt(bw_down) 2Mb
set opt(phy) Phy/Sat
set opt(mac) Mac/Sat
set opt(ifq) Queue/DropTail
set opt(qlim) 50
set opt(ll) LL/Sat
set opt(wiredRouting) OFF
set numsat 3
set numeb 2
set outfile [open out.tr w]
$ns trace-all $outfile
$ns node-config -satNodeType geo \
-llType $opt(ll) \
-ifqType $opt(ifq) \
-ifqLen $opt(qlim) \
-phyType $opt(phy) \
-macType $opt(mac) \
-channelType $opt(chan) \
-downlinkBW $opt(bw_down) \
-wiredRouting $opt(wiredRouting)
#Creation of satellital nodes
for {set i 0} {$i < $numsat} {incr i} {
set nsat($i) [$ns node]
}
#Position of satellital nodes
$nsat(0) set-position -55
$nsat(1) set-position -70
$nsat(2) set-position -85
#Creation of intersatellital links (nsat(0)<--->nsat(1)<--->nsat(2))
$ns add-isl interplane $nsat(0) $nsat(1) $opt(bw_down) $opt(ifq) \
$opt(qlim)
$ns add-isl interplane $nsat(1) $nsat(2) $opt(bw_down) $opt(ifq) \
$opt(qlim)
#Configuration of terminal(base-stations) nodes
$ns node-config -satNodeType terminal \
-llType $opt(ll) \
-ifqType $opt(ifq) \
-ifqLen $opt(qlim) \
-macType $opt(mac) \
-phyType $opt(phy) \
-channelType $opt(chan) \
-downlinkBW $opt(bw_down) \
-wiredRouting $opt(wiredRouting)
#Creation of base-stations nodes
for {set j 0} {$j < $numeb} {incr j} {
set eb($j) [$ns node]
}
#Position of base-station nodes over Ecuator parallel
$eb(0) set-position 0 -55
$eb(1) set-position 0 -85
#Creation of links between satellite and base-stations (eb(0)<--->nsat(0) and
nsat(2)<--->eb(1))
$eb(0) add-gsl geo $opt(ll) $opt(ifq) $opt(qlim) $opt(mac) $opt(bw_up) \
$opt(phy) [$nsat(0) set downlink_] [$nsat(0) set uplink_]
$eb(1) add-gsl geo $opt(ll) $opt(ifq) $opt(qlim) $opt(mac) $opt(bw_up) \
$opt(phy) [$nsat(2) set downlink_] [$nsat(2) set uplink_]
#Tracing satellital links
$ns trace-all-satlinks $outfile
#Options for wireless nodes
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 5 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set topo [new Topography]
$topo load_flatgrid 500 500
create-god $val(nn)
#Configuration for wireless nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF
#Creation of wireless nodes
for {set k 0} {$k < $val(nn) } {incr k} {
set nmov($k) [$ns node]
$nmov($k) set random-motion 1
}
#Disabling satellital node type
$ns unset satNodeType_
#Configuration of fixed nodes (by default)
$ns node-config -reset
#Creation of fixed nodes
for {set l 0} {$l < $numeb} {incr l} {
set nfijo($l) [$ns node]
}
#Creation of wired links between base-stations and fixed nodes
#$eb(0)<--->$nfijo(0)
$ns duplex-link $nfijo(0) $eb(0) 5Mb 2ms DropTail
#$eb(1)<--->$nfijo(1)
$ns duplex-link $nfijo(1) $eb(1) 5Mb 2ms DropTail
#Creation of links between between fixed and wireless nodes
#$nmov(0)<--->$nfijo(0)
$ns duplex-link $nmov(0) $nfijo(0) 5Mb 2ms DropTail
#$nmov(1)<--->$nfijo(0)
$ns duplex-link $nmov(1) $nfijo(0) 5Mb 2ms DropTail
#$nmov(2)<--->$nfijo(1)
$ns duplex-link $nmov(2) $nfijo(1) 5Mb 2ms DropTail
#$nmov(3)<--->$nfijo(1)
$ns duplex-link $nmov(3) $nfijo(1) 5Mb 2ms DropTail
#$nmov(4)<--->$nfijo(1)
$ns duplex-link $nmov(4) $nfijo(1) 5Mb 2ms DropTail
#Creation and attaching of UDP Agent to nmov(0) (origin of traffic)
set udp [new Agent/UDP]
$ns attach-agent $nmov(0) $udp
#Setting and attaching of traffic type
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
#$cbr set interval_ 60.01
#Creation of Null Agent (target of traffic)
set nulo [new Agent/Null]
$ns attach-agent $nmov(4) $nulo
#Connection between agents (agent level connecion)
$ns connect $udp $nulo
$ns at 1.0 "$cbr start"
$ns at 2.0 "$cbr stop"
$ns at 3.0 "finish"
#$ns at 4.0 "$ns halt"
proc finish {} {
global ns outfile
$ns flush-trace
close $outfile
exit 0
}
$ns run
#--------------------------------------
I agree any help that you can offer me.
Thanks all:
Juan Carlos Otálora Caro