Study of Udp Performance Using Network Simulator
Study of Udp Performance Using Network Simulator
no: Date:
AIM:
To study the performance of an UDP based network by considering the data rate of the packets sent.
PROCEDURE:
STEP 1.Start STEP 2.Set a simulator variable (ns). STEP 3.Set the animator file and the trace file to simulator. STEP 4.Create nodes for the network topology. STEP 5.Design the topology by connecting the nodes with required links and desirable orientation. STEP 6.Add UDP agent to a specific node and assign another node as the sink. STEP 7.The data (traffic) flows from the agent to the sink. STEP 8.Create the Application level traffic, Constant Bit Rate (CBR), to represent the data flow. STEP 9.Record the data rate at every interval of 0.5 seconds and store the contents in a trace file. STEP 10.Use this trace file to draw a performance graph. STEP 11.Close all the instances of ns and trace files. STEP 12.Initiate the animator (nam). STEP 13.Simulate the designed network. STEP 14.Verify the output. STEP 15.Stop.
PROGRAM:
set ns [new Simulator] set f [open out.tr w] $ns trace-all $f set nf [open out.nam w] $ns namtrace-all $nf set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] $ns color 0 Blue $ns color 1 Red $ns duplex-link $n0 $n2 5Mb 2ms DropTail $ns duplex-link $n1 $n2 5Mb 2ms DropTail $ns duplex-link $n2 $n3 1.5Mb 10ms DropTail set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0 $udp0 set class_ 0 set null0 [new Agent/Null] $ns attach-agent $n3 $null0 ns connect $udp0 $null0 $ns at 1.0 "$cbr0 start" puts [$cbr0 set packetSize_] puts [$cbr0 set interval_] $ns at 3.0 "finish" proc finish {} { global ns f nf $ns flush-trace close $f close $nf puts "running nam..." exec nam out.nam & exit 0 } $ns run
OUTPUT:
RESULT:
Thus, the program to study the performance of an UDP based network by considering the data rate of the packets sent has been executed successfully.