Lab 4
Lab 4
NETWORKS LAB-EXERCISE 4
Creating and simulating three different network topologies in Ns2 for 100 seconds,
measuring throughput and packet loss and plotting the result in graph.
1) Hybrid
Code:
set noOfNodes 10
set noOfNodes2 20
proc finish { } {
global tr ftr ns
$ns flush-trace
close $tr
close $ftr
exec nam out.nam &
exit 0
}
$ns run
Graphs:
106121018
===========================================================================
2) Line
Code:
set noOfNodes 25
proc finish { } {
global tr ftr ns
106121018
$ns flush-trace
close $tr
close $ftr
exec nam out.nam &
exit 0
}
$ns run
Graphs:
106121018
========================================================================
3) Star
Code:
set noOfNodes 10
proc finish { } {
global tr ftr ns
106121018
$ns flush-trace
close $tr
close $ftr
exec nam out.nam &
exit 0
}
$ns run
Graphs
106121018