Professional Documents
Culture Documents
Lab 7
Lab 7
Simulation of Standard Ethernet (IEEE 802.3) LAN using Bus topology and analyze the performance
impact of multiple loads and, transmitting at same time using NS2
AIM:
a. To Simulate the Ethernet LAN IEEE 802.3 standard using BUS Topology
b. To analyze the performance of the ETHERNET LAN parameters under multiple loads.
SOFTWARE USED:
Network Simulator (NS2), 2.35 version.
Exercise 1:
PROGRAM:
#prop delay
set n(delay) 10ms
# network interface
set n(ifq) Queue/DropTail
# channel class
set n(chan) Channel
if {$argc!=2} {
puts "Usage ns csmacd.tcl <Number of nodes> <number of traffic sources>"
puts "Example ns lab8.tcl 15 2"
}
# set up traffic
for {set i 1} {$i <= $n(nn)} {incr i} {
set udp($i) [new Agent/UDP]
$ns attach-agent $node($i) $udp($i)
set cbr($i) [new Application/Traffic/CBR]
$cbr($i) set packetSize_ 1000
$cbr($i) set rate_ 100Kb
$cbr($i) attach-agent $udp($i)
$ns connect $udp($i) $null(0)
$ns at 0.5 "$cbr($i) start"
$ns at 20.0 "$cbr($i) stop"
}
proc finish {} {
global ns nf tf
$ns flush-trace
close $nf
close $tf
exec nam out8.nam &
exit 0
}
$ns run
1. Traffic = 1
2. Traffic = 2
3. Traffic = 3
4. Traffic = 5
5. Traffic = 7
6. Traffic = 8
7. Traffic = 9
8. Traffic = 10
OBSERVATION TABLE: