• Tidak ada hasil yang ditemukan

ELECTRICAL AND COMPUTER ENGINEERING DEPA

N/A
N/A
Protected

Academic year: 2018

Membagikan "ELECTRICAL AND COMPUTER ENGINEERING DEPA"

Copied!
39
0
0

Teks penuh

(1)

MEKELLE UNIVERSITY

ETHIOPIAN INSTITUTE OF TECHNOLOGY

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT

Mini

thesis

On application development for mobile and ubiquitous computing

Title

Performance comparison of AODV and DSR routing protocols in mobile

ad-hoc network (MANET)

By

Mebratu Fana

Mekelle, Ethiopia

Submitted

To

Henoc Mulugeta

(2)

Acknowledgment

(3)

Abstract

A Mobile Ad-hoc Network (MANET) is a collection of wireless nodes that can dynamically form a network to exchange information without using any pre-existing fixed network infrastructure. MANET is a self organized and self configurable network where the mobile nodes move arbitrarily. The mobile nodes can receive and forward packets as a router. Each node operates not only as an end system, but also as a router to forward packets. The nodes are free to move about and organize themselves into a network. These nodes change position frequently. MANET does not require any fixed infrastructure, such as a base station; therefore, it is an attractive option for connecting devices quickly and spontaneously. In this three routing protocols AODV (Ad- Hoc On-Demand Distance Vector) and DSR (Dynamic Source Routing Protocol) are compared. Most of the previous research on MANET routing protocols have focused on simulation study by varying various parameters, such as network size, pause times

etc. The performance of these routing proto-cols is analyzed in terms of their Packet Delivery Fraction, Average End-to-End Delay and dropped packets and their results are shown in

(4)

Acknowledgment ... ii

4. Routing protocols in ad hoc mobile networks... 10

4.1 Ad-hoc on Demand Distance Vector (AODV) ... 10

4.1.1 Working of AODV... 11

5. Simulation results and performance comparisons ... 16

5.1 performance metrics ... 16

5.2 Simulation environment ... 17

5.3 Experimental results ... 18

5.4 Number of nodes and connections ... 18

5.5 Results and discussion ... 20

6. Conclusion ... 27

7. References ... 28

Appendix 1: Sample code ... 29

(5)

CHAPTER 1

1. Introduction

A mobile ad hoc network is a collection of wireless mobile nodes that dynamically establishes the network in the absence of fixed infrastructure [1]. One of the distinctive features of MANET is, each node must be able to act as a router to find out the optimal path to forward a packet. As nodes may be mobile, entering and leaving the network, the topology of the network will change continuously. MANETs provide an emerging technology for civilian and military applications. Since the medium of the communication is wireless, only limited bandwidth is available. Another important constraint is energy due to the mobility of the nodes in nature.

One of the important research areas in MANET is establishing and maintaining the ad hoc network through the use of routing protocols. Though there are so many routing protocols available, this research considers AODV and DSR for performance comparisons due to it familiarity among all other protocols. These protocols are analyzed based on the important metrics such as dropped data (packets), packet delivery ratio and average end-to-end delay and is presented with the simulation results obtained by NS-2 simulator. In particular, Section 2 presents the related works with a focus on the evaluation of the routing protocols. Section 3 briefly discusses the MANET routing protocols and the functionality of the two familiar routing protocols AODV and DSR. The simulation results and performance comparison of the two above said routing protocols are discussed in Section 4. Finally, Section 5 concludes with the

(6)

The use of wireless technology has become a ubiquitous method to access the Internet or making connection to the local network due to its easier and inexpensive deployment with a possibility of adding new devices to the network at no or lower cost. Devices equipped with wireless adapters together with a wireless access point constitute Wireless Local Area Networks (WLANs). Wireless access points, representing a fixed infrastructure, allow devices equipped with wireless adapters to be linked together in a Local Area Network (LAN) and to get access to the Internet. However, the reliance upon an existing infrastructure and its potential limitations on mobility can be a major drawback. Therefore, wireless-capable devices may operate as autonomous entities, communicating via multiple wireless hops without a pre-established fixed infrastructure. In the discussion that follows, such wireless-equipped devices are referred to as nodes and function as both clients and servers in the network to forward the data packets. Such

network is called a Mobile Ad-hoc Network (MANET) [3], where the nodes employed in the network can change their location from time to time. Nodes can also join or leave the network freely and arbitrarily without any restriction.

The idea of mobile ad-hoc networking is sometimes also known as infrastructure-less networking as it does not require any servers, routers, access-points or cables. Instead, a MANET is comprised of a set of autonomous mobile nodes where the nodes must work together in a distributed manner to enable routing among them. Because of the lack of centralized control and frequent changes of network topology, routing becomes a vital issue and a major challenge in these types of networks.

(7)

of MANET routing protocols has evolved over recent time. Examples of such routing protocols are, among others, Optimized Link State Routing (OLSR) protocol, Wireless Routing

Protocol (WRP), Ad-hoc On-Demand Distance Vector (AODV) routing protocol, Dynamic Source Routing (DSR) protocol and Temporally Ordered Routing Algorithm (TORA).

1.2 Problem Statement

Today, the routing protocols are extensively tuned to provide high-quality performance in the conventional mobile ad hoc network. In fact, the routing protocols are responsible for providing reliable data packets in mobile ad hoc networks. However, since these protocols have limitations of high power consumption, network scalability, low bandwidth, high error rates, and arbitrary movements of nodes sometimes packet losses occur due to the broken routes between the nodes , collision of data packets was happen and source nodes may suffer from long delays for route searching before they forward data packets. Hence, it is now widely recognized that determining the specific routing protocols that can perform better in a given MANET scenario would be an important contribution to contemporary research. In addition, due to the dynamic nature of

MANETs, the routing mechanism experiences a host of problems by being more susceptible to errors. In particular, member nodes can be affected by churn leading to routes disappearing and reappearing, which in turn leads to sudden packet losses and higher message delays in the network. Similarly, there are other factors like network size, network load, and bandwidth and signal strength that affect the performance of the MANET routing protocols. Therefore, a detailed analysis is required in order to gain an insight of these factors that determine the performance of the routing protocol. More specifically, it would be important to study how the different network parameters and protocols interact, and to what extent each of the individual factors affects the routing performance.

1.3 Motivation and Contribution

(8)

are moving around the battlefield in a random way and a central unit cannot be used for synchronization .Although MANET has been considered as a convincing candidate for better wireless services, research to enhancing its functionality is still in its infancy. Currently, research has been undertaken with regard to the task of identifying more suitable routing protocols. This thesis has subjected two routing protocols (of the same categories) in order to assess their performance in a few realistic MANET scenarios, which will eventually help to better understand their comparative merits and suitability for deployment under different network

scenarios. Among several routing protocols I select two reactive routing Protocols [4], such as AODV and DSR. I choose these as my candidate protocols since they cover a range of design choices, including source routing, hop-by-hop routing, periodic advertisement, and on-demand route discovery. Even though many MANET routing protocols have been proposed in recent years, current literature reports only a limited amount of performance study between them. More specifically, very few researches had previously been attempted to contrast their performance in a realistic manner. This research therefore provides a quantitative performance analysis of AODV and DSR routing protocols in the same framework within the MANETs. In order to evaluate such performance, average end-to-end delay, packet delivery ratio and dropped data (packets) are considered as performance metrics. In my thesis, a number of important system parameters such as number of nodes, packet size, traffic type and bandwidth are taken into consideration. In my study, all these scenarios are simulated and analyzed using ns-2 simulator (ns-2allinone-2.35 version). The motivation behind using the ns-2 simulator as the selected simulator is presented in the research methodology section.

1.4Aims and Objectives

Following the above background and problem statement, one of the major aims of the thesis is to gain a thorough understanding AODV and DSR performance comparison in MANET routing protocols.

The particular goals of this thesis work are to:

 Perform a simulation with different metrics.  Analysis of the results.

(9)

1.5Scope of the work

This research focuses on performance comparison of AODV and DSR routing protocols in the mobile ad hoc networks.

The work includes:

 Compare AODV and DSR average end –to- end delay with number of connection by varying number of nodes using simulation

 Compare AODV and DSR dropped data (packets) with number of connection by varying number of nodes using simulation

 Compare AODV and DSR packer delivery ratio with number of connection by varying number nodes using simulation

(10)

2

Related works

Johansson et al [5] and Broch et al [6] proposed new mobility metric, which measures mobility in terms of relative speeds of the nodes rather than absolute speeds and pause times. This metric is intended to capture and quantify the kind of node motion relevant for an ad hoc routing protocol. Throughput, Delay and routing load were examined for 50-node network for three routing protocols namely AODV, DSDV and DSR. They used ns-2 based simulation environment. Their findings reveal that DSR was more effective at low load while AODV was more effective at higher loads. They kept small packet size (64bytes).

In their simulation, a network size of 50 nodes, 10 to 30 traffic sources, seven different pause times and various movement patterns were chosen. They used ns-2 discrete event simulator.

Through simulation, they reached the conclusion that performance of DSR was good at all mobility rates and speeds. AODV produces more routing overhead than DSR at high rates of node mobility. Jorg [7] studied the behavior of different routing protocols on network topology changes resulting from link breaks, node movement, etc.

Parul Sharma, Arvind Kalia, and Jawaahar Thakur ; they compared the performance analysis of AODV and DSR routing protocols in mobile ad hoc networks. They analyzed the routing protocols in terms of packet delivery ratio and end to end delay parameters versus pause time and they generate the data packets by CBR.

Results and conclusion made by the authors:

1. Increase in the density of nodes yields to an increase in the mean End-to-End delay.

2. Increase in the pause time leads to a decrease in the mean End-to-End delay.

3. AODV has the best all round performance. It has an improvement of DSR.

4. DSR is suitable for networks with moderate mobility rate. It has low overhead that makes it suitable for low bandwidth and low power network.

(11)

Results and conclusion made by the authors can be summarized as:

The overall performance of DSR is better in both of the propagation models, whereas AODV perform better in average end-to-end delay in two ray ground model.

In this thesis the performance comparison of the two routing protocols (AODV and DSR) in the same category was evaluated by varying number of connections versus average end to end delay, dropped data (packets) and packet delivery ration.

Ajay Kumar and Ashwani Kumar Singln ( asingla_123@yahoo.co.in

singla_ash2001@yahoo.co.in): They proposed the performance evaluation of manet routing

protocols on the basis of tcp traffic pattern and they conclude that the performance of AODV

and DSR protocols is more affected while subject to change in pause time as compared to change in number of connections.

(12)

3

Methodology

The general steps which were performed to achieve the objectives of this thesis work.

3.1 Review

In this step any published work or surveying of the literature of the research work done relevant about the study area is gathered for assessment.

3.2 Simulation tool

NS-2allinone-2.35 version is software used in this study. NS-2 is a useful tool in research.  NS-2isa discrete event simulator for networking research

 Simulates at packet level

 Substantial support to simulate many protocols  Simulate wired and wireless network

 Is primarily UNIX based

 NS-2 is the de facto experiment environment in research community  Easy to use friendly simulator

 Well documented easy to understand programming environment  Well designed software

 Supports protocols

3.3 Simulation

After detail discussion of routing protocols for mobile ad hoc networks necessary evaluation preparation for the two routing protocol and analyzing its performance with the help of different parameters is done. These parameters are average end-to-end delay, packet delivery ratio and dropped packets.

3.4 Framework of the work

This work consists of five chapters which are organized as follows. In the first section an

(13)

and performance comparison of the two above said routing protocols are discussed in section 5. Finally, section 6 concludes with the comparisons of the overall performance of the two protocols AODV and DSR based on the dropped data, packet delivery ratio and average end-to-end delay metrics.

(14)

4.

Routing protocols in ad hoc mobile networks

For mobile ad hoc networks, the issue of routing packets between any pair of nodes becomes a challenging task because the nodes can move randomly within the network. A path that was considered optimal at a given point in time might not work at all a few moments later. Moreover, the stochastic properties of the wireless channels add to the uncertainty of path quality. Traditional routing protocols are proactive in that they maintain routes to all nodes, including nodes to which no packets are being sent. They react to any change in the topology even if no traffic is affected by the change, and they require periodic control messages to maintain routes to every node in the network. An alternative approach involves establishing reactive routes, which dictates that routes between nodes are determined solely when they are explicitly needed to route packets. This prevents the nodes from updating every possible route in the network, and instead allows them to focus either on routes that are being used, or on routes that are in the process of being set up.

The routing protocols are proactive in that they maintain routes to all nodes, including nodes to which no packets are sent. They react to topology changes, even if no traffic is affected by the change. They are based on either link-state or distance vector principles and require periodic control messages to maintain routes to every node in the network. An alternative approach is reactive route establishment, where routes between nodes are determined only when explicitly

needed to route packets. Two routing protocols are studied in this work, namely Ad-hoc on Demand Distance Vector (AODV) and Dynamic State Routing (DSR) protocols

4.1 Ad-hoc on Demand Distance Vector (AODV)

The AODV routing protocol is based on DSDV and DSR algorithm. It uses the periodic

(15)

destination IP address and the sequence number. The advantage of AODV is that it is adaptable to highly dynamic networks. However, node may experience large delays during route construction, and link failure may initiate another route discovery, which introduces extra delays and consumes more bandwidth as the size of the network increases

Table 4.1: basic characteristic of AODV and DSR Protocol Multiple routes Route metric

method

(16)

was received the RREQ if the same request was not processed previously (this is identified using the broadcast-id and source address).

Once the RREP is generated, it travels back to the source, based on the reverse path that it has set in it until traveled to this node. As the RREP travels back to source, each node along this path sets a forward pointer to the node from where it is receiving the RREP and records the latest destination sequence number to the request destination. This is called Forward Path Setup. If an intermediate node receives another RREP after propagating the first RREP towards source it

checks for destination sequence number of new RREP. The intermediate node updates routing information and propagates new RREP only, If the Destination sequence number is greater, OR If the new sequence number is same and hop count is small, OR Otherwise, it just skips the new RREP. This ensures that algorithm is loop-free and only the most effective route is used.

4.1.2 Characteristics of AODV

 Unicast, Broadcast, and Multicast communication.  On-demand route establishment with small delay.

 Multicast trees connecting group members maintained for lifetime of multicast group.  Link breakages in active routes efficiently repaired.

 All routes are loop-free through use of sequence numbers.  Use of Sequence numbers to track accuracy of information.

 Only keeps track of next hop for a route instead of the entire route.  Use of periodic HELLO messages to track neighbors.

4.1.3 Advantages of AODV

Because of its reactive nature, AODV can handle highly dynamic behavior of Vehicle Ad-hoc networks. Used for both unicasts and multicasts using the ‟J‟ (Join multicast group) flag in the packets.

4.1.4 Disadvantages of AODV

(17)

 Overhead on the bandwidth: Overhead on bandwidth will be occurred compared to DSR, when an RREQ travels from node to node in the process of discovering the route info on demand, it sets up the reverse path in itself with the addresses of all the nodes through which it is passing and it carries all this info all its way.

 No reuse of routing info: AODV lacks an efficient route B maintenance technique. The routing info is always obtained on demand, including for common cause traffic.

 It is vulnerable to misuse: The messages can be misused for insider attacks including route disruption, route invasion, node isolation, and resource consumption.

 AODV lacks support for high throughput routing metrics: AODV is designed to support the shortest hop count metric. This metric favors long, low bandwidth links over short, high bandwidth links.

 High route discovery latency: AODV is a reactive routing protocol. This means that AODV does not discover a route until a flow is initiated. This route discovery latency result can be high in large-scale mesh networks.

4.2 Dynamic State Routing (DSR)

(18)

The key distinguishing feature of DSR is the use of source routing. That is, the sender knows the complete hop-by-hop route to the destination. These routes are stored in a route cache. The data packets carry the source route in the packet header. When a node in the ad hoc network attempts to send a data packet to a destination for which it does not already know the route, it uses a route discovery process to dynamically determine such a route. Route discovery works by flooding the network with route request (RREQ) packets. Each node receiving an RREQ re-broadcasts it unless it is the destination or it has a route to the destination in its route cache. Such a node replies to the RREQ with a route reply (RREP) packet that is routed back to the original source. RREQ and RREP packets are also source routed. The RREQ builds up the path traversed across the network. The RREP routes itself back to the source by traversing this path backward. The route carried back by the RREP packet is cached at the source for future use. If any link on a

source route is bro-ken, the source node is notified using a route error (RERR) pack-et. The source removes any route using this link from its cache. A new route discovery process must be initiated by the source if this route is still needed. DSR makes very aggressive use of source routing and route caching.

The protocol is composed of two main operations:

(19)

Route maintenance: Route Maintenance is used to handle route breaks. When a node encounters a fatal transmission problem at its data link layer, it removes the route from its route cache and generates a route error message. The route error message is sent to each node that has sent a packet routed over the broken link. When a node receives a route error message, it removes the hop in error from its route cache. Acknowledgment messages are used to verify the correct operation of the route links [10].

4.2.2 Advantage of DSR

 Routes maintained only between nodes who need to communicate  reduces overhead of route maintenance

 Route caching can further reduce route discovery overhead

 A single route discovery may yield many routes to the destination, due to intermediate nodes replying from local caches

4.2.3 Disadvantages of DSR

 Routes get old: Efficiency can decrease , Cache routes may return invalid routes  Nodes may try different invalid routes before trigger a new route discovery

procedure

 Packet length grow with the number of hops of a route  One RREQ can reach all nodes of a network

 Potential collisions on RREQ frames sent by neighbor nodes  RREP storm if many neighbor nodes know routes

 One intermediate node may send a RREP with and invalid (old) route

(20)

5.

Simulation results and performance comparisons

A simulation study was carried out to evaluate the performance of MANET routing protocols AODV and DSR based on the metrics packet delivery ratio, average end-to-end delay and dropped packets with the following parameters.

5.1 performance metrics

The thesis focuses on 3 performance metrics which are quantitatively measured. The performance metrics are important to measure the performance and activities that are running in NS-2 simulation. The performance metrics are:

Packet delivery fractions (PDF): also known as the ratio of the data packets delivered to the destinations to those generated by the CBR sources. The PDF shows how successful a protocol performs delivering packets from source to destination. The higher for the value give use the better results. This metric characterizes both the completeness and correctness of the routing protocol also reliability of routing protocol by giving its effectiveness.

Figure 5.1: Formula for packet delivery fraction

Average end to end delay of data packets: There are possible delays caused by buffering during route discovery latency, queuing at the interface queue, retransmission delays at the MAC, and propagation and transfer times. The thesis use Average end-to-end delay.

(21)

Figure 5.2: Formulas for average end to end delay performance metric

Data packet loss: Mobility-related packet loss may occur at both the network layer and the MAC layer. In the thesis packet loss concentrate for network layer. When a packet arrives at the network layer, the routing protocol forwards the packet if a valid route to the destination is known. Otherwise, the packet is buffered until a route is available. A packet is dropped in two cases: the buffer is full when the packet needs to be buffered and the time that the packet has been buffered exceeds the limit.

Figure 5. 3: Formulas for packet loss performance metric

5.2 Simulation environment

Propagation ray mode Two way ground

(22)

The following table indicates that the results of packet delivery ratio, average end to end delay and dropped data calculated on different number of connection with different number of nodes for both AODV and DSR routing protocol.

The models were generated for 20, 40 and, 60 nodes with number of connection 5, 10, 15.

(23)

Figure5. 4: Numbers of mobile nodes created for 20 nodes for both AODV and DSR

(24)

5.5 Results and discussion

I evaluated the performance of AODV and DSR protocols under CBR traffic pattern by varying number of connections and number of nodes. Trace files produced by applying scenarios and awk scripts for evaluation of AODV and DSR protocols based on average Packet Delivery Ratio, average end to end delays and dropped data (packets).

(25)

As I observed from figure 4.7 when the number of nodes are minimum i.e. 20, DSR has highest PDF; while AODV has lowest PDF than DSR. When the number of nodes is increases the PDF for both decreases. Now as the numbers of nodes are increased further up to 60, the PDF for both of them decreases. For connection 5 the DSR has highest PDF than AODV.

Figure 5.8: Average end to end delays for connection 5 versus varying number of nodes

As I observed from figure 4.8 when DSR has shortest average end to end delay and the AODV has highest average end to end delay. For minimum number of nodes the two protocols AODV and DSR have shortest average end to end delay for node 40 both protocols average end to end delay increase and for node 60 average end to end delay for both of them decreases. For connection 5 the DSR has shortest average end to end delay than AODV.

(26)

for AODV is highest; while it is lowest for DSR. And when the nodes are increased further up to 60 the packet loss for DSR increases while packet loss AODV first increases and then decreases. Overall, DSR performs better in terms of packet loss than AODV. For connection 5 DSR has lowest packet loss while it is high in case of AODV.

Figure 5.10: Packet delivery ratios for connection 10 versus varying number of nodes

(27)

Figure 5.11: Average end to end delays for connection 10 versus varying number of nodes

As I observed from figure 4.11 when DSR has highest average end to end delay and the AODV has lowest average end to end delay. For minimum number of nodes the protocol AODV has shortest average end to end delay for node 40 both protocols average end to end delay decreased and for node 60 average end to end delays for both of them increased but AODV has high average end to end delay when the number of nodes increases. For connection 10 the AODV has better performance of average end to end delay than DSR routing protocol.

(28)

Loss for AODV is highest; while it is lowest for DSR. And when the nodes are increased further up to 60 the packet loss for DSR increases while packet loss AODV first increases and then decreases. In DSR the packet losses lowest for minimum number of nodes and the packet loss increases in case of DSR with number of nodes. So the DSR has lowest packet loss in lowest number of nodes. But AODV more better then DSR for highest number of nodes. For connection 10 AODV has better performance of packet loss when the number of nodes increases.

Figure 5.13: Packet delivery ratios for connection 15 versus varying number of nodes

(29)

Figure 5.14: Averages end to end delays for connection 15 versus varying number of nodes As it is observed from figure 4.14 when DSR has lowest average end to end delay for minimum node i.e. 20 and the AODV has highest average end to end delay at minimum node. Generally for minimum number of nodes the two protocols AODV and DSR have shortest average end to end delay for node 40 both protocols average end to end delay increase and for node 60 averages end to end delay for DSR decreases while average end to end to delay for AODV increased with number of nodes. So when the number of connection is increased the AODV end to end delay

increased.

(30)
(31)

CHAPTER 6

6.

Conclusion

This thesis was conducted to study the behavior of the two routing protocols (AODV and DSR) of the same categories of MANET and to compare the performance of the two routing protocols of MANET based on CBR traffic pattern. These routing protocols are studied in terms of Packet delivery ratio, average end to end delay and dropped packets with varying number of nodes and number of connections. It is concluded that DSR protocol performs better than compared to AODV protocols for packet delivery ratio (PDF) when number of nodes is lowest with varying number of connections and DSR less performs when number of nodes increased but by

increasing number of connection it performs better in large number of nodes but not as better as AODV in very large number of nodes. It is also concluded that performance of these protocols is

(32)

[1]. C.Sivaram murthy, B.S.Manoj, Adhoc wireless networks:Architectures, and protocols, Pearson Education, 2004

[2] Rolf Ehrenreich Thorup, "Implementing and evaluating the DYMO routing protocol," in Master Dissertation, Department of Computer Science at University of Aarhus, Denmark, 2007, pp. 1-133.

[3]. J. Macker and S. Corson, Mobile Ad hoc Networks (MANET), IETF Working Group Charter, 1997.

[4] C. Mbarushimana and A. Shahrabi, "Comparative study of reactive and proactive routing protocols performance in mobile ad hoc networks," in 21st International Conference on Advanced Information Networking and Applications Workshops, 2007, AINAW '07, vol. 2, pp. 679-684, August 2007.

[5]. D. Johnson, D. Maltz, and J. Jetcheva, “The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks “, Internet Draft, draft-ietf-manet-dsr-07.txt, work in progress,

2002.

[6]. J. Broch, D. A. Maltz, D. B. Johnson, Y. C. Hu, and J. Jetcheva”, A Performance Comparison of Multi-Hop Wireless Network Routing n Protocols,” Proceedings of the Fourth Annual ACM/IEEEInternational Conference on Mobile Computing and Networking

(MobiCom’98), October 25-30, 1998, Dallas, Texas, USA, pp. 25-30.

[7]. D. O. Jorg, “Performance Comparison of MANET Routing Protocols in Different Network Sizes”, Computer Networks & Distributed Systems, 2003

[8]. Casaravilla J., Dutra G., Pignataro N. & Acuña J. “Propagation Model for Small Macro cells in Urban Areas”2009.

[9]. Magnus Frodigh, Per Johansson and Peter Larsson “Wireless ad hoc networking-The art of networking without a network” Ericsson Review No. 4, 2000

[10]. A.K.Vatsa, Prince Chauhan, Meenakshi Chauhan and Jyothi Sharma, “Routing Mechanism for MANET in Disaster Area”, International Journal of

(33)

Appendix 1: Sample code

if {$argc !=3} {

Puts "Usage: ns adhoc.tcl Routing_Protocol Traffic_Pattern Scene_Pattern " Puts "Example:ns adhoc.tcl AODVcbr-20-5-2 scene-20-0-20"

exit }

set par1 [lindex $argv 0]

set par2 [lindex $argv 1] set par3 [lindex $argv 2]

set val(chan) Channel/WirelessChannel ;# channel type

set val(prop) Propagation/TwoRayGround ;# radio-propagationmodel set val(netif) Phy/WirelessPhy ;# network interface type

set val(mac) Mac/802_11 ;# MAC type

if { $par1=="AODV"} {

set val(ifq) CMUPriQueue }

else {

set val(ifq) Queue/DropTail/PriQueue ;# interface queue type

}

I used the following tcl code for generating traffic pattern in the routing protocols by

changing number of nodes and number of connection in both DSR and AODV routing

(34)
(35)

$ns_ node-config -adhocRouting $val(rp) \

(36)

for {set i 0} {$i < $val(nn) } {incr i} {

$ns_ at $val(stop).000000001 "$node_($i) reset";

}$ns_ at $val(stop).000000001 "puts \"NS EXITING...\"; $ns_ halt" puts "Start Simulation..."

(37)

Appendix 2: Awk files

# awk files used to calculate packet delivery fraction

if (( $1 == "s") && ( $35 == "cbr" ) && ( $19=="AGT" )) { sends++; }

if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) { recvs++; }

# awk files used to calculate average end to end delay

if ( start_time[packet_id] == 0 ) start_time[packet_id] = time;

if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) { end_time[packet_id] = time; } else { end_time[packet_id] = -1; }

# awk files used to calculate routing packets

(38)

#awk files used to calculate dropped packets

if (( $1 == "d" ) && ( $35 == "cbr" ) && ( $3 > 0 ))

#NRL = routing_packets/recvs; #normalized routing load PDF = (recvs/sends)*100; #packet delivery ratio[fraction] printf("send = %.2f\n",sends);

printf("recv = %.2f\n",recvs);

#printf("routingpkts = %.2f\n",routing_packets++); printf("PDF = %.2f\n",PDF);

#printf("NRL = %.2f\n",NRL);

(39)

printf("No. of dropped data (packets) = %d\n",droppedPackets); #printf("No. of dropped data (bytes) = %d\n",droppedBytes); }

Gambar

Figure  5. 3: Formulas for packet loss performance metric
Figure 5. 5: Number of mobile nodes created for 40 nodes for both AODV and DSR
Figure 5.9: Packet losses for connection 5 versus varying number of nodes
Figure 5.12: Packet losses for connection 10 versus varying number of nodes
+2

Referensi

Dokumen terkait

Dengan kata lain pembangunan drainase saat ini masih dilakukan secara sporadik dan parsial dengan kata lain masih belum terencana secara komprehensif, dimana

Seterusnya untuk mengkaji struktur Tari Ula-ula Lembing yang terdapat dalam kebudayaan masyarakat melayu Aceh Tamiang, yang merupakan media seni gerak yang

[r]

Melihat dari hasil observasi pada minggu pertama masih kurang baik sehingga perlu dilakukan pengulangan beberapa kali dan setelah dilakukan penggulangan, guru

PENINGKATAN PEMAHAMAN MATERI MENGOPERASIKAN MULTIMETER ANALOG DAN DIGITAL MELALUI PENGGUNAAN VIDEO PEMBELAJARAN. Universitas Pendidikan Indonesia | repository.upi.edu |

Penelitian dilaksanakan dalam beberapa tahap yaitu : 1) Tahap persiapan penelitian yaitu penyiapan kandang, peralatan, perlengkapan kandang 2) Tahap pembuatan

menunjukan bahwa fungsi biaya rata- rata dengan kurva berbentuk huruf J pada Industri Manufaktur adalah fungsi biaya rata-rata jangka pendek. Hal ini berbeda

[r]