Ex.
no: Date:
STUDY OF TCP PERFORMANCE USING NETWORK SIMULATOR.
AIM:
To study the performance of TCP based network by considering the bandwidth
PROCEDURE:
[Link] STEP [Link] a simulator variable (ns). STEP [Link] the animator file and the trace file to simulator. STEP [Link] nodes for the network topology. STEP [Link] the topology by connecting the nodes with required links and desirable orientation. STEP [Link] TCP agent to a specific node and assign another node as the sink. STEP [Link] the Application level traffic, File Transfer (FTP), to represent the data flow. STEP [Link] the data rate at every interval of 0.5 seconds and store the contents in a trace file. STEP [Link] this trace file to draw a performance graph. STEP [Link] all the instances of ns and trace files. STEP [Link] the animator (nam) STEP [Link] the designed network. STEP [Link] the output. STEP [Link]
PROGRAM:
set ns [new Simulator] set nf [open [Link] 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 tcp0 [new Agent/TCP] $ns attach-agent $n1 $tcp0 set sink0 [new Agent/TCPSink] $ns attach-agent $n3 $sink0 set ftp [new Application/FTP] $ftp attach-agent $tcp0 $ns connect $tcp0 $sink0 $ns at 1.0 "$ftp start" $ns at 10.0 "$ftp stop" $ns at 10.5 "finish" proc finish {} { global ns nf $ns flush-trace #close $f close $nf puts "running nam..." exec nam [Link] & exit 0 } $ns run
OUTPUT:
RESULT:
Thus, the program to study the performance of TCP based network by considering the bandwidth has been executed successfully.