You are on page 1of 69

Simulation of Routing Protocols in Mobile Ad-Hoc Networks

Submitted By
Nusrah Kanwal BETL F05 - 0136 nusrah.kanwal@hamdard.edu

Project Supervisor
Shams Ul Arfeen

FACULTY OF ENGINEERING SCIENCES & TECHNOLOGY Hamdard Institute of Information Technology Hamdard University, Main Campus, Karachi, Pakistan.

NOVEMBER 2009

Dedication

This report is dedicated to Shaheed Hakim Mohammad Saeed, my Teachers, my Supervisor, my Parents, my fellow colleagues and the hard working students of HIIT with a hope that they will succeed in every aspect of their Academic Career.

ii

Acknowledgement

In the name of Allah, the Most Gracious and the Most Merciful. Peace and blessings of Allah be upon Prophet Muhammad (SAWW). First and foremost, praise be to Allah, for giving me this opportunity, the strength and the patience to complete my dissertation finally, after all the challenges and difficulties. I would like to thank my supervisor, Shams Ul Arfeen for his highly motivated and most significant contribution in this project. I would also like to thank my parents for financial and moral support and also my friends who have helped and motivated me throughout. May Allah reward them all abundantly. Nusrah Kanwal BETL F05 0136

iii

Certificate

This is to certify that Ms. Nusrah Kanwal, D/O Syed Muhammad Farooq, BETL/F05/0136 have successfully completed her final year project. This project, Simulation of Routing Protocols in Mobile Ad-Hoc Networks was assigned to her, to fulfill the partial requirement for the bachelor degree of Telecommunication Engineering.

(Shams Ul Arfeen) Project Supervisor

(Rashid Hussain) Member Project Committee

(Ahmed Sikandar) Member Project Committee

(Fahad Azim) Deputy Director, HIIT

(Dr. Iqbal Ahmed Khan) Director, HIIT

iv

Table of Contents

Dedication ................................................................................................................................. ii Acknowledgement ................................................................................................................... iii Certificate ................................................................................................................................ iv Table of Contents ..................................................................................................................... v List of Tables ......................................................................................................................... viii List of Figures .......................................................................................................................... ix List of Graphs ........................................................................................................................... x Abbreviations .......................................................................................................................... xi Abstract ................................................................................................................................. xiii 1. Introduction to MANET ................................................................................................... 1 1.1. 1.2.
1.2.1. 1.2.2.

Background................................................................................................................. 1 Classification of Ad hoc Networks .............................................................................. 1


Infrastructure based wireless networks.............................................................................. 1 Ad hoc wireless networks(infrastructure less) ................................................................... 2

1.3. 1.4. 1.5. 1.6. 2. 2.1. 2.2.


2.2.1. 2.2.2. 2.2.3.

Overview of MANETs ................................................................................................ 2 Issues in MANET ....................................................................................................... 3 Aims and Objectives ................................................................................................... 4 Thesis structure ........................................................................................................... 4 MANET Routing Overview ........................................................................................ 5 Classification of Routing Protocols ............................................................................. 6
Proactive Routing Protocols ............................................................................................. 6 Reactive Routing Protocols .............................................................................................. 7 Hybrid Routing Protocols ................................................................................................. 7

Mobile Ad hoc Routing Protocols ..................................................................................... 5

2.3.
2.3.1.

Analysis of MANET Routing Protocols ...................................................................... 7


Ad hoc On-demand Distance Vector Routing (AODV) ..................................................... 8

2.3.1.1.

Description .................................................................................................... 8

2.3.1.1.1. Route table management............................................................................. 9 2.3.1.1.2. Route discovery ........................................................................................ 9 2.3.1.1.3. Route Maintenance ................................................................................. 10 v

2.3.1.2.
2.3.2.

Properties .................................................................................................... 10 Description .................................................................................................. 10 Properties .................................................................................................... 12 Description .................................................................................................. 12

Destination Sequenced Distance Vector Routing (DSDV) .............................................. 10

2.3.2.1. 2.3.2.2.
2.3.3.

Dynamic Source Routing (DSR) ..................................................................................... 12

2.3.3.1.

2.3.3.1.1. Route Discovery ..................................................................................... 13 2.3.3.1.2. Route Maintenance ................................................................................. 14 2.3.3.2. Properties .................................................................................................... 14
2.3.4. Temporarily Ordered Routing Algorithm (TORA) .......................................................... 15

2.3.4.1. 2.3.4.2. 2.4. 3. 3.1.


3.1.1. 3.1.2. 3.1.3. 3.1.4.

Description .................................................................................................. 15 Properties .................................................................................................... 17

Comparison............................................................................................................... 17 Network Simulators Overview .................................................................................. 19


Network Simulator-2 ...................................................................................................... 20 GloMoSim ..................................................................................................................... 20 QualNet ......................................................................................................................... 21 OPNET .......................................................................................................................... 21

Simulation Environment ................................................................................................. 19

3.2.
3.2.1.

Choice of Simulator .................................................................................................. 22


NS-2 Working Flow ....................................................................................................... 23

3.2.1.1. 3.2.1.2. 3.2.1.3. 3.2.1.4. 4. 4.1. 4.2. 4.3.


4.3.1. 4.3.2. 4.3.3. 4.3.4. 4.3.5.

Network Animator ........................................................................................ 23 Tool Command Language ............................................................................ 24 Trace File Format ........................................................................................ 27 AWK Script .................................................................................................. 28

Performance Analysis ..................................................................................................... 31 Simulation Parameters .............................................................................................. 31 Performance Analysis Factors ................................................................................... 32 Simulation Results .................................................................................................... 32
End to End Delay ........................................................................................................... 33 Normalized Routing Load .............................................................................................. 35 Packet Loss Ratio ........................................................................................................... 37 Routing Overhead .......................................................................................................... 39 Packet Delivery Fraction (PDF) ...................................................................................... 41

vi

5.

Conclusion ....................................................................................................................... 43 5.1. 5.2. Summary .................................................................................................................. 43 Future Work.............................................................................................................. 44

6. 7.

References ........................................................................................................................ 45 Appendix A ...................................................................................................................... 47 7.1.


7.1.1. 7.1.2. 7.1.3.

Installation Process of Linux ..................................................................................... 47


Introduction to VMware Workstation ............................................................................. 47 Creating new Virtual Machine ........................................................................................ 47 Installing VM Tools ....................................................................................................... 52

7.2.
7.2.1. 7.2.2.

Installation Process of Network Simulator ................................................................. 53


Getting NS-2 .................................................................................................................. 53 Steps for Installation....................................................................................................... 53

8.

Appendix B ...................................................................................................................... 55 8.1. AWK Program Used ................................................................................................. 55

vii

List of Tables

Table 1: DSDV Routing Table ................................................................................................. 11 Table 2: DSDV Routing Table ................................................................................................. 11 Table 3: Comparison of MANET Routing Protocols................................................................. 17 Table 4: Simulation Parameters ................................................................................................ 31 Table 5: Simulation Results: End to End Delay ........................................................................ 33 Table 6: Simulation Results: Normalized Routing Load ........................................................... 35 Table 7: Simulation Results: Packet Loss Ratio ........................................................................ 37 Table 8: Simulation Results: Routing Overhead........................................................................ 39 Table 9: Simulation Results: Packet Delivery Fraction ............................................................. 41 Table 10: Comparison of MANET Routing Protocols (on the basis of results) .......................... 43

viii

List of Figures

Figure 1: MANET ...................................................................................................................... 2 Figure 2: Ad hoc On-demand Distance Vector Routing Protocol ................................................ 8 Figure 3: Destination Sequenced Distance Vector..................................................................... 11 Figure 4: Destination Sequenced Distance Vector..................................................................... 11 Figure 5: Dynamic Source Routing Protocol............................................................................. 14 Figure 6: Temporarily Ordered Routing Algorithm ................................................................... 16 Figure 7: Simulators Utilization Trend...................................................................................... 19 Figure 8: NS-2 Working Flow .................................................................................................. 23 Figure 9: Screen Shot of Network Animator ............................................................................. 24 Figure 10: Old Wireless Trace File Format ............................................................................... 27 Figure 11: Screen Shot of VMware Workstation....................................................................... 47 Figure 12: Screen shot of New Virtual Machine Icon................................................................ 47 Figure 13: Screen Shot of New Virtual Machine Wizard 1........................................................ 48 Figure 14: Screen Shot of New Virtual Machine Wizard 2........................................................ 48 Figure 15: Screen Shot of CentOS Installation 1 ....................................................................... 49 Figure 16: Screen Shot of CentOS Installation 2 ....................................................................... 49 Figure 17: Screen Shot of CentOS Installation 3 ....................................................................... 50 Figure 18: Screen Shot of CentOS Installation 4 ....................................................................... 50 Figure 19: Screen Shot of CentOS Installation 5 ....................................................................... 50 Figure 20: Screen Shot of CentOS Installation 6 ....................................................................... 50 Figure 21: Screen Shot of CentOS Installation 7 ....................................................................... 51 Figure 22: Screen Shot of CentOS Installation 8 ....................................................................... 52 Figure 23: Screen Shot of CentOS Installation 9 ....................................................................... 52 Figure 24: Screen Shot of VM Tools Installation ...................................................................... 52 Figure 25: Screen Shot of VM Tools Icon................................................................................. 53

ix

List of Graphs

Graph 1: End to End Delay [2 m/s] ........................................................................................... 34 Graph 2: End to End Delay [15 m/s] ......................................................................................... 34 Graph 3: End to End Delay [30 m/s] ......................................................................................... 34 Graph 4: End to End Delay [45 m/s] ......................................................................................... 34 Graph 5: Normalized Routing Load [2 m/s] .............................................................................. 36 Graph 6: Normalized Routing Load [15 m/s] ............................................................................ 36 Graph 7: Normalized Routing Load [30 m/s] ............................................................................ 36 Graph 8: Normalized Routing Load [45 m/s] ............................................................................ 36 Graph 9: Packet Loss Ratio [2 m/s] .......................................................................................... 38 Graph 10: Packet Loss Ratio [15 m/s] ....................................................................................... 38 Graph 11: Packet Loss Ratio [30 m/s] ....................................................................................... 38 Graph 12: Packet Loss Ratio [45 m/s] ....................................................................................... 38 Graph 13: Routing Overhead [2 m/s] ........................................................................................ 40 Graph 14: Routing Overhead [15 m/s] ...................................................................................... 40 Graph 15: Routing Overhead [30 m/s] ...................................................................................... 40 Graph 16: Routing Overhead [45 m/s] ...................................................................................... 40 Graph 17: Packet Delivery Fraction [2 m/s] .............................................................................. 42 Graph 18: Packet Delivery Fraction [15 m/s] ............................................................................ 42 Graph 19: Packet Delivery Fraction [30 m/s] ............................................................................ 42 Graph 20: Packet Delivery Fraction [45 m/s] ............................................................................ 42

Abbreviations

AGT AODV AWK BRP CBR CLR CMU DAG DSDV DSR DYMO FAQ GloMoSim IARP IERP IMEP IP LAR MAC MANET NAM NS ODMRP OLSR OPNET OPSF OS

AGenT Ad hoc On-demand Distance Vector Aho Weinberger and Kernighan Bordercast Resolution Protocol Constant Bit Rate Clear Carngie Mellon University Directed Acyclic Graph Destination Sequenced Distance Vector Dynamic Source Routing Dynamic MANET On-demand Frequently Asked Questions Global Mobile information systems Simulation library IntrAzone Routing Protocol IntErzone Routing Protocol Internet MANET Encapsulation Protocol Internet IP Location Aided Routing Media Access Protocol Mobile Ad hoc NETworks Network Animator Network Simulator On-Demand Multicast Routing Protocol Optimized Link State Routing Operations Network Open Shortest Path First Operation System

xi

PDF RREP RREQ RTR SNT STAR Tcl/Tk TCP TORA UPD QoS QRY VMware WRP ZRP

Packet Delivery Fraction Route REPly Route REQuest RouTeR Scalable Network Technologies Source-Tree Adaptive Routing protocol Tool Command Language Transmission Control Protocol Temporarily Ordered Routing Algorithm Update Quality of Service Query Virtual Machine ware Wireless Routing Protocol Zone Routing Protocol

xii

Abstract

A MANET is a collection of wireless mobile nodes dynamically forming a temporary network without the use of any existing network infrastructure or centralized administration. Due to the limited transmission range of a node, data is forwarded using multi-hops so that one node can be able to exchange data with another node across the network. A variety of new routing protocols targeted specifically at this environment have been developed. This thesis presents the results of a detailed packet-level simulation comparing four prominent MANET routing protocols: Ad hoc On-demand Distance Vector Routing (AODV), Destination Sequenced Distance Vector Routing (DSDV), Dynamic Source Routing (DSR) and Temporarily Ordered Routing Algorithm (TORA). The comparison has been done on the basis of End to End Delay, Normalized Routing Load, Packet Loss Ratio, Routing Overhead and Packet Delivery Fraction (PDF) by varying the maximum speed and pause time. The results reveal that DSDV shows a poor result as compared to AODV and DSR with respect to packet delivery fraction. Also that DSDV will perform better in case of higher traffic load, whereas, AODV and DSR will experience an increased overhead. DSDV is a proactive routing protocol, and so, due to stale information, its performance is indirectly proportional to mobility. It is also concluded that DSR is not very suitable for real-time traffic.

xiii

1.

Introduction to MANET

1.1. Background The next generation of wireless communication systems, needs a rapid deployment of independent mobile users. Major examples include establishing survivable, efficient, dynamic communication for emergency/rescue operations, disaster relief efforts, and military networks. Such network scenarios cannot depend on centralized and organized connectivity, and can be conceived as applications of MANETs. A MANET is an independent collection of mobile nodes that communicate over comparatively bandwidth constrained wireless links. Since the nodes are mobile, the network topology may change quickly and unpredictably over time. The network is decentralized, where all network activity including discovering the topology and delivering messages must be executed by the nodes themselves, i.e., routing functionality will be integrated into mobile nodes.

1.2. Classification of Ad hoc Networks As compared to wired networks, wireless networks have a unique capability of conducting transmission without any wired links to the nodes. Nodes just have to be in each others transmission range. There are two categories of wireless networks, infrastructure based wireless networks and infrastructure less or ad hoc wireless networks.

1.2.1. Infrastructure based wireless networks Infrastructure networks have fixed network topology. Wireless nodes connect through a fixed point known as base station or access point. Mostly, the access point or base station is connected to the main network through a wired link. All of the wireless connections must pass from the base station. If a node is in the range of several base stations, it will connect to any one of those stations on the bases of some criteria [1], for example, communication quality or the content of communication services.

1.2.2. Ad hoc wireless networks(infrastructure less) An ad hoc wireless network is an autonomous system consisting of nodes, which may or may not be mobile, connected with wireless links and without using pre-existing communication infrastructure or central authority. Ad hoc networking is expected to play an important role in the future of wireless mobile networks due to the widespread use of mobile and hand-held devices.

1.3. Overview of MANETs MANET is a self-configuring network of mobile devices connected by wireless links. Each device or node in a MANET is free to move by itself in any direction, and will therefore change its links to other devices frequently. Each node must relay traffic, to another node within its range, and therefore be a router. The most important challenge in building a MANET is equipping each device, such that it can continuously maintain the information required to properly route traffic.

Figure 1: MANET

A MANET can be a standalone network or it can be connected to external networks such as the Internet. MANETs are different from the traditional wired networks on the basis of some characteristics; some of them are discussed below:

Limited bandwidth: Wireless links continue to have significantly lower capacity than their hardwired counterparts [2]. In addition, the realized throughput of wireless communications, after accounting for the effects of multiple access, fading, noise, and interference conditions, etc., is often much less than a radios maximum transmission rate [2].

Dynamic topology: Nodes are free to move arbitrarily; thus, the network topology which is typically multihop may change randomly and rapidly at unpredictable times, and may consist of both bidirectional and unidirectional links.

Energy-constrained operation: Some or all of the nodes in a MANET may rely on batteries or other exhaustible means for their energy. For these nodes, the most important system design criteria for optimization may be energy conservation.

Limited physical security: Mobile wireless networks are generally more prone to physical security threats than are fixed-cable networks. The increased possibility of eavesdropping, spoofing, and denial-of-service attacks should be carefully considered.

Asymmetric Links: All nodes in a MANET do not have the same transmission range, and therefore the links between them posses asymmetric properties.

1.4. Issues in MANET Some salient features that affect the design, deployment, and performance of MANET are as follows: Routing Medium access scheme Multicasting Transport layer protocol Pricing scheme Quality of service provisioning Self-organization Security Energy management Addressing and service discovery Scalability Deployment considerations

1.5. Aims and Objectives The objective for this thesis is to evaluate some of the proposed routing protocols for MANET, based on performance. Furthermore, the following goals have been focused in the thesis: Get a general understanding of MANETs Generate a simulation environment that could be used for analysis Analyze some of the proposed routing protocols for MANETs

1.6. Thesis structure This thesis consists of 6 chapters and two appendices. Chapter 1 enlightens the basic concept of MANETs and its issues. Chapter 2 describes the different routing protocols. Chapter 3 describes the simulator used. Chapter 4 includes the performance analysis that has been done on the protocols. Chapter 5 concludes the whole thesis and chapter 6 is the references that have been used. The appendices contain the installation process of Linux and the simulator along with their screen shots, the AWK program that has been used and the modified codes for protocols.

2. Mobile Ad hoc Routing Protocols

2.1. MANET Routing Overview Routing is the most important aspect in ad hoc network since ad hoc network topology frequently changes and multi-hop communication is required. In MANET, routing is different from other networks and so it has its own protocols for achieving the task of routing, some of them are invented primarily for MANETs, and some were adapted from routing protocols in used wired networks. One of the most important targets of these protocols is that they must be able to work with any topology, because MANETs topology may change at any time. The most important differences between MANETS and conventional networks with respect to routing are: Conventional networks are usually static. This is very different from Ad Hoc networks, where the topology can be very different at different times and may change rapidly. In conventional networks, all the routes can be known in advance. Whereas, in MANETs, this is not always possible due to mobility and it is possible for each node to have the route to reach all the other nodes. In the MANETS it is not wise to overflow the routing information through the network. This is in contrast to conventional networks where bandwidth is not limited. Therefore it becomes clear that MANET routing protocols need to accomplish some goals such as the followings: 1. Distributed operation: Conventional networks always worked in a centralized structure; this does not exist in MANETS. Therefore, routing protocols need to work in a decentralized network without any hierarchy operations are without structure and decentralized. 2. Uni-directional links: Ad hoc routing protocols are designed with a wired network in mind. However, in wired networks, links are assumed to be directional. In ad hoc networks, this is not the case; differences in wireless networking hardware of nodes or radio signal fluctuations may cause uni-directional links, which can only be traversed in one direction. 5

3. Reactive approach: Protocols that follow a reactive approach have to provide the route only when it is needed by the nodes. The problem related to this is that latency can be high [3]. 4. Proactive approach: With this approach the routing protocol must provide the capability to create and maintain the routes in the routing tables continuously without introducing high overhead [3].

2.2. Classification of Routing Protocols Routing protocols can be classified into these categories depending on their properties Proactive Routing Protocols Reactive Routing Protocols Hybrid Routing Protocols

2.2.1. Proactive Routing Protocols For all protocols in this category (also called table-driven protocols), the route is already available when one node wants to send data. It does not matter that the nodes do not need the route at any particular time; they continuously look for an available route. Therefore when the route is needed the information is already available. The time interval at which a route advertisement broadcast is sent is important because it will be a factor which will decide if the network has a good performance or there will be higher overhead in the network. The nodes keep the current route information in two ways, periodically when they do the route discovery and when they discover that any route has changed even if they are not part of the route. An advantage of proactive routing protocols is that when the nodes need the route, they already have the information; hence it provides a very low latency and very good performance. The problem arises when there is overhead in the network; due to routing packets, because nodes require the available routes at all times. Routes which are not required are also maintained. It can be concluded that the overhead is the main disadvantage for proactive routing protocols [4]. Examples of proactive routing protocols are OLSR [5] or DSDV [6]

2.2.2. Reactive Routing Protocols Reactive routing protocols (also called on-demand protocols) obtain routes only when needed. When the node needs to send a packet, it will broadcast a route request. The nodes in its transmission range will receive it and they will broadcast, and so on until some node has a route to the destination or the route request is received by the destination. The nodes which have the route to the destination or the destination itself unicasts a route reply towards the source node. In this kind of protocols the nodes do not try to keep routing information if they do not need it. An advantage of this approach is the overhead in the network is typically low. Therefore, nodes save energy, bandwidth and memory. But as a disadvantage, these protocols have higher route acquisition latency; because when they need a route it first needs to be discovered [4]. Examples of these protocols are AODV [7] or DSR [8].

2.2.3. Hybrid Routing Protocols Both approaches (reactive and proactive) have advantages and disadvantages depending on the characteristics of the networks. The hybrid routing protocols have been created to avoid the disadvantages of the reactive and proactive protocols, but to get the advantages of both at the same time. In hybrid approach there are two different zones, the first one where the nodes are near source node, proactive approach is followed the nodes will maintain the routing tables with the neighbors within a determinate number of hops. In the other zone, the nodes far from the source, the approach to get these nodes is reactive. [3]. Example of these protocols is ZRP [10].

2.3. Analysis of MANET Routing Protocols The protocols that have been analyzed in this thesis are: Ad hoc On-demand Distance Vector Routing Destination Sequenced Distance Vector Routing Dynamic Source Routing Temporarily Ordered Routing Algorithm

2.3.1. Ad hoc On-demand Distance Vector Routing (AODV) 2.3.1.1. Description

The Ad hoc On-Demand Distance Vector(AODV) [7] routing protocol enables multihop routing between participating mobile nodes wishing to establish and maintain an ad-hoc network. AODV is based upon the distance vector algorithm. It is a reactive protocol, it only requests a route when needed and does not require nodes to maintain routes to destinations that are not actively participating in the communication. As long as the end points of a communication connection have valid routes to each other, AODV does not play any role. Features of this protocol include loop freedom and that link breakages cause immediate notifications to be sent to the affected set of nodes, but only that set. Additionally, AODV has support for multicast routing and avoids the Bellman Ford "counting to infinity" problem [11]. The use of destination sequence numbers guarantees that a route is "fresh". The algorithm uses various messages to discover and maintain links. Whenever a node wants to find a route to another node, it broadcasts a Route Request (RREQ) to all its neighbors. The RREQ circulates through the network until it reaches the destination or a node with a fresh enough route to the destination. Then the route is created by unicasting a RREP back to the source.

Figure 2: Ad hoc On-demand Distance Vector Routing Protocol

The algorithm uses hello messages (a special RREP) that are broadcasted periodically to the immediate neighbors. If hello messages stop coming from a particular node, the neighbor can assume that the node has moved away and mark that link to the node as broken and notify the 8

affected set of nodes by sending a link failure notification (a special RREP) to that set of nodes.

2.3.1.1.1.

Route table management

AODV needs to keep track of the following information for each route table entry:

Destination IP Address: IP address of the destination node. Destination Sequence Number: Sequence number of the destination. Hop Count: Number of hops required to reach the destination. Next Hop: The neighbor, which has been chosen to forward packets to the destination for this route entry. Lifetime: The time for which the route is available. Active neighbor list: Neighbor nodes that are currently using this route entry. Request buffer: Makes sure that a request is only used once.

2.3.1.1.2.

Route discovery

A node broadcasts a RREQ when it needs a route to a destination and does not have one already. This can happen if the route to the destination is unknown, or if a previously valid route expires. After broadcasting a RREQ, the node waits for a RREP. If the reply is not received within a certain time, the node may rebroadcast the RREQ or assume that there is no route to the destination. Forwarding of RREQs is done when the node receiving a RREQ does not have a route to the destination. Therefore it rebroadcasts a RREQ. The node also creates a temporary reverse route to the Source IP Address in its routing table with next hop equal to the IP address field of the neighboring node that sent the broadcast RREQ. This is done to keep track of a route back to the original node making the request, and might be used for the last RREP to find its way back to the requesting node. The route is temporary in the sense that it is valid for a much shorter time, than an actual route entry. When the RREQ reaches a node that either is the destination node or a node with a valid route to the destination, a RREP is generated and unicasted back to the requesting node. While this RREP is forwarded, a route is created to the destination and when the RREP reaches the source node, there exists a route from the source to the destination.

2.3.1.1.3.

Route Maintenance

When a node detects that a route to a neighbor no longer is valid, it will eliminate the routing entry and send a link failure message, a triggered route reply message to the neighbors that are actively using the route, informing them that this route no longer is available. For this purpose AODV uses an active neighbor list to monitor the neighbors that are using a particular route. The nodes that receive this message will repeat this procedure. The message will finally be received by the affected sources that can chose to either stop sending data or requesting a new route by sending out a new RREQ.

2.3.1.2.

Properties

The advantage with AODV compared to classical routing protocols like distance vector and link-state is that AODV has very less number of routing messages in the network. This is because of AODVs reactive approach. This advantage pays off when the topology is changing often. AODV routes in a more traditional sense as compared to DSR. The advantage with a more traditional routing protocol in an ad-hoc network is that connections from the ad-hoc network to a wired network like the Internet is most likely easier. The sequence numbers that AODV uses represents the freshness of a route and is increased when something happens in the surrounding area. The sequence numbers prevents the formation of loops. AODV only maintains one route for each destination. It uses hello messages at the IPlevel. The hello messages add a large overhead to the protocol. AODV only supports bi-directional links and not the unidirectional links. When a node receives a RREQ, it will setup a reverse route to the source by using the node that forwarded the RREQ as next hop. This means that the route reply, in most cases is unicasted back the same way as the route request used.

2.3.2. Destination Sequenced Distance Vector Routing (DSDV) 2.3.2.1. Description

DSDV [6] is a hop-by-hop distance vector routing protocol. Each node has a routing

10

table that for all reachable destinations stores the next-hop and number of hops for that destination. Like distance-vector, DSDV requires each node to periodically broadcast routing updates. The advantage with DSDV over traditional distance vector protocols is that DSDV assures loop-freedom. Dest. Next Hop N4 N1 N2 N3 N5 N6
Figure 3: Destination Sequenced Distance Vector

Metric

Seq. No

N4 N2 N2 N2 N6 N6 N6 N6

0 2 1 2 2 1 2 3

S406_N4 S128_N1 S564_N2 S710_N3 S392_N5 S076_N6 S128_N7 S050_N8

N7 N8

Table 1: DSDV Routing Table

Dest.

Next Hop

Metric

Seq. No

N4 N1 N2 N3 N5 N6
Figure 4: Destination Sequenced Distance Vector

N4 N6 N2 N2 N6 N6 N6 N6

0 3 1 2 2 1 2 3

S516_N4 S238_N1 S674_N2 S820_N3 S502_N5 S186_N6 S238_N7 S160_N8

N7 N8

Table 2: DSDV Routing Table

11

Table 1 shows the routing table of DSDV before N1 changes its position, as N1 changes its position; the entries in the routing table are also changed, and can be seen in table 2. To assure loop-freedom DSDV uses a sequence numbers to tag each route. The sequence number represents the freshness of a route and routes with higher sequence numbers are favorable. If the routes have the same sequence number then the one with a lower hop-count I considered to be used. The sequence number is increased when a node N4 detects that a route to a destination N1 has broken. So the next time node N4 advertises its routes, it will advertise the route to N1 with an infinite hop-count and a sequence number that is larger than before. DSDV essentially is distance vector with some adjustments to make it better suited for ad-hoc networks. These adjustments consist of triggered updates that will take care of topology changes in the time between broadcasts. To reduce the amount of information in these packets there are two types of update messages defined: full and incremental dump. The full dump carries all available routing information and the incremental dump only carries the information that has changed since the last dump.

2.3.2.2.

Properties

Because DSDV is dependent on periodic broadcasts it requires some time to converge before a route can be used. This converge time can probably be considered negligible in a static wired network, where the topology is not changing so frequently. On the other hand, in an adhoc network, where the topology is very dynamic, this converge time will probably mean a lot of dropped packets before a suitable route is detected. The periodic broadcasts add a lot of overhead into the network.

2.3.3. Dynamic Source Routing (DSR) 2.3.3.1. Description

Dynamic Source Routing (DSR) [8] [12] is also a reactive protocol. It allows nodes to dynamically discover a route across multiple network hops to any destination. Source routing means that each packet carries the complete ordered list of nodes through which the packet must pass, in its header. DSR does not use periodic routing messages/router advertisements, and so it reduces network bandwidth overhead, conserves battery power and avoids large routing updates throughout the ad-hoc network. DSR relies on support from the MAC layer (the MAC layer

12

should inform the routing protocol about link failures). Route discovery and route maintenance are the two basic modes of operation in DSR.

2.3.3.1.1.

Route Discovery

Route discovery is the mechanism in which a node N1 wishing to send a packet to N8, obtains the source route to N8. Node N1 requests a route by broadcasting a Route Request (RREQ) packet. Every node receiving this RREQ searches through its route cache for a route to the requested destination. DSR stores all known routes in its route cache. If no route is found, it forwards the RREQ further and adds its own address to the recorded hop sequence. This request propagates through the network until either the destination or a node with a route to the destination is reached. When this happens, a Route Reply (RREP) is unicasted back to the initiator. This RREP packet contains the sequence of network hops through which it may reach the destination. In Route Discovery, a node first sends a RREQ with the maximum propagation limit (hop limit) set to zero, not allowing its neighbors to rebroadcast it. By using just a single broadcast packet, this method allows a node to query the route caches of all its neighbors. Nodes can also operate their network interface in promiscuous mode; the interface address filtering is disabled and causes the network protocol to receive all packets that the interface overhears. These packets are scanned for useful source routes or route error messages and then they are discarded. The route back to the initiator can be retrieved in several ways. The simplest way is to reverse the hop record in the packet. Though, this assumes symmetrical links. In order to deal with this, DSR checks the route cache of the replying node. If a route is found, it is used as an alternative. Another way is to piggyback the reply on a RREQ targeted at the initiator. This means that DSR can calculate correct routes in the presence of asymmetric (unidirectional) links. Once a route is found, it is stored in the cache with a time stamp and the route maintenance begins.

13

Figure 5: Dynamic Source Routing Protocol

2.3.3.1.2.

Route Maintenance

Route maintenance is the mechanism by which a packet sender N1 detects if the network topology has changed, lest the route to the destination N8 can no longer be in use. This might happen because a host within a source route, moves out of wireless transmission range or is powered off making the route unusable. A failed link is sensed by either actively monitoring acknowledgements or passively by running in promiscuous mode, overhearing that a packet is forwarded by a neighboring node. When route maintenance senses a problem with a route in use, a route error packet is sent back to the source node. When this error packet is received, the hop in error is removed from this hosts route cache, and all routes that contain this hop are shortened at this point.

2.3.3.2.

Properties

DSR has an advantage of source routing. Intermediate nodes do not need to maintain up-to-date routing information in order to route the packets they relay. There is also no need for periodic routing advertisement messages, which leads to reduced network bandwidth overhead, particularly when little or no significant host is moving. Battery power is also conserved on the mobile hosts, both by not sending the advertisements and by not needing to receive them; a host could go down to sleep as an alternative. The key advantage of this protocol is that it learns routes by scanning for information in packets that are received. A route from N1 to N8 through N2 means that N1 learns the route to

14

N8, but also that it will learn the route to N2. The source route will also mean that N2 learns the route to N1 and N8 and that N8 learns the route to N1 and N2. This form of active learning reduces overhead in the network, which is very good. Each packet carries a slight overhead which contains the source route of the packet. This overhead increases when the packet has to go through more hops to reach the destination. So the packets sent will be somewhat bigger, because of the overhead. Running the interfaces in promiscuous mode can be a serious security issue. As the address filtering of the interface is turned off and all packets are scanned for information. A potential intruder could listen to all packets and scan them for useful information such as passwords and credit card numbers. Applications have to provide the security by encrypting their data packets before transmission. The routing protocols are prime targets for impersonation attacks and therefore they must also be encrypted.

2.3.4. Temporarily Ordered Routing Algorithm (TORA)

2.3.4.1.

Description

Temporally Ordered Routing Algorithm (TORA) [9] is a distributed routing protocol. The core algorithm is one in a family referred to as link reversal algorithms. TORA is designed to minimize the effect of topological changes. A key concept in its design is that control messages are typically confined to a very small set of nodes. It guarantees that all routes are loop-free, but temporary loops may form, and typically provides multiple routes for any source/destination pair. It provides only the routing mechanism and depends on Internet MANET Encapsulation Protocol (IMEP) [13] for other basic functions. TORA can be divided into three basic functions: creating routes, maintaining routes, and erasing routes. The creation of routes basically assigns directions to links in an undirected network or portion of the network, building a directed acyclic graph (DAG) rooted at the destination (See Figure 6). TORA assigns a height to node in the network. All messages in the network flow downstream, from a node with higher height to a node with lower height. Query (QRY) and Update (UPD) packets are used to discover routes. When a node with no downstream links needs a route to a destination, it will broadcast a QRY packet. This QRY packet will spread through the

15

network until it reaches a node that has a route to the destination or it is the destination itself. Such a node will then broadcast a UPD packet that contains the node height. Every node receiving this UPD packet will set its own height to a larger height than specified in the UPD message. The node then broadcasts its own UPD packet. This will result in a number of directed links from the originator of the QRY packet to the destination. This process may result in multiple routes. Maintaining routes refers to reacting to topological changes in the network in a manner such that routes to the destination are re-established within a finite time, meaning that its directed portions return to a destination-oriented graph within a finite time. Upon detection of a network partition, all links in the portion of the network that has become partitioned from the destination are marked as undirected to erase invalid routes. Routes are erased by using clear (CLR) messages.

Figure 6: Temporarily Ordered Routing Algorithm

16

2.3.4.2.

Properties

A comparison made by the CMU Monarch project [12] has shown that the overhead in TORA is quite large because it uses IMEP for some of its basic functions. The graph is aimed at the destination, which has the lowest height. However, the source originating the QRY does not necessarily have the highest height. This can lead to the situation, where multiple routes are possible from the source to the destination, but only one route will be discovered. The reason for this is that the height is initially based on the distance in number of hops from the destination.

2.4. Comparison As yet, the protocols have been analyzed theoretically. Table 3 summarizes and compares the result from these theoretical analyses and shows which protocol has what property.

AODV Loop-free Multiple routes Distributed Routing Philosophy Unidirectional link support QoS Support Multicast Security Power conservation Periodic broadcasts Requires reliable or sequenced data Routing Metric Yes No Yes Reactive No No Yes No No Yes (When needed) No Freshest & shortest path

DSDV Yes No Yes Proactive No No No No No Yes No Shortest path

DSR Yes Yes Yes Reactive Yes No No No No No No Shortest path

TORA No, (temporary loops) Yes Yes Reactive No No No No No Yes (IMEP) Yes Shortest path

Table 3: Comparison of MANET Routing Protocols

17

The only proactive protocol in this comparison is DSDV. It is the most similar protocol to traditional routing protocol in wired networks. The addition of sequence numbers ensures loopfree routes. DSDV will probably be good enough in networks, with low mobility. The authors of DSDV reckoned the same and designed AODV, which is a reactive version of DSDV. They also added multicast capabilities, which will enhance the performance considerably when one node communicates with several nodes. The reactive approach in AODV has many similarities with that of DSR. They both have a route discovery mode that uses request messages to find new routes. The difference is that DSR is based on source routing and will learn more routes than AODV. DSR also has the advantage that it supports unidirectional links. DSR has however one major drawback and it is the source route that must be carried in each packet, causing an increase in overhead. This can be quite costly, especially when considering QoS and also when there are a lot of nodes. AODV can connect to the internet more easily, as compared to DSR because of its traditional routing. It can be concluded that none of these protocols take smart routing decisions when a networks goes through high traffic load. Since the route selection factor used by these protocols are metrics such as the shortest hop count and the fastest response time to a request, it might lead to a situation where all the traffic gets routed through the same route even if there are other routes available with lesser traffic load.

18

3. Simulation Environment

3.1. Network Simulators Overview There are several simulation programs that can be used for the simulation. According to a survey carried out in 2005, the simulator utilization rate are as seen in Figure 7 in the form of a pie chart, in which each segment represents a particular simulator. From this figure, the three most popular simulators, NS-2 (39%), GloMoSim (21%), and OPNET (9%), accounted for more than 2/3 of the simulators used. NS-2, GloMoSim, and OPNET are highly modular discrete event simulators. These simulators are provided for simulating the behavior of networks in a complex network topology [14]. For this thesis, a survey was carried out to find the best suitable simulator, based on the following criteria: How difficult is the installation? How frequent is the simulator used in research-papers regarding MANETs? Is it open source? Which protocols does it support? How user friendly is it? How well is its documentation?

Figure 7: Simulators Utilization Trend

19

3.1.1. Network Simulator-2 This simulator is probably the most commonly used software of the four. Network Simulator 2 [15], also called NS-2, is developed by ISI, the Information Sciences Institute at the USC School of engineering. The source code is free of charge. There is a comprehensive manual for the installation and use of the software on the NS-2 homepage [16]. The software is mostly text-based and can be complicated to use if the user is not familiar with Unix-commands. Some parts are managed with GUIs, which makes it easier to understand the happenings. NS-2 (now NS-3) is constantly under development and its progress can be monitored on its homepage. There is also a bug report forum where users can report any problems and bugs they encounter while using NS-2. In addition to these features there are also a FAQ and the possibility to sign up to different ns-related mailing lists.

3.1.2. GloMoSim GloMoSim stands for Global Mobile information systems Simulation library and supports protocols for a purely wireless network [17]. Its developed at UCLA Parallel Computing Laboratory (UCLA PCL) and is intended for academic institutions for research purposes. The current version, GloMoSim 2.0 (December 2000), can be downloaded from the GloMoSim homepage if you are within the edu domain. If commercial users want to use GloMoSim theyll have to obtain the commercial version called QualNet. This version is extended in some areas. You can read more about it in section 3.1.3. In order to get GloMoSim to work you will need the latest Parsec Compiler (included with the GloMoSim distribution), Parsec is a C-based simulation language developed by PCL at UCLA. There is very little documentation of the installation procedure, which is poorly described. If the user runs into trouble while installing, the documentation would not be of much use. Protocols supported by GloMoSim are AODV, Bellman-Ford, DSR, Fisheye, LAR, ODMRP and WRP. Developing ones own protocols in GloMoSim is possible. But to do so the user should have some familiarity with Parsec. Although the code to the protocols will be written

20

purely in C code, with some Parsec functions for time management, Parsec compiler will be needed. Although there are some papers in which GloMoSim have been used, its not as frequently used as NS-2. Also there is no FAQ, forum or a mailing list on the homepage.

3.1.3. QualNet QualNet is a software for network simulations, developed by SNT (Scalable Network Technologies). SNT claims that QualNet can be used for designing a network or network device to optimize it, saving time and money [18]. The QualNet software consists of five tools plus integration modules and model libraries. QualNet Animator allows for graphically designing the network model (using a wide library of components) and can be used to display the simulation as it runs or later on. QualNet Designer allows users to generate code for their own protocol from scratch and make special statistic reports. Adjustments can be made to already defined protocol models. QualNet Analyzer is a graphic tool that presents statistics of different experiments in graphs. The QualNet model library is a large library of networking options and contains the MANET library. It includes models for providing wireless dynamic routing, shadowing, fading, mobility, detailed physical layer effects such as steerable directional antennas and complex modulation schemes. Routing protocols provided are AODV, BRP, DSR, DYMO, Fisheye, IARP, IERP, LAR, OLSR, STAR, ZRP and ODMRP. Documentation and help can be found at their homepage [18]. There are manuals as well as a FAQ and a forum. Users can also get support by emailing or phoning SNT. QualNets customers include companies like Microsoft and Boeing and it is used by the military. There are also some publications done featuring QualNet as the simulation tool.

3.1.4. OPNET OPNET is a simulation tool that is developed by OPNET Technologies Inc. They are a leading provider of management software for networks and applications. OPNET have a number solutions that aims to help the customer in different areas like, application performance troubleshooting, application deployment planning, network configuration auditing, network capacity and resiliency planning and network technology R&D.

21

For simulating a MANET, OPNET provides a software platform called the OPNET Modeler. This software also contains a large number of different models for simulating network protocols, technologies and applications. There is a wireless model included that provides these routing protocols AODV, DSR, OLSR, OPSF and TORA. Although OPNET is rather intended for companies to diagnose and organize their networks, individual users can develop and implement their own protocol or modify existing implementations of standard protocols. The software tends to be well documented and there shouldnt be any problems either with the installation or support. On the homepage [19] there are technical resources with a FAQ and product updates as well as a forum for OPNET users. To be able to participate in the forum and download the documents you have to have a license since they are protected by passwords. On the negative part the software is very expensive and not easy to obtain for single individuals.

3.2. Choice of Simulator When choosing a simulation program the question of what you want to simulate and which resources you have to conduct these simulations are of key importance. The simulation work for this thesis can be done on any of these four simulators. But due to time limitation and the available backup provided, the choice was quite limited. The question also arises of how much open source code that is publicly available. This is an important factor since time is limited and implementing a protocol or writing the simulation code will require a lot of time. GloMoSim is available for downloading only if your IP address resolves to an academic domain name. The documentation isnt very good and it seems to be hard to get any kind of support. Although some papers have used GloMoSim to simulate MANET protocols, the question is how to compare results with those who have used other simulators. NS-2 is free to download and researchers for simulating MANETs commonly use it. It has an extensive manual and some support in the mailing list. New features are developed continuously and added functions for protocols are available for downloading. Altogether the choice of simulation program is quite clear; NS-2 provides the best overall solution.

22

3.2.1. NS-2 Working Flow Figure 8 shows a block diagram of the working flow of NS-2. The mobility pattern file specifies the initial position and the gradual movement of the nodes. The connection pattern file specifies the traffic flow and how the nodes are connected. These two files are embedded into the Tcl script, which subsequently runs on an NS-2. This Tcl file creates two output files: NAM file and trace file. The NAM file contains the visual animation of the scenario and can be viewed on the network animator (NAM). The trace file contains the operations of a simulation represented as a chronological sequence of events. Each event occurs at an instant in time. Trace file contains raw data and AWK is used to extract useful data from them e.g. delay, overhead, throughput etc. After having the information in the appropriate format, to plot the result graphs is the last task for obtaining the information to evaluate the simulations. The graphs are used to examine and compare the results of different simulation scenarios.

Figure 8: NS-2 Working Flow

3.2.1.1.

Network Animator

Nam is a Tcl/TK based animation tool for viewing network simulation traces and real world packet traces. It supports topology layout, packet level animation, and various data inspection tools. Visualization of mobile nodes can be viewed as animations on NAM. Figure 9 shows the animation of a MANET with 25 nodes.

23

Figure 9: Screen Shot of Network Animator

3.2.1.2.

Tool Command Language

Tcl is a scripting language which provides interfacing with C++ objects such as agents, protocols, links, queues etc. In the beginning of a Tcl file, variables are defined and can be seen in the code below:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. set val(chan) Channel/WirelessChannel set val(prop) Propagation/TwoRayGround set val(netif) Phy/WirelessPhy set val(mac) Mac/802_11 set val(ifq) Queue/DropTail/PriQueue set val(ll) LL set val(ant) Antenna/OmniAntenna set val(x) 1000 ;# X dimension of the topography set val(y) 1000 ;# Y dimension of the topography set val(ifqlen) 50 ;# max packet in ifq set val(seed) 1.0 set val(adhocRouting) AODV set val(nn) 25 ;# how many nodes are simulated set val(cp) "/root/ns-allinone-2.33/ns2.33/tcl/mobility/scene/aodv/cp/aodv-00-15-3"

24

15. set val(sc) "/root/ns-allinone-2.33/ns2.33/tcl/mobility/scene/aodv/sc/aodv-00-15-3" 16. set val(stop) 600.0 ;# simulation time

In the main program, first of all, the global variables are initialized:
17. set ns_ 18. set topo [new Simulator] [new Topography]

19. set tracefd [open aodv-00-15-3.tr w] 20. set namtrace [open aodv-00-15-3.nam w] 21. $ns_ trace-all $tracefd 22. $ns_ namtrace-all-wireless $namtrace $val(x) $val(y)

A simulator instance is being created in line 17, line 18 sets up a topography object. Line 19, 20, 21 and 22 creates trace object for NS and NAM.
23. $topo load_flatgrid $val(x) $val(y) 24. set god_ [create-god $val(nn)]

In line 23 a new topology instance is being defined as a flat grid of area x meters x y meters, the values of x and y are defined in the beginning. Line 24 creates a God instance. The number of wireless nodes is passed as an argument. It is used to create a matrix to store connectivity information of the topology. The next code will define how nodes should be created:
25. $ns_ node-config -adhocRouting $val(adhocRouting) \ 26. -llType $val(ll) \ 27. -macType $val(mac) \ 28. -ifqType $val(ifq) \ 29. -ifqLen $val(ifqlen) \ 30. -antType $val(ant) \ 31. -propType $val(prop) \ 32. -phyType $val(netif) \ 33. -channelType $val(chan) \ 34. -topoInstance $topo \ 35. -agentTrace ON \ 36. -routerTrace ON \ 37. -macTrace OFF

25

Line 25 37 defines the global node setting; the variables defined in the beginning are being called in this section.
38. 39. 40. 41. for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion }

Line 38 41 creates the specified number of nodes [$val(nn)] and "attach" them to the channel.
42. puts "Loading connection pattern..." 43. source $val(cp) 44. puts "Loading scenario file..." 45. source $val(sc)

Line 42 and 43 defines the node movement model, whose path is provided in the beginning. Line 44 and 45 defines the traffic model whose path is also provided in the beginning.
46. for {set i 0} {$i < $val(nn)} {incr i} { 47. $ns_ initial_node_pos $node_($i) 20 48. }

Line 46 48 defines the initial position of the nodes in NAM.


49. for {set i 0} {$i < $val(nn) } {incr i} { 50. $ns_ at $val(stop).0 "$node_($i) reset"; 51. } 52. $ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"

53. puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)" 54. puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)" 55. puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)" 56. puts "Starting Simulation..." 57. $ns_ run

Line 49 57 tells the nodes when the simulation ends.

26

3.2.1.3.

Trace File Format

The trace file provides traces of all the events that occurred during the simulation in a chronological sequence. Each event occurs at an instant in time. The trace file format used in this thesis is the old wireless trace format. The traces in a trace file may look like this:

s 100.691175361 _13_ RTR --- 758 cbr 532 [0 0 0 0] ------- [13:1 14:0 30 8] [17] 0 3 r 100.694465925 _11_ AGT --- 757 cbr 532 [13a b 12 800] ------- [9:3 11:0 29 11] [64] 2 2 r 100.700628759 _8_ RTR --- 758 cbr 532 [13a 8 d 800] ------- [13:1 14:0 30 8] [17] 1 3 f 100.700628759 _8_ RTR --- 758 cbr 532 [13a 8 d 800] ------- [13:1 14:0 29 19] [17] 1 3 It can be seen that the variables are separated by spaces. Figure 10 explains the format:

Figure 10: Old Wireless Trace File Format

Some variables are further explained as follows [20]: The operation performed can be of four types: o s = send o r = receive

27

o f = forward o D = drop Service of the node or the trace level can be o AGT = agent o RTR = router o MAC = media access control The different reasons for dropping a packet are given below: o END = end of simulation o COL = MAC collision o DUP = MAC duplicate o ERR = MAC packet error o RET = MAC retry count exceeded o STA = MAC invalid state o BSY = MAC busy o NRTE = no route is available o LOOP = there is a routing loop o TTL = time to live has reached zero o TOUT = packet has expired o CBK = MAC callback o IFQ = no buffer space in IFQ o ARP = dropped by ARP o OUT = dropped by base stations on receiving routing updates from nodes outside its domain

3.2.1.4.

AWK Script

The word AWK is derived from the names of its inventors (Aho Weinberger and Kernighan). AWK is a C-like-programming language designed to search files for lines (or other units of text) that contain certain patterns, either in files or data streams. The raw data contained in trace files can be processed using AWK to extract useful data, such as throughput, jitter, packet loss ratio, end to end delay etc.

28

The structure of an AWK script contains three sections: BEGIN Pattern END The BEGIN section executes only one time i.e.in the beginning of the script. Usually, variables are defined in this section, if a user wants to print a heading; it could be done in this section too. As the name says, the pattern section contains the pattern that the user is looking for, in a particular file or data stream. This pattern executes throughout the file. The functions defined in this section are executed on one line at a time. The END section also executes only once i.e. in the end. This section usually contains printf functions and final calculations. Consider the following input data stream:

s 100.691175361 _13_ AGT --- 758 cbr 532 [0 0 0 0] ------- [13:1 14:0 30 8] [17] 0 3 r 100.694465925 _11_ AGT --- 757 cbr 532 [13a b 12 800] ------- [9:3 11:0 29 11] [64] 2 2 r 100.700628759 _8_ RTR --- 758 cbr 532 [13a 8 d 800] ------- [13:1 14:0 30 8] [17] 1 3 f 100.700628759 _8_ RTR --- 758 cbr 532 [13a 8 d 800] ------- [13:1 14:0 29 19] [17] 1 3

And an AWK script which calculates sent packets:


BEGIN{ printf (Sent Packets:); Sent=0; } { if (( $1 == "s") && { sent++; } } END{ printf ( Sent Packets = %d,\n, sent); } ($7 == cbr) && ($4=="AGT" ))

29

After running this AWK script on the data stream, the output would be:
Sent Packets: Sent Packets = 1

30

4. Performance Analysis

4.1. Simulation Parameters As scenario is a very crucial part of the simulation, 5 instances were created for each scenario. The result was then compiled using average of those 5 instances. The simulation parameters that have been used for the simulations are shown in Table 4. It can be seen that the maximum speed, the pause time and the protocols have been varied.

Parameter Transmission Range of each node Total Nodes Maximum Connections Data Rate Packet Rate Node Speed Pause Time Traffic Type Routing Protocols Propagation Model Queue Type Simulation Time Area Size Packet Size Initial Node Placement NS-2 version
Table 4: Simulation Parameters

Value 250 m 25 nodes 15 connections 11 Mbps 1 Packet/sec 2, 15, 30 and 45 m/s 0, 15, 30, 45 and 100 sec Constant Bit Rate (CBR) AODV, DSDV, DSR and TORA Random WayPoint Droptail 600 sec 1000 x 1000 m 512 bytes Random NS-2.29 and NS-2.33

31

4.2. Performance Analysis Factors Before going into the actual simulation results, the factors to be measured when comparing routing protocols in MANET are described. The performance analysis is based on the following factors as a function of maximum speed and pause time:

End to End Delay o It is the time taken by a packet to reach the destination o It is preferred low Normalized Routing Load o It is a ratio of network control packets to all delivered packets o It is preferred low Packet Loss Ratio o It is the ratio of sent packets to those not received at their destinations o It is preferred low Routing Overhead o It is the number of routing packets o It is preferred low Packet Delivery Fraction (PDF) o The ratio of the data packets delivered to the destinations to those generated by the CBR sources o It is preferred high

4.3. Simulation Results The results obtained during the simulation are depicted in this section. The protocols that have been simulated are DSDV, AODV, DSR and TORA, to compare how much better/worse these protocols perform in different scenarios. The simulations were conducted on a Dell Latitude E5500 Laptop with an Intel Core 2 Duo processor at 2.4 GHz, with 2 Gigabytes of RAM. In these simulations there are four types of different scenarios used, based on the maximum speed of the nodes. The results will conclude how each protocol performs in the different scenarios. The simulation results on the basis of chosen factors can be seen as follows:

32

4.3.1. End to End Delay

End to End Delay Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 2 m/s AODV 0.110 0.084 0.070 0.214 0.172 DSDV 0.066 0.048 0.042 0.044 0.054 15 m/s DSDV 0.232 0.150 0.178 0.090 0.088 30 m/s DSDV 0.256 0.248 0.302 0.226 0.146 45 m/s DSDV 0.208 0.510 0.310 0.370 0.108 DSR 0.260 0.640 0.552 0.514 0.730 TORA 0.358 0.418 0.334 0.670 0.364

AODV 0.254 0.378 0.388 0.490 0.404

DSR 1.544 1.038 2.078 1.562 1.080

TORA 0.764 1.392 0.880 1.108 1.094

AODV 0.452 0.352 0.466 0.482 0.466

DSR 1.658 1.896 2.376 1.616 2.568

TORA 0.972 1.486 1.642 1.450 1.710

AODV 0.438 0.570 0.588 0.710 0.536

DSR 1.134 1.738 2.192 3.170 2.392

TORA 1.682 1.306 1.558 1.590 1.368

Table 5: Simulation Results: End to End Delay

33

Graph 1: End to End Delay [2 m/s]

Graph 2: End to End Delay [15 m/s]

Graph 3: End to End Delay [30 m/s]

Graph 4: End to End Delay [45 m/s]

End-to-end delay of data packets includes all possible delay caused by buffering during route discovery latency, transmission delays at the MAC, queuing at interface queue, and propagation and transfer time. Among these four protocols, DSDV has the least average end-toend delay. DSDV is a proactive protocol and the advantage of being one is that a path to a destination is immediately available, so it experiences no delay for route discovery, when an application needs to send a packet. DSR is a source routing protocol, therefore it has longer delay because its route discovery takes more time as every intermediate node tries to extract information before forwarding the reply, throughout the path. Hence, while source routing makes route discovery more profitable, it slows down the transmission of packets. This is the reason why AODV performs better than two other reactive protocols in general.

34

4.3.2. Normalized Routing Load

Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100

Normalized Routing Load 2 m/s AODV DSDV 0.654 0.318 0.686 0.302 0.738 0.282 0.960 0.314 1.012 0.310 15 m/s DSDV 0.570 0.620 0.640 0.562 0.548 30 m/s DSDV 0.806 0.960 0.876 0.822 0.598 45 m/s DSDV 0.950 1.180 1.190 1.008 0.684

DSR 0.328 0.448 0.382 0.356 0.446

TORA 3.172 3.784 3.634 3.158 3.890

AODV 2.148 2.236 2.240 2.322 1.854

DSR 1.544 1.174 1.708 1.558 1.006

TORA 7.236 10.188 8.346 8.622 8.500

AODV 3.140 2.834 2.884 2.922 2.528

DSR 2.084 2.270 2.116 1.764 1.538

TORA 10.900 12.658 12.442 12.306 10.094

AODV 3.884 3.698 3.554 3.148 2.672

DSR 2.948 2.540 2.590 2.520 1.970

TORA 15.128 14.032 12.220 12.296 7.588

Table 6: Simulation Results: Normalized Routing Load

35

Graph 5: Normalized Routing Load [2 m/s]

Graph 6: Normalized Routing Load [15 m/s]

Graph 7: Normalized Routing Load [30 m/s]

Graph 8: Normalized Routing Load [45 m/s]

The results show that TORA has the highest normalized routing load; this is because TORA uses IMEP for its basic functions. DSDV being a proactive protocol enjoys the advantage of having the lowest normalized routing load, because proactive routing protocols do not need too much routing packets. The normalized routing load of AODV is higher than DSR, because AODV periodically broadcasts hello messages and DSR does not. The normalized routing load of TORA increases drastically as the mobility is increased, whereas, in the case of AODV and DSR, it increases slightly.

36

4.3.3. Packet Loss Ratio

Packet Loss Ratio Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 AODV 17.260 18.160 21.640 23.170 27.650 DSDV 60.740 65.040 65.450 62.040 51.820 AODV 14.760 14.960 17.080 20.320 25.790 DSDV 52.690 59.160 57.130 56.960 48.030 45 m/s DSR 4.980 7.320 7.380 11.030 16.950 TORA 31.626 31.173 33.052 36.687 34.362 AODV 14.110 15.190 15.890 19.830 20.390 DSDV 43.350 47.150 50.180 44.140 46.490 30 m/s DSR 6.170 7.310 8.550 8.230 14.530 TORA 26.575 34.059 35.465 35.795 35.780 AODV 7.010 10.440 9.330 18.990 21.540 DSDV 27.850 25.130 21.570 25.640 29.910 15 m/s DSR 6.540 4.950 12.170 11.160 7.930 TORA 21.221 30.683 25.712 30.449 32.025 2 m/s DSR 4.720 10.550 5.680 4.890 10.430 TORA 19.823 24.573 20.155 21.955 23.453

Table 7: Simulation Results: Packet Loss Ratio

37

Graph 9: Packet Loss Ratio [2 m/s]

Graph 10: Packet Loss Ratio [15 m/s]

Graph 11: Packet Loss Ratio [30 m/s]

Graph 12: Packet Loss Ratio [45 m/s]

DSR has the lowest packet loss ratio because it stores the information of multiple paths, whereas AODV does not. Whenever a link breaks AODV broadcasts a route request and waits for some time to get new information by receiving a route reply; during this time AODV will queue the packets, which are sometimes dropped because of expiration in the AODV queue. But DSR will send the packets through an alternate path. DSDV has the highest packet loss ratio because, being a proactive protocol, it sends packets even before the routing tables have had enough time to converge and so the packets are dropped, because it sends packets on a broken route that is listed as valid in its routing table. Majority of dropped packets in TORA are due to routing loops, and it increases with the increase in mobility.

38

4.3.4. Routing Overhead

Routing Overhead Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 AODV 26147.4 24290.6 22514.4 19400.6 15530.8 DSDV 3030.6 3342.8 3320.4 3074.8 2568.2 AODV 21682.6 19475.2 19413.8 18793.2 14829.8 DSDV 3059.6 3163.2 2987.6 2848.2 2499.8 AODV 14877.0 15402.0 15199.6 15091.6 11928.4 DSDV 2618.2 2644.2 2580.2 2517.4 2364.2 AODV 4922.6 4973.8 5194.6 6224.0 6364.2 DSDV 1853.6 1838.0 1776.8 1885.8 1749.8 2 m/s DSR 2396.2 3113.2 2906.6 2725.2 3205.2 15 m/s DSR 11633.4 9072.6 12159.6 11285.8 7532.0 30 m/s DSR 15813.8 16962.8 15627.4 13139.6 10617.0 45 m/s DSR 22788.2 19151.2 19424.6 17403.4 13110.8 TORA 81468.6 76536.0 64518.6 61352.2 38457.6 TORA 64271.2 65920.2 62297.2 62582.2 49306.0 TORA 45000.4 51545.2 48791.6 47144.0 46046.4 TORA 20569.0 21338.4 22665.8 19167.8 23126.4

Table 8: Simulation Results: Routing Overhead

39

Graph 13: Routing Overhead [2 m/s]

Graph 14: Routing Overhead [15 m/s]

Graph 15: Routing Overhead [30 m/s]

Graph 16: Routing Overhead [45 m/s]

TORA has high routing overhead because IMEPs feedback loops cause heavy congestion and it increases significantly with the increase in mobility. AODV has more routing overhead than DSR because route discoveries usually propagate to every node in the network. DSR uses routing cache aggressively, and maintains multiple routes per destination. Routing overhead in DSDV is more or less constant. This is due to the tremendous overhead incurred by DSDV when exchanging routing tables.

40

4.3.5. Packet Delivery Fraction (PDF)

Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 Max. Speed Pause Time 0 15 30 45 100 AODV 82.668 81.644 78.070 76.438 71.866 AODV 85.108 84.894 82.704 79.460 73.720 AODV 85.788 84.510 84.002 80.008 79.168 AODV 92.938 89.398 80.422 80.848 78.276

Packet Delivery Fraction 2 m/s DSDV 72.140 74.764 78.326 74.286 69.994 15 m/s DSDV 56.660 52.812 49.770 55.864 53.476 30 m/s DSDV 47.324 40.852 42.842 43.016 51.950 45 m/s DSDV 39.260 34.974 34.568 37.916 48.170 DSR 94.948 92.586 92.456 88.646 82.590 TORA 68.084 67.902 65.598 61.790 63.464 DSR 93.654 92.472 91.088 88.646 85.072 TORA 72.656 64.814 63.060 63.248 61.368 DSR 93.138 94.802 87.538 91.558 91.866 TORA 78.180 68.122 72.964 67.450 65.842 DSR 95.234 89.294 94.232 88.492 89.362 TORA 79.546 72.428 77.322 76.406 74.776

Table 9: Simulation Results: Packet Delivery Fraction

41

Graph 17: Packet Delivery Fraction [2 m/s]

Graph 18: Packet Delivery Fraction [15 m/s]

Graph 19: Packet Delivery Fraction [30 m/s]

Graph 20: Packet Delivery Fraction [45 m/s]

DSDVs packet delivery fraction (PDF) is very less due to stale routing information. If a node using DSDV is transmitting data and link failure occurs, it queues the packets until it gets a new path for the desired destination. Node starts to drop the packets if the queue is full, and happens frequently at high mobility. Also, as the nodes speed increases, the difference in PDF becomes bigger; this is because as speed increases, the probability of link failure increases. AODV broadcasts a route request immediately in case of a link failure, and so its PDF is quite better as compared to DSDV. DSR on the other hand uses alternate path that it has saved during route discovery, and so enjoys a higher PDF. TORA has comparatively less PDF than AODV and DSR, due to the reason that it drops a lot of packets as a result of routing loops.

42

5. Conclusion

5.1. Summary In the previous chapter, the performance analysis was done, which brings out these comparative results:

Factors End to End Delay Normalized Routing Load Packet Loss Ratio Routing Overhead Packet Delivery Fraction DSDV DSDV DSR DSDV DSR

Best to Worse Performer AODV DSR AODV DSR AODV TORA AODV TORA AODV TORA DSR TORA DSDV TORA DSDV

Table 10: Comparison of MANET Routing Protocols (on the basis of results)

The results are summarized as follows:

The fraction of packets received for AODV is in a range of 70-100%, and for DSR, it is in a range of 80-100%, this is because they have link layer support for link breakage and so they are much more stable. Whereas DSDV highly depends on periodic broadcasts and so it shows a rather poor result, not even 50% of the packets are received when mobility is increased. In case of a higher traffic load, congestion will occur and packets will be dropped. So if the routing protocol is fast enough in finding a route, the packets will have to spend less time in a buffer, which will result in a smaller probability of packet drops. DSDV would perform very well in such cases, but the overhead of AODV and DSR would definitely increase. The overall performance of DSDV decreases as mobility is increased, because of stale information in its routing tables.

43

DSR performs better over AODV and TORA, because it has source routing, and it stores multiple paths, so that it may react instantly in case of a broken route. It is also observed that DSR has higher end to end delay, and that makes DSR not very suitable for real-time traffic. 5.2. Future Work Mobile ad-hoc networks are of increasing interest in a lot of applications, such as collaborative computing, sensing networks, potential fourth generation wireless systems, and reaction to incidents that destroyed the existing communication structure. There is much research going on and there are yet many issues that could be subject to further studies. Some of them are: Simulator Environment: Using an improved simulator environment, e.g. by using more protocols (e.g. ZRP), by varying number of nodes, by varying transmission range etc. Security: It is an important issue, as routing protocols are prime targets for impersonation attacks, and MANETS are formed without any centralized authority. TCP Variants: As TCP is optimized for wired links, it is not suitable for MANETs; therefore its variants are designed such that they can use the bandwidth efficiently. Quality of Service: the needs for Quality of Service can be taken under concern, considering what purpose the network is created for. Energy Management: It is an essential requirement for the efficient operation of the battery powered MANETs.

The field of MANETs is rapidly on the rise and changing, and while there are yet many challenges that need to be met, it is likely that such networks will see widespread use in a few years time.

44

6. References

[1]

K. Leung, et. al., Transmission Control Protocol (TCP) in wireless Networks: issues, approaches and challenges. IEEE Communications Survey, Vol. 8 No. 4, pp. 64-79, 4th October 2006.

[2] [3]

http://www.ietf.org/rfc/rfc2501.txt Bjrn Wigerg, et. al., Porting AODV-UU Implementation to NS-2 and Enabling TraceBased Simulation. Uppsala University, December 2002. C.Siva Murthy, et. al., Ad Hoc Wireless Networks Architectures and Protocols. Published May 24, 2004 by Prentice Hall.

[4]

[5] [6]

http://www.ietf.org/rfc/rfc3626.txt Charles Perkins, et. al., Highly dynamic destination-sequenced distance vector routing (DSDV) for mobile computers. Charles Perkins, et. al., Ad-hoc On-Demand Distance Vector Routing. In Proceedings WMC-SA 99, Second IEEE Workshop on Mobile Computing Systems and Applications, pp.90-100, Feb 1999. D. Johnson, et. al., Dynamic Source Routing in Ad Hoc Wireless Networks. Computer Communication Review Proceedings of SIGCOMM 96, Aug. 1996. V. D. Park, et. al., A Highly Adaptive Distributed Routing Algorithm for Mobile Wireless Networks, Proc. INFOCOM 97, Apr. 1997.

[7]

[8]

[9]

[10] Haas, J., 1997, A new routing protocol for the reconfigurable wireless networks, Proc. of IEEE 6th International Conference on Universal Personal Communications 97, pp. 562 566. [11] http://wiki.uni.lu/secan-lab/Count-To-Infinity+Problem.html [12] Josh Broch, et. al., A Performance Comparison of Multi-hop wireless Ad hoc Network Routing Protocols. Mobicom 98, Dallas Texas, 25-30 October, 1998. [13] M. S. Corson, et. al., Internet MANET Encapsulation Protocol (IMEP) Specification. Internet Draft draft-ietf-manet-imep-spec-01.txt

45

[14] C. R. Dow, et. al., A Study of Recent Research Trends and Experimental Guidelines in Mobile Ad-hoc Networks. Proceedings of the 19th International Conference on Advanced Information Networking and Applications (AINA05). [15] http://www.isi.edu/nsnam/ns/ [16] http://www.isi.edu/nsnam/ns/ns-documentation.html [17] http://pcl.cs.ucla.edu/projects/glomosim/ [18] http://www.scalable-networks.com/products/qualnet/ [19] http://www.opnet.com/ [20] http://www.isi.edu/nsnam/ns/doc/node186.html

46

7. Appendix A

7.1. Installation Process of Linux 7.1.1. Introduction to VMware Workstation Virtual Machine ware (VMware) allows multiple standard operating systems and their applications to run with high performance in secure and transportable virtual machines. Each virtual machine is equivalent to a PC with a unique network address and full complement of hardware choices.

Figure 11: Screen Shot of VMware Workstation

7.1.2. Creating new Virtual Machine A new virtual machine can be created by clicking the icon shown in the figure below:

Figure 12: Screen shot of New Virtual Machine Icon

It is optional whether you install the operating system using a CD or an iso image.

47

Figure 13: Screen Shot of New Virtual Machine Wizard 1

As Cent OS is not a pre defined system in VMware, Red Hat Enterprise Linux 5 is used as an equivalent.

Figure 14: Screen Shot of New Virtual Machine Wizard 2

Chose the disk size you want to assign to this particular machine and power it on, the following screen will appear.

48

Figure 15: Screen Shot of CentOS Installation 1

The machine will now load the iso image and installation of the operating system will start. Click next and follow instructions.

Figure 16: Screen Shot of CentOS Installation 2

49

Figure 17: Screen Shot of CentOS Installation 3

Figure 18: Screen Shot of CentOS Installation 4

Figure 19: Screen Shot of CentOS Installation 5

Figure 20: Screen Shot of CentOS Installation 6

Choose Customize now and click next. Select the following packages: Desktop Environment: o o Gnome desktop environment KDE desktop environment Applications: o o o o o o o Editors Emacs Engineering and scientific Games and entertainment Graphical and internet Office/productivity Sound and video

50

o o o o o o o o Server: o

Text based internet Development: Development libraries Development tools Gnome software development KDE software development Legacy software development Ruby software development X- software development

Printing support Base System:

o o o

Base Dial-up network support X-window support And none from Clustering, Cluster storage and Languages

Click next and continue.

Figure 21: Screen Shot of CentOS Installation 7

51

Figure 22: Screen Shot of CentOS Installation 8

Figure 23: Screen Shot of CentOS Installation 9

Now chose a user name and its password. CentOS 5.3 is now installed.

7.1.3. Installing VM Tools Power the virtual machine on, and on the VMware Workstation click on VMInstall VM Tools and follow these instructions.

Figure 24: Screen Shot of VM Tools Installation

52

An icon for VM Tools will appear on the desktop

Figure 25: Screen Shot of VM Tools Icon

Extract the tar.gz file from this CD, and the place the folder in root home Now go to vmware-tools-distrib folder and run the file vmware install.pl as follows: o [root@localhost vmware-tools-distrib]# ./vmware-install.pl This will install VM tools, now log out and log in again The VM Tools are now active.

7.2. Installation Process of Network Simulator 7.2.1. Getting NS-2 NS-2 is freely available from: http://www.isi.edu/nsnam/dist/

7.2.2. Steps for Installation a. Download the latest version of ns-allinone package b. Copy this package into Cent OS c. Extract package in root home d. Go to folder ns-allinone-2.33 and run ./install in the terminal [root@localhost ns-allinone-2.33]# ./install e. After installation go back to root home and open bash profile in gedit [root@localhost ~]# gedit .bash_profile f. Copy the following paths in the bash profile (write the correct folder names)
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc

53

fi # User specific environment and startup programs PATH=$PATH:~/ns-allinone-2.33/bin:~/ns-allinone2.33/tcl8.4.18/unix:~/ns-allinone-2.33/tk8.4.18/unix LD_LIBRARY_PATH=~/ns-allinone-2.33/otcl-1.13:~/ns-allinone2.33/lib TCL_LIBRARY=~/ns-allinone-2.33/tcl8.4.18/library export PATH export LD_LIBRARY_PATH export TCL_LIBRARY unset USERNAME

g. h. i.

Save and close gedit Log out from root and then again log in Now to validate the software go to /root/ns-allinone-2.33/ns-2.33 and run

./validate [root@localhost ns-2.33]# ./validate NS-2 is now ready to be used.

54

8. Appendix B

8.1. AWK Program Used


BEGIN { sends=0; recvs=0; routing_packets=0.0; droppedBytes=0; droppedPackets=0; highest_packet_id =0; sum=0; recvnum=0; } { time = $2; packet_id = $6; # CALCULATE PACKET DELIVERY FRACTION if (( $1 == "s") && ( $7 == "cbr" ) && ( $4=="AGT" )) { sends++; } if (( $1 == "r") && ( $7 == "cbr" ) && ( $4=="AGT" )) { recvs++; } # CALCULATE DELAY if ( start_time[packet_id] == 0 ) { start_time[packet_id] = time; } if (( $1 == "r") && ( $7 == "cbr" ) && ( $4=="AGT" )) { end_time[packet_id] = time; } else { end_time[packet_id] = -1; } # CALCULATE TOTAL OVERHEAD if (($1 == "s" || $1 == "f") && $4 == "RTR" && $7 =="AODV") routing_packets++; # DROPPED PACKETS if (( $1 == "D" ) && ( $7 == "cbr" ) && ( $2 > 0 )) { droppedBytes=droppedBytes+$8; droppedPackets=droppedPackets+1; } #find the number of packets in the simulation if (packet_id > highest_packet_id) highest_packet_id = packet_id; } END { for ( i in end_time ) { start = start_time[i]; end = end_time[i];

55

packet_duration = end - start; if ( packet_duration > 0 ) { sum += packet_duration; recvnum++; } } delay=sum/recvnum; NRL = routing_packets/recvs; #normalized routing load PDF = (recvs/sends)*100; #packet delivery ratio[fraction] printf("Sent packets = %.2f\n",sends); printf("Received packets = %.2f\n",recvs); printf("Dropped packets = %d\n",droppedPackets); printf("Packet Delivery Fraction = %.2f\n",PDF); printf("Normalized Routing Load = %.2f\n",NRL); printf("E2E Delay in seconds = %.2f\n",delay); printf("Routing Overhead = %.2f\n",routing_packets++); printf("No. of dropped data (bytes) = %d\n",droppedBytes); }

56

You might also like