Hi every body
I installed SIP on ns2.27 on my ubuntu10.4
when I run the sample script of it, it runs successfully. (sip_example.tcl)
byt when I want to change a UA, and replace it with a wireless node, instead of a wired node, I get this error:
segmentation Fault!
here is my code that runs with error:
Code:
###########################################################################
# SIP+Wireless??
###########################################################################
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) 2 ;# number of mobilenodes+BS
set opt(adhocRouting) DSDV ;# routing protocol
set opt(x) 250 ;# x coordinate of topology
set opt(y) 250 ;# y coordinate of topology
set opt(seed) 0.0 ;# random seed
set opt(stop) 100 ;# time to stop simulation
set opt(ftp1-start) 25.0
#//*********************************************************************//
set ns [new Simulator]
$ns set-address-format hierarchical
# set up for hierarchical routing
$ns node-config -addressType hierarchical
AddrParams set domain_num_ 3 ;# number of domains
lappend cluster_num 1 2 2 ;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 2 2 2 2 ;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel ;# of each domain
# Initializations
set tf [open out_sip_test.tr w]
set nf [open out_sip_test.nam w]
$ns trace-all $tf
#$ns namtrace-all $nf
$ns namtrace-all-wireless $tf $opt(x) $opt(y)
# Create topography object
set topo [new Topography]
# define topology
$topo load_flatgrid $opt(x) $opt(y)
# create God
create-god [expr $opt(nn)]
#XXX TODO create god check shavad!!!
#set god_ [God instance]
#$god_ set-dist 1 2 2
#$god_ set-dist 0 2 3
#$god_ set-dist 0 1 1
# Routers
set n0 [$ns node 0.0.0]
set n1 [$ns node 1.0.0]
#proxy of domain2
set n5 [$ns node 1.0.1]
set n3 [$ns node 1.1.0]
#fix Terminal: CN
set n7 [$ns node 1.1.2]
set n2 [$ns node 2.0.0]
#proxy for domain3
set n6 [$ns node 2.0.1]
# create a mobilenode that would be mov
#Proxiy 2
#$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) \#
# -topoInstance $topo \
# -wiredRouting ON \#
# -agentTrace ON \
# -routerTrace OFF \
# -macTrace OFF \
# configure for base-station node
set chan_1_ [new $opt(chan)]
$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) \
-channelType $opt(chan) \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF
#base station for MN
set n4 [$ns node 2.1.0]
$n4 random-motion 0 ;# disable random motion
# mobile Terminal: MN
$ns node-config -wiredRouting OFF
set n8 [$ns node 2.1.1]
$n8 base-station [AddrParams addr2id \
[$n4 node-addr]]
#$n8 base-station [2.1.0]
# Set nodes' positions
$n0 set X_ 100
$n0 set Y_ 150
$n1 set X_ 60
$n1 set Y_ 110
$n2 set X_ 140
$n2 set Y_ 110
$n3 set X_ 60
$n3 set Y_ 60
$n4 set X_ 140
$n4 set Y_ 60
$n5 set X_ 10
$n5 set Y_ 110
$n6 set X_ 190
$n6 set Y_ 110
$n7 set X_ 60
$n7 set Y_ 10
$n8 set X_ 140
$n8 set Y_ 10
# Set nodes' colors
$n0 color black
$n1 color black
$n2 color black
$n3 color black
$n4 color black
$n5 color orange
$n6 color orange
$n7 color blue
$n8 color blue
# Routers
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n0 $n2 1Mb 10ms DropTail
$ns duplex-link $n1 $n3 1Mb 10ms DropTail
$ns duplex-link $n2 $n4 1Mb 10ms DropTail
# Proxies
$ns duplex-link $n1 $n5 1Mb 10ms DropTail
$ns duplex-link $n2 $n6 1Mb 10ms DropTail
# Terminals
$ns duplex-link $n3 $n7 1Mb 10ms DropTail
#$ns duplex-link $n4 $n8 1Mb 10ms DropTail
# Proxy servers
$n5 label "proxy.atlanta.com"
set serveraddrATL [$n5 node-addr]
set sipATL [new Agent/SIPProxy atlanta.com]
$ns attach-agent $n5 $sipATL
$n6 label "proxy.biloxi.com"
set serveraddrBLX [$n6 node-addr]
set sipBLX [new Agent/SIPProxy biloxi.com]
$ns attach-agent $n6 $sipBLX
# User agents
$n7 label "alice@atlanta.com"
set sipalice [new Agent/SIPUA alice atlanta.com]
$ns attach-agent $n7 $sipalice
$n4 label "bob@biloxi.com"
#$n8 label "bob@biloxi.com"
set sipbob [new Agent/SIPUA bob biloxi.com]
#$ns attach-agent $n8 $sipbob
$ns attach-agent $n4 $sipbob
# Setup outbound proxies
$sipalice set-proxy $serveraddrATL
$sipbob set-proxy $serveraddrBLX
# Set Record-Route on proxies
$sipATL set recordRoute_ 1
$sipBLX set recordRoute_ 1
# Register proxies with DNS "God"
DNSGod register proxy atlanta.com $serveraddrATL
DNSGod register proxy biloxi.com $serveraddrBLX
#finish procedure
proc finish {} {
global ns tf nf
$ns flush-trace
close $tf
close $nf
puts "NS-simulation finished!"
exit 0
}
# Put nodes in place again
$ns at 0.0 "$ns dump-namnodes"
# Configure one terminal for complex response, waiting between 1 and 3
# seconds after ringing to pick up the phone
$sipbob set simple_ 0
$sipbob set minAnsDel_ 1.0
$sipbob set maxAnsDel_ 3.0
# Register nodes at home
$ns at 1.0 "$ns trace-annotate \"Registering alice@atlanta.com\""
$ns at 1.0 "$sipalice register"
$ns at 1.1 "$ns trace-annotate \"Registering bob@biloxi.com\""
$ns at 1.1 "$sipbob register"
# Sessions
$ns at 5.0 "$ns trace-annotate \"alice@atlanta.com starts session to bob@biloxi.com\""
$ns at 5.0 "$sipalice invite bob biloxi.com bw 32kb 64kb"
$ns at 10.0 "$ns trace-annotate \"bob@biloxi.com ends session to alice@atlanta.com (any side may terminate the call)\""
$ns at 10.0 "$sipbob bye"
# setup TCP connections between a wired node and the MobileHost
#set udp1 [new Agent/UDP]
#$udp1 set class_ 2
#set null [new Agent/Null]
#$ns attach-agent $n7 $udp1
#$ns attach-agent $n8 $null
#$ns connect $udp1 $null
#set cbr1 [new Application/Traffic/CBR]
#$cbr1 attach-agent $udp1
#$cbr1 set PacketSize_ 1000
#$cbr1 set rate_ 0.01Mb
#$ns at 20 "$cbr1 start"
$ns at 100.0 "finish"
$ns at $opt(stop).0 "$n8 reset";
$ns initial_node_pos $n8 20
$ns flush-trace
$ns run
and it's the original code that runs successfully:
Code:
set ns [new Simulator]
$ns set-address-format hierarchical
AddrParams set domain_num_ 3
# Initializations
set tf [open out_sip_test.tr w]
set nf [open out_sip_test.nam w]
$ns trace-all $tf
$ns namtrace-all $nf
# Routers
set n0 [$ns node 0.0.0]
set n1 [$ns node 1.0.0]
set n2 [$ns node 2.0.0]
set n3 [$ns node 1.1.0]
set n4 [$ns node 2.1.0]
# Proxies
set n5 [$ns node 1.0.1]
set n6 [$ns node 2.0.1]
# Terminals
set n7 [$ns node 1.1.2]
set n8 [$ns node 2.1.2]
# Set nodes' positions
$n0 set X_ 100
$n0 set Y_ 150
$n1 set X_ 60
$n1 set Y_ 110
$n2 set X_ 140
$n2 set Y_ 110
$n3 set X_ 60
$n3 set Y_ 60
$n4 set X_ 140
$n4 set Y_ 60
$n5 set X_ 10
$n5 set Y_ 110
$n6 set X_ 190
$n6 set Y_ 110
$n7 set X_ 60
$n7 set Y_ 10
$n8 set X_ 140
$n8 set Y_ 10
# Set nodes' colors
$n0 color black
$n1 color black
$n2 color black
$n3 color black
$n4 color black
$n5 color orange
$n6 color orange
$n7 color blue
$n8 color blue
# Routers
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n0 $n2 1Mb 10ms DropTail
$ns duplex-link $n1 $n3 1Mb 10ms DropTail
$ns duplex-link $n2 $n4 1Mb 10ms DropTail
# Proxies
$ns duplex-link $n1 $n5 1Mb 10ms DropTail
$ns duplex-link $n2 $n6 1Mb 10ms DropTail
# Terminals
$ns duplex-link $n3 $n7 1Mb 10ms DropTail
$ns duplex-link $n4 $n8 1Mb 10ms DropTail
# Proxy servers
$n5 label "proxy.atlanta.com"
set serveraddrATL [$n5 node-addr]
set sipATL [new Agent/SIPProxy atlanta.com]
$ns attach-agent $n5 $sipATL
$n6 label "proxy.biloxi.com"
set serveraddrBLX [$n6 node-addr]
set sipBLX [new Agent/SIPProxy biloxi.com]
$ns attach-agent $n6 $sipBLX
# User agents
$n7 label "alice@atlanta.com"
set sipalice [new Agent/SIPUA alice atlanta.com]
$ns attach-agent $n7 $sipalice
$n8 label "bob@biloxi.com"
set sipbob [new Agent/SIPUA bob biloxi.com]
$ns attach-agent $n8 $sipbob
# Setup outbound proxies
$sipalice set-proxy $serveraddrATL
$sipbob set-proxy $serveraddrBLX
# Set Record-Route on proxies
$sipATL set recordRoute_ 1
$sipBLX set recordRoute_ 1
# Register proxies with DNS "God"
DNSGod register proxy atlanta.com $serveraddrATL
DNSGod register proxy biloxi.com $serveraddrBLX
#finish procedure
proc finish {} {
global ns tf nf
$ns flush-trace
close $tf
close $nf
puts "NS-simulation finished!"
exit 0
}
# Put nodes in place again
$ns at 0.0 "$ns dump-namnodes"
# Configure one terminal for complex response, waiting between 1 and 3
# seconds after ringing to pick up the phone
$sipbob set simple_ 0
$sipbob set minAnsDel_ 1.0
$sipbob set maxAnsDel_ 3.0
# Register nodes at home
$ns at 1.0 "$ns trace-annotate \"Registering alice@atlanta.com\""
$ns at 1.0 "$sipalice register"
$ns at 1.1 "$ns trace-annotate \"Registering bob@biloxi.com\""
$ns at 1.1 "$sipbob register"
# Sessions
$ns at 5.0 "$ns trace-annotate \"alice@atlanta.com starts session to bob@biloxi.com\""
$ns at 5.0 "$sipalice invite bob biloxi.com bw 32kb 64kb"
$ns at 10.0 "$ns trace-annotate \"bob@biloxi.com ends session to alice@atlanta.com (any side may terminate the call)\""
$ns at 10.0 "$sipbob bye"
$ns at 100.0 "finish"
$ns run
what i must to do? help me please.