Kathmandu UniversitySchool of EngineeringDepartment of
Electrical & Electronics Engineering
FINAL YEARPROJECT REPORT
SimulationOf MAC Layer of IEEE 802.16 e WiMAX
A final year project report submitted in partial fulfilmentof
the requirements for the degree ofBachelor of Engineering
Submitted By:Saurav Bhattarai (Regd. No.) Kastuv M. Tuladhar
(Regd. No.)
1
July, 2013
CERTIFICATION
Final Year Project ReportOn
by: (Regd. No.) (Regd. No.)
Approved by: 1. Project Supervisor
___________________ ____________________________ __________
(Signature) (Name) (Date)
2. Head/In-Charge of the Department
___________________ ____________________________ __________
(Signature) (Name) (Date) vi
ABSTRACT
ACKNOWLEDGEMENT
ABBREVIATIONSAbbreviationsFull Form First Used in Page
LIST OF FIGURES
LIST OF TABLESTable 1.1: Simulation Parameters5Table 4.1:
Characteristic in low traffic22Table 4.2: Characteristic in high
traffic22
22
TABLE OF CONTENTSABSTRACTiACKNOWLEDGEMENTiiABBREVIATIONSiiiLIST
OF FIGURESivLIST OF TABLESvChapter 1: Introduction11.1Background
and Objectives11.1.1 Background11.1.2 Objectives21.2System
Overview21.3Methodology31.3.1 Simulation strategy31.3.2 Simulation
Model41.3.3 Performance Metrics61.4Overview of Report6Chapter 2:
Literature Review82.1Wireless network82.2Static and Dynamic
Routing92.2.1 Dynamic Routing Categories102.2.2 Distance-vector
Routing or Reactive Protocols112.2.3 Link-State Routing or
Proactive Protocols122.3Network Simulator14Chapter 3: Simulation
Results and Analysis153.1Network Construction153.2Analysis16Chapter
4: Discussion and Conclusion224.1Discussion and
Conclusion224.2Recommendation23Bibliography24Appendix: Codes for
Simulation and Analysis25Chapter 1INTRODUCTION Background and
ObjectivesBackgroundA network is a collection of two or more
computing devices connected by a communication medium. When a
computing device wishes to send information to another device, it
may do so by transmitting the information along a shared
communication medium. This is why networking acts as a connecting
bridge between nodes. Since majority of the networks are packet
switched networks so the transmission and reception of the
information is based on the method of routing which involves use of
different protocols and algorithm for path selection. Wireless
networking is an emerging technology that allows users to access
information and services, regardless of their geographic position.
Infrastructured network consists of a network with fixed and wired
gateways. A mobile host communicates with a bridge in the network
(called base station) within its communication radius. In ad hoc
networks all nodes are mobile and can be connected dynamically in
an arbitrary manner. Such networks are very useful in emergency
search-and-rescue operations, meetings or conventions in which
persons wish to quickly share information, and data acquisition
operations in inhospitable terrain.As people become increasingly
dependent on cell phones and other wireless communication links,
the development of efficient and economic routing protocols has
gained greater focus. The need to exchange digital information
outside a typical wired office environment is growing rapidly. For
example, people in a conference may wish to exchange information, a
group of students may need to interact during their group
discussions, or disaster recovery personal may need to provide
relief information after a calamity has occurred. Each of the
devices used by these people can be considered a node in an ad hoc
network.There is no stationary infrastructure or base station for
communication so routing in MANET has been a challenging task ever
since the wireless network came into existence. The major reason
for this is the constant change in network topology because of high
degree of node mobility. A number of routing protocols have been
developed for accomplishing such task. Among them is the dynamic
routing. Dynamic routing varies from stationary routing as it can
automatically update its routing table by a routing protocol
running on the router.In this project, analysis of two protocols
(AODV and OLSR) under different performance criteria for routing
(e.g. delay, throughput) has been implemented.ObjectivesOne of the
more powerful features of packet switched systems is their ability
to dynamically route packets. This power also comes with a
complexity that can lead to an interesting set of problems. If one
could count on a network operating in a static configuration with
no failures, the routing problem would be simple; static tables
could suffice as the basis for all routing decisions. For each
packet destined to a particular destination, the next hop would be
identified in the table, and the packet would be forwarded.
However, in the real world, nodes are added to networks, links
fail, and topologies change. As networks get larger, administration
and management problems increase. Therefore, automated route
management rapidly becomes a necessity. So, simulation of the
performance of two of the more significant routing mechanisms that
are used in the ad hoc network, reactive Ad hoc On Demand Distance
Vector (AODV) and proactive Optimized Link State Routing (OLSR)
protocols was conducted. The main objectives are:Implementation of
proactive (OLSR) and reactive (AODV) routing protocols.Performance
analysis of OLSR and AODV based on performance metrics such as
jitter throughput and average end-to-end delay.
System OverviewThis projects aims to simulate a network for
evaluating performance of two different dynamic routing techniques
(AODV and OLSR). The project does not consider designing a physical
system. So the system will consist of a virtual network for
simulation.The network will consist of hosts/nodes and links. For
ad hoc network, links are wireless where each node can route
packets to their respected neighboring node. Unlike infrastructured
network, the ad hoc networks all nodes are mobile and can be
connected dynamically in an arbitrary manner. The nodes will be
considered both stationary and mobile for simulating the
performance of ad hoc network designed. The different components of
a network can be presented as:Address: Each node in a network has a
unique identifier called the nodes address. This address is used in
routing to determine where packets should be sent.Ad hoc network: A
network which is formed without a priori knowledge or planning.
Nodes belonging to an ad hoc network do not share any central
authority or support structure.Broadcast: A packet which is
broadcast is received by all nodes within transmission range of the
sender.Hop: Each time a packet is transmitted, it is said to have
performed one hop. Multi-hop networks require nodes in the network
to enlist the aid of neighboring nodes to forward packets towards a
destination node.Link: A communication channel by which a node can
send packets to another node.Loop: Some protocols, when they have
not converged, can set up routing loops. A loop is formed when two
nodes do not agree on the shortest path to a destination. For
example, suppose node. A routes a packet to node B, but B
subsequently routes the packet back to A. In this example, the
packet will be routed between nodes A and B, or until their routing
logic is synchronized and the routing protocol converges.Mobile
node: A node which is willing and able to physically move location,
resulting in network topology changes.Router: A node willing to
forward and route packets on behalf of other nodes. In ad hoc
networks, typically every node acts as a router.Topology: The graph
representing node positions and their links to other nodes. The
topology is said to change when links change state (are either
created or destroyed) or nodes change state.
Methodology1 Simulation strategy
OTCL Script (.tcl extension file) Whole simulation study is
divided into two part one is create the node (that may be cell
phone, internet or any other devices) i.e. NS-2 output. Its called
NAM (Network Animator) file, which shows the nodes movement and
communication occurs between various nodes in various conditions or
to allow the users to visually appreciate the movement as well as
the interactions of the mobile nodes. And another one is graphical
analysis of trace file (.tr). Trace files contain the traces of
event that can be further processed to understand the performance
of the network. Figure 5 depicts the overall process of how a
network simulation is conducted under NS-2. Output files such as
trace files have to be parsed to extract useful information. The
parsing can be done using the awk command (in UNIX and LINUX, it is
necessary to use gwak for the windows environment) or perl script.
The results have been analyzed using Excel or Matlab. A software
program which can shorten the process of parsing trace files
(Xgraph and TraceGraph) has also been used in this paper. However,
it doesnt work well when the trace file is too large. To generate
trace file and nam file, we call tcl script in CYGWIN command
shell. By varying the simulation parameter shown in table 1, we can
see the graphical variation between various performance metrics
like throughput, drop, delay, jitter etc. 4.2 Results Generated
trace file that is (.tr) s 10.006348737 _1_ MAC --- 3 ack 118 [13a
0 1 800] ------- [1:0 0:0 32 0] [0 0] 0 0 r 10.007293041 _0_ MAC
--- 3 ack 60 [13a 0 1 800] ------- [1:0 0:0 32 0] [0 0] 1 0 s
10.007303041 _0_ MAC --- 0 ACK 38 [0 1 0 0] r 10.007318041 _0_ AGT
--- 3 ack 60 [13a 0 1 800] ------- [1:0 0:0 32 0] [0 0] 1 0 s
10.007318041 _0_ RTR --- 4 tcp 1560 [0 0 0 0] ------- [0:0 1:0 32
1] [1 0] 0 0 s 10.007318041 _0_ AGT --- 5 tcp 1540 [0 0 0 0]
------- [0:0 1:0 32 0] [2 0] 0 0 r 10.007318041 _0_ RTR --- 5 tcp
1540 [0 0 0 0] ------- [0:0 1:0 32 0] [2 0] 0 0 1. First field is
event type; it may be r, s, f, d for received, sent, forwarded and
dropped respectively. 2. The second field is the time. 3. The third
field is the node number. 4. The fourth field is MAC to indicate,
if the packet concerns a MAC layer; it is AGT to indicate the
transport layer (e.g. tcp) packet, or RTR if it concerns the route
packet. It can be IFQ for drop packets. 5. After the dashes comes
the global sequence number of the packet (not tcp sequence number).
6. At the next field comes more information on the packet type
(e.g. tcp, ack, or udp). 7. Next is the packet size in byte. 8. The
4 numbers in the first square brackets concern MAC layer
information. The first hexadecimal number specifies the expected
time in seconds to send this data packets over the wireless
channel. The second number stand for the MAC-id of the sending node
third is for receiving node. And fourth number, 800, specifies that
the MAC type is ETHERTYPE_IP. 9. The next number in the second
square brackets concern the IP source and destination addresses,
then the ttl (time to live) of the packet (in our case 32). 10. The
third brackets concern the tcp information: its sequence number and
acknowledgement number. 4.2.1 Nam file output NAM is a Tcl/TK based
animation tool for viewing network simulation traces and real world
packet traces. A network animator that provides packet-level
animation and protocol-specific graphs to aid the design and
debugging of new network protocols have been described. Taking data
from network simulators (such as ns) or live networks, NAM was one
of the first tools to provide general purpose, packet-level, and
network animation, before starting to use NAM, a trace file needs
to create [7]. This trace file is usually generated by NS. Once the
trace file is generated,Execute NS-2 Command (test.tcl)Output
(Trace and Nam file) (.tr and .nam)Graph plotting ( awk, matlab,
excel)Network AnimatorView nam file
Figure 01.1: Simulation Overview
Whole simulation study is divided into two parts, one is to
create the node (that may be cell phone, internet or any other
devices) i.e. NS-2 output. Its called NAM (Network Animator) file,
which shows the nodes movement and communication occurs between
various nodes in various conditions or to allow the users to
visually appreciate the movement as well as the interactions of the
mobile nodes. And another one is graphical analysis of trace file
(.tr). Trace files contain the traces of event that can be further
processed to understand the performance of the network [1]. Figure
1.1 depicts the overall process of how a network simulation is
conducted under NS-2. Output files such as trace files have to be
parsed to extract useful information. The parsing can be done using
the awk command in Ubuntu. The results have been analyzed using
Excel or Matlab. To generate trace file and nam file, that is
called as tcl script in Ubuntu terminal. By varying the simulation
parameter, the graphical variation can be seen between various
performance metrics like throughput, delay and jitter. The required
bash file to run simulation for multiple samples was also
written.After gaining knowledge about NS-2 basics, wireless network
was simulated. First wrote aodv.tcl and olsr.tcl with 16 nodes
network and simulation was done.Trace and nam files were
created.Network animator was used to visualize the network.Awk
script was used to extract useful information from trace file
generated, to calculate average end-to-end delay, jitter,
throughput and maximum delay.Bash file was written to conduct
simulation for multiple time using power the network as random
parameter varying from 0 to 2 watts.The parameters were plotted
using excel.
Simulation Model Scenario: For the simulation scenario, 400*400
m2 square was considered taking into account of reference paper
[3]. 16 nodes were considered for simulation as we initialized that
it optimizes the result considering the area chosen. Two-ray-ground
model was taken for radio propagation, as it considers both indoor
and outdoor propagation. Each wireless node is considered to have
omni directional antenna. The remaining parameter of the network is
tabulated in Table 1 [4].
Table 1.1: Simulation ParametersParameterValue
SimulatorNS-2 (Version 2.34 )
Channel typeWireless channel
Radio-propagation modelTwo ray ground wave
Network interface typeWireless
MAC TypeMac /802.11
Interface queue TypeQueue/DropTail/PriQueue
Link Layer TypeLogical Link
AntennaOmni Antenna
Maximum packet in buffer50
Area ( m2)400 * 400
Number of mobile node16 / 50
Source TypeUDP
Simulation Time1000 sec
Mobility modal Movement patternspeed (m/s) Random5
CBRPacket sizeIntervalRate 1000 bytes0.02 sec256kbps
Routing Protocols AODV, OLSR
Capture Threshold 10 dB
Carrier Sense Threshold2.78831e-9 watt
Transmitted Power0 to 2 watt
Receiver Threshold Power1.11532e-8 watt
Operating Frequency2.4 GHz for 802.11g
System Loss0 dB
Coverage Radius0 - 260 m
Channel Bandwidth1Mbps
Transmitter Antenna Gain 0 dB
Receiver Antenna Gain0 dB
Antenna TX-RX height1.5m
1 2 3 39.1 39.2 Performance MetricsThe following different
performance metrics are evaluated to understand the behavior of
OLSR and AODV routing protocols Throughput Throughput is the number
of packet that is passing through the channel in a particular unit
of time. This performance metric shows the total number of packets
that have been successfully delivered from source node to
destination node. Equation (i) shows the mathematical expression
for throughput. --------------------------------------------
(i)Average Endto-End delay A specific packet is transmitted from
source to destination node and calculation of the difference
between send time and received time gives end-to-end delay. Delays
due to route discovery, queuing, propagation and transfer time are
included in the delay metric. Equation (ii) shows the mathematical
expression for average end to end delay.-----------------
(ii)Jitter The term jitter is often used as a measure of the
variability over time of the packet latency across a network. A
network with constant latency has no variation (or jitter). Packet
jitter is expressed as an average of the deviation from the network
mean latency. In other word jitter is the variation of the packet
arrival time. In jitter calculation the variation in the packet
arrival time is expected to be minimum. The delays between the
different packets need to be low if we want better performance in
Mobile Ad-hoc Networks. Equation (iii) shows expression for jitter
calculation. -----------------------------------------------------
(iii) Overview of ReportThis project is divided into four different
chapters, each one illustrating the description of the project in
detail. The report highlights the system overview and the
technology and literature review conducted for the completion of
the project.Chapter 1 discusses the introduction part regarding the
project. The background of the project and its objective initiate
the report. The system overview defines the components of a
network. As simulation is conducted for analysis, the system
overview explains the basic components of network. The simulation
strategy and different parameters considered for simulation are
classified under methodology heading. Chapter 2 deals with the
Literature Survey where we have tried to put all necessary details
that helps to understand technical terminologies of the project.
The research and survey done during the project time are also
included in the survey which could be referred to understand the
project.Simulation Results and Analysis are dealt in the chapter 3.
The subsystems, in the two different sections considering low and
high density traffic are explained with the results after the
simulation.Chapter 4 emphasizes on the conclusion of the project.
The outcome of the project under different parameter is highlighted
under this section. The chapter includes recommendation for the
further research and analysis that can be conducted in this field
of MANET.
Chapter 2LITERATURE REVIEW2 1 Wireless networkWireless
networking allows users to access information, without any
dedicated line connected within them. Wireless networks can be
classified in two types:Infrastructured networksInfrastructured
network consists of a network with fixed and wired gateways as
shown in Figure 2.1. A mobile host communicates with a bridge in
the network (called base station) within its communication radius.
The mobile unit can move geographically while it is communicating.
When it goes out of range of one base station, it connects with new
base station (handoff) and starts communicating through it. In this
approach the base stations are fixed.
Figure 01.1: Infrastructured network
Infrastructureless networksIn ad hoc networks all nodes are
mobile and can be connected dynamically in an arbitrary manner. All
nodes of these networks behave as routers and take part in
discovery and maintenance of routes to other nodes in the network
as shown in Figure 2.2 and Figure 2.3. Ad hoc networks are very
useful in emergency search-and-rescue operations, meetings or
conventions in which persons wish to quickly share information, and
data acquisition operations in hostile landscape.
Figure 2.2: Infrastructureless network
Figure 2.3: Ad hoc network with three nodes4 5 59.3 Static and
Dynamic Routing There are two basic methods of building a routing
table:Static RoutingDynamic RoutingA static routing table is
created, maintained, and updated by a network administrator,
manually. A static route to every network must be configured on
every router for full connectivity. This provides a rough level of
control over routing, but quickly becomes impractical on large
networks. Routers will not share static routes with each other,
thus reducing CPU/RAM overhead and saving bandwidth. However,
static routing is not fault-tolerant, as any change to the routing
infrastructure (such as a link going down, or a new network added)
requires manual intervention. Routers operating in a purely static
environment cannot seamlessly choose a better route if a link
becomes unavailable.A dynamic routing table is created, maintained,
and updated by a routing protocol running on the router. Examples
of routing protocols include AODV (Ad hoc on demand distance
vector), EIGRP (Enhanced Interior Gateway Routing Protocol) and
OLSR (Optimized Link State Routing Protocol). Routers do share
dynamic routing information with each other, which increases CPU,
RAM, and bandwidth usage. However, routing protocols are capable of
dynamically choosing a different (or better) path when there is a
change to the routing infrastructure.Most of the protocols
available in the network are categorized as: RIP- Routing
Information Protocol AODV-Ad-hoc On-demand distance vector
OLSR-Optimized Link State Routing Protocol OSPF-Open Shortest Path
FirstThe following briefly outlines the advantages and
disadvantages of static routing:Advantages of Static Routing:
Minimal CPU/Memory overhead No bandwidth overhead (updates are not
shared between routers) Granular control on how traffic is
routedDisadvantages of Static Routing: Infrastructure changes must
be manually adjusted No dynamic fault tolerance if a link goes down
Impractical on large network
The following briefly outlines the advantages and disadvantages
of dynamic routing:Advantages of Dynamic Routing: Simpler to
configure on larger networks Will dynamically choose a different
(or better) route if a link goes down Ability to load balance
between multiple linksDisadvantages of Dynamic Routing: Updates are
shared between routers, thus consuming bandwidth Routing protocols
put additional load on router CPU/RAM The choice of the best route
is in the hands of the routing protocol, and not the network
administrator
Dynamic Routing CategoriesDistance-vector protocolsLink-state
protocolsHybrid protocols
ProactiveReactiveHybridRouting ProtocolsOLSRAODVZRP
Figure 2.4: Ad-hoc Routing ProtocolsFigure 2.4 shows the
different types of routing protocol adapted in MANETs. It presents
main groups of protocol under which OLSR and AODV are included. So,
OLSR is proactive and AODV is reactive routing
protocol.Distance-vector Routing or Reactive ProtocolsAll
distance-vector routing protocols share several key
characteristics: Periodic updates of the full routing table are
sent to routing neighbors. Distance-vector protocols suffer from
slow convergence, and are highly susceptible to loops. Some form of
distance is used to calculate a routes metric. The Bellman-Ford
algorithm is used to determine the shortest path.A distance-vector
routing protocol begins by advertising directly-connected networks
to its neighbors. These updates are sent regularly (RIP every 30
seconds; IGRP every 90 seconds). Neighbors will add the routes from
these updates to their own routing tables. Each neighbor trusts
this information completely, and will forward their full routing
table (connected and learned routes) to every other neighbor. Thus,
routers fully (and blindly) rely on neighbors for route
information, a concept known as routing by rumor. There are several
disadvantages to this behavior. Because routing information is
propagated from neighbor to neighbor via periodic updates,
distance-vector protocols suffer from slow convergence. This, in
addition to blind faith of neighbor updates, results in
distance-vector protocols being highly susceptible to routing
loops. Distance-vector protocols utilize some form of distance to
calculate a routes metric. RIP uses hop count as its distance
metric, and IGRP uses a composite of bandwidth and delay.Ad-hoc
On-demand distance vector (AODV)Reactive protocols discover routes
only as needed [4]. When a node wishes to communicate with another
node, it checks with its existing information for a valid route to
the destination. If one exists, the node uses that route for
communication with the destination node. If not, the source node
initiates a route request procedure, to which either the
destination node or one of the intermediate nodes sends a reply
back to the source node with a valid route. A soft state is
maintained for each of these routes, if the routes are not used for
some period of time, the routes are considered to be no longer
needed and are removed from the routing table. Example of this type
algorithm is DSR and AODV. AODV is a reactive protocol, even though
it still uses characteristics of a proactive protocol. AODV takes
the interesting parts of DSR and DSDV in the sense that it uses the
concept of route discovery and route maintenance of DSR and the
concept of sequence numbers and sending of periodic hello messages
from DSDV. AODV uses a destination sequence number for each route
entry. The destination sequence number is created by the
destination for any route information it sends to requesting nodes
[7]. Using destination sequence numbers ensures loop freedom and
allows knowing which of the available routes is fresher and
requesting node always selects the one with greatest sequence
number. When a node wants to find a route, it broadcasts a RREQ to
all network till either destination is reached or another node is
found with a fresh enough route to the destination. Then a RREP is
sent back to the source and the discovered route is made available.
Fresh Enough route is a valid route entry for the destination whose
associated sequence number is at least as great as that contained
in RREQ. Nodes that are part of an active route may offer
connectivity information by broadcasting periodically local hello
messages (special RREP messages) to its immediate neighbors. If
hello messages stop arriving from a neighbor beyond some given time
threshold, the connection is assumed to be lost. When a node
detects that a route to a neighbor node is not valid it removes the
routing entry and sends a RERR message to neighbors that are active
and use the route; this is possible by maintaining active neighbor
lists. This procedure is repeated at nodes that receive RERR
messages. A source that receives an RERR can reinitiate a RREQ
message.
Advantages: Routes are established on demand and destination
sequence numbers are used to find the latest route to the
destination. Lowered delay for connection setup.
Disadvantages: AODV does not allow handling unidirectional
links. Multiple Route Reply packets in response to a single Route
Request packet can lead to heavy control overhead. Periodic
beaconing leads to unnecessary bandwidth consumption
Link-State Routing or Proactive ProtocolsLink-state routing
protocols were developed to lessen the convergence and loop issues
of distance-vector protocols. Link-state protocols maintain three
separate tables:Neighbor table It contains a list of all neighbors,
and the interface each neighbor is connected off of. Neighbors are
formed by sending Hello packets.Topology tableThe otherwise known
as the link-state table, contains a map of all links within an
area, including each links status.Shortest-Path tableIt contains
the best routes to each particular destination (otherwise known as
the routing table). Link-state protocols do not route by rumor.
Instead, routers send updates advertising the state of their links
(a link is a directly-connected network). All routers know the
state of all existing links within their area, and store this
information in a topology table. All routers within an area have
identical topology tables. The best route to each link (network) is
stored in the routing (or shortest path) table. If the state of a
link changes, such as a router interface failing, an advertisement
containing only this link-state change will be sent to all routers
within that area. Each router will adjust its topology table
accordingly, and will calculate a new best route if required. By
maintaining a consistent topology table among all routers within an
area, link-state protocols can converge very quickly and are immune
to routing loops. Additionally, because updates are sent only
during a link-state change, and contain only the change (and not
the full table), link-state protocols are less bandwidth intensive
than distance-vector protocols. However, the three link-state
tables utilize more RAM and CPU on the router itself. Link-state
protocols utilize some form of cost, usually based on bandwidth, to
calculate a routes metric. The Dijkstra formula is used to
determine the shortest path.
Optimized Link State Routing Protocol (OLSR)Optimized Link State
Protocol (OLSR) is a proactive routing protocol, so the routes are
always immediately available when needed. OLSR is an optimization
version of a pure link state protocol. So the topological changes
cause the flooding of the topological information to all available
hosts in the network. To reduce the possible overhead in the
network protocol uses Multipoint Relays (MPR) [5]. The idea of MPR
is to reduce flooding of broadcasts by reducing the same broadcast
in some regions in the network, more details about MPR can be found
later in this chapter. Another reduce is to provide the shortest
path. The reducing the time interval for the control messages
transmission can bring more reactivity to the topological
changes.OLSR uses two kinds of the control messages: Hello and
Topology Control (TC) [7]. Hello messages are used for finding the
information about the link status and the hosts neighbors. With the
Hello message the Multipoint Relay (MPR) Selector set is
constructed which describes which neighbors has chosen this host to
act as MPR and from this information the host can calculate its own
set of the MPRs. The Hello messages are sent only one hop away but
the TC messages are broadcasted throughout the entire network. TC
messages are used for broadcasting information about own advertised
neighbors which includes at least the MPR Selector list. The TC
messages are broadcasted periodically and only the MPR hosts can
forward the TC messages. There is also Multiple Interface
Declaration (MID) messages which are used for informing other host
that the announcing host can have multiple OLSR interface
addresses. The MID message is broadcasted throughout the entire
network only by MPRs. There is also a Host and Network Association
(HNA) message which provides the external routing information by
giving the possibility for routing to the external addresses. The
HNA message provides information about the network- and the net
mask addresses, so that OLSR host can consider that the announcing
host can act as a gateway to the announcing set of addresses. The
HNA is considered as a generalized version of the TC message with
only difference that the TC message can inform about route
cancelling while HNA message information is removed only after
expiration time.
Advantages:Reduce the number of duplicate retransmissions while
forwarding a broadcast packet.Restrict the set of nodes
retransmitting a packet from all nodes (regular flooding) to a
subset of all nodes. The size of this subset depends on the
topology of the network.
Network SimulatorFor the simulation of the developed system,
version 2.34 of NS-2 has been used in this project. Ns-2 is a
discrete event simulator targeted at networking research. It began
as a part of the REAL network simulator and is evolving through an
ongoing collaboration between the University of California at
Berkeley and the VINT project. It is an Object oriented program
written C++/OTCL. It works in Linux, Mac and Windows. It can
simulate existing network protocols: TCP, routing, and multicast
protocols over both wired and wireless networks. It also provides
possibility to implement and test new protocols and applications
[2].
Chapter 3SIMULATION RESULTS AND ANALYSIS3 2 Network
TopologySimulation of a wireless network was done using NS-2
simulator, NAM (network animator) and awk scripting as described in
methodology section. AODV and OLSR, these routing protocols are
also related Distance Vector and Link State respectively as RIP and
OSPF are.The further tcl script written for the wireless network
according to Simulation Model is presented in Appendix.
Figure 3.1: NAM 16 nodes wireless network Figure 3.1 presents
the snapshot of virtual network constructed in NS-2. Network
Animator (NAM) is used to visualize the nodes in the network
considered. The network shown consists of 16 nodes connected
wirelessly. Each of the node moves randomly to the destination
point at a constant velocity of 5 m/s as defined in .tcl script.
Here node 0 is the source node whereas node 15 is the sink or
destination node. The circular ring shows the coverage area of
respective nodes transmitting packets.
Results and Analysis6 7 8 9 99.4 99.5 For single node
transmission
Figure 3.2: Throughput for low trafficFigure 3.2 shows
throughput of the network increases with increase in transmission
power.In case of low traffic with low node density beyond 1 watt
transmission power, AODV protocol delivers almost all originated
data packets (around 90-100%). OLSR performs less efficiently then
AODV when number of source nodes are low (1 source node) with low
node density (16 nodes). With increase in power level the coverage
area of each node increases hence decreasing the number of nodes
the packets have to travel for transmission from source to
destination. AODV uses only one route that is shortest path for
delivery of data from source node to destination node due to
throughput increases effectively for AODV than OLSR for low node
density.The performance of AODV is significantly better below power
level of 1 watt.
Figure 3.3: Average End-to-End Delay for low trafficWith
increase in power level the coverage area of each node increases
hence decreasing the number of nodes the packets have to travel for
transmission from source to destination. AODV uses only one route
that is shortest path for delivery data from source node to
destination node due to this reason maximum delay for AODV is low
as compare to OLSR as shown in Figure 3.3. OLSR use more than one
route to transfer data packet from source node to destination node
which causes more delay as it is not always using shortest path for
delivering all data packet from source node to destination node.The
performance of AODV is significantly better below power level of 1
watt.
Figure 3.4: Jitter for low trafficAs power increases the number
of hubs packets has to travel through decreases so the jitter
decreases. As presented in Figure 3.4, average jitter is always
high for OLSR protocol because OLSR uses more than one route to
transfer data packets from source node to destination node. These
different routes cause variation in delay to delivering the data
packet from source node to destination node due to this average
jitter increase significantly in case of OLSR. In case of AODV it
uses only one route to deliver data packet until this route fails
in that situation it starts new route discovery process for
destination node. So jitter performance of AODV is better.The
performance of AODV is significantly better below power level of 1
watt.
For six sources transmission and 50 nodes
Figure 3.5: Throughput for high trafficFor the multiple source
transmission to the same source, (here we have considered six
sources transmitting to node 15) throughput increases. As the
multiple sources are transmitting packets at same observation time,
throughput increases than in single source transmission.Throughput
of the network increases with increase in transmission power up to
1.5 watt. As OLSR uses more than one route to transfer packets, in
higher traffic density the throughput for OLSR is more than that of
AODV. AODV uses only one route to transfer packets to destination
and does not update its routing table unless the existing route
fails. So throughput is lower for AODV than OLSR in high traffic
density. Figure 3.5 shows the throughput of OLSR and AODV within
power range of 0-2 watts.Beyond 1.5 watt transmission power, the
throughput decreases due to CSMA technique used. As power
increases, coverage increases and nearer nodes interfere with each
other. Since multiple nodes are transmitting at the same time, each
node has to wait until it finds the free link using CSMA.
Figure 3.6: Average End-to-End Delay for high trafficFor higher
node density, the average end-to-end delay increases than in single
source transmission as nodes have to queue the packets before
transmission and low link access due to CSMA used.With increase in
power level the coverage area of each node increases hence
decreasing the number of nodes the packets have to travel for
transmission from source to destination. AODV uses only one route
that is shortest path for delivery of data from source node to
destination node due to this reason maximum delay for AODV is low
as compare to OLSR as presented in Figure 3.6. OLSR use more than
one route to transfer data packet from source node to destination
node which causes more delay as it is not always using shortest
path for delivering all data packet from source node to destination
node.
Figure 3.7: Jitter for high traffic
Figure 3.8: N.Jitter for high trafficFor higher node density,
the average jitter increases than in single source transmission as
nodes have to queue the packets before transmission and low link
access due to CSMA used. As power increases the number of hubs
packets has to travel through decreases so the jitter
decreases.Average jitter is always high for OLSR protocol because
OLSR uses more than one route to transfer data packets from source
node to destination node. These different routes cause variation in
delay to delivering the data packet from source node to destination
node due to this average jitter increase significantly in case of
OLSR. In case of AODV it uses only one route to deliver data packet
until this route fails in that situation it starts new route
discovery process for destination node. So jitter performance of
AODV is better. Figure 3.7 shows the jitter performance of these
routing protocols AODV and OLSR in different transmitted power.
Chapter 4DISCUSSION AND CONCLUSION3 Discussion and
ConclusionAODV and OLSR are the two different routing techniques
adapted in dynamic routing protocol. So, this project helps to
analyze their characteristic behavior in ad hoc network. The nodes
in ad hoc network can be mobile so it is necessary for packets from
one node to properly route to destination node. The delay, jitter
and throughput are the basic characteristic of routing protocol in
a network. This project helps to find suitable routing protocol in
given condition of the network.This report discusses about the
introduction to network and the types of dynamic routing. The AODV
and OLSR are the two techniques adapted in Distant-vector Routing
Protocol (DVRP) and Link-state Routing Protocol (LSRP)
respectively. Their analysis gives the function of these protocols;
DVRP and LSRP. The characteristic of this network is simulated on
NS-2 simulator. OLSR and AODV have minimum throughput of 0 kbps at
power below receiver sensitivity for both high and low traffic
density. The rounded minimum and maximum of the matrices values are
tabulated in Table 4.1 and Table 4.2.Table 4.1: Characteristic in
low trafficThroughput (kbps)Average End-to-End Delay (ms)Jitter
(ms)
MINMAXMINMAXMINMAX
OLSR0254101400265
AODV02561510025
Table 4.2: Characteristic in high trafficThroughput
(kbps)Average End-to-End Delay (ms)Jitter (ms)
MINMAXMINMAXMINMAX
OLSR0612404253024201
AODV052040385192143
We can conclude that for low node density and low traffic, AODV
performs better in context of jitter, delay, and throughput and
power utilization than OLSR. For high node density and high
traffic, OLSR performs better than AODV in context of throughput
but average end-to-end delay is still lower for AODV.
RecommendationThe simulation analyzes the performance of the
respective protocols considering low network density (16 nodes and
single source) and high network density (50 nodes and six sources)
in a predefined area. The simulation also takes into account power
analysis from 0-2 watts.The simulation can be further carried out
for different parameters (area, node density, etc.) other than
considered in this project. MANETs have dynamic range. So, there is
always a unique scenario even if a single parameter of node
(transmitted power, carrier threshold, receiver sensitivity, etc.)
is changed. The simulation carried out does not perfectly represent
a practical scenario. So, this simulation can also be carried out
for or by setting up a practical existing network. Performance of
other dynamic routing protocols like DSR, DSDV, RIP and OSPF can
also be analyzed.
Bibliography[1] Gupta, S. K., & Kumar, R.K. Performance
Metric Comparison of AODV and DSDV Routing Protocols in MANET Using
NS-2. Retrieved from http://
www.csjournals.com/IJITKM/PDF%203-1/74.pdf
[2] Network simulator NS-2. Retrieved December 10, 2011, from
http://www.isi.edu/nsnam/ns/index.html
[3] Gowrishankar, S., Basavaraju, T.G., Singh, M., & Sarkar,
S.K. Scenario based Performance Analysis of AODV and OSLR in Mobile
Ad hoc Network. Retrieved December 9, 2011, from
http://www.ijcim.th.org/SpecialEditions/v15nSP4/P08SEARCC_ScenariobasedPerformanceAnalysis.pdf
[4] Fakhri, Y., Amnai, M., & Abouchabaka, J. Traffic
Multiservice Based performance Analysis of OLSR and AODV Protocols
for Mobile Ad hoc Networks. Retrieved January 10, 2012, from
http://www.aicit.org/ijact/ppl/36_IJACT9-8.pdf
[5] Singh, S., Sran, S.S., & Chand, T.(2008, March 29).
Performance Comparison of AODV, OLSR and OFLSR in Wireless Mesh
Networks. Retrieved January 10, 2012, from
http://www.rimtengg.com/coit2008/proceedings/NW3.pdf
[6] Liu, K. (2006). Network Simulator 2: Introduction. Retrieved
January 12, 2012, from
http://cs.binghamton.edu/~kliu/ta/cs527/ns2pre.pdf
[7] Holter, K. (2005, April 23). Comparing AODV and OLSR.
Retrieved January 27, 2012, from
http://folk.uio.no/kenneho/studies/essay.pdf
AppendixCODES FOR SIMULATION AND ANALYSISTcl file for aodv
protocol, aodv.tcl:#
====================================================================#
Define options#
======================================================================set
val(chan)Channel/WirelessChannelset
val(prop)Propagation/TwoRayGroundset val(netif)Phy/WirelessPhyset
val(mac)Mac/802_11set val(ifq)Queue/DropTail/PriQueueset
val(ll)LLset val(ant) Antenna/OmniAntennaset val(x)400 ;# X
dimension of the topographyset val(y)400 ;# Y dimension of the
topographyset val(ifqlen)50 ;# max packet in ifqset val(rp) AODVset
val(nn) 16 ;# how many nodes are simulated
### Setting The Simulator Objects set ns_ [new Simulator]#create
the nam and trace file: set tracefd [open aodv.tr w] $ns_ trace-all
$tracefd $ns_ use-newtrace
# set namtrace [open aodv.nam w] #$ns_ namtrace-all-wireless
$namtrace $val(x) $val(y)
set topo [new Topography] $topo load_flatgrid $val(x) $val(y)
create-god $val(nn) set chan_1_ [new $val(chan)] # Defining Node
Configuration $ns_ node-config -adhocRouting $val(rp) \ -llType
$val(ll) \ -macType $val(mac) \ -ifqType $val(ifq) \ -ifqLen
$val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType
$val(netif) \ -topoInstance $topo \ -agentTrace ON \ -routerTrace
ON \ -macTrace ON \ -movementTrace ON \ -channel $chan_1_
#set random transmitter powerset power [expr (rand()*2)]
#Open the file for writing power random valueset out [open
"aodv_power.xls" a+]puts $out "$power"close $out
Phy/WirelessPhy set CPThresh_ 10.0Phy/WirelessPhy set CSThresh_
2.78831e-9 Phy/WirelessPhy set RXThresh_ 1.11532e-8 Phy/WirelessPhy
set bandwidth_ 1Mb#Phy/WirelessPhy set Pt_ 0.281838Phy/WirelessPhy
set Pt_ $powerputs "power=$power"Phy/WirelessPhy set freq_
2.4e+12Phy/WirelessPhy set L_ 1.0Antenna/OmniAntenna set X_
0Antenna/OmniAntenna set Y_ 0Antenna/OmniAntenna set Z_
1.5Antenna/OmniAntenna set Gt_ 1Antenna/OmniAntenna set Gr_ 1
### Creating The WIRELESS NODES for {set i 0} {$i < $val(nn)
} {incr i} { set node_($i) [$ns_ node] $node_($i) random-motion 1
;# enable random motion }
### Setting The Initial Positions of Nodes # Here node0 is the
source.
$node_(0) set X_ 50.0 $node_(0) set Y_ 50.0 $node_(0) set Z_ 0.0
$node_(1) set X_ 144.0 $node_(1) set Y_ 274.0 $node_(1) set Z_ 0.0
$node_(2) set X_ 90.0 $node_(2) set Y_ 90.0 $node_(2) set Z_
0.0
$node_(3) set X_ 143.0 $node_(3) set Y_ 266.0 $node_(3) set Z_
0.0
$node_(4) set X_ 201.0 $node_(4) set Y_ 300.0 $node_(4) set Z_
0.0 $node_(5) set X_ 147.0 $node_(5) set Y_ 203.0 $node_(5) set Z_
0.0 $node_(6) set X_ 230.0 $node_(6) set Y_ 291.0 $node_(6) set Z_
0.0
$node_(7) set X_ 295.0 $node_(7) set Y_ 319.0 $node_(7) set Z_
0.0
$node_(8) set X_ 363.0 $node_(8) set Y_ 335.0 $node_(8) set Z_
0.0
$node_(9) set X_ 334.0 $node_(9) set Y_ 347.0 $node_(9) set Z_
0.0
$node_(10) set X_ 304.0 $node_(10) set Y_ 277.0 $node_(10) set
Z_ 0.0 $node_(11) set X_ 212.0 $node_(11) set Y_ 194.0 $node_(11)
set Z_ 0.0 $node_(12) set X_ 319.0 $node_(12) set Y_ 300.0
$node_(12) set Z_ 0.0
$node_(13) set X_ 80.0 $node_(13) set Y_ 125.0 $node_(13) set Z_
0.0
$node_(14) set X_ 349.0 $node_(14) set Y_ 146.0 $node_(14) set
Z_ 0.0
# Node_(21) is the data collection point
$node_(15) set X_ 250.0 $node_(15) set Y_ 360.0 $node_(15) set
Z_ 0.0
## Giving Mobility to Nodes $ns_ at 0.01 "$node_(0) setdest 50.0
50.0 5.0"$ns_ at 5.0 "$node_(0) setdest 350.0 350.0 5.0"$ns_ at 6.0
"$node_(0) setdest 45.0 350.0 5.0"$ns_ at 7.0 "$node_(0) setdest
50.0 50.0 5.0"$ns_ at 0.01 "$node_(1) setdest 10.0 1.0 5.0"$ns_ at
2.01 "$node_(2) setdest 10.0 100.0 5.0"$ns_ at 3.01 "$node_(3)
setdest 10.0 200.0 5.0"$ns_ at 2.01 "$node_(4) setdest 10.0 300.0
5.0"$ns_ at 4.01 "$node_(5) setdest 10.0 350.0 5.0"$ns_ at 4.01
"$node_(6) setdest 100.0 1.0 5.0"$ns_ at 5.01 "$node_(7) setdest
100.0 100.0 5.0"$ns_ at 12.01 "$node_(8) setdest 100.0 200.0
5.0"$ns_ at 3.01 "$node_(9) setdest 100.0 300.0 5.0"$ns_ at 6.01
"$node_(10) setdest 100.0 350.0 5.0"$ns_ at 0.01 "$node_(11)
setdest 200.0 1.0 5.0"$ns_ at 0.01 "$node_(12) setdest 200.0 100.0
5.0"$ns_ at 2.01 "$node_(13) setdest 50.0 50.0 5.0"$ns_ at 7.01
"$node_(14) setdest 200.0 300.0 5.0"$ns_ at 3.01 "$node_(15)
setdest 170.0 10.0 5.0"$ns_ at 9.0 "$node_(0) setdest 1.0 200.0
5.0"$ns_ at 4.01 "$node_(1) setdest 100.0 1.0 5.0"$ns_ at 2.01
"$node_(2) setdest 100.0 100.0 5.0"$ns_ at 3.01 "$node_(3) setdest
100.0 200.0 5.0"$ns_ at 2.01 "$node_(4) setdest 100.0 300.0
5.0"$ns_ at 4.01 "$node_(5) setdest 100.0 350.0 5.0"$ns_ at 4.01
"$node_(6) setdest 50.0 1.0 5.0"$ns_ at 5.01 "$node_(7) setdest
20.0 100.0 5.0"$ns_ at 10.01 "$node_(8) setdest 20.0 200.0 5.0"$ns_
at 14.01 "$node_(9) setdest 20.0 300.0 5.0"$ns_ at 14.01
"$node_(10) setdest 20.0 350.0 5.0"$ns_ at 11.01 "$node_(11)
setdest 20.0 1.0 5.0"$ns_ at 11.01 "$node_(12) setdest 10.0 100.0
5.0"$ns_ at 11.01 "$node_(13) setdest 100.0 160.0 5.0"$ns_ at 11.01
"$node_(14) setdest 50.0 240.0 5.0"
## Setting The Node Size $ns_ initial_node_pos $node_(0) 60 $ns_
initial_node_pos $node_(1) 40 $ns_ initial_node_pos $node_(2) 40
$ns_ initial_node_pos $node_(3) 40 $ns_ initial_node_pos $node_(4)
40 $ns_ initial_node_pos $node_(5) 40 $ns_ initial_node_pos
$node_(6) 40 $ns_ initial_node_pos $node_(7) 40 $ns_
initial_node_pos $node_(8) 40 $ns_ initial_node_pos $node_(9) 40
$ns_ initial_node_pos $node_(10) 40 $ns_ initial_node_pos
$node_(11) 40 $ns_ initial_node_pos $node_(12) 40 $ns_
initial_node_pos $node_(13) 40 $ns_ initial_node_pos $node_(14) 40
$ns_ initial_node_pos $node_(15) 60 ## SETTING ANIMATION RATE$ns_
at 0.0 "$ns_ set-animation-rate 30.0ms"
#### Establishing Communication
#Set Udp, cbr agent and attach those with nodes
set udp1 [new Agent/UDP]$ns_ attach-agent $node_(0) $udp1$udp1
set class_ 0
set cbr1 [new Application/Traffic/CBR]$cbr1 attach-agent
$udp1$cbr1 set packetSize_ 1000$cbr1 set interval_ 0.02$cbr1 set
rate_ 256kb
# Attach null agent for sinkset null1 [new Agent/Null]$ns_
attach-agent $node_(15) $null1$ns_ connect $udp1 $null1
# Start the traffic generator$ns_ at 0.0 "$cbr1 start"
# Setting the time to stop the simulation$ns_ at 1000.0
"stop"$ns_ at 1000.01 "puts \"NS EXITING...\" ; $ns_ halt" ###
PROCEDURE TO STOP
proc stop {} { global ns_ tracefd $ns_ flush-trace close
$tracefd exec nam aodv.nam exit 0
}
puts "Starting Simulation........" $ns_ run
For olsr protocol following parameters has been changed:set
val(rp) OLSR#OLSR behaviour Agent/OLSR set use_mac_ trueAgent/OLSR
set debug_ falseAgent/OLSR set willingness 3Agent/OLSR set
hello_ival_ 2Agent/OLSR set tc_ival_ 5
Awk script for analyzing system matrics from trace file:#
===================================================================
# AWK Script for calculating:
#
===================================================================
BEGIN {recvdSize = 0startTime = 500stopTime = 0flow = 0pkt =
1000}{# Trace line format: newif ($2 == "-t") {event = $1time =
$3node_id = $5flow_id = $39pkt_id = $41pkt_size = $37flow_t =
$45level = $19}# Store packets send timeif (level == "AGT"
&& flow_id == flow && node_id == src &&
sendTime[pkt_id] == 0 && (event == "+" || event == "s")
&& pkt_size >= pkt) {if (time < startTime) {startTime
= time}sendTime[pkt_id] = timethis_flow = flow_t}# Update total
received packets' size and store packets arrival timeif (level ==
"AGT" && flow_id == flow && node_id == dst
&& event == "r" && pkt_size >= pkt) {if (time
> stopTime) {stopTime = time}# Rip off the headerhdr_size =
pkt_size % pktpkt_size -= hdr_size# Store received packet's
sizerecvdSize += pkt_size# Store packet's reception
timerecvTime[pkt_id] = time}}END {# Compute average delaydelay =
avg_delay = recvdNum = tot_delay = 0for (i in recvTime) {delay =
delay + (recvTime[i] - sendTime[i]);if((recvTime[i] -
sendTime[i])>max_delay){max_delay=recvTime[i] -
sendTime[i];}recvdNum ++}if (recvdNum != 0) {avg_delay = delay /
recvdNumtot_delay = delay} else {avg_delay = 0}# Compute average
jittersjitter1 = 0prev_time = delay = prev_delay = processed =
deviation = 0prev_delay = -1for (i=0; processed>
aodv_status.xls(( count++ ))done