[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Tracing Lan BW.




Hi Ns-Users

I simulated a lan.And started the FTP transfer from
one node to another.i have seen the BW consumption in
simulation by trace the link option.I wanted to see
the graph using the xgraph.I tried the Marc's Tut for
that.But it is not working.As it traces the bytes at
each node.I want to have BW on a link i.e. LAN.
Can any body  guide me how to have the trace file for
BW.And have the xgraph for it.
I have attached my code below.
Thanks in advance.
Any help will be appreciated.

Adeel
UNSW
Australia






 set ns [new Simulator]
 set f [open outftp.nam w]
 $ns namtrace-all $f
 
 set n0 [$ns node]
 set n1 [$ns node]
 set n2 [$ns node]
 set n3 [$ns node]
 set n4 [$ns node]
 set n5 [$ns node]

 set nodelist_ "$n0 $n1 $n2 $n3"
 
 
 
 $ns duplex-link $n4 $n0  10Mb 20ms DropTail
 $ns duplex-link $n5 $n2  10Mb 20ms DropTail
 
 $ns duplex-link-op $n4 $n0 orient down
 $ns duplex-link-op $n5 $n2 orient down
 
 set lan_ [$ns make-lan $nodelist_ 10Mb 1ms LL
Queue/DropTail Mac/802_3 Channel]
 
 $ns compute-routes
 
 set tcp0 [$ns create-connection TCP $n0 TCPSink $n3
2]
 set tcp2 [$ns create-connection TCP $n2 TCPSink $n4
3]
 

 set ftp0 [$tcp0 attach-app FTP]
 set ftp2 [$tcp2 attach-app FTP]

  $ftp0 set fid_ 2
 $ftp2 set fid_ 3


$ns color 2 Tan
$ns color 3 Red
 
 $ns at 1.0 "$ftp0 start"

 $ns at 2.0 "$ftp2 start"
 
 $ns at 3.0 "$ns halt"
 puts "running..."
 $ns run
 
 puts "finishing..."
 $ns flush-trace
 close $f
 

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/