LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2013, 07:50 AM   #1
Helen jameel
LQ Newbie
 
Registered: Jun 2013
Location: Manchester
Posts: 6

Rep: Reputation: Disabled
Unhappy Error when adding LAR protocol in NS2


Hi,
I am a new user for Ns and i have problem. I am using NS 2.32
I added LAR routing protocol in ns-2.
I made all indicated changes in ns-2 .

when i try to use this protocol in my simulation script, it produces the following errors.

ns: _o14 setdest 1227.525413344914 105.150581330834 12.551829817654:
(_o14 cmd line 1)
invoked from within
"_o14 cmd setdest 1227.525413344914 105.150581330834 12.551829817654"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o14" line 2)
(SplitObject unknown line 2)
invoked from within
"_o14 setdest 1227.525413344914 105.150581330834 12.551829817654"


My script was:
#*****************************************************************************#
# File Name: box.tcl #
# Purpose: #
# Original Author: #
# Modified by: #
# Date Created: #
#
# Copyright (C) 2004 Toilers Research Group -- Colorado School of Mines #
#
# Please see COPYRIGHT.TXT and LICENSE.TXT for copyright and license #
# details. #
#******************************************************************************/


puts "setting initial variables..."
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(x) 300
set val(y) 600
set val(ifqlen) 50
set val(rp) AODV
#set val(rp) DSR
#set val(rp) DSDV
set val(nn) 3
set val(txPower) 0.0075 ; #100 meters
set val(rxPower) 1
set val(sc) "mob.2"
#set val(sc) [lindex $argv 0] ;# mobility file
set val(dataStart) 1000.0
set val(dataStop) 2000.0
set val(signalStop) 2005.0
set val(finish) 2010.0

# =====================================================================
# Other default settings

puts "setting other default settings..."

LL set mindelay_ 50us
LL set delay_ 25us
LL set bandwidth_ 0 ;# not used

Agent/Null set sport_ 0
Agent/Null set dport_ 0

Agent/CBR set sport_ 0
Agent/CBR set dport_ 0

Agent/TCPSink set sport_ 0
Agent/TCPSink set dport_ 0

Agent/TCP set sport_ 0
Agent/TCP set dport_ 0
Agent/TCP set packetSize_ 512

Queue/DropTail/PriQueue set Prefer_Routing_Protocols 1

# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0

# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set Rb_ 2*1e6
#this was the default
#Phy/WirelessPhy set Pt_ 0.2818
# This is for 100m
Phy/WirelessPhy set Pt_ 7.214e-3
# This is for 40m
#Phy/WirelessPhy set Pt_ 8.5872e-4
# This is for 250m
#Phy/WirelessPhy set Pt_ 0.2818
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0

# =====================================================================
# This puts in only the headers that we need.
# =====================================================================
puts "removing unecessary packet headers..."
remove-all-packet-headers
add-packet-header IP
add-packet-header Common
add-packet-header LAR
add-packet-header LL
add-packet-header Mac

#Create a simulator object
set ns_ [new Simulator]

#Open a trace file

set nt [open out.trace w]
$ns_ trace-all $nt

set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# New API to config node:
# 1. Create channel (or multiple-channels);
# 2. Specify channel in node-config (instead of channelType);
# 3. Create nodes for simulations.

# Create channel #1
puts "creating channel..."
set chan_1_ [new $val(chan)]

#
# define how node should be created
#

#global node setting
puts "setting global node values..."
$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) \
-channel $chan_1_ \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace OFF \
-macTrace OFF \
-movementTrace OFF \
-txPower $val(txPower) \
-rxPower $val(rxPower)

# create the nodes
puts "creating the nodes..."

# create the nodes
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}

#
#Define a 'finish' procedure
proc finish {} {
global ns_ nt
$ns_ flush-trace
close $nt
exit 0
}

# Load the movement file
puts "Loading the mobility file..."
source $val(sc)



puts "creating lar agents and attaching them to nodes..."
for {set i 0} {$i < $val(nn)} {incr i} {
set g($i) [new Agent/LAR]
$node_($i) attach $g($i) 254

# need to tell the lar agents about their link layers
set ll($i) [$node_($i) set ll_(0)]
$ns_ at 0.0 "$g($i) set-ll $ll($i)"

# need to tell the lar agents which nodes they're on also
$ns_ at 0.0 "$g($i) set-node $node_($i)"
}




# the format now for the lar send is
#
# "$nodeId sendData <dest ID> <size> <method>"
#
# this will be used to test in a static configuration, and will
# change once the mobility portion is figured out.
#Schedule events

puts "Scheduling the send events"
for {set k $val(dataStart)} {$k < $val(dataStop)} {set k [expr $k + 0.25] } \
{
$ns_ at $k "$g(0) sendData 49 64 B"
$ns_ at [expr $k + .0001] "$g(1) sendData 48 64 B"
$ns_ at [expr $k + .0002] "$g(2) sendData 47 64 B"


}


# this is done to make the simulator continue running and "settle" things out
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $val(signalStop) "$g($i) larDone"
}

$ns_ at $val(finish) "finish"
$ns_ at [expr $val(finish) + 0.1] "puts \"NS Exiting...\" ; $ns_ halt"

#Run the simulation
puts ""
puts ""
puts "***********************************************"
puts "***********************************************"
puts "***********************************************"
puts ""
puts "Running the simulation"
puts ""
puts "***********************************************"
puts "***********************************************"
puts "***********************************************"
puts ""
puts ""
$ns_ run
 
Old 06-04-2013, 10:47 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
Welcome to LQ.

This LAR patch works : toilers-LAR-DREAM-2.32.patch
$ wget http://www.prism.gatech.edu/~gtg975v...EAM-2.32.patch
... Providing ns-allinone-2.32/ns-2.32/lar/box.tcl (7.2 kB) , step.tcl, etc.

Your file, box-Helen.tcl (5.6 kB) : $ ns-lar box-Helen.tcl
No issues. The file tcl/mobility/scene/cbr-3-test was used as mob.2 :
Code:
setting initial variables...
setting other default settings...
removing unecessary packet headers...
creating channel...
setting global node values...
creating the nodes...
Loading the mobility file...
creating lar agents and attaching them to nodes...
Scheduling the send events


***********************************************
***********************************************
***********************************************

Running the simulation

***********************************************
***********************************************
***********************************************


num_nodes is set 3
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 220.0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LAR agent on node 0 done at 2005
Statistics for node:  0
Data Received:
	dataRxPkts:       0
	dataRxBytes:      0
	totalEEdelay:     0
	totalHops:        0
Data Sent or Dropped:
	dataTxPkts:       0
	dataTxBytes:      0
	dataDroppedSrc:   64
	dataDroppedInt:   0
Data Overhead:
	dataTxPktsFwd:    0
	dataTxBytesFwd:   0
	dataRxPktsFwd:    0
	dataRxBytesFwd:   0
Protocol Overhead:
	protocolTxPkts:   5192
	protocolTxBytes:  181864
	protocolRxPkts:   7405
	protocolRxBytes:  261690
	routeErrorsGen:   0
	routeErrorsRx:    0
	larRtReqTx:       0
	larRtReqRx:       0
	floodRtReqTx:     1334
	floodRtReqRx:     0
	oneHopRtReqTx:    1334
	oneHopRtReqRx:    0
	srcRtErrors:      0
	droppedAtEnd:     64
	pktOverflow:      3936
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LAR agent on node 1 done at 2005
Statistics for node:  1
Data Received:
	dataRxPkts:       0
	dataRxBytes:      0
	totalEEdelay:     0
	totalHops:        0
Data Sent or Dropped:
	dataTxPkts:       0
	dataTxBytes:      0
	dataDroppedSrc:   64
	dataDroppedInt:   0
Data Overhead:
	dataTxPktsFwd:    0
	dataTxBytesFwd:   0
	dataRxPktsFwd:    0
	dataRxBytesFwd:   0
Protocol Overhead:
	protocolTxPkts:   5238
	protocolTxBytes:  183428
	protocolRxPkts:   7614
	protocolRxBytes:  269212
	routeErrorsGen:   0
	routeErrorsRx:    0
	larRtReqTx:       0
	larRtReqRx:       0
	floodRtReqTx:     1334
	floodRtReqRx:     0
	oneHopRtReqTx:    1334
	oneHopRtReqRx:    0
	srcRtErrors:      0
	droppedAtEnd:     64
	pktOverflow:      3936
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LAR agent on node 2 done at 2005
Statistics for node:  2
Data Received:
	dataRxPkts:       0
	dataRxBytes:      0
	totalEEdelay:     0
	totalHops:        0
Data Sent or Dropped:
	dataTxPkts:       0
	dataTxBytes:      0
	dataDroppedSrc:   64
	dataDroppedInt:   0
Data Overhead:
	dataTxPktsFwd:    0
	dataTxBytesFwd:   0
	dataRxPktsFwd:    0
	dataRxBytesFwd:   0
Protocol Overhead:
	protocolTxPkts:   5256
	protocolTxBytes:  184040
	protocolRxPkts:   7643
	protocolRxBytes:  270174
	routeErrorsGen:   0
	routeErrorsRx:    0
	larRtReqTx:       0
	larRtReqRx:       0
	floodRtReqTx:     1334
	floodRtReqRx:     0
	oneHopRtReqTx:    1334
	oneHopRtReqRx:    0
	srcRtErrors:      0
	droppedAtEnd:     64
	pktOverflow:      3936
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
? May be your file "mob.2" is trying to do something impossible ?


P.S. : Please edit post #1 to use code tags for the "box.tcl" code.
http://www.linuxquestions.org/questi...gs-4175464257/

-

Last edited by knudfl; 06-04-2013 at 11:04 AM.
 
1 members found this post helpful.
Old 06-05-2013, 05:01 AM   #3
Dhaval Deolasi
LQ Newbie
 
Registered: Mar 2013
Posts: 6

Rep: Reputation: Disabled
Check whether you have specified correct parameters while generating mobility file.
For example, I have generated mobility file by giving commamnd ./setdest -n 50 -p 10.0 -M 10.0 -t 1000.0 -x 300.0 -y 600.0 > test.mob on command prompt.
 
2 members found this post helpful.
Old 06-06-2013, 08:12 AM   #4
Helen jameel
LQ Newbie
 
Registered: Jun 2013
Location: Manchester
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanx the problem was solved
The problem was from mob.2 file

Last edited by Helen jameel; 06-06-2013 at 08:14 AM.
 
Old 06-06-2013, 08:14 AM   #5
Helen jameel
LQ Newbie
 
Registered: Jun 2013
Location: Manchester
Posts: 6

Original Poster
Rep: Reputation: Disabled
But how can I calculate the throughput, packet delivery ratio and end-to-end packet delay
 
Old 06-06-2013, 02:34 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
# 5 .

These awk scripts / perl script will usually work :
pdf.awk analysis.pl genthroughput.awk getRatio.awk
sending+loss_rate.awk Throughput2007.awk

→ → ns2-awk_scripts0513.tar.bz2.txt
http://www.linuxquestions.org/questi...8&d=1369145583

-
 
1 members found this post helpful.
Old 06-07-2013, 04:18 AM   #7
Helen jameel
LQ Newbie
 
Registered: Jun 2013
Location: Manchester
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you Mr.knudfl, I really appreciate your efforts with me.
 
Old 06-07-2013, 07:58 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
Additional LAR hints :

There is another LAR thread : by @Dhaval Deolasi
http://www.linuxquestions.org/questi...le-4175463906/
 
Old 08-18-2013, 09:09 PM   #9
digital star
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Hello Helen jameel, hope you will be fine. I have the same problem. could you send me the file where you made the changes. Thanks in advance.

Last edited by digital star; 08-19-2013 at 03:03 AM.
 
Old 08-19-2013, 03:00 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
Post # 9, @digital star : Welcome to LQ.

Please delete your email address. Or expect some spam.
We already have "Send email to digital star" :
http://www.linuxquestions.org/questi...ember&u=747747

The "Helen jameel files" are included in 'lar-examples0713.tar.bz2' :
https://docs.google.com/file/d/0B7S2...it?usp=sharing
→ box-Helen.tcl, box-Helen.tcl-cbr3.txt, etc.

And http://www.linuxquestions.org/questions/tags/lar/

-

Last edited by knudfl; 08-19-2013 at 03:02 AM.
 
Old 08-19-2013, 03:06 AM   #11
digital star
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Thank you so much Knudfl, i need toilers-LAR-DREAM-2.32.patch. I can't download from here http://controls.ae.gatech.edu/claus/ns_lardream.html. Thanks
 
Old 08-19-2013, 03:27 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
# 11 .

This works OK :
$ wget http://www.prism.gatech.edu/~gtg975v...EAM-2.32.patch
... and 'toilers-LAR-DREAM-2.32.patch' is downloaded.

... Which you would know by following the link in post #8 and/or #10 :
http://www.linuxquestions.org/questions/tags/lar/
>>> http://www.linuxquestions.org/questi...-4175464665/#2

-
 
Old 08-19-2013, 03:42 AM   #13
digital star
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Thanks for your quick reply.... Done !!!
This Forum is Very Helpful ... THANKS

Last edited by digital star; 08-19-2013 at 03:51 AM.
 
Old 08-21-2013, 07:22 AM   #14
digital star
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
when i try to use this protocol in my simulation script, it produces the following errors.

/project/ns-allinone-2.32/ns-2.32/lar$ ns box.tcl
setting initial variables...
setting other default settings...
removing unecessary packet headers...
num_nodes is set 50
creating channel...
setting global node values...
creating the nodes...
INITIALIZE THE LIST xListHead
Loading the mobility file...
couldn't read file "": no such file or directory
while executing
"source.orig {}"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source $val(sc)"
(file "box.tcl" line 165)

This is my code.

if {$argc != 1} {
puts "Usage: <mobility file>"
exit 65
}


puts "setting initial variables..."
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(x) 300
set val(y) 600
set val(ifqlen) 50
set val(rp) AODV
#set val(rp) DSR
#set val(rp) DSDV
set val(nn) 50
set val(txPower) 0.0075 ; #100 meters
set val(rxPower) 1
set val(sc) "mob.2"
set val(sc) [lindex $argv 0] ;# mobility file
set val(dataStart) 1000.0
set val(dataStop) 2000.0
set val(signalStop) 2005.0
set val(finish) 2010.0

# =====================================================================
# Other default settings

puts "setting other default settings..."

LL set mindelay_ 50us
LL set delay_ 25us
LL set bandwidth_ 0 ;# not used

Agent/Null set sport_ 0
Agent/Null set dport_ 0

Agent/CBR set sport_ 0
Agent/CBR set dport_ 0

Agent/TCPSink set sport_ 0
Agent/TCPSink set dport_ 0

Agent/TCP set sport_ 0
Agent/TCP set dport_ 0
Agent/TCP set packetSize_ 512

Queue/DropTail/PriQueue set Prefer_Routing_Protocols 1

# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0

# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set Rb_ 2*1e6
#this was the default
#Phy/WirelessPhy set Pt_ 0.2818
# This is for 100m
Phy/WirelessPhy set Pt_ 7.214e-3
# This is for 40m
#Phy/WirelessPhy set Pt_ 8.5872e-4
# This is for 250m
#Phy/WirelessPhy set Pt_ 0.2818
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0

# =====================================================================
# This puts in only the headers that we need.
# =====================================================================
puts "removing unecessary packet headers..."
remove-all-packet-headers
add-packet-header IP
add-packet-header Common
add-packet-header LAR
add-packet-header LL
add-packet-header Mac

#Create a simulator object
set ns_ [new Simulator]

#Open a trace file

set nt [open out.trace w]
$ns_ trace-all $nt

set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# New API to config node:
# 1. Create channel (or multiple-channels);
# 2. Specify channel in node-config (instead of channelType);
# 3. Create nodes for simulations.

# Create channel #1
puts "creating channel..."
set chan_1_ [new $val(chan)]

#
# define how node should be created
#

#global node setting
puts "setting global node values..."
$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) \
-channel $chan_1_ \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace OFF \
-macTrace OFF \
-movementTrace OFF \
-txPower $val(txPower) \
-rxPower $val(rxPower)

# create the nodes
puts "creating the nodes..."

# create the nodes
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}

#
#Define a 'finish' procedure
proc finish {} {
global ns_ nt
$ns_ flush-trace
close $nt
exit 0
}

# Load the movement file
puts "Loading the mobility file..."
source $val(sc)

#Create lar agents and attach them to the nodes
puts "creating lar agents and attaching them to nodes..."
for {set i 0} {$i < $val(nn)} {incr i} {
set g($i) [new Agent/LAR]
$node_($i) attach $g($i) 254

# need to tell the lar agents about their link layers
set ll($i) [$node_($i) set ll_(0)]
$ns_ at 0.0 "$g($i) set-ll $ll($i)"

# need to tell the lar agents which nodes they're on also
$ns_ at 0.0 "$g($i) set-node $node_($i)"
}

# the format now for the lar send is
#
# "$nodeId sendData <dest ID> <size> <method>"
#
# this will be used to test in a static configuration, and will
# change once the mobility portion is figured out.
#Schedule events

puts "Scheduling the send events"
for {set k $val(dataStart)} {$k < $val(dataStop)} {set k [expr $k + 0.25] } \
{
$ns_ at $k "$g(0) sendData 49 64 B"
$ns_ at [expr $k + .0001] "$g(1) sendData 48 64 B"
$ns_ at [expr $k + .0002] "$g(2) sendData 47 64 B"
$ns_ at [expr $k + .0003] "$g(3) sendData 46 64 B"
$ns_ at [expr $k + .0004] "$g(4) sendData 45 64 B"
$ns_ at [expr $k + .0005] "$g(5) sendData 44 64 B"
$ns_ at [expr $k + .0006] "$g(6) sendData 43 64 B"
$ns_ at [expr $k + .0007] "$g(7) sendData 42 64 B"
$ns_ at [expr $k + .0008] "$g(8) sendData 41 64 B"
$ns_ at [expr $k + .0009] "$g(9) sendData 40 64 B"
$ns_ at [expr $k + .0010] "$g(10) sendData 39 64 B"
$ns_ at [expr $k + .0011] "$g(11) sendData 38 64 B"
$ns_ at [expr $k + .0012] "$g(12) sendData 37 64 B"
$ns_ at [expr $k + .0013] "$g(13) sendData 36 64 B"
$ns_ at [expr $k + .0014] "$g(14) sendData 35 64 B"
$ns_ at [expr $k + .0015] "$g(15) sendData 34 64 B"
$ns_ at [expr $k + .0016] "$g(16) sendData 33 64 B"
$ns_ at [expr $k + .0017] "$g(17) sendData 32 64 B"
$ns_ at [expr $k + .0018] "$g(18) sendData 31 64 B"
$ns_ at [expr $k + .0019] "$g(19) sendData 30 64 B"
}


# this is done to make the simulator continue running and "settle" things out
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $val(signalStop) "$g($i) larDone"
}

$ns_ at $val(finish) "finish"
$ns_ at [expr $val(finish) + 0.1] "puts \"NS Exiting...\" ; $ns_ halt"

#Run the simulation
puts ""
puts ""
puts "***********************************************"
puts "***********************************************"
puts "***********************************************"
puts ""
puts "Running the simulation"
puts ""
puts "***********************************************"
puts "***********************************************"
puts "***********************************************"
puts ""
puts ""
$ns_ run

Last edited by digital star; 08-21-2013 at 07:26 AM.
 
Old 08-21-2013, 07:45 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,483

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
# 14 .
Quote:
couldn't read file "": no such file or directory
That's 'mob.2':
Quote:
set val(sc) "mob.2"
Please take care that 'mob.2' is located in the same folder as »box.tcl«,
and that the simulation is run from that folder. ( $ pwd ).

Remark : Code must be in "code tags" : Please edit post #14.
Code tags : Type [/code] at code end, and [code] at code start.
http://www.linuxquestions.org/questi....php?do=bbcode
http://www.linuxquestions.org/questi...gs-4175464257/

-
 
  


Reply

Tags
lar, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding new protocol to ns2 savankiran Programming 3 03-22-2017 01:39 PM
NS2: MFR and LAR routing protocol anisabutsi Linux - Software 1 06-04-2013 12:20 PM
make error in ns2.29 when adding new protocol assassin91 Linux - Newbie 25 04-23-2012 11:17 PM
error in adding new protocol in ns2.34 for fedora 14 jothi8 LinuxQuestions.org Member Success Stories 0 03-05-2012 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration