?Dear all ns-users,
    I've read the paper-"Fwd: NS2 EURANE & Evalvid",and I'm tring to run a UMTS 
tcl script which contains the Rayleigh fading between UE and BS, but when I run 
it , I always get the error information: "segment fault", I don't know why, and 
while I change "Ray_3kmh-700m-200s-UEnr1" to "idealtrace" , it can run 
successfully. Can you help me? the code follows below. Thank you very much!   
##############################
global ns
remove-all-packet-headers
add-packet-header MPEG4 MAC_HS RLC LL Mac RTP TCP IP Common Flags

set ns [new Simulator]

set f [open out2ue.tr w]
#$ns trace-all $f


proc finish {} {
    global ns
    global f
    $ns flush-trace
    close $f
    puts " Simulation ended."
    exit 0
}

#$ns set debug_ 0

#$ns set hsdschEnabled_ 1
#$ns set hsdsch_rlc_set_ 0
#$ns set hsdsch_rlc_nif_ 0

$ns node-config -UmtsNodeType rnc

# Node address is 0.
set rnc [$ns create-Umtsnode]

$ns node-config -UmtsNodeType bs \
  -downlinkBW 32kbs \
  -downlinkTTI 10ms \
  -uplinkBW 32kbs \
  -uplinkTTI 10ms \
      -hs_downlinkTTI 2ms \
      -hs_downlinkBW 64kbs \

# Node address is 1.
set bs [$ns create-Umtsnode]

$ns setup-Iub $bs $rnc 622Mbit 622Mbit 15ms 15ms DummyDropTail 2000

$ns node-config -UmtsNodeType ue \
  -baseStation $bs \
  -radioNetworkController $rnc
  
$bs set X_ 100.0
$bs set Y_ 100.0
$bs set Z_ 0.0

# Node address for ue1 and ue2 is 2 and 3, respectively.
set ue1 [$ns create-Umtsnode]
set ue2 [$ns create-Umtsnode]

$ue1 set X_ 800.0
$ue1 set Y_ 100.0
$ue1 set Z_ 0.0

$ue2 set X_ 100.0
$ue2 set Y_ 400.0
$ue2 set Z_ 0.0

# Node address for sgsn0 and ggsn0 is 4 and 5, respectively.
set sgsn0 [$ns node]
set ggsn0 [$ns node]

# Node address for node1 and node2 is 6 and 7, respectively.
set node1 [$ns node]
set node2 [$ns node]

$ns duplex-link $rnc $sgsn0 622Mbit 0.4ms DropTail 1000
$ns duplex-link $sgsn0 $ggsn0 622MBit 10ms DropTail 1000
$ns duplex-link $ggsn0 $node1 10MBit 15ms DropTail 1000
$ns duplex-link $node1 $node2 10MBit 35ms DropTail 1000
#Routing gateway
$rnc add-gateway $sgsn0

#Agent set-up for ue1
set tcp0 [new Agent/TCP]
#$tcp0 set windowInit_ 10
#$tcp0 set window_ 16
#$tcp0 set packetSize_ 512 
$tcp0 set fid_ 0
$tcp0 set prio_ 2

#Agent set-up for ue2
set tcp1 [new Agent/TCP]
$tcp1 set fid_ 1
$tcp1 set prio_ 2

#$ns attach agent to a commonfixed node
$ns attach-agent $node2 $tcp0
$ns attach-agent $node2 $tcp1

#Create and connet two applications to their agent
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0

set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1

#Create and attach sinks
set sink0 [new Agent/TCPSink]
$sink0 set fid_ 0
$ns attach-agent $ue1 $sink0

set sink1 [new Agent/TCPSink]
$sink1 set fid_ 1
$ns attach-agent $ue2 $sink1

#Connect sinks to TCP agents
$ns connect $tcp0 $sink0
$ns connect $tcp1 $sink1

$ns node-config -llType UMTS/RLC/AM \
  -downlinkBW 64kbs \
  -uplinkBW 64kbs \
  -downlinkTTI 20ms \
  -uplinkTTI 20ms \
      -hs_downlinkTTI 2ms \
      -hs_downlinkBW 64kbs

#$ns create-hsdsch $ue1 $sink0

#Create HS-DSCH and attach TCP agent for ue1
$ns create-hsdsch $ue1 $sink0

#Attach TCP agent for ue2 to existing HS-DSCH
$ns attach-hsdsch $ue2 $sink1

#Loads input tracefiles for each UE, identified by its fid_
#$bs setErrorTrace 0 "UE1 trace file"
#$bs setErrorTrace 1 "UE2 trace file"

#$bs setErrorTrace 0 "idealtrace"
#$bs setErrorTrace 1 "idealtrace"

$bs setErrorTrace 0 "Ray_3kmh-700m-200s-UEnr1"
$bs setErrorTrace 1 "Ray_3kmh-300m-200s-UEnr1"
$bs loadSnrBlerMatrix "SNRBLERMatrix"

#set dch0 [$ns create-dch $ue1 $sink0]

#Tracing for all HSDPA traffc in downtarget
$rnc trace-inlink-tcp $f 0
$bs trace-outlink $f 2

#UE1 Tracing 
$ue1 trace-inlink $f 2
$ue1 trace-outlink $f 3
$bs trace-inlink $f 3
$ue1 trace-inlink-tcp $f 2

#UE2 Tracing 
$ue2 trace-inlink $f 2
$ue2 trace-outlink $f 3
$bs trace-inlink $f 4
$ue2 trace-inlink-tcp $f 2

# sample the bottleneck queue every 0.1 sec. store the trace in qm.out
#set qmon [$ns monitor-queue $rnc $bs [open qwire.out w] 0.1];
#[$ns link $rnc $bs] queue-sample-timeout; # [$ns link $n2 $n3] start-tracing

$ns at 0.0 "$ftp0 start"
$ns at 0.002 "$ftp1 start"
$ns at 10.1 "$ftp0 stop"
$ns at 10.102 "$ftp1 stop"
$ns at 10.201 "finish"

puts " Simulation is running ... please wait ..."
$ns run
####################################

Reply via email to