12.07.2015 Views

Wireless Ad Hoc and Sensor Networks

Wireless Ad Hoc and Sensor Networks

Wireless Ad Hoc and Sensor Networks

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

368 <strong>Wireless</strong> <strong>Ad</strong> <strong>Hoc</strong> <strong>and</strong> <strong>Sensor</strong> <strong>Networks</strong>path algorithm, using number of hops as the metric. OLSR’s method maynot result in optimal routes, in most cases, in terms of delay <strong>and</strong> energyconsumption for ad hoc wireless networks. The following algorithm isused by the OEDR protocol to calculate the routing table, based on theinformation contained in neighbor <strong>and</strong> topology tables (flowchart for thealgorithm is presented in Figure 8.4). Algorithm:1. Clear all entries in the routing table, RT() s , of node s .2. Record the new entries in the RT()s , starting with one-hop neighborsin Ns () as destination nodes. For each neighbor entry in theneighbor table, record a new route entry in the routing table,where destination <strong>and</strong> next-hop addresses are both set to theaddress of the neighbor; distance is set to 1, <strong>and</strong> the cost of theroute is set to the cost of the link from the neighbor table.3. Then record the new entries for destination nodes i + 1 hops awayin the routing table. The following procedure is executed for eachvalue of i , starting with i = 1 <strong>and</strong> incrementing it by 1 each time. Theexecution will be stopped if no new entry is recorded in an iteration.• For each topology entry in the topology table, if the last-hopaddress corresponds to the destination address of a route entrywith distance equal to i , then check to see if a route entryalready exists for this destination address.a. If the destination address of the topology entry does notcorrespond to the destination address of any route entryin the routing table, then a new route entry is recorded inthe routing table where:• Destination is set to destination address in topologytable.• Next-hop is set to next-hop of the route entry whosedestination is equal to previously mentioned last-hopaddress.• Distance is set to i + 1.• Cost of the route is set to the sum: Cost s, last−hop+ C last − hop, destination (cost of the route entry in the RT()swith the last-hop as its destination address + cost of thelink between the destination <strong>and</strong> its last-hop from thetopology table).b. Else, if there exists a route entry in RT()s whose destinationaddress corresponds to the destination address of the topologyentry, then compute the cost of the new route as the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!