[ns] how to create my own packet in NS2

2011-04-14 Thread narendra k

hi all,
can any buddy tell me how to create my own packet for broadcasting & route
establishment??
its urgent.

regards
Narendra


Re: [ns] xgraph (urgent)

2011-04-14 Thread tran hung

Hi,

If you do steps follow Amit that still met this error. Maybe you not
installed xgraph yet.

Hope it helps,
regards,
phathienhung.

On Thu, Apr 14, 2011 at 11:25 AM, s s  wrote:

>
> In the name of God
> Dear friends
> Hi
>
> when we want to run xgraph in our tests,
> we write in stop proc the bellow commands:
> exec xgraph out.tr
>
> and we have ERROR:
> couldn't execute "xgraph":no such file or directory.
>
> would you please help me?
>
> Best Regards
> Sarah
>


[ns] Tracefile example of GPSR

2011-04-14 Thread Zakia Khalfallah


Hi, 
anyone has an exemple of the trace file result for a GPSR protocol simulation ?
thanks,
  


[ns] a sentence of tcl ,I do not understand

2011-04-14 Thread 兰天

 eval $ns_ attach-agent \$node_($src) \$udp($src)

this tcl sentence,use some symbol "\",

I check the related books that could not apply in this place,

could any one explain that?

thanks a lot

[ns] add new node to my tcl code

2011-04-14 Thread mikes1313


Hi I am a little bit confused, first of all my total number of nodes is 100.
I want to add an extra node beside $mnode_(10) in order to optimize my
stats(I don't have any dropped packets) for instance $mnode_(20) can
somebody help me modify the code below with this new add.


for {set i 0} {$i < $val(nn) } { incr i } {
set mnode_($i) [$ns node]
}
 
 
 
for {set i 1} {$i < $val(nn) } { incr i } {
$mnode_($i) set X_ [ expr {$val(x) * rand()} ]
$mnode_($i) set Y_ [ expr {$val(y) * rand()} ]
$mnode_($i) set Z_ 0
}
 
# Position of Sink
 
$mnode_(10) set X_ [ expr {$val(x)/2 + 1} ]
$mnode_(10) set Y_ [ expr {$val(y)/4 + 1} ]
$mnode_(10) set Z_ 0.0
 
 
 
$mnode_(0) set X_ [ expr {$val(x)/2} ]
$mnode_(0) set Y_ [ expr {$val(y)/4} ]
$mnode_(0) set Z_ 0.0
$mnode_(0) label "Sink"
 
 
for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $mnode_($i) 10
}
 
 
#Setup a UDP connection
set udp [new Agent/UDP]
$ns attach-agent $mnode_(10) $udp
 
set sink [new Agent/Null]
$ns attach-agent $mnode_(0) $sink
 
$ns connect $udp $sink
$udp set fid_ 2 

Thanks alot 
MIKE
-- 
View this message in context: 
http://old.nabble.com/add-new-node-to-my-tcl-code-tp31397795p31397795.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] Node ID

2011-04-14 Thread Mohammed Alenezi

Hi,

I 'm modifying the UDP.cc code and I want to check at certain time in which
node the packet in? I tried to use the source (src_) of the ip header
however, it printed the source of the original packet. In other words, in
the following example:

A---BC  A sends to C packets through B, the src_
variable in the IP header will always print A as source.

MY QUESTION: How can I print B???


It 's very urgent guys,

Plz any directions!!

-- 
Regards,
Mohd.


[ns] need help to calculating end-to-end delay by using tcsh script

2011-04-14 Thread ®°· . ¸ . •°™ AwS ™°·· . ¸ . •°®

hi everbody..
I have the following script to calculate latency for three different types of 
flows, can anybody please help me to modify it to calculate end-to-end delay 
for whole the system? 
I'm using the new tracefile format.
 
please it is very urgent.
my email id is sandanet2...@yahoo.com
 

#!/bin/tcsh
#
# works on a trace file produced by ns
# outputs layer-to-layer per-packet latency for a given flow,
# indexed by the send time for the packet
if ( $#argv != 3 ) then
  echo usage:
  echo "  " $0 \ \ \
  exit 1
endif
set scenario = $1
set flow = $2
set layer = $3
set sendlayer = $layer
if ( $layer == 'MAC' ) then
  set sendlayer = IFQ
endif
set tracefile = $scenario.tr
set tmpfile = `mktemp /tmp/latency.sendtimes.XX`
set outfile = $scenario.$flow.lat
rm -f $outfile
touch $outfile
# determine the first packet for a flow based on the first pkt
# received at the agent layer
set pkt = `egrep "^r .*\-Nl AGT .*\-If $flow " $tracefile | head -1 | gawk 
'{print $43;}'`
# determine the sender/receiver based on the first packet exchanged
# the true receiver is the last node to receive the packet
set snode = `egrep "^s .*\-Nl $layer .*\-If $flow .*\-Ii $pkt " $tracefile | 
head -1 | gawk '{print $9;}'`
set rnode = `egrep "^r .*\-Nl $layer .*\-If $flow .*\-Ii $pkt " $tracefile | 
tail -1 | gawk '{print $9;}'`
# determine per-packet send times; use the first transmission
# time if there are retransmissions
egrep "^s .*\-Ni $snode .*\-Nl $sendlayer .*\-If $flow " $tracefile | gawk 
'{print $43, $3;}' | sort -k1,1g -u >> $tmpfile
# determine per-packet recv times, match them to send times
# based on the packet id, and compute latency; use the time
# of the first recv if there were retransmissions
egrep "^r .*\-Ni $rnode .*\-Nl $layer .*\-If $flow " $tracefile | gawk '{print 
$43, $3;}' | sort -k1,1g -u | \
gawk -v sendfile=$tmpfile -v outfile=$outfile '{  \
 pkt = $1;  \
 rtime = $2;  \
 getline < sendfile; \
 while ($1 < pkt) { getline < sendfile };  \
 if ($1 > pkt) { print "FATAL ERROR"; exit 1 };  \
 printf "%.9f %.9f\n", $2, (rtime - $2) >> outfile; \
}'
# run latstats tool on the outfile
gawk '{print $2;}' $outfile | latstats | gawk '{print "", $0}'
# cleanup
rm $tmpfile

Re: [ns] xgraph (urgent)

2011-04-14 Thread Ashwini Patankar

On 04/15/2011 05:30 AM, ns-users-requ...@isi.edu wrote:

[ns] xgraph (urgent)

Go to the xgraph folder run ./configure and then run make , it will give you
one error related to getline() function, open the respective file and change
the occurrance of getline to my_getline() (there are two instances of the
function) and then re run ./configure and make , it should get compiled
correctly now run a make clean in ns2 folder and re install it by writing
make. It will install ns2 with xgrpah. With the evolution of compilers there
are many functions which are now in built in gcc like getline.


-- 

Thanks and Regards,

*Ashwini Shankar Patankar*
  www.wirelesscafe.wordpress.com