Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network: Routing Y. Richard Yang 3/30/2011.

Similar presentations


Presentation on theme: "Network: Routing Y. Richard Yang 3/30/2011."— Presentation transcript:

1 Network: Routing Y. Richard Yang 3/30/2011

2 Admin Project meetings Weekly meeting for 15 min
Please sign up on the classesv2 server

3 Recap: Routing Overview
The problem of routing is to find a good path for each source destination pair Issues How to define a path to be good? How do we compute the path? A E D C B F

4 Recap: Design Dimensions
What does each node know? Whole network topology and per link cost Link state Set of neighbors that can reach dest Link reversal Neighbors’ costs to destination When to know? All the time (proactive) Upon a need to forward a data packet (reactive/on demand)

5 Recap: Link Reversal Motivations Implementation maintain a mesh
(hopefully) local adaptation Implementation A node i contains a triple (i, i, i) representing its height of the node Suppose there is a link from node i to node j, the direction is determined by their heights i -> j: if (i, i, i) > (j, j, j) For destination D, the height is (0, 0, D)

6 min  of all neighbors with new 
Illustration min  of all neighbors with new  min  of all neighbors

7 Analysis: Convergence
Does the partial reversal algorithm converge? What is convergence? a protocol converges if it stops after a finite number of steps after the last link Up/Down event

8 Analysis by Invariants
Invariants are statements defined over the states of the distributed nodes A very effective method in understanding distributed asynchronous systems is invariants

9 Analysis The state of a node An invariant over the state of a node
its height as well as its neighbors’ (potentially obsolete) heights An invariant over the state of a node  is non-decreasing

10 Convergence if Not Partitioned
Partial reversal always converges after a finite number of steps, if not partitioned proof by contradiction: assume not converge, i.e., the protocol runs forever after the last change. Since each node will increase its  value by at least one after each step, then there should exist a subset of nodes whose  values go to infinite dest infinite

11 Partition A B A B D D Node A and node B will increase their heights repeatedly forever.

12 Analysis: Loop of Link Reversal
Does the partial reversal algorithm form loops? the algorithm does not have any loops after convergence because the heights form a total order before convergence, temporary loops may form due to inconsistent views

13 Temporally-Ordered Routing Algorithm (TORA)
TORA modifies the partial link reversal algorithm to be able to detect partitions When a partition is detected, all nodes in the partition are informed, and link reversals in that partition cease For details, see the backup slides at the end

14 Summary: Link Reversal Algorithms
Advantages the DAG provides many hosts the ability to send packets to a given destination beneficial when many hosts want to communicate with a single destination Disadvantages paths may not be the best loops before convergence hurt performance

15 Design Dimensions What does each node know?
Whole network topology and per link cost (link state) Set of neighbors that can reach dest Link reversal Neighbors’ costs to destination (distance vector)

16 Distance Vector Routing Algorithm
Based on the Bellman-Ford algorithm at node X, the distance (or any additive link quality metric) to Y is updated by where dX(Y) is the current distance at node X from X to Y, N(X) is the set of the neighbors of X, and d(X, Z) is the distance of the direct link from X to Z Implemented in the RIP routing protocol and some wireless mesh networks

17 Distance Table: Example
7 8 1 2 Below is just one step! The algorithm repeats for ever! distance tables from neighbors computation E’s distance, forwarding table distance table E sends to its neighbors E d () A B C D A 7 1 d(E,A) B 7 1 8 d(E,B) D 2 d(E,D) A 1 8 B 15 8 9 D 4 2 1, A 8, B 4, D 2, D A: 1 B: 8 C: 4 D: 2 E: 0 destinations

18 Distance Vector in the Presence of Topology Dynamics
Good news propagate fast Link AB is up

19 Distance Vector in the Presence of Topology Dynamics
Bad news propagate slowly: referred to as the count-to-infinity problem Link AB is down or cost increases substantially

20 Why Count-to-Infinity
Routing loop: a loop is a global state (consisting of the nodes’ local states) at a global moment (observed by an oracle) such that there exist nodes A1, A2, …, An such that A1 (locally) thinks A2 as down stream, A2 thinks A3 as down stream, An thinks A1 as down stream

21 Destination-sequenced distance vector protocol (DSDV)
There are optimizations but we present the base protocol Only handle the case when link is broken Let’s assume the destination node is D Basic idea: DSDV tags each route with a sequence number Each destination node D periodically advertises monotonically increasing even sequence numbers When a node realizes that the link that it uses to reach destination D is broken, the node increases the sequence number for D to be one greater than the previous one (odd number).

22 DSDV: Details Periodical and triggered updates
periodically D increases its seq# SD by 2 and broadcasts with (SD, 0) if A is using B as next hop to reach D and A discovers that the link AB is broken A increases its sequence number SA by 1 (odd) sets dA to , and sends (SA, dA) to all neighbors The step if SA > SB, then update may not be good because it maybe a cross talk.

23 DSDV: Details Update after receiving a message
Assume B sends to A the information (SB, dB), where SB is the sequence number at B for destination D and dB is the distance from B to D; when A receives (SB, dB) if SB > SA and A uses B as next hop then // higher seq#, always update SA = SB if (dB == ) dA = ; else dA= dB + d(A,B) else if SA == SB, then // conditional update if dA > dB + d(A,B) dA= dB + d(A,B) and uses B as next hop The step if SA > SB, then update may not be good because it maybe a cross talk. A B route update (SB, dB)

24 DSDV: Example H F E A G C D D B

25 Question Does DSDV solve the count-to-infinity problem (i.e., no routing loop is formed)?

26 Technique Again use the invariant method to understand the distributed asynchronous protocol Consider any node A What is the state of node A? (SA, dA)

27 Consider a Single Node A
What properties do you observe about the state of node A, i.e. (SA, dA)? SA is non-decreasing dA is non-increasing for the same sequence number time

28 Invariants For any node
time For any node sequence number is non-decreasing for the same sequence number, distance is non-increasing For a pair of nodes, if A (according to local state) considers B as next hop to destination D: either SB > SA (B updates seq# after sends update) or SB == SA implies dB < dA if link cost is not zero A B

29 Claim: DSDV Does Not Form Loop
Proof by induction and contradiction assume initially no loop (no one has next hop so no loop) derive contradiction by assuming that we have a loop when we add a new link, e.g., when A decides to use B as next hop update A B

30 Loop Freedom of DSDV update Consider a critical moment
A considers B as next hop and forms a loop If any link in the loop (X considers Y as next hop) satisfies SY > SX by transition along the loop SB > SB If all nodes along the loop have the same sequence number by transition along the loop dB > dB update A B X Y

31 Discussion of DSDV Q: what is the scope of updates when a link changes status?

32 Summary: Routing Algorithms
Complete information: Nodes maintain complete topology, link cost info “link state” algorithm Distributed next hop distance: Nodes maintain distance to each dest. Iterative process of computation, exchange of info with direct neighbors “distance vector” algorithm Partial connectivity information: Nodes maintain reachability topology (mesh) for each dest. “link reversal” algorithm A E D C B F 2 1 3 5

33 Design Dimensions What does each node know? When to know?
Whole network topology and per link cost Neighbors’ costs to destination Set of neighbors that can reach dest When to know? All the time (proactive) Upon a need to forward a data packet (reactive/on demand)

34 DSR Concepts On-demand route discovery Source routing
DSDV, link state and link reversal protocols are proactive: they continuously maintain routes/topology DSR is a reactive protocol, maintaining active routes only Source routing no need to maintain information at intermediate nodes

35 Dynamic Source Routing (DSR)
When node S wants to send a packet to node D, but does not know a route to D, node S initiates a route discovery Source node S floods Route Request (RREQ) Each node appends its own identifier when forwarding RREQ

36 Route Discovery: RREQ Y Z S E F B C M L J A G H D K I N
Represents a node that has received RREQ for D from S

37 Broadcast transmission
Route Discovery: RREQ Y Broadcast transmission Z [S] S E F B C M L J A G H D K I N Represents transmission of RREQ [X,Y] Represents list of identifiers appended to RREQ

38 Forwarding RREQ A request is forwarded by a node if
the node is not destination the node has not seen RREQ with the same sequence number (from the same source) When forwarding RREQ, use a random delay to avoid collision

39 Route Discovery: RREQ Y Z S [S,E] E F [S,B] B C M L J A G [S,C] H D K
N Node H receives RREQ from two neighbors B and C Node C and E send RREQ to each other

40 Route Discovery: RREQ Y Z S E F B [S,E,F] C M L J A G H D K [S,C,G] I
N Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once

41 Route Discovery: RREQ Y Z S E F [S,E,F,J] B C M L J A G H D K I N
[S,C,G,K]

42 Route Discovery: RREQ Y Z S E [S,E,F,J,M] F B C M L J A G H D K I N
Node D does not forward RREQ, because node D is the intended target of the route discovery

43 Route Reply (RREP) Destination D on receiving the first RREQ, sends a Route Reply (RREP) why first? RREP includes the route from S to D on which RREQ was received by node D Question: how to send RREP from D back to S?

44 Route Reply in DSR Route Reply is sent by reversing the route in Route Request (RREQ) this requires bi-directional link to ensure this, RREQ should be forwarded only if it received on a link that is known to be bi-directional this also necessary for IEEE MAC is used to send data, then links have to be bi-directional (since Ack is used) If unidirectional (asymmetric) links are allowed, then RREP may need a route discovery from D back to S

45 Route Reply Y Z S RREP [S,E,F,J,D] E F B C M L J A G H D K I N
Represents RREP control message

46 hence the name source routing
Data Delivery in DSR Y Z DATA [S,E,F,J,D] S E F B C M L J A G H D K I N When node S sends a data packet to D, the entire route is included in the packet header hence the name source routing

47 DSR Optimization: Route Caching
Each node caches a new route it learns by any means, e.g., when node S finds route [S,E,F,J,D] to node D, node S also learns route [S,E,F] to node F when node K receives Route Request [S,C,G], node K learns route [K,G,C,S] to node S when node F forwards Route Reply RREP [S,E,F,J,D], node F learns route [F,J,D] to node D a node may also learn a route when it overhears data packets

48 DSR: Summary Advantages Disadvantages
reactive: routes maintained only between nodes who need to communicate route caching can further reduce route discovery overhead Disadvantages packet header size grows with route length due to source routing flood of route requests may potentially reach all nodes in the network

49 Ad Hoc On-Demand Distance Vector
Combination of ideas in DSR and DSDV on-demand mechanism of route discovery and route-maintenance from DSR plus the hop-by-hop routing (not source routing), sequence numbers and periodic beacons from DSDV

50 Comparison of Routing Algorithms in the Presence of Topology Dynamics

51 Comparisons of The Protocols
Some key parameters affecting the performance of a routing protocol number of nodes mobility model, e.g., the way-point model, where each node picks a random target, moves to the target at a random speed picked uniformly in a range, pauses for some time after arrival traffic model, e.g., Constant Bit Rate (CBR) Performance metrics packet delivery ratio routing overhead path optimality

52 Path Optimality: Difference from Optimal
50 nodes; 20 sources; 20 m/s

53 Comparison: Packet Delivery Ratio
50 nodes; 20 sources; 20 m/s

54 Comparison: Packet Delivery Ratio
50 nodes; 20 sources; 1 m/s

55 Summary: Traditional Routing
So far, all routing protocols in the framework of traditional wireline routing Implicit assumptions we adopted when defining the problem a graph representation of underlying network point-to-point graph, edges with costs select a lowest-cost route for a src-dest pair commit to a specific route before forwarding each node forwards a received packet as it is to next hop

56 Motivating Scenario: I

57 Motivating Scenario: II
Motivating question: can we take advantage of transmissions that reach unexpectedly far or unexpectedly short? Traditional routing picks a single route, e.g., src -> B -> D -> dst Packets received off path are useless

58 Motivating Scenario: III
Src A sends 1 packet to dst B; src B sends packet 3 to dst A The network needs to transmit 4 packets Motivating question: can we do better? p1 p1 A R B p2 p2

59 Motivating Scenario: III
If R has both packets 1 and 3, it can combine them and explore coding and broadcast nature of wireless A B R

60 Backup Slides

61 A Local Loop A A B B D D When B does a reversal, B locally thinks A is downstream; before B’s new height arrives at A, A thinks B is downstream as well.

62 Temporally-Ordered Routing Algorithm (TORA)

63 Link Direction Through “Heights”
Each node i has a height – a quintuple Hi = (t, oid, r, d, i), where  : the “logical time” of a link failure oid: the node who originates the failure r : a “reflect” bit  : a reference level i : node ID Link direction through heights Node i points to node j if Hi > Hj When Hj is unknown, it is set to NULL; NULL is considered to be infinite

64 TORA: Three Basic Functions
Creating routes on demand A query (QRY) message is flooded through the network An update (UPD) message propagates back if route exists If a node uses another node as next hop, it increases the  value by 1 Maintaining routes using link reversal A node sends an UPD message to re-orient the links after detecting no outgoing links Link reversal is similar to partial link reversal set the first three elements to be the highest among neighbors if all neighbors have the highest first three elements if (no reflect bit) set reflect bit else find partition else set = min {j: where neighbor j has the highest first three elem}-1 Erasing routes when partitioned A clear (CLR) message is flooded through the network to erase invalid routes

65 TORA: Created Routes (0, 0, 0, 3, A) (0, 0, 0, 2, D) (0, 0, 0, 1, E)
(0, 0, 0, 2, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H)

66 TORA: Link from D to E Fails
(0, 0, 0, 2, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H)

67 TORA: Link from B to H Fails
(0, 0, 0, 2, D) (0, 0, 0, 1, E) (0, 0, 0, 2, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H)

68 TORA: B Updates (0, 0, 0, 3, A) (0, 0, 0, 2, D) (0, 0, 0, 1, E) UPD
(1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) Assume B’s clock is 1 when detecting failure

69 TORA: D Updates UPD (0, 0, 0, 3, A) (1, B, 0, -1, D) (0, 0, 0, 1, E)
(1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) (1,B,0) = max( A:(0,0,0), B:(1,B,0) ); -1 = min{0}-1

70 TORA: A Updates UPD (1, B, 0, -2, A) (1, B, 0, -1, D) (0, 0, 0, 1, E)
(1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) (1,B,0) = max( B:(1,B,0),C:(0,0,0), D:(1,B,0) ); -2 = min{0,-1}-1

71 TORA: Link from A to C is Down
(1, B, 0, -2, A) (1, B, 0, -1, D) (0, 0, 0, 1, E) (1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H)

72 TORA: A Updates UPD (2, A, 0, 0, A) (1, B, 0, -1, D) (0, 0, 0, 1, E)
(1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) Assume A’s clock is 2 when detecting failure

73 TORA: D Updates UPD (2, A, 0, 0, A) (2, A, 0, -1, D) (0, 0, 0, 1, E)
(1, B, 0, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) (2,A,0) = max( A:(2,A,0), B:(1,B,0) ); -1 = min{0}-1

74 TORA: B Updates (2, A, 0, 0, A) (2, A, 0, -1, D) (0, 0, 0, 1, E) UPD
(0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) Because B’s neighbors have the same first three values

75 TORA: D Updates UPD (2, A, 0, 0, A) (2, A, 1, -1, D) (0, 0, 0, 1, E)
(2, A, 1, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) (2,A,1)=max(A:(2,A,0),B:(2,A,1)); -1 = min{0}-1

76 TORA: A Detects Partition
CLR (-, -, -, -, A) (2, A, 1, -1, D) (0, 0, 0, 1, E) (2, A, 1, 0, B) (0, 0, 0, 3, C) (0, 0, 0, 0, F) (0, 0, 0, 2, G) (0, 0, 0, 1, H) (2,A,1)=max(A:(2,A,0),B:(2,A,1)); -1 = min{0}-1

77 The Reverse-Poison (Split-horizon) Hack
D C B 7 8 1 2 If the path to a dest is through neighbor h, report  to neighbor h for dest. E’s distance, forwarding table distance tables from neighbors computation distance table E sends to its neighbors E d () A B C D A 7 1 d(E,A) B 7 1 8 d(E,B) D 2 d(E,D) A 1 8 B 15 8 9 D 4 2 1, A 8, B 4, D 2, D To A A:  B: 8 C: 4 D: 2 E: 0 To B A: 1 B:  C: 4 D: 2 E: 0 To D A: 1 B: 8 C:  D:  E: 0 destinations distance through neighbor

78 An Example Where Split-Horizon Fails
1 When the link between C and D fails, C will set its distance to D as  However, unfortunate timing can cause problem A receives a new update () from C, then a previous update from B (when B thought C was good) arrives; then A will use B to go to D A sends the good news to C C sends the good news to B

79 Using Route Cache Advantages Disadvantages
using route cache can speed up route discovery and reduce RREQ propagation check route cache before issues RREQ intermediate nodes can send Route Reply using route cache Disadvantages stale caches can adversely affect performance e.g., a sender may try several stale routes (obtained from local cache, or replied from cache by other nodes), before finding a good route


Download ppt "Network: Routing Y. Richard Yang 3/30/2011."

Similar presentations


Ads by Google