Tuesday, June 4, 2019
Examining The Network Simulations Of NS2 Information Technology Essay
Examining The net profit Simulations Of NS2 Information Technology EssayNS2 is a Linux based hawkshaw to perform ne twork good examples. NS2 is based on C++ and TCL programming Languages. TCL uses simple program lines to define network configuration and C++ allows users to adjust communications protocol functionalities in occurrence and also to define new protocols. Our Project involves simulation of VoIP over two maneuver layer protocols UDP and SCTP.Installation of NS2Installation of NS2 involves many steps. These Steps areChecking for pre-requisites occupy make sure that you have installed the fedora 12 O.S with all packages and you are logged in as administrator.Downloading latest version of NS2We first Downloaded NS2 v. 2.34 from http//sourceforge.net/projects/nsnam/files/allin atomic number 53/ns-allinone-2.34/ns-allinone-2.34.tar.gz/download aspirateing the NS2 packageExtract the contents of .tar file in a directory and go into that directory. The spare-time activity sn apshot shows the extracted file against .tar file.Patching of SCTP moduleInitially NS2 does not provide delay to SCTP, so we have to download apply its patch before installation of NS2. The patch can be downloaded from http//pel.cis.udel.eduNow untar the patch in a directory and lineament the minded(p) command in oddment patch -p0 Now we are ready to install NS2 with SCTP module.Installation of NS2 We can either install NS2 by typing commands in the terminal. Or we can do this by simply double clicking the install file. The snapshot to a lower place shows the later.Now the installation has doughed. It would take some time to come it.Configuring the installation path of NS2The terminal provide get get closed after installation of NS2. Now open terminal again and type gedit /.bashrc to piece the path fileNow edit this file as in the figureNow save and close bash file and type following command in the terminal to tell your O.S ab break through the path of NS2 source /.bashrcC onfirming the installation of NS2To confirm that NS2 is checkly installed, type ns in the terminal. The outlook of the terminal will be changed in this way(Else it would print some filter of error in the terminal.)To revert to the normal mode type exit in the terminal.Running a simple computer code on NS2NS2 executes .tcl file format. If you have followed all the previous steps, then you can execute a .tcl file by typing the following syntax in the terminal ns file name.tclBut make sure you are the directory where the .tcl file is present.e.g Here we have a sample code al-Quran.tcl. In this code we are simulating a simple topology of two wired customers.On typing ns script.tcl in the terminal, we get the following output intervention the output mesmerism fileOn execution of .tcl code, two output files are generated. One is the .nam file with which we see the graphical simulation of our code. The other one is the .tr trace file, with which we can analyze the output of our simula tion. The trace file looks likeIt contains various parameters such as arrival time of packets, packet size transport agent etc. Using the trace file, we can get the graphical outputs to analyze the behavior of our simulation.To do this we need a graph ask outing computer software such as xgraph or gnusecret plan. Here we are utilise gnuplot. But to draw a graph, we need to filter the trace file and get the coordinates out of which we can draw a graph.To filter a trace file, we write an awk script. Since we have to draw graphs for latency and throughput, therefore we will write one script for each type of graph. The awk script for latency islatencyBEGIN time1 = 0.0time2 = 0.0time2 = $2if ($1==r) printf(%f %fn, time1, time2) latencytime1 += $2END print(Done)And awk script for throughput isthroughputBEGIN node =1time1 = 0.0time2 = 0.0num_packet=0bytes_counter=0time2 = $2if (time2 time1 0.05) thru = bytes_counter / (time2-time1)thru /= 1000000printf(%f %fn, time2, thru) throughpu ttime1 = $2if ($1==r) bytes_counter += $6num_packet++END print(Done)Now type the following command in the terminal to filter the trace filegawk file=awk file name.awk trace file name.trThe filtered file would be like thisNow weve to give a plot for which our graph is to be ploted. (i.e weve to tell about the x and y coordinates)So we create a simple file in which we tell about these parameters. specify title VoIP over UDP Latency p break loosee grid traffic circle ylabel s score xlabel timeplot latency w linespoints title voip throughputNow type gnuplot in the terminal to enter into gnuplot mode.Here type the command load x-y parameters file (inner double quotes inclusive)And type exit to exit gnuplotFormation of VOIP Traffic over the NetworkVoIP (Voice over IP) is simply the transmission of voice transaction over IP-based networks. The Internet Protocol (IP) was originally designed for data networking. It is also referred to as IPtelephoneor Internet Telephony.Simulating VOIP in NS2VoIP is basically just UDP packets encapsulating RTP packets with the voice data inside, all you should need to do to simulate a VoIP stream is set the correct packet size and frequency that the packets are sent out and that would simulate a stream.In NS2 we will implement VOIP over UDP and SCTP protocols. We will implement VOIP development a simple two-node topology. For this we will do the following stepscreate two .tcl filessimulate VOIP traffichandle the trace files to draw graphs for latency and throughput for evaluation between the two protocolsSimulation of VoIP over the network using UDPCreating the tcl file-First create a tcl file for Voip simulation over UDP protocol.Given below is the source code for our file voip_udp.tcl start new simulationset ns new Simulator setup tracing/namset tr open voip.tr wset nf open voip.nam w$ns trace-all $tr$ns namtrace-all $nf finish function, close all trace files and open up namproc finish global ns nf tr$ns flush-traceclose $nfclos e $trexec nam voip.nam exit 0 creating nodesset node0 $ns node$node0 label Voice 1$node0 color redset node1 $ns node$node1 label Voice 2$node1 color blue creating duplex-link$ns duplex-link $node0 $node1 256Kb 50ms DropTail$ns duplex-link-op $node0 $node1 direct right setup colors$ns color 1 Yellow$ns color 2 green 2-way VoIP connection pretend a UDP agent and attach it to node0set udp0 new Agent/UDP$ns attach-agent $node0 $udp0 set udp0 flowid to 1$udp0 set fid_ 1 Create a CBR traffic source and attach it to udp0set cbr0 new Application/Traffic/CBR$cbr0 set packetSize_ 128$cbr0 set interval_ 0.020 set traffic class to 1$cbr0 set class_ 1$cbr0 attach-agent $udp0 Create a Null sink to arrest UDPset sinknode1 new Agent/LossMonitor$ns attach-agent $node1 $sinknode1 Connect the UDP traffic source to Null sink$ns connect $udp0 $sinknode1set udp1 new Agent/UDP$ns attach-agent $node1 $udp1$udp1 set fid_ 2set cbr1 new Application/Traffic/CBR$cbr1 set packetSize_ 128$cbr1 set interval_ 0. 020$cbr1 set class_ 2$cbr1 attach-agent $udp1set sinknode0 new Agent/LossMonitor$ns attach-agent $node0 $sinknode0$ns connect $udp1 $sinknode0 end of voice simulation setup start up traffic$ns at 0.1 $cbr0 start$ns at 0.1 $cbr1 start$ns at 10.0 $cbr0 hitch$ns at 10.0 $cbr1 stop$ns at 10.5 finish run the simulation$ns runSimulate VOIP trafficNow type the following command in the terminal to view simulation of VOIP over UDP ns voip_udp.tclThe output isPerformance of SCTPNow we draw the graphs with gnuplot using above mentioned steps. The performance is evaluated on the basis of latency, throughput and subject matter.The capacity can be evaluated with the help of latency and throughput.LatencyThroughputSimulation of VoIP over the network using SCTPCreating the tcl file-First create a tcl file for Voip simulation over UDP protocol.Given below is the source code for our file voip_sctp.tcl start new simulationset ns new Simulator setup tracing/namset tr open voip.tr wset nf open voip.na m w$ns trace-all $tr$ns namtrace-all $nf finish function, close all trace files and open up namproc finish global ns nf tr$ns flush-traceclose $nfclose $trexec nam voip.nam exit 0 creating nodesset n0 $ns node$n0 label Voice 1$n0 color redset n1 $ns node$n1 label Voice 2$n1 color blue creating duplex-link$ns duplex-link $n0 $n1 256Kb 50ms DropTail$ns duplex-link-op $n0 $n1 orient right setup colors$ns color 1 Yellow$ns color 2 Green 2-way VoIP connectionCreate a UDP agent and attach it to n0set sctp0 new Agent/SCTP$ns attach-agent $n0 $sctp0$sctp0 set fid_ 1set cbr0 new Application/Traffic/CBR$cbr0 set packetSize_ 128$cbr0 set interval_ 0.020 set traffic class to 1$cbr0 set class_ 1$cbr0 attach-agent $sctp0 Create a Null sink to receive Dataset sinknode1 new Agent/LossMonitor$ns attach-agent $n1 $sinknode1set sctp1 new Agent/SCTP$ns attach-agent $n1 $sctp1$sctp1 set fid_ 2set cbr1 new Application/Traffic/CBR$cbr1 set packetSize_ 128$cbr1 set interval_ 0.020$cbr1 set class_ 2$cbr1 a ttach-agent $sctp1set sinknode0 new Agent/LossMonitor$ns attach-agent $n0 $sinknode0$ns connect $sctp0 $sctp1$ns at 0.1 $cbr0 start$ns at 0.1 $cbr1 start stop up traffic$ns at 10.0 $cbr0 stop$ns at 10.0 $cbr1 stop finish simulation$ns at 10.5 finish run the simulation$ns runSimulate VOIP trafficNow type the following command in the terminal to view simulation of VOIP over UDP ns voip_sctp.tclThe output isPerformance of SCTPNow we draw the graphs with gnuplot using above mentioned steps. The performance is evaluated on the basis of latency, throughput and capacity.The capacity can be evaluated with the help of latency and throughput.LatencyThroughputDifference between SCTP and UDPSCTPSCTP Stands for Stream Control Transmission Protocol. It is a Transport Layer protocol. It is a connection-oriented protocol similar to TCP, but provides facilities such as multi-streaming and multi-homing for better performance and redundancy. It is used in Unix-like operating systems.UDPUDP stands for User Datagram Protocol. It is a minimal cognitive content-oriented transport layer protocol. It enables two hosts to connect and send short messages to one another. Unlike Transmission Control Protocol (TCP), it does not guarantee that data is received or that it is received in the order in which it was sent.Comparison between SCTP and UDPMessage OrientationIn SCTP, message boundaries are preserved. If an application sends a 100-byte message, the peer application will receive all 100 bytes in a single read no more, no less. UDP provides a message-oriented service, but without SCTPs reliability.Un-Ordered ServiceIn addition to ordered message service (and parallel ordered service discussed above), SCTP offers the reliable delivery of messages with no order constraints. UDP provides unordered service, but again without SCTPs reliability. Unordered reliable delivery will be useful for many applications, in particular disk over LAN services (iSCSI, RDMA, etc.) where the application alr eady provides ordering.Stronger checksumSCTP uses a 32-bit end-to-end checksum proven to be mathematically stronger than the 16-bit ones-complement sum used by UDP. SCTPs better checksum provides stronger verification that a message passes end-to-end without bit errors going undetected.These were some of the differences between SCTP and UDP. A tabulated distinguish between the two protocols is given belowServices/FeaturesSCTPUDPConnection-orientedyesnoFull duplexyesyesReliable data transferyesnoPartial-reliable data transfer facultativenoOrdered data deliveryyesnoUnordered data deliveryyesyesFlow controlyesnoCongestion controlyesnoECN up to(p)yesnoSelective ACKsyesnoPreservation of message boundariesyesyesPath MTU discoveryyesnoApplication PDU fragmentationyesnoApplication PDU bundlingyesnoMultistreamingyesnoMultihomingyesnoProtection against SYN flooding attacksyesn/aAllows half-closed connectionsnon/aReachability checkyesnoPsuedo-header for checksumno (uses vtags)yesTime wait st atefor vtagsn/aSCTP vs. UDPLatencyFrom the graphs of latency we conclude that latency is slightly higher in UDP. In real practice, latency in UDP is much higher than in SCTP. Practically, the latency in UDP is about 15% more than SCTP.ThroughputFrom the graphs of throughput we see that UDP shows a constant but less throughput while SCTP shows continuous fluctuations in its graph. But boilersuit SCTP has a higher throughput than UDP. In real practice, throughput in SCTP is about 15% more than in UDP.CapacityBy observing the graphs of throughput, we conclude the SCTP can support more capacity than UDP. UDP will loose its performance at higher data rates.ConclusionFrom the above statistics, we conclude that SCTP is better than UDP in terms of latency, throughput and capacity. then there is no doubt in the fact that that SCTP is going to be the future of VOIP and many other network technologies. But since this technology is under the process of evolution so it may take some time for it to replace the older technologies like UDP and TCP etc.Refrenceshttp//yonghoon.livejournal.com/4799.htmlhttp//www.isoc.org/briefings/017/index.shtmlhttp//www.google.com/dictionary?source=dict-chrome-exsl=entl=enq=sctphttp//www.google.com/dictionary?langpair=enenq=udphl=enaq=fhttp//mailman.isi.edu/pipermail/ns-users/2006-August/056723.htmlhttp//books.google.com.pk/books?id=bF3L7g1u_mQCpg=PA189lpg=PA189dq=udp+vs+sctp+latency+throughputsource=blots=zdb5JeCsMfsig=PPt8c4nvtcrIJcXr5eKBIe_GbkQhl=enei=XhIgTYCeLs-z8QO8_KS8BQsa=Xoi=book_resultct=resultresnum=2ved=0CB4Q6AEwAQv=onepageqf=true
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.