Conseguences of soil crude oil pollution on some wood properties of olive trees https://doi.org/10.30526/31.2.1951 Computer | 222 2018( عام 2)العدد ( 31)المجلد مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 Network Performance Analysis Based on Network Simulator NS-2. Maan Y. Anad Alsaleem Directorate of Education of Nineveh Naors Y. Anad Alsaleem Nawfal Ali Zakar Dept. of Computer AL-Hamdaniya University nawrasyounis@yahoo.com Abstract NS-2 is a tool to simulate networks and events that occur per packet sequentially based on time and are widely used in the research field. NS-2 comes with NAM (Network Animator) that produces a visual representation it also supports several simulation protocols. The network can be tested end-to-end. This test includes data transmission, delay, jitter, packet- loss ratio and throughput. The Performance Analysis simulates a virtual network and tests for transport layer protocols at the same time with variable data and analyzes simulation results based on the network simulator NS-2. Keywords: NS-2, Loss of packets, Required time, Transport layer protocol, Throthput, Delay time. https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 223 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 Introduction The purpose of its development was simulating the events that occur in the network separately. And provide support for simulate network protocols (Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and guidance and multicast protocols for both wired and wireless networks [1]. The network simulator NS-2 is open source program built in C++ language in terms of interfaces and OTCL object oriented language for simulation [6]. Within this environment, simulator user designs its network by typing OTCL text then simulation program simulated it within specific factors [7]. Related Work Recently SharatKaushik , Poonam , Anita Tomar(2014) studied the comparison of both protocol and fund that TCP is more reliable than UDP because its packet loss rate is less than UDP as it sends through two transmission nodes. Basic Architecture of NS-2 The NS-2 was designed depending on two languages C++ and OTCL language commands. These two languages have been linked by TCLCL is a set of functions and through which connectivity between C++ and OTCL [8]. After completion of simulation process the simulator generates the results in two ways: The first is a graphical simulation of network operations which shows through NAM and the second is Trace file that explains the events and the chronology of their occurrence. To interpret these results graphically and interactively there are tools available such as NAM and XGraph. To analyze certain events in the network it extracts texts based on the given data to configure concept display. The basic architecture of the simulators is shown in Figure (1). Figure (1): Network simulator architecture NS-2 Configuring the Network Environment NS-2 version (2.35) is an open source multi-protocol simulation program occupies a very important position in the domain of network simulators [4]. It simulates events and it can simulate the entire network environment, knowing the events and the chronology of their occurrence. This research creates a virtual network using both transport layer protocols to compare the performance of the protocols on the same channel with different nodes and same transmission time.The network consists of 6 nodes works as a client and 2 nodes as host represent the routers in the network and the use of the protocol TCP was inserted between the node (0) from the first side of the network with node (4) from the other side and the TCP sinkProtocol at the end of the node (4) to receive data as a client and notify the ACK to sender . The UDP protocol was proposed to use between the nodes (1) from the first end of the same network with nodes (5) to the other end of the network as shown in Figure (2). https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 224 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 Figure (2): Proposed network architecture To create the previous environment in the simulator NS-2 a file is created as TCL1.TCL. The code is generated through the NSG2 program and the connection shall be as follows: #Setup FTP0 set ftp0 [new Application/FTP] $ftp0 attach-agent $tcp0 $ns at 1.0 "$ftp0 start" $ns at 2.0 "$ftp0 stop" #Setup FTP1 set ftp1 [new Application/FTP] $ftp1 attach-agent $tcp1 $ns at 1.0 "$ftp1 start" $ns at 2.0 "$ftp1 stop" #Setup FTP2 set ftp2 [new Application/FTP] $ftp2 attach-agent $tcp2 $ns at 1.0 "$ftp2 start" $ns at 2.0 "$ftp2 stop" #Setup CBR0 set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp6 $cbr3 set packetSize_ 1000 $cbr3 set rate_ 1.0Mb $cbr3 set random_ null $ns at 1.0 "$cbr3 start" $ns at 2.0 "$cbr3 stop" The Script for node number 0 to use ftp protocol and the time for start and stop sending. https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 225 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 #Setup CBR1 set cbr4 [new Application/Traffic/CBR] $cbr4 attach-agent $udp7 $cbr4 set packetSize_ 1000 $cbr4 set rate_ 1.0Mb $cbr4 set random_ null $ns at 1.0 "$cbr4 start" $ns at 2.0 "$cbr4 stop" #Setup CBR2 set cbr5 [new Application/Traffic/CBR] $cbr5 attach-agent $udp8 $cbr5 set packetSize_ 1000 $cbr5 set rate_ 1.0Mb $cbr5 set random_ null $ns at 1.0 "$cbr5 start" $ns at 2.0 "$cbr5 stop" Simulation Setup and Scenario Assumptions At the time of executing TCL text will get all the data during the implementation process so we can analyze that data which appeared in the trace file as shown in figure (4) after simulation and knowledge of network efficiency. Networks simulator NS-2 provides ability to track and monitor data. We can record and track packages all the time by following files (trace file), which records each packet in the channel or in the queue and tracks its progress, arrival or loss. Monitoring simulations can also be used to monitor all packets and data streams for a specific signal at the same time it provides a dynamic view of the simulation process via the NAM controller, to start executing we insert the command "ns ABC.TCL", the program will automatically generate an (NAM) monitor. Figure (3) views network simulation traces and real world packet traces. Figure (3): A visual representation rendering using the (NAM) controller. https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 226 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 The meaning of red and green objects in figure (3) is the drop rate of data for both nodes where the red for nodes used UDP and green for node used TCP. at the end of the simulation, two files will generate the first is ABS.nam which represents the source file for the visual simulation process which is used in the NAM controller and another fileABC.tr, where the latter records the process of data transfer and all events which is done through the data recorded by the network performance analysis. Experimental Results and Comparative Analysis NS-2 has a high ability to process results. The simulator uses (AWK) language to analyze and process data in the trace file (TR .AWK) and it’s a powerful software language in data processing. The network performance analysis is done by analyzing the data string in the trace file (TR) in terms of delay time, transmission tension, throughput, finally packets loss rate. The trace files(TR) show the sequences of events in the simulation where the trace string contains the event, time of event, sent nodes, nodes sent to it, the protocol, package size, sender's address, recipient address and finally the ID of the package as shown in Figure (4). Figure (4): Trace files elements TR Inside the trace file the data will be according to chronological order of events as follows: + 0 4 3 cbr 210 ------- 4 4.0 0.0 0 0 - 0 4 3 cbr 210 ------- 4 4.0 0.0 0 0 + 0 5 3 tcp 40 ------- 1 5.0 1.0 0 1 - 0 5 3 tcp 40 ------- 1 5.0 1.0 0 1 By analyzing the data for the network, the " delay time " was obtained and compared as shown in figure (5), where the delay time for sender’s package from side to side was very close in both protocols. https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 227 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 Figure (5): Delay time Throughput of data transferred on the same network for the same time was different as it's described in figure (6) where UDP are much higher than TCP and the reason is no flow control or acknowledgement. The UDP shows nearly constant behavior with increasing throughput. Figure (6): Throughput is measured in bits per second (mbps). Data transmission jitter within the network depending on data received for the nodes (8, 13) within the same time was the rate of jitter in TCP is higher than the UDP. But UDP showed a higher Jitter rate in the first transmitter and stabilized in 2Sand decreased less than a TCP and remained at this rateup to 9S as shown in figure (7). 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 TCP CBR simulation time (s) 0 20 40 60 80 100 120 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 TCP CBR simulation time (s) https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 228 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 Figure (7): A diagram showing Jitter Conclusion Network performance analysis is the key to understand the efficiency of managing and network operation. Network simulators provide a practical and reliable way to plan and test communications networks. In this research assumed a wire mesh model and analyze it and monitoring the performance of assumed networks. Two of the most important network protocols have been Applied (TCP, UDP) on suggested network in terms of delay time, throughput, data jitter by analyzing the network performance using NS-2 simulator . 0 0.001 0.002 0.003 0.004 0.005 0.006 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 TCP CBR Time(S) https://doi.org/10.30526/31.2.1950 https://doi.org/10.30526/31.2.1951 Computer | 229 2018( عام 2)العدد ( 31)لمجلد ا مجلة إبن الهيثم للعلوم الصرفة و التطبيقية Ibn Al-Haitham J. for Pure & Appl. Sci. Vol.31 (2) 2018 References 1. ShikhaSaxena,SuraiyaHusain, (2015) "Network Simulator Technique of implementing the network on the computer" , International Journal of Scientific Engineering and Applied Science,December,. 1, 9,.448 – 457. 2. TeerawatIssariyakul,EkramHossain, ( 2012) "Introduction to Network Simulator NS2" , 2nd Edition , Spring , Canada,. 3. Naors, Y. AnadAlsaleem, (2017) "Comparison of Efficiency of Network Simulators",Journal of Babylon University/Engineering Sciences , , .25 , .2 , . 792-797. 4.RachnaChaudhary,ShwetaSethi, (2012) "A study of comparison of Network Simulator -3 and Network Simulator -2" , International Journal of Computer Science and Information Technologies, ,. 3,. 1,.3085 – 3092. 5.NehaSingh,VinitaMathur, (2012)"Network Simulator NS2-2.35" ,International Journal of Advanced Research in Computer Science and Software Engineering, May,. 2, 5,.224- 228. 6. ArvindT , (2016) "A Comparative Study of Various Network Simulation Tools" , International Journal of Computer Science and Engineering Technology ,Aug,. 7, . 8,.374 -378. 7.Shweta Gambhir1,KuldeepTomar , (2014) "Study Of Computer Network Issues And Improvising Drop Rate Of Tcp Packets USING NS2" ,International Journal in Foundations of Computer Science and Technology ,July, 4.4.85-98. 8. Karl , M (2005) , "A Comparison of the architecture of network simulators NS-2 and TOSSIM" , National Institute of Technology Karnataka surathkal . wireless information network group . 9. SharatKaushik ,Poonam and Anita Tomar ," A Comparative Analysis of Transport Layer Protocols (2014)" , International Journal of Information and Computation Technology. ISSN 0974-2239 4, Number 14,. 1403-1410. https://doi.org/10.30526/31.2.1950