Presentation is loading. Please wait.

Presentation is loading. Please wait.

Routing.

Similar presentations


Presentation on theme: "Routing."— Presentation transcript:

1 Routing

2 Distance Vector (DV) Routing
Sets up minimum distance routes to all nodes in a network Routing tables created at each node with following fields: The core algorithm is based on ‘Bellman Ford shortest path algorithm’ Destination Next hop Cost X V 14 Q B 11 ..

3 DV example: Initial State
Destination Next hop Cost A 1 C 3 E 9 Destination Next hop Cost B 1 C 5 A B C D E 1 2 9 3 5 4 Destination Next hop Cost C 4 E 2

4 DV example: Final State
Destination Next hop Cost A 1 C 3 E 9 D ? Destination Next hop Cost B 1 C 5 D ? E 1 9 B E A 3 2 5 D C 4

5 DV steps Each node advertises its routing table to neighbors(only destination & cost) Each neighbor updates its table based on following equation 𝐶𝑜𝑠 𝑡 𝑦 𝐷𝑒𝑠𝑡 =min⁡(𝐶𝑜𝑠 𝑡 𝑦 𝐷𝑒𝑠𝑡 ,𝐶𝑜𝑠𝑡 𝑋,𝑌 +𝐶𝑜𝑠 𝑡 𝑥 (𝐷𝑒𝑠𝑡)) In the above equation, X and Y are neighbors Cos t y Dest denotes cost of reaching node ′𝐷𝑒𝑠𝑡′ from Y Cost X,Y denotes weight of edge XY

6 DV example for node C Destination Next hop Cost A 1 C 3 E 9
B 1 C 5 A B C D E 1 2 9 3 5 4 Destination Next hop Cost C 1 E

7 DV example for node C Destination Next hop Cost A 1 C 3 E 9
B 1 C 5 A B C D E 1 2 9 3 5 4 Destination Cost A 1 C 3 E 9 Destination Next hop Cost C 4 E 2

8 A B C D E 1 2 9 3 5 4 C’s routing table Advertisement from B to C Destination Next hop Cost A 5 B 3 D 4 Destination Cost A 1 C 3 E 9

9 A B C D E 1 2 9 3 5 4 C’s routing table Advertisement from B to C Destination Next hop Cost A 5 B 3 D 4 E - Destination Cost A 1 C 3 E 9 𝐶𝑜𝑠 𝑡 𝐶 𝐸 =min⁡(𝐶𝑜𝑠 𝑡 𝐶 𝐸 ,𝐶𝑜𝑠𝑡 𝐵,𝐶 +𝐶𝑜𝑠 𝑡 𝐵 (𝐸)) 𝐶𝑜𝑠 𝑡 𝐶 𝐸 = min ∞, 3+9 =12 New route identified

10 C’s routing table Destination Next hop Cost A B 4 3 D E 12 New route added

11 A B C D E 1 2 9 3 5 4 C’s routing table Advertisement from B to C Destination Next hop Cost A 5 B 3 D 4 E 12 Destination Cost A 1 C 3 E 9 𝐶𝑜𝑠 𝑡 𝐶 𝐴 =min⁡(𝐶𝑜𝑠 𝑡 𝐶 𝐴 ,𝐶𝑜𝑠𝑡 𝐵,𝐶 +𝐶𝑜𝑠 𝑡 𝐵 (𝐴)) 𝐶𝑜𝑠 𝑡 𝐶 𝐴 = min 5, 3+1 =4 Route updated

12 C’s routing table Destination Next hop Cost A B 4 3 D E 12 Route updated

13 DV example for node C Destination Next hop Cost A 1 C 3 E 9
B 1 C 5 A B C D E 1 2 9 3 5 4 Destination Next hop Cost C 4 E 2 Destination Cost B 1 C 5

14 A B C D E 1 2 9 3 5 4 C’s routing table Advertisement from A to C Destination Next hop Cost A 5 B 3 D 4 E 12 Destination Cost B 1 C 5 𝐶𝑜𝑠 𝑡 𝐶 𝐵 =min⁡(𝐶𝑜𝑠 𝑡 𝐶 𝐵 ,𝐶𝑜𝑠𝑡 𝐴,𝐶 +𝐶𝑜𝑠 𝑡 𝐴 (𝐵)) 𝐶𝑜𝑠 𝑡 𝐶 𝐵 = min 3, 5+1 =3 Not updated C’s routing table unchanged

15 DV example for node C Destination Next hop Cost A 1 C 3 E 9
B 1 C 5 A B C D E 1 2 9 3 5 4 Destination Next hop Cost C 4 E 2 Destination Cost C 4 E 2

16 A B C D E 1 2 9 3 5 4 C’s routing table Advertisement from D to C Destination Next hop Cost A 5 B 3 D 4 E 12 Destination Cost C 4 E 2 𝐶𝑜𝑠 𝑡 𝑦 𝐷𝑒𝑠𝑡 =min⁡(𝐶𝑜𝑠 𝑡 𝑦 𝐷𝑒𝑠𝑡 ,𝐶𝑜𝑠𝑡 𝑋,𝑌 +𝐶𝑜𝑠 𝑡 𝑥 (𝐷𝑒𝑠𝑡)) 𝐶𝑜𝑠 𝑡 𝐶 𝐸 =min⁡(𝐶𝑜𝑠 𝑡 𝐶 𝐸 ,𝐶𝑜𝑠𝑡 𝐷,𝐶 +𝐶𝑜𝑠 𝑡 𝐷 (𝐸)) 𝐶𝑜𝑠 𝑡 𝐶 𝐸 = min 12 ,4 +2 =6 Route Updated

17 C’s routing table Destination Next hop Cost A 5 B 3 D 4 E 6 Updated Next-hop and Cost

18 DV properties After one round of message exchange with neighbors, new routes to 2 hop nodes discovered After two rounds, routes to 3 hop neighbors discovered Converges after a few rounds if topology does not change

19 DV properties Completely distributed algorithm – No node has global picture, yet learns shortest paths to all nodes in the network

20 Changes in Topology Nodes send updates. Two types
Triggered update: Topology change, link failure triggers an update to be sent to neighbors Periodic update: sent even when no change happens in routing table

21 Periodic updates better than triggered updates
Destination Next hop Cost B 1 C A Destination Next hop Cost A 1 B B C Destination Next hop Cost A 1 C

22 Periodic updates better than triggered updates
Destination Next hop Cost B 1 C A Destination Next hop Cost A 1 B B C Destination Next hop Cost A 1 C

23 Periodic updates better than triggered updates
Destination Next hop Cost B 1 A Destination Next hop Cost A 1 B C Destination Next hop Cost A 1 C

24 Periodic updates better than triggered updates
Destination Next hop Cost B 1 A triggered update (A to B) Destination Cost B 1 Destination Next hop Cost A 1 B C Destination Next hop Cost A 1 C B ignores

25 B send this update eve though it does not see any change in its table
If B does not send a periodic update, such as below, nodes A and C cannot learn about new paths to each other. B send this update eve though it does not see any change in its table Destination Cost A 1 C Destination Next hop Cost B 1 A triggered update (A to B) Destination Next hop Cost A 1 B C Destination Next hop Cost A 1 C Destination Cost A 1 C B ignores

26 Destination Next hop Cost B 1 C 2 New paths learnt A periodic update (B to A) Destination Next hop Cost A 1 B 2 B C Destination Next hop Cost A 1 C periodic update (B to C) B ignores

27 DV  Count to Infinity problem
A B 2 1 E .. A B C E D N C A 1 E .. D - Destination N - Next Hop C - Cost

28 DV  Count to Infinity problem
A B 2 1 E .. C does not remove A, it doesn’t know A is down C can corrupt other nodes with stale updates about A A B C E D N C 1 E .. B removes A

29 DV  Count to Infinity problem
A B 2 1 E .. A B C E D N C 1 E .. D C A 2 B 1 E .. C sends an advertisement to B

30 DV  Count to Infinity problem
A B 2 1 E .. A B C E D N C 1 E .. A 3 D C A 2 B 1 E .. False route to A learnt with C as next hop

31 DV  Count to Infinity problem
A B 2 1 E .. D C 1 E .. A 3 B sends an advertisement to C A B C E D N C 1 E .. A 3

32 DV  Count to Infinity problem
C updates route to A with a higher cost D N C A B 4 1 E .. D C 1 E .. A 3 A B C E D N C 1 E .. A 3 This process continues until cost to non-existent destination reaches infinity Messages sent during this time to A will be wasteful

33 Avoiding Count to Infinity Problem
Use sequence numbers, update routes only if the message has a new sequence number

34 DSDV (Destination sequenced DV)
Adds sequence numbers to routing table entries Initial sequence number created at the destination

35 DSDV (Destination sequenced DV)
B 2 1 6 E .. A B C D E D N C S A 1 2 4 E .. D - Destination N - Next Hop C – Cost S – Sequence number

36 DSDV (Destination sequenced DV)
B 2 1 6 E .. A B C D E D N C S A 3 1 4 E .. B updates A’s cost to infinity and increases sequence number

37 DSDV (Destination sequenced DV)
B 2 1 6 E .. A B C D E D N C S A 3 1 4 E .. D C S A 2 B 1 6 E .. C sends an advertisement to B C’s update on A ignored by B because B’s data has a higher sequence number

38 DSDV (Destination sequenced DV)
B 2 1 6 E .. D C S A 3 1 4 E .. B sends an advertisement to C A B C D E D N C S A - 3 1 4 E ..

39 DSDV (Destination sequenced DV)
B’s update on route to A overrides C’s table since it has a higher sequence number D N C S A - 3 B 1 6 E .. D C S A 3 1 4 E .. B sends an advertisement to C A B C D E D N C S A - 3 1 4 E .. The entire network learns about latest node failures/updates

40 Limitations of DV/DSDV
Too much message flooding might be a bandwidth overhead Convergence can be slow for mobile networks

41 Dynamic Source Routing (DSR)
On demand routing  No periodic updates When a source wants to route packets, routes generated Consists of two parts Route discovery Route maintenance

42 I G C S H B F A D J E

43 Source sends a route request
RREQ (Resource request packet is generated) includes source, destination, intermediate nodes (initially empty) Seq. num Source Intermediate Nodes Destination

44 Seq.no, source, int nodes, dest
G C 2 S D S H B F A D J E

45 2 S D I G C S H B F A 2 S D D 2 S D J E

46 B re-broadcasts after adding itself
B received 2 S D B re-broadcasts after adding itself I 2 S B D G C S H 2 S D B F A D J E Intermediate nodes add themselves to the intermediate nodes, and rebroadcast the RREQ

47 If sequence number was seen before, message is dropped
2 S B D S H 2 S B D B F A D 2 S B D J E If sequence number was seen before, message is dropped

48 I G C 2 S B D S H 2 S B D B F A D 2 S B D J E

49 I G C 2 S B D S H 2 S B D B F 2 S B,F D A D 2 S B D J E

50 I G C S H B F 2 S B,F D A D J E When the destination receives the RREQ, it generates a Route Reply (RREP) The packet is routed back by following the list of intermediate nodes in the RREQ

51 I G S->B->F->D C S H B F RREP A D J E
After D previous one is F D J E

52 I G C S H S->B->F->D B F A D J E

53 I G C S H S->B->F->D B F A D J E

54 I G C S->B->F->D S H B F A D J E Now source knows the route It appends route with the data

55 I G C Data S->B->F->D S H B F A D J E

56 I G C S Data S->B->F->D H B F A D J E

57 I G C S Data S->B->F->D H B F A D J E

58 I G C S H B F A D Data S->B->F->D J E

59 DSR optimizations Intermediate nodes can generate RREP if they have the route in their cache I G C S H 2 S B,F D B F A F->D D J E

60 I G C S H S->B->F->D B F A D J E

61 DSR optimizations RREP packets are cached
New route generation is not needed if cache has an unexpired entry Intermediate nodes cache overhead routes for their own use

62 Route maintenance RERR (route error) packets broadcasted to indicate broken links

63 I G C S H S->B>F->D S->C>G-I B F A F->D D J E

64 I G C S H S->B>F->D S->C>G-I x F->D B F A F->D D J E

65 I G C x F->D S H S->B>F->D S->C>G-I B F A F->D D J E

66 I G C x F->D S H S->C>G-I B F A F->D D J E

67 DSR limitations High overhead for large networks
Need to carry route information in each packet

68 AODV (Adhoc On-demand distance vector)
Best of both worlds of DSR and DSDV Like DSDV it is next hop based routing, full route path not included in packet Like DSR, does not need periodic route maintenance messages

69 Source sends Route Request (RREQ)
RREQ packet format Seq. num Source Destination

70 Seq.no, source, dest I G C 2 S D S H B F A D J E

71 2 S D I G C S H 2 S D B F A D 2 S D J E Backward pointers created towards nodes sending/forwarding RREQ

72 I G C S H 2 S D B F A D J E

73 I G C S H B F 2 S D A D J E

74 2 S D I G C S H B F 2 S D A D J E 2 S D Hop Count Generates RREP (route reply) with hop count 0 Sent back along backward pointer

75 I G C S H 2 S D 1 B F A D J E Intermediate nodes receive and update hop-count by 1 (duplicate messages ignored as in DSR) Forward pointers (green arrows) generated pointing to next hop for destination

76 I G C S H 2 S D B F A D J E

77 I G C 2 S D 3 S H B F A D J E Just follow next hop links (green lines – forward pointers) during actual routing

78 AODV properties RERR (like DSR) messages keep the network updated in case of failures Sequence numbers prevent count to infinity problem Widely used in WiFi-adhoc networks, ZigBee etc.

79 How to select link weights
Hop-count does not characterize a wireless link accurately Wireless links are lossy. How can we take this into account while assigning link weights A B C D E ?

80 Delivery ratio (DR) Characterizes fraction of packets delivered through a link DR = 0.5 A B Half of packets fail If DR = 0.5, on average, we need to transmit two packets to get one successful reception

81 Delivery ratio (DR) Characterizes fraction of packets delivered through a link DR = 0.33 A B 66% of packets fail If DR = 0.33, on average, we need to transmit three packets to get one successful reception

82 Delivery ratio (DR) Characterizes fraction of packets delivered through a link DR = p A B 100*(1-p)% of packets fail If DR = p, on average, we need to transmit 1 𝑝 packets to get one successful reception

83 Define a new metric called ETX
ETX = expected number of transmissions on a link for successful reception B A B D C ETX=1 ETX = 2 ETX ≈2 DR=1 DR =0.5 A D DR = 0.51 C DR = 0.51

84 Minimum ETX routing ETX = expected number of transmissions on a link for successful reception B A B D C ETX=1 ETX = 2 ETX ≈2 DR=1 DR =0.5 A D DR = 0.51 C DR = 0.51 Cost A-> B->D = ∑(ETX of all links along the path) = = 3 Cost A-> C->D = ∑(ETX of all links along the path) = = 4 Minimum ETX route is better. Hence ABD better than ACD

85 Minimum ETX routing Any classical routing algorithm such as DSDV, DSR, AODV can use ETX as the edge weights for routing.


Download ppt "Routing."

Similar presentations


Ads by Google