2. Introduction
• What is Ad Hoc Network?
• In Latin, ad hoc means "for this," further
meaning "for this purpose only.”
•All nodes are mobile and can be
connected dynamically in an arbitrary
manner.
•No default router available.
•Potentially every node becomes a router:
must be able to forward traffic on behalf of
others.
3. Ad Hoc Networks
Wireless networks can be divided in two fundamental
categories:
Infrastructure-based
Wireless clients connecting to a base-station (APs,
Cell Towers) that provides all the traditional network
services (routing, address assignment)
Infrastructure-less
The clients themselves must provide all the traditional
services to each other
4. Ad Hoc Networks
Ad-hoc networks main features:
Decentralized
Do not rely on preexisting infrastructure
Each node participates in routing by
forwarding data to neighbor nodes
Fast network topology changes due to nodes’
movement
6. Ad Hoc Routing Protocols Overview
Ad hoc Routing Protocols
Table Driven
(Proactive)
CGSR DSDV WRP
AODV DSR TORA SSRABR
Source-Initiated
On-demand Driven
(Reactive)
Hybrid
ZRP
7. • Proactive Protocols
– have lower latency due to maintenance of routes at all times
– can result in much higher overhead due to frequent route updates
• Reactive Protocols may have
– higher latency since the routes have to be discovered when the source
node initiates a route request
– lower overhead since routes are maintained only on-demand basis
Proactive vs. Reactive Routing Protocols
8. MANET Protocols
• Proactive Protocols
– Table driven
– Continuously evaluate routes
– No latency in route discovery
– Large capacity to keep network
information current
– A lot of routing information may
never be used!
• Reactive Protocols
– On Demand
– Route discovery by some
global search
– Bottleneck due to latency
of route discovery
– May not be appropriate for
real-time communication
9. Ad-hoc routing algorithms
Hottest routing algorithm categories:
Pro-active (table-driven) routing
Maintains fresh lists of destinations & their routes by periodically
distributing routing tables
Disadvantages:
1. Respective amount of data for maintenance
2. Slow reaction on restructuring and failures
(e.g. OSLR, DSDV)
Reactive (on-demand) routing
On demand route discovery by flooding the network with Route
Request packets
Disadvantages:
1. High latency time in route finding
2. Flooding can lead to network clogging
(e.g. AODV, DSR)
11. Outline
Ad-Hoc networks
Ad-hoc routing algorithms
Ad-Hoc on-demand Distance Vector Routing (AODV)
General info
Path Discovery
Path Maintenance
Local Connectivity Maintenance
Conclusion
Dynamic Source Routing (DSR)
Comparison of AODV and DSR
12. (AODV) General info
Reactive algorithms like AODV create routes on-
demand. They must however, reduce as much as
possible the beneficial time
We could largely eliminate the need of periodically
system-wide broadcasts
AODV uses symmetric links between neighboring
nodes. It does not attempt to follow paths
between nodes when one of the nodes can not hear
the other one
13. (AODV) General info
Nodes that have not participate yet in any packet
exchange (inactive nodes), they do not maintain
routing information
They do not participate in any periodic routing table
exchanges
14. (AODV) General info
Each node can become aware of other nodes in its
neighborhood by using local broadcasts known as
hello messages
neighbor routing tables organized to :
1. optimize response time to local movements
2. provide quick response time for new routes
requests
15. (AODV) General info
AODV main features:
Broadcast route discovery mechanism
Bandwidth efficiently (small header information)
Responsive to changes in network topology
Loop free routing
16. Outline
Ad-Hoc networks
Ad-hoc routing algorithms
Ad-Hoc on-demand Distance Vector Routing (AODV)
General info
Path Discovery
Path Maintenance
Local Connectivity Maintenance
Conclusion
Dynamic Source Routing (DSR)
Comparison of AODV and DSR
17. (AODV) Path Discovery
Initiated when a source node needs to
communicate with another node for which it has no
routing info
Every node maintains two counters:
node_sequence_number
broadcast_id
The source node broadcast to the neighbors a
route request packet (called RREQ)
18. (AODV) Path Discovery
RREQ structure
<src_addr, src_sequence_#, broadcast_id, dest_addr,
dest_sequence_#, hop_cnt>
src_addr and broadcast_id uniquely identifies a RREQ
broadcast_id is incremented whenever source node
issues a RREQ
Each neighbor either satisfy the RREQ, by sending
back a routing reply (RREP), or rebroadcast the RREQ
to its own neighbors after increasing the hop_count by
one.
19. (AODV) Path Discovery
If a node receives a RREQ that has the same
<src_addr, broadcast_id> with a previous RREQ it
drops it immediately
If a node cannot satisfy the RREQ, stores:
Destination IP
Source IP
broadcast_id
Expiration time (used for reverse path process)
src_sequence_#
20. (AODV) Path Discovery
1. Reverse Path Setup
In each RREQ there are:
src_sequence_#
the last dest_sequence_#
src_sequence_# used to maintain freshness
information about the reverse route to the source
dest_sequnece_# indicates how fresh a route must
be, before it can be accepted by the source
21. (AODV) Path Discovery
1.Reverse Path Setup (continue)
As RREQ travels from source to many destinations, it
automatically sets up the reverse path, from all nodes
back to the source.
But how does it work?
Each node records the address of the neighbor from which it
received the first copy of the RREQ
These entries are maintained for at least enough time, for the
RREQ to traverse the network and produce a reply
22. (AODV) Path Discovery
1.Reverse Path Setup (continue)
U
D
Z
Y
W
S
V
S
D
Z
W
ZW
Source node
Destination node
Neighbor nodes
S sends RREQ
Figure 1
W, Y can not satisfy RREQ
i. Set up reverse path
ii. Rebroadcast RREQ to
neighbors
Z, V, U can not satisfy RREQ
i. Set up reverse path
ii. Rebroadcast RREQ to
neighbors
RREQ reached destination
Reversed path is fully set up
From which RREP can travel
back to S
23. (AODV) Path Discovery
2. Forward Path Setup
A node receiving a RREP propagates the first RREP
for a given source towards the source (using the
reverse path that has already established)
Nodes that are not in the path determined by the
RREP will time out after 3000 ms and will delete the
reverse pointers
24. (AODV) Path Discovery
2. Forward Path Setup (continue)
U
D
Z
Y
W
S
V
S
D
Z
W
WZ
Source node
Destination node
Z has a reversed path to W
Figure 2
ZW W has a forward path to Z
D replies with a
RREP to Z
Z receives RREP
and set up a
forward pointer
The same
for the
other
nodes
Time out
25. (AODV) Path Discovery
2. Forward Path Setup (Conclusion)
Minimum number of RREPs towards source
The source can begin data transmission as soon as
the first RREP received and update later its routing
information if it learns of a better route
26. (AODV) Path Maintenance
Movement of nodes not lying along an active path does NOT
affect the route to that path's destination
If the source node moves, it can simply re-initiate the route
discovery procedure
If the destination or some intermediate node moves, a
special RREP is sent to the affected nodes
To find out nodes movements periodic hello messages can be
used, or (LLACKS) link-layer acknowledgments (far less
latency)
27. (AODV) Path Maintenance
When a node is unreachable the special RREP that
is sent back towards the source, contains a new
sequence number and hop count of ∞
U
D
Z
Y
S
V
Z
W
Figure 3
Link between Z
and D fails
Z sents a
special RREP
So do W
So now source must find a new path. To do that, it sents a RREQ with a new greater
sequence number
28. (AODV) Local Connectivity
Maintenance
Nodes learn of their neighbors in one or two ways:
1. Whenever a node receives a broadcast from a
neighbor it update its local connectivity
information about this neighbor
2. If a neighbor has not sent any packets within
hello_interval it broadcasts a hello message,
containing its identity and its sequence number
29. (AODV) Local Connectivity
Maintenance
How hello messages work:
Hello messages do not broadcasted outside the
neighborhood because the contain a TTL (time to
leave) value of 1.
Neighbors that receive the hello message update
their local connectivity information to the node that
have broadcasted the hello message
30. (AODV) Local Connectivity
Maintenance
How hello messages work: (continue)
Receiving a hello from a new neighbor, or failing to
receive allowed_hello_loss (typically 2) consecutive
hello messages from a node previously in the
neighborhood, indicates that the local connectivity
has changed
31. (DSR) General
Two main mechanisms that work together to allow the
discovery and maintainance of source routes:
Route discovery
Route maintainance
32. (DSR) General
Route discovery:
Is the mechanism by which a source node S, obtains
a route to a destination D
Used only when S attempt to send a packet to D and
does not already knows a route to D
33. (DSR) General
Route maintainance:
Is the mechanism by which source node S is able to
detect if the network topology has changed and can
no longer use its route to D
If S knows another route to D, use it
Else invoke route discovery process again to find a
new route
Used only when S wants to send a packet to D
34. (DSR) General
Each mechanism operate entirely on demand
DSR requires no periodic packets of any kind at any
level
Uni-directional and asymmetric routes support
(e.g. send a packet to a node D through a route and receive a
packet D from another route)
36. (DSR) Basic Route Discovery
When S wants to sent a packet to D:
it places in the header of the packet a source route
giving the sequence of hops that the packet should
follow on its way to D
S obtains a suitable source route by searching its route
table
If no route found for D, S initiate the Route Discovery
protocol to dynamically find a new route to D
37. (DSR) Basic Route Discovery
Sender
Broadcasts a Route Request Packet (RREQ)
RREQ contains a unique Request ID and the address of the
sender
Receiver
If this node is the destination node, or has route to the
destination send a Route Reply packet (RREP)
Else if is the source, drop the packet
Else if is already in the RREQ's route table,
drop the packet
Else append the node address in the RREQ's route table
and broadcast the updated RREQ
38. (DSR) Basic Route Discovery
U
D
Z
Y
W
S
V
S
D
Z
W
ZW
Source node
Destination node
Neighbor nodes
S sends RREQ
Figure 4
RREQ packet
Id=2, {S}
Id=2, {S}
Id=2, {S, W}
Id=2, {S, Y}
Id=2, {S, Y}
Id=2, {S, W, Z}
39. (DSR) Basic Route Discovery
When a RREQ reaches the destination node, a RREP
must be sent back to source
The destination node:
Examine its own Route Cache for a route back to source
If found, it use this route to send back the RREP
Else, the destination node starts a new Route Discovery
process to find a route towards source node
In protocols that require bi-directional links like 802.11, the
reversed route list of the RREQ packet can be used, in order to
avoid the second Route Discovery
41. (DSR) Basic Route Maintenance
Each node transmitting a packet:
is responsible for confirming that the packet has been received
by the next hop along the source route
The confirmation it is done with a standard part of MAC layer
(e.g. Link-level ACKs in 802.11)
If none exists, a DSR-specific software takes the
responsibility to sent back an ACK
When retransmissions of a packet in a node reach a maximum
number, a Route Error Packet (RERR) is sent from the node back
to the source, identifying the broken link
42. (DSR) Basic Route Maintenance
The source:
Removes from the routing table the broken route
Retransmission of the original packet is a function of
upper layers (e.g. TCP)
It searches the routing table for another route, or start
a new Route Discovery process
43. (DSR) Basic Route Maintenance
U
D
Z
Y
W
S
V
S
D
Z
W
ZW
Source node
Destination node
Neighbor nodes
Figure 5
RERR packet
Link fails
Intermediate
node sents a
RERR
RERR(Z, D)
RERR(Z, D)
Route Table
D: S, W, Z, D
V: S, Y, V
45. (DSR) Conclusion
Excellent performance for routing in multi-hop wireless
ad hoc networks
Very low routing overhead even with continuous rapid
motion, which scales to :
1. zero when nodes are stationary
2. the affected routes when nodes are moving
Completely self-organized & self-configuring network
Entirely on-demand operation. No periodic activity of any
kind at any level
46. Comparison of AODV and DSR
Main common features:
On-demand route requesting
Route discovery based on requesting and replying
control packets
Broadcast route discovery mechanism
47. Comparison of AODV and DSR
Main common features: (continue)
Route information is stored in all intermediate nodes
along the established path
Inform source node for a broken links
Loop-free routing
48. Comparison of AODV and DSR
Main differences:
DSR can handle uni and bi-directional links, AODV uses
only bi-directional
In DSR, using a single RREQ - RREP cycle, source and
intermediate nodes can learn routes to other nodes on
the route
DSR maintains many alternate routes to the destination,
instead of AODV that maintains at most one entry per
destination
49. Comparison of AODV and DSR
Main differences: (continue)
DSR doesn’t contain any explicit mechanism to expire
stale routes in the cache , In AODV if a routing table
entry is not recently used , the entry is expired
DSR can’t prefer “fresher” routes when faced multiple
choices for routes. In contrast, AODV always choose
the fresher route (based on destination sequence
numbers)
50. Comparison of AODV and DSR
Main differences: (continue)
DSR’s RREQ has variable length depending on the nodes
that the packet has traveled. AODV’s RREQ size is
constant
As a result DSR’s header overhead may increase as more
nodes become active, so we expect that AODV
throughput in those scenarios to be better
51. Dynamic Source Routing (DSR)
• Each packet header contains a route, which is represented as a complete
sequence of nodes between a source-destination pair
• Protocol consists of two phases
– route discovery
– route maintenance
• Optimizations for efficiency
– Route cache
– Piggybacking
– Error handling
52. DSR Route Discovery
• Source broadcasts route request (id, target)
• Intermediate node action
– Discard if id is in <initiator, request id> or node is in route record
– If node is the target, route record contains the full route to the target;
return a route reply
– Else append address in route record; rebroadcast
• Use existing routes to source to send route reply; else piggyback
53. DSR Route Maintenance
• Use acknowledgements or a layer-2 scheme to detect broken links; inform
sender via route error packet
• If no route to the source exists
– Use piggybacking
– Send out a route request and buffer route error
• Sender truncates all routes which use nodes mentioned in route error
• Initiate route discovery
54. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
55. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
Represents transmission of RREQ
Z
Y
Broadcast transmission
M
N
L
[S]
[X,Y] Represents list of identifiers appended to RREQ
56. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
• Node H receives packet RREQ from two neighbors:
potential for collision
Z
Y
M
N
L
[S,E]
[S,C]
57. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
• Node C receives RREQ from G and H, but does not forward
it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
[S,C,G]
[S,E,F]
58. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
M
• Nodes J and K both broadcast RREQ to node D
• Since nodes J and K are hidden from each other, their
transmissions may collide
N
L
[S,C,G,K]
[S,E,F,J]
59. Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
• Node D does not forward RREQ, because node D
is the intended target of the route discovery
M
N
L
[S,E,F,J,M]
60. Route Discovery in DSR
• Destination D on receiving the first RREQ, sends a Route Reply (RREP)
• RREP is sent on a route obtained by reversing the route appended to
received RREQ
• RREP includes the route from S to D on which RREQ was received by
node D
61. Route Reply in DSR
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
M
N
L
RREP [S,E,F,J,D]
Represents RREP control message
62. Dynamic Source Routing (DSR)
• Node S on receiving RREP, caches the route
included in the RREP
• When node S sends a data packet to D, the entire
route is included in the packet header
– hence the name source routing
• Intermediate nodes use the source route included
in a packet to determine to whom a packet should
be forwarded
63. Data Delivery in DSR
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
M
N
L
DATA [S,E,F,J,D]
Packet header size grows with route length
64. DSR Optimization: Route Caching
• Each node caches a new route it learns by any means
• When node S finds route [S,E,F,J,D] to node D, node S also learns route [S,E,F]
to node F
• When node K receives Route Request [S,C,G] destined for node, node K learns
route [K,G,C,S] to node S
• When node F forwards Route Reply RREP [S,E,F,J,D], node F learns route
[F,J,D] to node D
• When node E forwards Data [S,E,F,J,D] it learns route [E,F,J,D] to node D
• A node may also learn a route when it overhears Data
• Problem: Stale caches may increase overheads
65. AODV
• Route Requests (RREQ) are forwarded in a manner similar to DSR
• When a node re-broadcasts a Route Request, it sets up a reverse path
pointing towards the source
– AODV assumes symmetric (bi-directional) links
• When the intended destination receives a Route Request, it replies by
sending a Route Reply (RREP)
• Route Reply travels along the reverse path set-up when Route Request is
forwarded
66. AODV Forward path setup
• RREQ arrives at a node that has current route to the destination (
larger/same sequence number)
• unicast request reply (RREP)<source_addr, dest_addr, dest_sequence_#,
hop_cnt,lifetime> to neighbor
• RREP travels back to the source along reverse path
• each upstream node updates dest_sequence_#, sets up a forward pointer to
the neighbor who transmit the RREP
67. Route Requests in AODV
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
68. AODV Reverse path setup
• Counters : Sequence number, Broadcast id
• Reverse Path
– Broadcast route request (RREQ) < source_addr, source_sequence-# ,
broadcast_id, dest_addr, dest_sequence_#, hop_cnt >
– RREQ uniquely identified by <source_addr , broadcast_id>
– Route reply (RREP) if neighbor is the target, or knows a higher
dest_sequence_#
– Otherwise setup a pointer to the neighbor from whom RREQ was received
– Maintain reverse path entries based on timeouts
69. Route Requests in AODV
B
A
S E
F
H
J
D
C
G
I
K
Represents transmission of RREQ
Z
Y
Broadcast transmission
M
N
L
70. Route Requests in AODV
B
A
S E
F
H
J
D
C
G
I
K
Represents links on Reverse Path
Z
Y
M
N
L
71. Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
I
K
• Node C receives RREQ from G and H, but does not forward
it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
73. Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
• Node D does not forward RREQ, because node D
is the intended target of the RREQ
M
N
L
74. Forward Path Setup in AODV
B
A
S E
F
H
J
D
C
G
I
K
Z
Y
M
N
L
Forward links are setup when RREP travels along
the reverse path
Represents a link on the forward path
75. Route Request and Route Reply
• Route Request (RREQ) includes the last known sequence number for the
destination
• An intermediate node may also send a Route Reply (RREP) provided that it
knows a more recent path than the one previously known to sender
• Intermediate nodes that forward the RREP, also record the next hop to
destination
• A routing table entry maintaining a reverse path is purged after a timeout
interval
• A routing table entry maintaining a forward path is purged if not used for a
active_route_timeout interval
76. Link Failure
• A neighbor of node X is considered active for a routing table entry if the
neighbor sent a packet within active_route_timeout interval which was
forwarded using that entry
• Neighboring nodes periodically exchange hello message
• When the next hop link in a routing table entry breaks, all active neighbors
are informed
• Link failures are propagated by means of Route Error (RERR) messages,
which also update destination sequence numbers
77. Route Error
• When node X is unable to forward packet P (from node S to node D) on
link (X,Y), it generates a RERR message
• Node X increments the destination sequence number for D cached at node
X
• The incremented sequence number N is included in the RERR
• When node S receives the RERR, it initiates a new route discovery for D
using destination sequence number at least as large as N
• When node D receives the route request with destination sequence number
N, node D will set its sequence number to N, unless it is already larger than
N
78. AODV: Summary
• Routes need not be included in packet headers
• Nodes maintain routing tables containing entries only for routes that are in
active use
• At most one next-hop per destination maintained at each node
– DSR may maintain several routes for a single destination
• Sequence numbers are used to avoid old/broken routes
• Sequence numbers prevent formation of routing loops
• Unused routes expire even if topology does not change
79. The 3 Routes of TORA
• Route Creation: Establishing a set of directed
links from the source to destination.
• Route Maintenance: Changes in topology
cause routes to be reestablished.
• Route Erasure: Upon partition detection routes
are removed.
80. Controlling TORA
• Three Control Packets:
• Query (QRY) flooded through network to
establish routes.
• Update (UPD) propagates back if route exists
and re-orient route structure
• Clear (CLR) flooded through network to erase
invalid routes.
81. How High is TORA?
• TORA maintains its DAG by a quintuple.
• H = (t, oid, r, d, i)
• H = Height
• t = time
• oid = orignating node ID
• r = reflection bit; 0 = original, 1 = reflected
• d = ordering integer
• i = nodes ID
82. Temporally Order Routing Algorithm
• Creating Routes: query/reply
• QRY packet is flooded through network
• UPD packet propagates back if route exist
• Maintaining Routes: link-reversal
• UPD packets re-orient the route structure
• Erasing Routes
• CLR packet is floodthrough network to erase
invalid routes
83. a
f
e
d
c
b
h
g
(-,-,-,-,d)
(-,-,-,-,b)
(-,-,-,-,c)
(-,-,-,-,f)(-,,-,-,-e)
Only the non-NULL node (destination) responds with a UPD pac
(0,0,0,0,h)
(-,-,-,-,a)
The source broadcasts a QRY packet with height(D)=0, all others NU
(0,0,0,4,b)
(0,0,0,4,c)
(0,0,0,3,e)
(0,0,0,2,f)
(0,0,0,2,d)
(0,0,0,3,a)
source
Dest.
A node receiving a UPD sets its height to one more than UPD
Source receives a UPD with less height
UP
D
QRY
QRYQRY
(-,-,-,-,g)(0,0,0,1,g)
84. TORA: Height metric
• Each node contains a quintuple
• Logical time of a link failure
• Unique ID of the node that defined the new
reference level
• Reflection indicator bit
• A propagation ordering parameter, height
• Unique ID of the node
85. Route Maintenance and Erasing
• No reaction necessary if all nodes still have
downstream links.
• A new reference level is defined if a node loses its
last downstream link.
• Synchronized clock is important, accomplished
via GPS or algorithm such as Network Time
Protocol.
• CLR packet to be flooded to clear the invalid
packet.