You are on page 1of 58

Topics on Wireless Ad Hoc Networks

Routing Protocols
Dr. Stavros Toumpis
Telecommunications Research Center Vienna

Routing

3 1 A 2 4

6 5

Typically, nodes are not within the direct communication range of all other nodes. Nodes need to discover routes (consisting of intermediate nodes) through which they can deliver their packets to their distant destinations. This is the task of the routing protocol. This task is complicated by the presence of node mobility. The routing protocol must be coupled with a medium access control (MAC) protocol. The routing protocol species to whom a node should transmit the packet, The MAC protocol species when it should transmit the packet. Many dierent classications of routing protocols exist.

1. Dynamic Source Routing (DSR) [1, 2]

Assumptions
All nodes participate in the protocol, and there is no malicious interference (no security issues). Network diameter is relatively small (around 10 at most). Receivers detect the transmission of corrupted/destroyed packets. Nodes are mobile, but the levels of mobility are moderate. Nodes may be promiscuous (i.e., decode packets that are not intended for them). Both uni-directional and bi-directional links are acceptable. But the medium access layer may neutralize all uni-directional links. With CSMA/CA, uni-directional links are not used. With Aloha, they may be used.
4

Two Basic Mechanisms

Route Discovery: If a node S has a packet for node D, but does not know a route to D, it initiates the Route Discovery Mechanism. Route Maintenance: If a node S is using a route to node D, and realizes that the route is stale (for example, because of node mobility), and has no other route stored in its cache, it initiates the Route Maintenance Mechanism.

Route Discovery: ROUTE REQUEST packet propagation

If a node S wants to nd a route to node D, it transmits a ROUTE REQUEST packet, containing the following information: The source ID (node S). The destination ID (node D) . A request ID. A list of intermediate nodes that the ROUTE REQUEST packet has traversed (initially the list is empty). If a node X receives a ROUTE REQUEST packet: If X=D, X replies with a ROUTE REPLY packet. If X = D, and the request ID is new to X, X transmits the ROUTE REQUEST packet once more, appending its address to the list of intermediate nodes.

"A"

"A,B"

"A,B,C"

"A,B,C,D"

A RQ

C RQ RQ

RQ

RQ: Route Request Packet

Route Discovery: ROUTE REPLY packet propagation

A node that receives a ROUTE REQUEST packet intended for itself will send a ROUTE REPLY packet to the source, even if it already has replied. What if a route back to the original source is not known? One approach is to infer the route from the incoming ROUTE REQUEST packet. This is acceptable if all links are bi-directional. Another approach is to initiate a new Route Discovery. This may be necessary if the links may be uni-directional. Will the second approach create an innite loop?

Multiple routes are returned


B

By construction, the protocol returns multiple routes. A good thing? In the above network, it may produce the two routes highlighted with a dashed line. Are other routes possible? Could it have produces three routes? Is it possible for two routes to share a few common nodes?
8

Route Maintenance
The responsibility for the successful propagation of a packet is divided: Each node must acknowledge the successful reception of the packet to the node preceding it in the route. Each node makes a xed number of attempts to transmit a packet (number of attempts is a design variable). Is one enough? If all attempts fail (because of malfunctions or node mobility), the last node to receive the packet sends a ROUTE ERROR packet to the source. (What if the route to the source is not known?) Upon the reception of the ROUTE ERROR packet, the source purges the route from its routing cache, and initiates a new route discovery.

RE A DP B

RE C DP D E

RE: Route Error Packet DP: Data Packet

Improvement 1: Promiscuity

The routing overhead can be signicantly decreased, if nodes promiscuously use routing information intended for other nodes that they happen to overhear. For example, in the following network, if all links are bi-directional, a single ROUTE REQUEST packet initiated by A and destined for E is enough for all nodes to gain a complete picture of the network.
RQ A RR B RR RQ C RR RQ D RR RQ E

RQ: Route Request Packet RR: Route Reply Packet

10

Promiscuity has its pitfalls

If the network has uni-directional links, nodes must be careful. In the above gure, if the link from X to C is uni-directional (X can transmit to C but not the other way round), the routing information on the header of the data packet is useless for C . If the link from X to C is bi-directional, but the links of the lower chain are uni-directional, what information can be inferred?
A DP V W
DP: Data Packet

B DP

C DP

D DP

11

Improvement 2: Replying to ROUTE REQUEST packets using cached routes

If a node X receives a ROUTE REQUEST packet intended for a destination for which X knows a route, there is no need to propagate the ROUTE REQUEST packet further. X simply replies with a ROUTE REPLY packet containing the augmented route. For example, in the network below, if B knows the route to E, and A sends a ROUTE REQUEST packet intended for E, B immediately replies with a ROUTE REPLY packet, containing the complete route.
RQ A RR
RQ: Route Request Packet RR: Route Reply Packet

12

A potential problem

In the network below, imagine that G knows the route to E, and received a ROUTE REQUEST from node A, for E. Should it suggest the route A B C F G F C D E ? Should it suggest the route A B C D E ? Or should it remain silent?
RQ RQ

C
RQ

F
RQ

RQ: Route Request Packet

13

Improvement 3: ROUTE REQUEST hop limits

If A tries to nd a route to B, four routes will be returned. Of these, R1 is the shortest, and hence the best. The creation of the rest consumes a lot of bandwidth. Solution: Impose a maximum number of hops on all ROUTE REQUEST packets. How should the limit be selected?

R4 B A R1

R2

R3
14

Improvement 4: Suppressing Route Reply Storms


In the network below, everyone knows the route to G, except from A. If A issues a ROUTE REQUEST packet, everyone will try to respond, and there may be collisions (depending on the MAC protocol used). Solution: If a node knows a route of length h, it issues a ROUTE REPLY packet after time T = H (h + r 1) where r is a random variable, uniformly distributed in (0, 1). Does this make sense? How do we select H ?
"C,B,G"

D
RQ RQ

"B,G"

A
RQ RQ RQ

"G"

E
"F,B,G"

"B,G"

RQ: Route Request Packet

15

Improvement 5: Packet Salvaging


In the network below, if A is using the obsolete route R1, node C has two options: It sends a ROUTE ERROR packet back to A, and discards the packet. It sends a ROUTE ERROR packet back to A, but also attempts to salvage the packet, by routing it as its own, using a dierent route (R2) that still works. The second option is a very useful trick, because as we move closer to a node, routing information becomes more accurate. Should node A retransmit the packet?
A B R1
16

R2 C

Improvement 6: Gratuitous Route Replies

If node A is using (the longer) route R1 to send data to C, node B will send a gratuitous ROUTE REPLY packet to A, notifying it that it can switch to (the shorter) route R2.
R2 A B C R1

17

Improvement 7: Spreading ROUTE ERROR packets

When a link fails, a ROUTE ERROR packet is sent to the source A. The nodes along the route that failed are notied of the failure by promiscuously receiving the ROUTE ERROR packet. To make sure that the link that failed is purged from other routing caches, the source A issues a new ROUTE REQUEST packet, piggybacking the routing error in it.
RQ/RE RQ/RE RQ/RE
RE: Route Error Packet DP: Data Packet RQ/RE: Route Request Packet, containing routing error information

RE A DP B

RE C DP D E

18

Improvement 8: Caching Negative Information

Nodes might want to cache the fact that a link just went down. This is not the same as purging all routes that use this link from the cache. If another node suggests a route with this link, the route is probably stale and should be ignored. Nodes might also want to cache the fact that a specic link is erratic, and hence should be avoided. Negative information should be purged after a certain amount of time. How do we pick the time?

19

Improvement 9: Multicasting

Until now, each packet had a single destination (unicasting). In some applications, packets have many destinations (multicasting), or we want everyone to receive the packet (broadcasting). Typical example: SOS signals. Sending the packet consecutively to all destinations is extremely bandwidth consuming. Much better to send the packet to all destinations at once. A rudimentary approach with DSR: Piggyback the packet in a ROUTE REQUEST packet to a ctitious destination. What are the potential problems of this approach?
20

2. Bellman-Ford algorithm

21

Table-Driven Routing

In source routing, the aim is for each node S to know the complete route S A1 A2 A3 . . . D to a destination D. An example is the Dynamic Source Routing (DSR) protocol we just saw. With table-driven routing, each node only needs to know the next hop to the destination, and how many hops away the destination is. This information stored in each node is often arranged in a table, hence the term table-driven routing. Such algorithm are often called distance vector algorithms, because nodes exchange vectors of their known distances to all other nodes. An example is the Bellman-Ford algorithm, one of the rst ones to be used for routing in the Internet, which we study next.

22

The Bellman-Ford algorithm [3]

Consider a collection of nodes, connected over bi-directional wired links of given delays. We want to nd the fastest route from each node to any other node. An example network:
3

2
1

4
2

1
3

1 1

Initially, each node knows the distances to its direct neighbors, and stores them to its routing table. Nodes other than their direct neighbors are assumed to be at an innite distance. Then, nodes start exchanging their routing tables.

23

Step 1
Destination 1 2 3 4 5 Next Hop 2 3 Distance 0 1 3 Destination 1 2 3 4 5 Next Hop 1 3 4 Distance 1 0 1 3

Node 1:

Node 2:

Node 3:

Destination 1 2 3 4 5

Next Hop 1 2 5

Distance 3 1 0 1

Node 4:

Destination 1 2 3 4 5

Next Hop 2 5

Distance 3 0 2

Node 5:

Destination 1 2 3 4 5

Next Hop 3 4 -

Distance 1 2 0

24

Step 2
Destination 1 2 3 4 5 Next Hop 2 32 2 3 Distance 0 1 32 4 4 Destination 1 2 3 4 5 Next Hop 1 3 4 3 Distance 1 0 1 3 2

Node 1:

Node 2:

Node 3:

Destination 1 2 3 4 5

Next Hop 12 2 5 5

Distance 32 1 0 3 1

Node 4:

Destination 1 2 3 4 5

Next Hop 2 2 5 5

Distance 4 3 3 0 2

Node 5:

Destination 1 2 3 4 5

Next Hop 3 3 3 4 -

Distance 4 2 1 2 0

25

Step 3
Destination 1 2 3 4 5 Next Hop 2 2 2 32 Distance 0 1 2 4 43 Destination 1 2 3 4 5 Next Hop 1 3 4 3 Distance 1 0 1 3 2

Node 1:

Node 2:

Node 3:

Destination 1 2 3 4 5

Next Hop 2 2 5 5

Distance 2 1 0 3 1

Node 4:

Destination 1 2 3 4 5

Next Hop 2 2 5 5

Distance 4 3 3 0 2

Node 5:

Destination 1 2 3 4 5

Next Hop 3 3 3 4 -

Distance 43 2 1 2 0

26

Disadvantages of the Bellman-Ford Algorithm

As the number of nodes n increases, the routing overhead increases very fast, like O(n2). When the topology changes, routing loops may form: A packet travels ad innitum along routes of the form . . . A B ... A B ...
A

With source routing, this is never a problem. AODV was invented to circumvent these problems.

27

3. Ad Hoc On-Demand Distance Vector (AODV) Routing [4, 5]

28

AODV Routing Tables


Each routing entry contains the following pieces of information (the rst three are the same with the entries of the Bellman-Ford Algorithm) : Destination. Next hop toward the destination. Number of hops left to reach the destination. Sequence number of the destination. (The sequence number reveals how fresh is the information in the routing table.) Active neighbors for that destination. (If the route to the destination disappears, these neighbors will be notied.) Expiration time for the route table entry. (Whenever the route is used, the expiration time is updated.)
29

Path Discovery with AODV: RREQ Packets

If a source node S has a packet for a destination node D and does not know the next hop toward D, it initiates a path discovery, by broadcasting a route request (RREQ) packet. The RREQ packet contains the following elds: The The The The The address of the source node. address of the destination node. sequence number of the source. last known sequence number of the destination. hop count to the source (set to 0).

Nodes increment their sequence numbers just before transmitting a RREQ or a RREP packet.

30

RREP Packets
When a node A receives a RREQ packet:

If A has already replied to another RREQ packet from the same source node, and with the same or higher source destination number, node A disregards the packet. Otherwise, if A does not know the route to the destination, it broadcasts another RREQ packet, after increasing the hop count by 1, and noting: The next hop to the source, how many hops away the source is, the source destination number. (this information will be used for routing the RREP packet). Otherwise (node A knows a route to the destination), node A stores: The next hop to the source, how many hops away it is, the source sequence number, and then unicasts a Route Reply (RREP) packet back the source, letting it know how many hops away it is from its destination.

31

Path Discovery, Example 1


In the following network, node 3 knowns how to route packets to node 5 and node 1 wants to nd a route to 5.

9 1 2 3 4

8 5

7 6

2 hops away from 5Sequence no: 62 Next hop:4 Known sequence number to 5: 62
RREQ: RREP: Node 1 is looking for node 5 Next hop to 1: 2 2 hops away from node 1 Known sequence number of 5: 0

32

Path Discovery, Example 2


In the following network, no node has routing information of any kind, and node 5 wants to nd a route to node 5.

9 1 2 3 4

8 5

7 6

Sequence number: 62 Next hop to 5 is node 3 3 hops from 5 Known sequence number to 5: 62 RREQ: RREP: Node 1 is looking for node 5 Next hop to 1: 7 6 hops away from node 1 Known sequence number of 5: 0

33

AODV only returns one route


RQ RQ RQ RQ RQ RR RQ RQ RQ RQ RQ RQ RQ RQ RQ RQ RQ RQ RQ RQ RR RR RQ RQ RQ RQ RQ RQ RQ RQ RQ

A
RQ

RQ

B only replies to the rst RREQ packet. As the RREQ packets propagate, routing information about the reverse paths is accumulated. If this information is not used soon, it is purged by the routing cache.

34

Path Maintenance
Each node A monitors the links to all its neighbors. If the link to a neighbor B disappears, and this neighbor B is actively used for routing, node A sends a Route Error (RERR) packet to all its neighbors that are using the link. Each of these neighbors will propagate the RERR packet further, if needed. The RERR packets will use a destination sequence number which is incremented by 1 from the previously known. This ensures that no routing loops are formed:
A

35

Path Maintenance Example


In the following network, after the link from node 4 to node 5 is gone, node 1 has to discover a new route.

9 1 2 3 4

8 5

7 6

Sequence number: 62 I no longer have a path to node 5 Sequence number for 4: 63 Node 1 is looking for node 5 Next hop to 1: 7 Node 1 is 6 hops away Known sequence number of 5: 63

RERR: RREQ:

36

The use of timeouts in AODV

Each reverse routing table entry has a route request expiration timer. If a RREQ packet goes through a node, the node stores reverse routing information, i.e. routing information for the source. If no RREP goes through the node, the routing information is purged. All unused routing entries automatically expire after a specied timeout interval. Intuition: The route is probably obsolete, so it is better to ignore it, than to attempt to use it and incur additional delay. How should the interval be chosen?

37

Similarities and Dierence between DSR and AODV [6]

Similarities: Both are on-demand. Both use a similar route discovery process. Dierences: DSR uses source routing (and so all routes are trivially loop-free), but AODV uses only table-driven routing (and so extra care must be taken to ensure that routes are loop-free). DSR has no timers (so some of its routes may be stale), AODV uses them extensively. DSR discovers many routes (and so has quick backups if a route is gone), AODV only one route (and so initiates route discoveries much more often).

38

Performance Comparison of DSR and AODV: Simulation Set up

Event-driven simulation with ns-2. 100 nodes, placed in an area of size 2200 m 600 m.

40 of them act as Constant Bit Rate (CBR) sources, with random destinations. Packet sizes are 512 bytes. Mobility is according to the random waypoint model: A node moves along a straight line with a random speed and for a random distance .. .. it then pauses for a random time interval .. and then starts to move toward a new direction. CSMA/CA (as specied in IEEE 802.11) is used for unicast packets (for example, data packets) CSMA (as specied in IEEE 802.11) is used for broadcast packets (for example, route requests)

39

Performance Comparison of DSR and AODV: Throughput and Routing Load vs. Oered Load

Question: Who made the comparison, the AODV design team or the DSR design team?
40

Performance Comparison of DSR and AODV: Average Delay vs. Oered Load

Question: why is the delay not exploding, but rather saturates?


41

Why is DSR doing so bad?


R4 B A R1

R2

R3

In DSR, if a route becomes obsolete and a backup exists, the source attempts to use the backup. But there is a high probability that the backup route has also become obsolete.
42

Potential Improvements

DSR can be improved by removing aged routes from the system. Both AODV and DSR can be improved if nodes are allowed to drop aged packets from their queues. Reason: Aged packets have probably initiated time-outs in higher layers of the protocol stack, so even if they are received by the destination, they will be ignored. Both AODV and DSR can be improved if they try to minimize the congestion as opposed to the hops counts of routes.

43

4. Geographic Routing

44

Geographic Routing [7]

Basic idea: if nodes know their position and the position of their destination, they can decide on next hop without any routing overhead. Two catches: Nodes must know their position, either by using GPS, or other means [8]. Nodes must know the position of their destination, i.e. a location service is needed. Question: are we back where we started? Bottomline: geographic routing consists of two basic mechanisms, (A) a localization part and (B) a routing part.

45

Localization in DREAM [9]

Everyone is periodically broadcasting packets containing his position, that are allowed to travel some distance R. The faster a node moves, the most frequently the packets must be transmitted. The larger distance R is, the more accurate is the information that other nodes have about the node. Note that nodes very far away do not really need accurate information! This is called the distance eect.

46

Other methods of localization

Assign designated location server. whoever wants to nd someone must contact the localization server. This creates the chicken-and-egg problem and reduces robustness. Have many nodes be location servers, spread around a grid, or forming a tree. Homezone strategy: The location of a node is constantly being kept at nodes whose location is a hashing of the node id. What if there are no nodes in that location?

47

Routing strategies

Transmit packet to node closest to the destination (node C). Few hops but lots of interference. Transmit packet to node closest to you (node A) Many hops but not much interference. Compass routing: transmit packet to node closest on the line formed by you and the destination (node B) Intuitive, cool name. Transmit at random Simple

48

A potential problem

Packets might reach a local minimum. Solutions: Work around the gap (easy if graph is planar, but dicult in general case). Transmit many copies toward the general direction of the destination.
49

Do we really need a localization service? The EASE algorithm [10]

1. When a node has a packet to send to a destination, it sends the packet rst to the last place where he saw the destination. 2. Once there, the packet nds a node that has seen the destination more recently than the previous node, and sends him to the last place the destination was seen. 3. Go to step 2., unless destination is found The average length of the hops needed scales as we could hope for. This is what police detectives do in movies.
50

n, which is the best

5. Concluding Remarks

51

Hybrid Protocols

Reactive protocols have small overhead but big latency, and work well in big networks. Proactive protocols have big overhead bus small latency, and work well for small networks. Hybrid Protocols tend to combine the two approaches, and have the best of two worlds For example, the Zone Routing Protocol (ZPR) [11] breaks the network in zones. For intra-zone trac, it is proactive. For inter-zone trac, it is reactive.

52

Other approaches to routing


Energy aware routing [12] Use AODV, DSR, etc., but distance metric is the energy spent. Combine Route Discovery (for example in AODV, DSR) with geographical information, to improve eciency. For example, if we know that our destination is to the north (because, for example, it was there a minute ago, we only send ROUTE REQUEST packets toward the north. But we need GPS capabilities for that. Avoid using unstable links. Implemented in Associativity Based Routing Protocol (ABR) [13]. Cross-layer integration with transport layer, MAC layer, and physical layer.
53

Many classications exist

Source routing vs table driven Proactive vs Reactive vs Hybrid Flat vs. Hierarchical Location based (i.e. geographic) vs others etc.

54

(Partial) list of proactive protocols [7]

55

(Partial) list of reactive protocols [7]

56

References
[1] D. B. Johnson, D. A. Maltz, and J. Broch, DSR: The Dynamic Source Routing Protocol for Multihop Wireless Ad Hoc Networks. Addison-Wesley, 2001, ch. 5, pp. 139172. [2] J. Broch, D. B. Johnson, and D. A. Maltz, The dynamic source routing protocol for mobile ad hoc networks, Internet Draft draft-ietf-manet-dsr-01.txt, Dec. 1998. [3] D. P. Bertsekas and R. Gallager, Data Networks, 2nd ed. Englewood Clis, NJ: Prentice Hall, Dec. 1991. [4] C. E. Perkins and E. M. Royer, Ad hoc on-demand distance vector routing, in Proc. IEEE WMCSA, vol. 1, New Orleans, LA, Feb. 1999, pp. 90100. [5] C. Perkins, Ed., Ad Hoc Networking, 1st ed. Boston, MA: Addison-Wesley, Dec. 2000. [6] E. M. Royer and C.-K. Toh, A review of current routing protocols for ad-hoc mobile wireless networks, IEEE Personal Commun. Mag., vol. 6, no. 2, pp. 4655, Apr. 1999. [7] M. Mauve, J. Widmer, and H. Hartenstein, A survey on position based routing in mobile ad hoc networks, IEEE Network Magazine, vol. 15, no. 6, pp. 3039, Nov. 2001. [8] J. Hightower and G. Borriello, Location systems for ubiquitous computing, IEEE Computer, vol. 34, no. 8, pp. 5766, Aug. 2001. [9] S. Basagni, I. Chlamtac, V. R. Syrotiuk, and B. A. Woodward, A distance routing eect algorithm for mobility, in Proc. ACM MobiCOM, Dallas, TX, Oct. 1998, pp. 7684. [10] M. Grossglauser and M. Vetterli, Locating nodes with EASE: Last encounter routing in ad hoc networks through mobility diusion, in Proc. IEEE INFOCOM, vol. 3, San Francisco, CA, Mar.-Apr. 2003, pp. 19541964.
57

[11] M. R. Pearlman and Z. J. Haas, Determining the optimal conguration for the zone routing protocol, IEEE J. Select. Areas Commun., vol. 6, no. 2, pp. 13951414, Aug. 1999. [12] J.-H. Chang and L. Tassiulas, Energy conserving routing in wireless ad-hoc networks, in Proc. IEEE INFOCOM, vol. 1, Tel Aviv, Israel, Mar. 2000, pp. 2231. [13] C.-K. Toh, Ad Hoc Mobile Wireless Networks: Protocols and Systems, 1st ed. Prentice Hall, Dec. 2001. Englewood Clis, NJ:

[14] M. Abolhasan, T. Wysocki, and E. Dutkiewicz, A review of routing protocols for mobile ad hoc networks, Elsevier Ad Hoc Networks, vol. 2, no. 1, pp. 122, Jan. 2004.

58

You might also like