[ns] awk files HELP!!
Pepe Lupen
loperini at hotmail.com
Fri Sep 2 08:22:46 PDT 2005
Hello, I need help me, please.
I have created the following simulation and now I need to obtain several
parameters (delay, bandwidth...) to later analyze the obtained results. I
need files awk to calculate the dalay of the packages tcp, the occupation of
the channel (consumed bandwidth), the received packages and the loss
packages.I don't know alot of awk, and for that reason I request aid. If
somebody could help with these files awk me very it would be been thankful.
Thanks, I wait for your aid.
I'm sorry for my English!!!
-------------------------------------------------------------------------------
set opt(node) 10
set opt(bw) 1000Mb
set num_tcp 8
set ns [new Simulator]
#Define different colors for data flows (for NAM)
$ns color 1 Blue
$ns color 2 Red
$ns color 3 Yellow
#Open the Trace files
set file1 [open out1000_256.tr w]
#set winfile [open WinFile w]
$ns trace-all $file1
#Open the NAM trace file
set file2 [open out1000_256.nam w]
$ns namtrace-all $file2
#Define a 'finish' procedure
proc finish {} {
global ns file1 file2
$ns flush-trace
close $file1
close $file2
exec nam out1000_256.nam &
exit 0
}
set num $opt(node)
for {set i 0} {$i < $num} {incr i} {
set node($i) [$ns node]
lappend nodelist $node($i)
}
$node(0) color red
$node(0) shape box
set lan [$ns newLan $nodelist $opt(bw) 40ms LL Queue/DropTail MAC/Csma/Cd
Channel]
set na [$ns node]
$na color yellow
$ns duplex-link $na $node(0) 0.5Mb 40ms DropTail
#Give node position (for NAM)
$ns duplex-link-op $na $node(0) orient rigt
#Setup a TCP connection
set trafico $num_tcp
for {set j 0} {$j < $trafico} {incr j} {
set tcp($j) [new Agent/TCP]
$ns attach-agent $node(0) $tcp($j)
set sink($j) [new Agent/TCPSink]
$ns attach-agent $node([expr $j+1]) $sink($j)
$ns connect $tcp($j) $sink($j)
$tcp($j) set fid_ 1
$tcp($j) set window_ 1024
$tcp($j) set packetSize_ 256
#Setup a FTP over TCP connection
set ftp($j) [new Application/FTP]
$ftp($j) attach-agent $tcp($j)
$ftp($j) set type_ FTP
}
for {set k 0} {$k < $num_tcp} {incr k} {
$ns at 0.1 "$ftp($k) start"
$ns at 4.5 "$ftp($k) stop"
}
$ns at 5 "finish"
$ns run
_________________________________________________________________
Acepta el reto MSN Premium: Correos más divertidos con fotos y textos
increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis.
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos
More information about the Ns-users
mailing list