set 8a
play

SET 8a Rout outing ing Algor lgorit ithms hms 1 Network Layer - PDF document

CMPE 252: Computer Networks SET 8a Rout outing ing Algor lgorit ithms hms 1 Network Layer The main functions at the network layer are addressing, routing, congestion control, and admission control. Addressing consists of


  1. CMPE 252: Computer Networks SET 8a Rout outing ing Algor lgorit ithms hms 1 Network Layer  The main functions at the network layer are addressing, routing, congestion control, and admission control.  Addressing consists of identifying where a destination is with respect to the network topology.  Routing consists of (a) computing paths from sources to destinations and (b) forwarding packets along such paths.  Congestion control consists of limiting the amount of data a source can sent into the network.  Admission control consists of limiting the number of sources allowed to send data into the network, and in a way is part of system-wide congestion control. 2 Routing  Algorithms used to compute paths from sources to destinations can be:  Static or adaptive: Routers compute paths off-line or dynamically in response to changes in topology or even traffic.  Hierarchical or flat (heterarchical): Routers and hosts are organized into clusters of nodes or all destinations and routers are treated as peers.  On-demand or table-driven: Routers maintain routing information for only those destinations for which need to forward data, or for all destinations.  You will also see routing algorithms classified according to the type of information they use. 3 1

  2. Routing Algorithms  Most books and papers classify routing algorithms into distance-vector and link-state algorithms.  Distance-Vector Algorithm: Routers exchange their distances to known destinations; a router uses the distance vectors received from its neighbors to compute its own distances. Computation is distributed.  Link-State Algorithm: Routers exchange information about the state of the links in the network; a router uses this information to compute its distances to destinations. Computation is local.  Doesn ’ t this sound a bit like the “ Tastes Great/Less Filling ” argument? 4 Similar Type of Classification Applies to Horses! Horses could classify horses as: Horses with no PJs Horses with PJs Unfortunately, zebras are not horses! :) 5 So What Does This have to Do with Routing Algorithms?  A routing algorithm is not solely defined by the type of information maintained at routers.  Some information must be disseminated throughout the network, which necessarily involves a distributed computation. 6 2

  3. Routing Algorithms Routing algorithms should be classified  according to: The type of search they support 1. The mechanism(s) used to detect that the operations 2. executed in the search complete successfully or not. The entities for which routes are built 3. The identifiers used to denote such entities. 4. Routing algorithms (protocols) today assume  BFS, nodes/networks as destinations, globally unique pre-defined identifiers. We first address the mechanisms used to detect  the completion of operations supporting such a search. 7 Routing Algorithms  A routing algorithm always carries out a distributed computation to obtain correct paths from each source to its desired destinations.  Some indication that at least some aspect of this computation has ended must be available to routers.  The end of any distributed computation can be detected in three known ways (and combinations of them):  Termination detection over a tree  Termination detection using sequence numbers (time stamps)  Termination detection over a ring  Distances or link states can be used in each of these three types of algorithms! A good read: Nancy Lynch, “ Distributed Algorithms, ” Morgan Kaufman, 96 8 Shortest-Path Routing Problem: Compute the path of minimum length from each router to  each destination Notation: G(N, E) is the network of |N| nodes and |E| links  i P j N i h2 k …. hx (i, k) l i k i j i D l ( h , h ) ∀ ∑ = j i i 1 + q i hop h P ∈ i j p 9 3

  4. Bellman-Ford Algorithm  BF iterates on the number of hops away from a node. ∞ ∞ Step 1: Initialize source 10 node S with a 0 distance to A C itself and all other nodes with an infinite distance. 1 2 Step 2: Set H = 1 ∞ 2 2 Step 3: Label all nodes H 10 E S hops away from S with the smallest distance from S to 0 5 the nodes. 5 Step 4: Stop if all nodes B D 1 have been covered and no label can be reduced by ∞ ∞ increasing H . Link costs are the same in both link directions Else, set H = H+1 and repeat Step 3 10 Bellman-Ford Algorithm ∞ 1, 1 H = 1: 10 A C 1 2 1 2 2 ∞ 10 E S 0 1 5 5 Only A and B B D 1 can be reached ∞ 5, 1 within one hop 11 Bellman-Ford Algorithm 7, 2 1, 1 H = 2: 10 A C 1 2 1 2 2 ∞ 10 E S 0 1 5 5 A, B, C and D can B D 1 be reached within two hops 5, 1 6, 2 12 4

  5. Bellman-Ford Algorithm 1, 1 11, 2 H = 2: 10 A C 1 2 1 2 2 ∞ 10 E S 0 5 B, C and D are 5 relabeled. B D 1 We need to increase H to cover 5, 1 --, 2 E and reduce 3, 2 labels. 13 Bellman-Ford Algorithm 11, 2 1, 1 H = 3: 5, 3 10 A C 1 2 --, 3 1 2 2 10 E S 0 5 All nodes are 5 labeled. B D 1 E cannot have 5, 1 --, 2 a valid label 3, 2 4, 3 with H = 3 14 Bellman-Ford Algorithm H = 4: 1 5 10 A C 1 2 4 2 2 10 7 E S 0 5 5 Increase H to 4 B D 1 3 4 No more nodes can be reached and no label can be reduced 15 5

  6. Distributed Bellman-Ford Algorithm (DBF)  The objective of DBF is to have a distributed implementation of BF, so that routers can compute distances to destinations distributedly.  To accomplish this, the computation of a distance to a destination starts at the destination itself.  The iteration of DBF is on the number of hops away from a destination.  DBF operates independently for each destination.  Destination starts by stating the distance to itself is 0  The neighbors of the destination receive this information, process it and send their own updates.  Distances propagate throughout the network. 16 Notation i D jk k D i i i D D l = + j j jk k k successor for j: i s (i, k) j i l k i D p j j p q D q j Node i must compute the shortest distance to j, which we show to be through neighbor k 17 DBF  Information maintained at each router:  Distance Table: Distance to each destination reported by each neighbor  Link-Cost Table: Cost of link to each adjacent node  Routing Table: Distance and successor (next hop) to each destination  Information exchanged among routers:  Vector of one or more entries, each entry stating the distance to a destination  Services assumed:  Update messages are exchanged reliably, a node knows who its neighbors are 18 6

  7. DBF i D The next hop for j jk k D is a neighbor that i i i D D l = + j j jk k provides the k (i, k) s i minimum distance j l i according to the i k D p Bellman-Ford j j equation. p q D q j Router I computes every time it receives an input event (link change or update D i j message) and sends an update message to its neighbors. D i is computed with the Bellman-Ford Equation: j { } D i Min D i l i | p N i = + ∈ j jp p 19 Example of DBF Operation  For simplicity, we will assume “ synchronous operation ” in all cases! 4 3 2 1 d c b a j 1 1 1 1 0 1 1 2 2 3 3 4 4 time 20 Counting to Infinity in DBF  The problem with DBF is that it does not have a termination detection mechanism! 4 3 2 1 X d c b a j 3 = 2+1 4 4 = 3+1 5 5 5 6 6 6 6 7 7 7 …. etc time 21 7

  8. Correctness of DBF Note that BF can only converge if H is finite!  partition 1 Step 1: Initialize source node S 5 with a 0 distance to itself and all 10 other nodes with an infinite A C distance. 1 2 Step 2: Set H = 1 2 2 10 E Step 3: Label all nodes H hops 6 S away from S with the smallest distance from S to the nodes. 0 2 5 Step 4: Stop if all nodes have been B D covered and no label can be 1 reduced by increasing H . 3 4 Else, set H = H+1 and repeat Step 3 After partition, the max H from S to E is infinity! S can keep max number of nodes in the network (N), and the distance and hop count for each destination. S can stop when hop count = N, because longest path must be N-1 hops. 22 Ad Hoc Solutions (do not work) Counting to N takes too long! Alternatives include:  Split horizon: Tell successor distance to destination is infinity.  Hold-down timer: After distance to destination increases, send update stating new distance through current successor, wait for a long period of time before computing new successor and shortest distance and then act as in DBF.  Poisoned reverse: After distance increase, report an infinite distance and then correct the distance.  Next-hop information: Communicate the distance and next hop to each destination (used in RIP v2) 23 DBF Correctness  Liveness:  Each node updates its routing table independently of others.  The only possibility of deadlock occurs in the reliable exchange of update messages (the equivalent of a point-to-multipoint ARQ)  Safety:  We must show that, in the absence of deadlocks and after an arbitrary sequence of topology changes, the protocol produces correct routing tables and stops sending updates. 24 8

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend