CN Lab Week 3
CN Lab Week 3
Week - 3
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exit 0 }
#Start simulation
$ns run
OUTPUT(BUS):
P V S Jyothirmaye CSE – 4 20135A0524
Ring Topology :
#Create a simulator object
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exit 0 }
#Orient
#Start simulation
$ns run
OUTPUT(RING):
Mesh Topology :
#Create a simulator object
proc finish {} {
global ns nf
P V S Jyothirmaye CSE – 4 20135A0524
$ns flush-trace
close $nf
exit 0 }
#Orient
#Start simulation
$ns run
P V S Jyothirmaye CSE – 4 20135A0524
OUTPUT(MESH):
Star Topology :
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
puts "running nam"
exec nam out.nam &
exit 0
}
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 n6 [$ns node]
$ns duplex-link $n0 $n1 10Mbps 10ms DropTail
P V S Jyothirmaye CSE – 4 20135A0524