destination sequenced
play

Destination-Sequenced Ad-hoc networks Distance-Vector Bellman-ford - PDF document

Outline Destination-Sequenced Ad-hoc networks Distance-Vector Bellman-ford routing protocol DSDV Critique Suitability of DSDV to sensor networks Ritun Patney Ad-hoc Networks Ad-hoc Networks (Cont.) Group of nodes which


  1. Outline Destination-Sequenced � Ad-hoc networks Distance-Vector � Bellman-ford routing protocol � DSDV � Critique � Suitability of DSDV to sensor networks Ritun Patney Ad-hoc Networks Ad-hoc Networks (Cont.) � Group of nodes which form a network in Every node in an the absence of any infrastructure network ad-hoc network acts as a router or centralized administration (base station, etc.) A B C All nodes can talk to one another directly � A and B can talk � B and C can talk � A and C can’t talk directly � B acts as a router to forward packets between A and C Bellman-ford algorithm Bellman-Ford routing 2 protocol 1 B D 3 4 A 2 4 E C Problem – To find the shortest path to a node from A 1

  2. Bellman-ford algorithm Bellman-ford algorithm ∞ ∞ 2 2 1 1 B D B D 0 3 4 3 4 A A ∞ 2 2 4 E 4 E C C ∞ Problem – To find the shortest path to a node from A Problem – To find the shortest path to a node from A 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 2. Relax every edge in the network 2. Relax every edge in the network i. Let d(u) be the cost to reach u from source, d(v) be the i. d(u), d(v), d(u, v) cost to reach v from the source, and d(u, v) be the cost of ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) an edge between nodes u and v 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 Bellman-ford algorithm Bellman-ford algorithm ∞ ∞ 1 1 2 2 1 1 B D B D 0 0 3 4 3 4 A A 2 ∞ 2 ∞ 4 E 4 E C C ∞ 2 Problem – To find the shortest path to a node from A Problem – To find the shortest path to a node from A 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 2. Relax every edge in the network 2. Relax every edge in the network i. d(u), d(v), d(u, v) i. d(u), d(v), d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 4. Considering AC Bellman-ford algorithm Bellman-ford algorithm 1 ∞ 1 ∞ 2 2 1 1 B D B D 0 0 3 4 3 4 A A 2 ∞ 2 6 4 4 E E C C 2 2 Problem – To find the shortest path to a node from A Problem – To find the shortest path to a node from A 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 2. Relax every edge in the network 2. Relax every edge in the network i. d(u), d(v), d(u, v) i. d(u), d(v), d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 4. Considering AC, now CB 4. Considering AC, CB, now CE 2

  3. Bellman-ford algorithm Bellman-ford algorithm 1 10 1 3 2 2 1 1 B D B D 0 0 3 4 3 4 A A 6 6 2 2 4 E 4 E C C 2 2 Problem – To find the shortest path to a node from A Problem – To find the shortest path to a node from A 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 1. Assign ‘A’ a cost of 0. Assign all others a cost of infinity 2. Relax every edge in the network 2. Relax every edge in the network i. d(u), d(v), d(u, v) i. d(u), d(v), d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) ii. If d(v) > d(u) + d(u, v), then d(v) = d(u) + d(u, v) 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 3. For edge AB, u = A, v = B, d(u) = 0, d(v) = ∞ , d(u, v) = 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 i. Since, d(v) > d(u) + d(u, v), assign d(v) = 0 + 1 4. Considering AC, CB, CE, now ED 4. Considering AC, CB, CE, ED, now BD Bellman-Ford Routing Problems with Bellman-Ford � Every node maintains a routing table entry � Count to Infinity, Loops for every other node <destination, cost, 3 4 next hop> A B C � Every node sends list of <destination, cost> to every other neighbor Routing Table at B Routing Table at C � A node chooses the next hop per Destination Cost Next Destination Cost Next destination based on the node through Hop Hop C 4 C B 4 B which it is least costly – can be hop count, A 3 A A 7 B bandwidth, etc. Problems with Bellman-Ford Problems with Bellman-Ford � Count to Infinity, Loops � Count to Infinity, Loops 3 4 3 4 A A B C B C Routing Table at B Routing Table at C Routing Table at B Routing Table at C Destination Cost Next Destination Cost Next Destination Cost Next Destination Cost Next Hop Hop Hop Hop B 4 B B 4 B C 4 C C 4 C A 11 C A 7 B A 11 C A 15 B 3

  4. Problems with Bellman-Ford � Count to Infinity, Loops DSDV 3 4 A B C 12 2 D Routing Table at B Routing Table at C Destination Cost Next Destination Cost Next Hop Hop C 4 C B 4 B A 18 C A 14 D DSDV Building Routing Tables � Proactive, table-driven � Nodes broadcast routing updates Routing Table Entry at C protocol Node Next Hop Seq. � Incremental updates - like new nodes, link � All nodes maintain a Count Num. Hop breakage – fit in one packet - frequent Route Table Entry for � Full Dump updates – contain the whole routing B B 1 Seq B every other table – may take multiple packets - infrequent destination in the D D 1 Seq D network � Sequence Number – helps removing stale routes, A B 2 Seq A � Route Table Entry – and avoids loops C C 0 Seq C contains next hop for � Generally always stamped by the destination in a destination, number even number increments of hops to reach the � In case of link failures, neighbors increment destination, a A B C D the sequence number of destination with the sequence number failed link by 1 – odd sequence numbers Building Routing Tables (Cont.) Node Addition <K, 1, 384> � Nodes can receive routing path to a destination <K, 2, 384> <K, 0, 384> via multiple neighbors. � Choose route with a new sequence number A B C K � If sequence number same, choose route with a lesser hop count <Node, Next Hop, Metric, Sequence Number Node > A, A, 0, 456 B, B, 1, 258 C, B, 2, 560 4

  5. Node Addition Link Failure <K, 1, 384> <K, 2, 384> <K, 0, 384> A B C K A B C K L <Node, Next Hop, Metric, Sequence Number Node > <Node, Next Hop, Metric, Sequence Number Node > A, A, 0, 456 C, C, 0, 560 A, A, 0, 456 B, B, 1, 258 ….. B, B, 1, 258 C, B, 2, 560 K, K, 0, 384 C, B, 2, 560 K, B, 3, 384 L, K, 1, 834 K, B, 3, 384 L, B, 4, 834 Link Failure (Cont.) Link Failure (Cont.) <K, ∞ , 385> <K, ∞ , 385> <K, ∞ , 385> <K, ∞ , 385> <L, ∞ , 835> <L, ∞ , 835> <L, ∞ , 835> <L, ∞ , 835> A B C L A B C L <Node, Next Hop, Metric, Sequence Number Node > <Node, Next Hop, Metric, Sequence Number Node > C, C, 0, 560 C, C, 0, 560 A, A, 0, 456 A, A, 0, 456 ….. ….. B, B, 1, 258 B, B, 1, 258 K, K, ∞ , 385 K, K, ∞ , 385 C, B, 2, 560 C, B, 2, 560 L, K, ∞ , 835 L, K, ∞ , 835 K, B, 3, 384 K, B, ∞ , 385 L, B, 4, 834 L, B, ∞ , 835 Detecting Link Failure Damping Fluctuations � Detection � A sends route update R � R traverses through X and � If data is flowing over a link, failure of link A Y layer to deliver a packet can be used to � B receives R from Y first. B assume link failure further advertises R X Y � If a node does not hear for long from it’s � Soon after, R received via X (better metric) – B again established neighbor advertises R. � This causes unnecessary n hops n+1 hops route updates for all neighbors of B B 5

Recommend


More recommend