You are on page 1of 53

COMP9332 Network Routing & Switching

Routing for Adhoc Networks


www.cse.unsw.edu.au/~cs9332
CSE, UNSW

Previous lectures
Fixed routing infrastructure Fixed infrastructure provides routing RIP, OSPF were designed for fixed routing infrastructure
Routers are in fixed infrastructure Routers are not mobile

CSE, UNSW

This lecture
What if there is no routing infrastructure? Ad hoc networks
What are they? Routing in MANETs Future directions

CSE, UNSW

What are ad hoc networks?


Networks without fixed infrastructure and nodes communicate over wireless links Example of fixed infrastructure: access points, routers, switches, Ethernet The simplest ad hoc network consist of 2 devices communicating over a wireless link
Devices can be laptops, bluetooth phone, PDA etc

CSE, UNSW

More complex ad hoc networks


Many hosts/devices communicating with each other wirelessly [illustration - next slide] The key feature is: no infrastructure Hosts can be stationary or mobile If hosts are mobile, it is known as Mobile ad hoc network (MANET)

CSE, UNSW

Ad hoc network - an illustration

C A B D
6

CSE, UNSW

MANET application (1)

Battle field communications e.g. among tanks and soldiers Military origin of MANET CSE, UNSW
7

MANET application (2)

Search and rescue Mobile devices on personnel and vehicles CSE, UNSW Good for remote areas

MANET application (3)

CSE, UNSW

http://yoshida.kuee.kyoto-u.ac.jp/~aolim/text/adhoc/text/8_1.html 9

Why MANETs
Why MANETs?
Fast and easy to deploy Wireless untethered connection Mobility is assumed Anywhere anytime network formation

CSE, UNSW

10

Features of MANET
Nodes use wireless communications Lack of fixed infrastructure Multi-hop radio communications Nodes are also routers Variable topology

Nodes can only directly communicate with nodes within their radio range [illustration - next slide] Nodes forward the traffic for each other In contrast to the Internet: Hosts do not do routing

CSE, UNSW

11

Multi-hop radio communications

C A
Wireless connectivites A B, B C, D B, C D

B D
12

A-B : single hop


CSE, UNSW

A-C : multi-hop

Variable topology network (1)


Topology refers to connectivity graphs of routers Traditional networks deploy fixed routing infrastructure
topology is fixed fixed and known neighbours IP address prefix tells the location

CSE, UNSW

13

Variable topology network (2)


Due to
1. Limited radio range 2. Mobility of nodes Links are made and broken. This result in variable topology or time varying topology

In MANETs
topology may change rapidly no fixed neighbours (neighbours change dynamically) no fixed routes (they may quickly become invalid)

CSE, UNSW

14

Variable topology example


Now
A C

Later
B A C B

Topology

Topology

CSE, UNSW

15

Routing Challenges for MANETs


No fixed topology
routes become invalid quickly

All router links are wireless links

Routers have limited battery life

wireless bandwidth is limited and expensive routing overhead (bandwidth consumption) has to be very low routers are not connected to fixed powerlines routing overhead (power consumption) has to be low

CSE, UNSW

16

Problems with traditional approaches


Traditional Table Driven Routing
each node maintains up-to-date routing tables tables are broadcast periodically when topology changes, nodes propagate update messages periodic broadcast is costly

Time varying topology

Topology needs to be updated to provide accurate topology information Accurate route information But frequent topology update consumes bandwidth

CSE, UNSW

17

Approaches to MANET routing (1)


Approach 1: Proactive / table-driven
Maintains route to all destinations Nodes exchange routing information in a smart way to reduce bandwidth consumption IETF has standardised
Optimised link state routing (RFC3626) Topology dissemination based reversed path forwarding (RFC3684)

CSE, UNSW

18

Approaches to MANET routing (2)


Approach 2: Reactive / on-demand
Nodes do not maintain routes to all destinations When a node needs to communicate with another node, the route is discovered ondemand IETF has standardised Ad hoc on demand distance vector (AODV) in RFC3561
Will look at this in greater details later

CSE, UNSW

19

Approaches to MANET routing (3)


Approach 3: Hybrid
Combination of proactive and reactive approaches

Approach 4: Position-based
Packet header carries the position (e.g. GPS coordinates) of the destination node Routing decision is based on position rather than IP addresses

CSE, UNSW

20

Features of on-demand routing


On-Demand
up-to-date routes to all destinations are not maintained no periodic broadcast of tables route discovery process is invoked when a host needs to send a datagram to a destination route remains valid till destination remains reachable

CSE, UNSW

21

Ad-hoc On Demand Distance Vector Routing (AODV)


The on-demand variant of traditional distance vector routing protocol Routes are found on-demand When source needs to know the route, it initiates a route discovery process The source learns the route as the outcome of the route discovery process

CSE, UNSW

22

AODV - key components


Messages
Route request (RREQ) Route reply (RREP) Route repair Route discovery Route repair Maintaining neighbour information

Components

CSE, UNSW

23

AODV - terminology
Originating node
The node which initiates the route discovery process

Two types of paths


Forward path: source to destination Reverse path: destination to source

CSE, UNSW

24

Route discovery process (1)


Originating node S has packets to send to destination node D
S doesnt know about a route to D S performs route discovery by broadcasting an RREQ message to its neighbours Intermediate nodes re-broadcast this message if
It hasnt seen this message before, and It doesnt know about a route to D The RREQ message is identified by a sequence number

CSE, UNSW

25

Route discovery process (2)


If none of the intermediate nodes in the network knows a route to D
This is the same as flooding the RREQ message in the network

CSE, UNSW

26

Maintaining reverse path information (1)


Node 1 = Source node
Node 2 adds the following information to its routing table: Destination: Node 1 Next Hop: Node 1 Node 3 adds the following information to its routing table: Destination: Node 1 Next Hop: Node 2 Node 5 adds the following information to its routing table: Destination: Node 1 Next Hop: Node 3
27

When a node receives an RREQ message, it enters reverse path information in its routing table
CSE, UNSW

RR E

RR E

5
RREQ

Maintaining reverse path information (2)


Node 1 = Source node Node 5 receives an RREQ from node 2 and adds the following information to its routing table: Destination: Node 1 Next Hop: Node 2

RR E

RREQ

3 5
Later, Node 5 receives the same RREQ from node 3, should it modify its routing table?
28

CSE, UNSW

Exercise
1 2 3 5 6 9 D

Assuming Node 1 = Source, Node D = Destination. If no intermediate nodes knows a route to D. What are the reverse paths that have been established when the RREQ message reaches the destination?
CSE, UNSW

29

Solution
1 2 3 5 6 9 D

Assuming node-3 receives RREQ from node-2 before it receives the request from node 5, and node-D receives it from node-6 before from node-9.

CSE, UNSW

30

RREQ packet format


Source address Reqst ID Dest address Hop count

An RREQ message is uniquely identified by source address and request id The message is broadcast by using IP limited broadcast address 255.255.255.255 Each intermediate node increments the hop count field by 1

CSE, UNSW

31

Creating the forward path (1)


If the destination is in the network, the RREQ message will eventually
Reaches the destination node, or, A node in the network which knows a route to the destination

These nodes will reply with an RREP message

6
CSE, UNSW

D 9

= RREQ

= RREP

D unicasts an RREP message to the node from which it first receives an RREQ message

32

RREP message format


Source address Dest address Hop count Life time

RREP message identifies the


Originating node Destination node

Lifetime - validity time

CSE, UNSW

33

Creating the forward path (2)


= reverse path established = RREP

1 2 3 5 6 9 D

When Node 6 receives the RREP message 1. It enters the following information in its routing table Destination = D, NextHop = D. 2. It unicasts the RREP message along the reverse path that has already been established.

Exercise:
= reverse path established = RREP

1 2 3 5 6 9 D

When Node 3 receives the RREP message from node 6, what information will it enter in its routing table? What actions will it take after that?

Solution:
= reverse path established = RREP

1 2 3 5 6 9 D

Since it receives the RREP message from node 6, it enters Destination = Node D, Next Hop = Node 6. It then consults its routing table and find that the next hop to Node 1 (the originating node) is Node 2 (this is the reverse path) so it unicasts an RREP to Node 2

Creating the forward path (3)


Note that, if an intermediate node knows of a path to the destination, it can send a RREP message

1 2 3 5
CSE, UNSW

= RREQ

= RREP

6 9

Node 3 knows a valid route to D, it can send a RREP.


37

Route Maintenance
Due to movements of nodes, routes may be broken during a session Such broken routes must be repaired and maintained until the end of the session The node which detects a link-break in an active route, back propagates an error message to the source The source reinitiates the route discovery process to find a new route

CSE, UNSW

38

Route Repair (Detour Creation)


4 goes out of reach of 3

4
error mesg

2 1

4 6 5

source/dest idiate nodes

After another route discovery

2 1
CSE, UNSW

3 6

5
39

Detecting Route Failure (1)


Each node broadcasts a hello message periodically If a node does not receive a hello message from a neighbour in the last period, it means the neighbour has moved out of range It purges all entries in its routing table for which the next hop is this unreachable neighbour

CSE, UNSW

40

Detecting Route Failure (2)


It also sends error message to all active neighbours (for which the next hop is this unreachable neighbour) so they can purge these routes as well from their routing tables These active neighbours relay the error message to their active neighbours and so on

CSE, UNSW

41

What is an Active Neighbour?


For each destination in a nodes routing table, a neighbour is an active neighbour if it fed a packet to this node for this destination in the last T sec
Destinati on 1 2 5 6 Next Hop 2 2 4 6 Active Nghbrs 4 4,6 2 2

1
CSE, UNSW

4 6 5

Routing Table at Node 3

Only shaded entries are affected when 4 becomes unreachable to 3. Active 42 neighbour 2 has to be notified.

Route discovery overhead


Should RREQ be disseminated network wide? If RREQ fails to find a path to the destination the first time
Should the source node re-initiate another route discovery? How many times should it re-try?

CSE, UNSW

43

Controlling RREQ message dissemination


Rationale
The destination may be located near the node initiating the route discovery A node nearby may know a route to the destination

Disseminating RREQ message throughout the network may be unnecessary

CSE, UNSW

44

Expanding ring search (ERS)


Searches incrementally bigger area if the previous search fails to find a route Implemented by manipulating the TTL field in the IP header Similar method is also used in some peerto-peer networks (e.g. Gnutella)

CSE, UNSW

45

ERS implementation (1)


Originating node
First route discovery round
Recall RREQ is encapsulated in an IP packet Set TTL in IP header to TTL_Start Wait for an RREP message Timeout set to RING_TRAVERSAL_TIME Case 1: Receives an RREP Okay Case 2: No RREP receives and timeout occurs Next round of route discovery

CSE, UNSW

46

ERS implementation (2)


Second route discovery round
Set TTL in IP header to TTL_Start + TTL_Increment Wait for an RREP message

More route discovery rounds are required if the originating node still fails to find a route

For each new round, the TTL is incremented by TTL_Increment This is continued until TTL reaches TTL_Threshold Initiate network-wide broadcast by setting TTL = Net_Diameter

CSE, UNSW

47

ERS parameters
The RFC recommends the following setting
TTL_START = 1 TTL_Increment = 2 TTL_Threshold = 7 Net_Diameter = 35 Node_Traversal_Time = 40ms Ring_Traversal_Time = 2 x Node_Traversal_Time x (TTL_value + Timeout_Buffer) Timeout_Buffer = 2

Configurable parameter to account for possible congestion

CSE, UNSW

48

ERS example (1)


Assumptions: Node 1: Source. Node 4: Destination. No nodes know about a route to node 4. Decrements TTL by 1, thus TTL = 0 Packet dropped.

Sets TTL = 1

2 1
Search area
CSE, UNSW

4 6 5

7 8

Originating node timeout as no RREP is received. 49 It sets TTL = 3 in the next round of search.

ERS example (2)


TTL=2 Sets TTL = 3 Destination reached. Send RREP.

2 1
Search area

4 6 5

7 8

CSE, UNSW

Note that RREQ does not reach nodes 5,7 and 8. Thus saving them from processing RREQ messages.
50

Controlling repeated route discovery attempts (1)


When TTL is set to Net_Diameter, how many times should the originating nodes be attempting to discover route in a network wide manner? RFC says this should be done using binary exponential backoff

CSE, UNSW

51

Controlling repeated route discovery attempts (2)


First time when a network-wide route discovery is done
Timeout = Net_Traversal_Time Wait this long for RREP before the 2nd attempt for the same destination is made Timeout for attempt (k+1) = 2 x timeout for attempt k Example:
Timeout for the 2nd attempt = 2 x Net_Traversal_Time Timeout for the 3rd attempt = 4 x Net_Traversal_Time

Binary exponential backoff means

Maximum number of retries = RREQ_RETRIES


RFC recommends RREQ_RETRIES be set to 2

CSE, UNSW

52

References
RFC3561 Ad hoc on-demand distance vector (AODV) routing

CSE, UNSW

53