Your SlideShare is downloading. ×
[PPT]
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

[PPT]

1,281
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,281
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
60
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Here is an abstract view of the internals of a typical router. We can separate the functionality of a router into control plane and data plane. The control plane is responsible for exchanging routing information (control packets) with other routers and making routing decisions. Generally, there exists a route processor to process these control packets and to update the routing table. This routing table is then condensed into a form known as forwarding table for quick lookup by the data plane. The job of data plane is to switch packets from input ports to output ports, which is essentially a forwarding.engine. Data packets flow thru this faster data plane while control packets are processed by slower control plane. Another way to look at is that routing decisions are made by control plane and forwarding lookups done by data plane.
  • See RFC 1264 “Internet Engineering Task Force Internet Routing Protocol Standardization Criteria.” 1991
  • Often called routing table
  • Under link state routing, each router gathers state of all the links in the network and then independently computes paths. Cost can be any generic metric capturing the link characteristics such bandwidth or delay.
  • What is the cost of controlled flooding? A router would not forward an LSP more than once. Since each LSP carries a sequence number, a router can discard the duplicates by matching the originator and the sequence numbers with its LSP database.
  • Suppose A wants to compute shortest paths to all other nodes. Initialization is like step 0. We add A itself to N and set the distance to all the neighbors as the cost of direct links and all others as infinity. Here D(B) is set 2 and D(E) set to infinity because B is a neighbor and E is not. Now in step 1, among all those nodes that are not in N, we select a node with the shortest distance. In this case D is that node with distance of 1. First, we add D to the set N. Then we update the distances of other nodes if they can be made shorter by going thru D. In this case we can improve the distance to C from 5 to 4 by going thru D instead of using the direct link. Similarly E can now be reached with distance 2. This way in each step, we pick the node with the shortest distance, add it to set N and update the distance of all other nodes not in N. After k iterations, shortest paths to nearest k neighbors are known. This process terminates after all the nodes are added to N. This algorithm can be viewed as the construction of shortest paths spanning tree with source node as the root. In such a tree, there is exactly one path from the source node to any other node and that is the shortest path.
  • Now we know how to construct a shortest paths spanning tree. But what we want is the routing table. Question is how do we get the routing table from this tree? Routing table is essentially a mapping from destination to next hop. This can be obtained very easily from the shortest paths spanning tree. Consider each node and the path to that node. The first node along the path is the next hop.
  • So far we have talked about link state routing. Under link state routing each router receives complete information about the network topology and computes shortest paths using Dijkstra’s algorithm. Now we will discuss a different routing protocol called distance vector Routing. Under distance vector routing, a router informs its neighbors about the distance from that router to every other router in the network. Unlike in link state routing, here information is exchanged only between neighbors. It is based on Bellman-Ford algorithm for computing shortest paths. We will go through an example to see how this works. Under distance vector routing, each router maintains a distance table. A row for each possible destination and a column for each neighbor. An entry in router X’s table corresponding to a row Y and a column Z is the distance from X to Y via Z. Given a distance table we can find the shortest distance to a destination, i.e., the smallest value in the row corresponding to the destination. A list of <destination, shortest distance> tuples is called a distance vector and these distance vectors are exchanged between neighbors.
  • Lets look at an example. Here A, B, C, D, and E are routers and the links are labeled with their costs. And this is a distance table at router E. You can see that there is one row per each destination an one column per each neighbor. If you look at the third row, it says that you can reach C via A with cost 6, via B with cost 9 and via D with 4. So the shortest distance to C is 4 via D. If E were to advertise its distance vector it will send <A,1>,<B,5>,<C,4>,<D,2>.
  • What we are really interested in is the routing table. How do we create a routing table from this distance table. Pretty simple. For example, to reach B the shortest path is via D. So the next hop for routing to B is D. We can get the whole routing table this way. Now the question is how do we compute this distance table. That’s where we use Bellman-Ford algorithm.
  • Now lets look at the convergence of distance vector routing. Here we show only the cost of reaching X from Y and Z. Suppose that the cost of link between X and Y changes from 4 to 1. The router Y notices the change and updates its distance table. Since the shortest distance changed, it notifies Z. The router Z changes the distance to X via Y as 2 from the previous value 5. It then notifies Y since the shortest distance changed. Y once again changes the distance table. However, this time no change in the shortest distance. This is the case when the link cost decreases which is a good news. Now lets see what happens when the link cost increases.
  • Suppose that link cost is increased from 4 to 60. Once again router Y senses the change, updates the distance table. It sees that it can reach X via Z with distance 6. Since the shortest distance changed, it notifies the neighbor Z. The router Z in turn updates its table and informs Y. This goes on and on. Do you know when it terminates? What will be the entries in distance table when it converges? It finally reaches steady state with distance from Y to X via Z as 51 and Z to X via Y as 52. This is the problem with distance vector routing. Good news travels fast but bad news travels slow. This results in what is known as count to infinity problem.
  • Consider this very simple case. Lets come up with the distance table. Since Y is directly connected to Z, distance from Y to Z is 1. Also, X can reach Z with distance 2. But the interesting thing is that Y thinks it can reach Z thru X with distance 3 (2+1). Now suppose link from Y to Z goes down. Y senses that and advertises new distance of 3 (which is via X). X recalculates its distance to Z as 4 and readvertizes. This goes on forever with both X and Y counting to infinity before they realize that Z is unreachable. What is the basic problem here. Y doesn’t have sufficient information to figure out whether there exists another path from X to Z. It can’t distinguish between the cases with and without the dotted link of cost 2. So what is the solution to this problem?
  • One solution to address this problem is split horizon. It is a simple rule that says a router should never advertise the cost of a destination to a neighbor if this neighbor is the next hop to reach that destination. In the previous example, according to split horizon rule, X wouldn’t say anything about Z to Y. A variation of this rule is called split horizon with poisonous reverse. In this case, instead of keeping quiet X tells Y that its distance to Z is infinity. This helps accelerate convergence.
  • Lets look at the earlier example again. Note that the initially the cost to reach Z from Y via X is infinity since Y is the next hop for Z to reach X. When the cost changes to 60, Y senses it, updates its table and notifies Z. The router Z realizes that direct link to X is shorter than going thru Y and updates its routing table. It then notifies Y which updates its table and makes Z its next hop to reach X. Then as per the rule, Y announces its cost to reach X as infinity. This way routers quickly converge to stable state. Does this solution completely solve the count to infinity problem?
  • What happens when the link Y to Z goes down. All three routers X, Y, and W together count to infinity. Split horizon solution works only when two routers are involved in a loop. So what is the solution? To completely eliminate the problem, a router some how need to figure out the complete path to a destination. Obvious solution is to pass on the path information along with the distance vector. This path vector approach is used in BGP.
  • Now lets compare these two routing protocols. Under link state, a router tells everyone about its neighbors using controlled flooding. Distance vector case a router communicates with neighbors only to inform about everyone. Link state each router gathers global information and computes its own table using Dijkstra’s algorithm. Distance vector performs distributed computation using other routers tables. We saw that distance vector can cause routing loops. There may be frequent changes in routes in the case of link state. This results in out of order delivery of packets which is undesirable. Both these approaches have advantages and disadvantages. Both are used in the Internet. OSPF is the most popularly used intra-domain routing protocol that is based on link state. RIP is based on distance vector which is being taken over by OSPF. BGP is an inter-domain protocol that uses path vectors.
  • Transcript

    • 1. Routing: Network Layer Part II
      • Routing Algorithms:
        • Link state vs. Distance Vector
      • Routing in the Internet
        • Intra-AS vs. Inter-AS routing
        • Intra-AS: RIP and OSPF
        • Inter-AS: BGP and Policy Routing
      • MPLS
      • Readings: Textbook: Chapter 4:
      • Sections 4.2-4.3, 4.5-4.6
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 2. Routing & Forwarding: Logical View of a Router Csci 232 – Computer Networks Routing and Network Layer Part II A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 3. IP Forwarding Process Csci 232 – Computer Networks Forwarding Process IP Forwarding Table Router 1. Remove a packet from an input queue 3. Match packet’s destination to a table entry 2. Check for sanity, decrement TTL field 4. Place packet on correct output queue If queues get full, just drop packets! If queues get full, just drop packets!
    • 4. IP Forwarding Table Csci 232 – Computer Networks Destination Next Hop Interface Net A Net B Net C, Host 3 Router 1 Direct Router 2 Router 1 INT 7 INT 7 INT 3 INT 4 A destination is usually a network. May also be a host, or a “gateway of last resort” (default) The next hop is either a directly connected network or a router on a directly connected network A physical interface Net C
    • 5. How Are Forwarding Tables Populated to Implement Routing? Csci 232 – Computer Networks Statically Dynamically Routers exchange network reachability information using ROUTING PROTOCOLS . Routers use this to compute best routes Administrator manually configures forwarding table entries In practice : a mix of these. Static routing mostly at the “edge” + More control + Not restricted to destination-based forwarding - Doesn’t scale - Slow to adapt to network failures + Can rapidly adapt to changes in network topology + Can be made to scale well - Complex distributed algorithms - Consume CPU, Bandwidth, Memory - Debugging can be difficult - Current protocols are destination-based
    • 6. Dynamic Routing: Intra- vs. Inter-AS Csci 232 – Computer Networks Routing and Network Layer Part II AS 1 AS 2 BGP EGP = Exterior Gateway Protocol IGP = Interior Gateway Protocol Metric based: OSPF, IS-IS, RIP, EIGRP (cisco) Policy based: BGP The Routing Domain of BGP is the entire Internet OSPF EIGRP
    • 7. Internet AS Hierarchy Csci 232 – Computer Networks Routing and Network Layer Part II border (exterior gateway) routers interior routers
    • 8. Intra-AS vs. Inter-AS Routing Csci 232 – Computer Networks Routing and Network Layer Part II Host h2 Intra-AS routing within AS A Intra-AS routing within AS B a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Inter-AS routing between A and B
    • 9. Intra-AS and Inter-AS Routing Csci 232 – Computer Networks Routing and Network Layer Part II physical layer
      • “ Gateways”:
        • perform inter-AS routing amongst themselves
        • perform intra-AS routing with other routers in their AS
      inter-AS, intra-AS routing in gateway A.c network layer link layer a b b a a C A B d A.a A.c C.b B.a c b c
    • 10. Where Does Forwarding Table Come From? Csci 232 – Computer Networks Forwarding Table OSPF Domain RIP Domain BGP Forwarding Table Manager OSPF Process OSPF Routing tables RIP Process RIP Routing tables BGP Process BGP Routing tables
    • 11. Routing
      • Goal: determine a “good” path through the network from source to destination
        • Good means usually the shortest path
      • Network modeled as a graph
        • Routers  nodes
        • Link  edges
          • Edge cost: delay, congestion level,…
      Csci 232 – Computer Networks Routing and Network Layer Part II A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 12. Basic Routing Problem
      • Assume
        • A network with N nodes, where each edge is associated a cost
        • A node knows only its neighbors and the cost to reach them
      • How does each node learn how to reach every other node along the shortest path?
      Csci 232 – Computer Networks Routing and Network Layer Part II A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 13. Routing: Issues
      • How are routing tables determined?
      • Who determines table entries?
      • What info is used in determining table entries?
      • When do routing table entries change?
      • Where is routing info stored?
      • How to control routing table size?
      • Answer these questions, we are done!
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 14. Routing Paradigms
      • Hop-by-hop Routing
        • Each packet contains destination address
        • Each router chooses next-hop to destination
          • routing decision made at each (intermediate) hop!
          • packets to same destination may take different paths!
        • Example: IP’s default datagram routing
      • Source Routing
        • Sender selects the path to destination precisely
        • Routers forward packet to next-hop as specified
          • Problem: if specified path no longer valid due to link failure!
        • Example:
          • IP’s loose/strict source route option
          • virtual circuit setup phase in ATM (or MPLS)
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 15. Routing Algorithms/Protocols
      • Issues Need to Be Addressed:
      • Route selection may depend on different criteria
        • Performance: choose route with the smallest delay
        • Policy: choose a route that doesn’t cross .gov network
      • Adapt to changes in network topology or condition
        • Self-healing: little or no human intervention
      • Scalability
        • Must be able to support a large number of hosts, routers
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 16. Centralized vs. Distributed Routing Algorithms
      • Centralized:
      • A centralized route server collects routing information and network topology, makes route selection decisions, then distributes them to routers
      • Distributed:
      • Routers cooperate using a distributed protocol
        • to create mutually consistent routing tables
      • Two standard distributed routing algorithms
        • Link State (LS) routing
        • Distance Vector (DV) routing
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 17. Link State vs Distance Vector
      • Both assume that
        • The address of each neighbor is known
        • The cost of reaching each neighbor is known
      • Both find global information
        • By exchanging routing info among neighbors
      • Differ in the information exchanged and route computation
        • LS: tells every other node its distances to neighbors
        • DV: tells neighbors its distance to every other node
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 18. Link State Algorithm
      • Basic idea: Distribute link state packet to all routers
        • Topology of the network
          • Cost of each link in the network
      • Each router independently computes optimal paths
        • From itself to every destination
        • Routes are guaranteed to be loop free if
          • Each router sees the same cost for each link
          • Uses the same algorithm to compute the best path
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 19. Link State: Control Traffic
      • Each node floods its local information to every other node in the network
      • Each node ends up knowing the entire network topology  use Dijkstra to compute the shortest path to every other node
      Csci 232 – Computer Networks Routing and Network Layer Part II Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6
    • 20. Link State: Node State Csci 232 – Computer Networks Routing and Network Layer Part II Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6 A B E D C A B E D C A B E D C A B E D C A B E D C A B E D C A B E D C
    • 21. Topology Dissemination
      • Each router creates a set of link state packets (LSPs)
        • Describing its links to neighbors
        • LSP contains
          • Router id, neighbor’s id, and cost to its neighbor
      • Copies of LSPs are distributed to all routers
        • Using controlled flooding
      • Each router maintains a topology database
        • Database containing all LSPs
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 22. Topology Database: Example Csci 232 – Computer Networks Routing and Network Layer Part II link state database A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 23. Constructing Routing Table: Dijkstra’s Algorithm
      • Given the network topology
        • How to compute the shortest path to each destination?
      • Some notation
        • X: source node
        • N: set of nodes to which shortest paths are known so far
          • N is initially empty
        • D(V): the cost of the known shortest path from source X to V
        • C(U,V): cost of link U to V
          • C(U,V) =  if not neighbors
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 24. Algorithm (at Node X)
      • Initialization
        • N = {X}
        • For all nodes V
          • If V adjacent to X, D(V) = C(X,V) else D(V) = 
      • Loop
        • Find U not in N such that D(U) is the smallest
        • Add U into set N
        • Update D(V) for all V not in N
          • D(V) = min {D(V), D(U) + C(U,V)}
        • Until all nodes in N
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 25. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) D(F),p(F) 2 2 1 3 1 1 2 5 3 5 1 Initialization: 2 N = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; … A E D C B F
    • 26. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD D(B),p(B) 2,A D(C),p(C) 5,A 4,D D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 2 2 1 3 1 1 2 5 3 5 A E D C B F
      • 8 Loop
      • 9 find w not in N s.t. D(w) is a minimum;
      • 10 add w to N;
      • update D(v) for all v adjacent
      • to w and not in N:
      • 12 D(v) = min( D(v), D(w) + c(w,v) );
      • 13 until all nodes in N;
    • 27. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD ADE D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E 2 2 1 3 1 1 2 5 3 5 A E D C B F
      • 8 Loop
      • 9 find w not in N s.t. D(w) is a minimum;
      • 10 add w to N;
      • update D(v) for all v adjacent
      • to w and not in N:
      • 12 D(v) = min( D(v), D(w) + c(w,v) );
      • 13 until all nodes in N;
    • 28. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD ADE ADEB D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E 2 2 1 3 1 1 2 5 3 5 A E D C B F
      • 8 Loop
      • 9 find w not in N s.t. D(w) is a minimum;
      • 10 add w to N;
      • update D(v) for all v adjacent
      • to w and not in N:
      • 12 D(v) = min( D(v), D(w) + c(w,v) );
      • 13 until all nodes in N;
    • 29. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E 2 2 1 3 1 1 2 5 3 5 A E D C B F
      • 8 Loop
      • 9 find w not in N s.t. D(w) is a minimum;
      • 10 add w to N;
      • update D(v) for all v adjacent
      • to w and not in N:
      • 12 D(v) = min( D(v), D(w) + c(w,v) );
      • 13 until all nodes in N;
    • 30. Example: Dijkstra’s Algorithm Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E 2 2 1 3 1 1 2 5 3 5 A E D C B F
      • 8 Loop
      • 9 find w not in N s.t. D(w) is a minimum;
      • 10 add w to N;
      • update D(v) for all v adjacent
      • to w and not in N:
      • 12 D(v) = min( D(v), D(w) + c(w,v) );
      • 13 until all nodes in N;
    • 31. Dijkstra’s Algorithm: In a Nutshell Csci 232 – Computer Networks Routing and Network Layer Part II Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A 2,A 2,A D(C),p(C) 5,A 4,D 3,E 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity infinity 4,E 4,E 4,E A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 32. Routing Table Computation Csci 232 – Computer Networks Routing and Network Layer Part II A E D C B F 2 2 1 3 1 1 2 5 3 5
    • 33. Distance Vector Routing
      • A router tells neighbors its distance to every router
        • Communication between neighbors only
      • Based on Bellman-Ford algorithm
        • Computes “shortest paths”
      • Each router maintains a distance table
        • A row for each possible destination
        • A column for each neighbor
          • D X (Y,Z) : distance from X to Y via Z
      • Exchanges distance vector (the table) with neighbors
        • Distance vector: current least cost to each destination
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 34. Distance Vector: Control Traffic
      • When the routing table of a node changes, the node sends its table to its neighbors
      • A node updates its table with information received from its neighbors
      Csci 232 – Computer Networks Routing and Network Layer Part II Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6
    • 35. Distance Table: Example Csci 232 – Computer Networks Routing and Network Layer Part II A E D C B 6 8 1 2 1 2 D () A B C D A 1 7 8 10 B 14 8 9 11 D 11 5 4 2 E cost to destination via destination
    • 36. Distance Table to Routing Table Csci 232 – Computer Networks Routing and Network Layer Part II D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 E cost to destination via destination A B C D A,1 D,5 D,4 D,2 Outgoing link to use, cost destination Distance table Routing table
    • 37. Distance Vector Routing Algorithm
      • iterative:
      • continues until no nodes exchange info.
      • self-terminating : no “signal” to stop
      • asynchronous:
      • nodes need not exchange info/iterate in lock step!
      • distributed:
      • each node talks only with directly-attached neighbors
      • Distance Table data structure
      • each node has its own
      • row for each possible destination
      • column for each directly-attached neighbor to node
      • example: in node X, for dest. Y via neighbor Z:
      Csci 232 – Computer Networks Routing and Network Layer Part II D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =
    • 38. Distance Vector Routing: Overview
      • Iterative, asynchronous: each iteration caused by:
      • local link cost change
      • message from neighbor: its least cost path change from neighbor
      • Distributed:
      • each node notifies neighbors only when its least cost path to any destination changes
        • neighbors then notify their neighbors if necessary
      Csci 232 – Computer Networks Routing and Network Layer Part II wait for (change in local link cost or msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each node:
    • 39. Distance Vector Algorithm: Example Csci 232 – Computer Networks Routing and Network Layer Part II X Z 1 2 7 Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y
    • 40. Distance Vector Algorithm: Example Csci 232 – Computer Networks Routing and Network Layer Part II X Z 1 2 7 Y
    • 41. Convergence of DV Routing Csci 232 – Computer Networks Routing and Network Layer Part II
      • router detects local link cost change
      • updates distance table
      • if cost change in least cost path, notify neighbors
      algorithm terminates “ good news travels fast ” X Z 1 4 50 Y 1
    • 42. Problems with DV Routing Csci 232 – Computer Networks Routing and Network Layer Part II
      • Link cost changes:
      • good news travels fast
      • bad news travels slow
        • “ count to infinity ” problem !
      algorithm continues on! X Z 1 4 50 Y 60
    • 43. Count-to-Infinity Problem Csci 232 – Computer Networks Routing and Network Layer Part II 1 1 2 X Y Z
    • 44. “ Fixes” to Count-to-Infinity Problem
      • Split horizon
        • A router never advertises the cost of a destination to a neighbor
          • If this neighbor is the next hop to that destination
      • Split horizon with poisonous reverse
        • If X routes traffic to Z via Y, then
          • X tells Y that its distance to Z is infinity
            • Instead of not telling anything at all
        • Accelerates convergence
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 45. Split Horizon with Poisoned Reverse Csci 232 – Computer Networks Routing and Network Layer Part II
      • If Z routes through Y to get to X :
      • Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z)
      algorithm terminates X Z 1 4 50 Y 60
    • 46. Count-to-Infinity Problem Revisited Csci 232 – Computer Networks Routing and Network Layer Part II X Y Z W
    • 47. Link State vs Distance Vector
      • Tells everyone about neighbors
      • Controlled flooding to exchange link state
      • Dijkstra’s algorithm
      • Each router computes its own table
      • May have oscillations
      • Open Shortest Path First (OSPF)
      • Tells neighbors about everyone
      • Exchanges distance vectors with neighbors
      • Bellman-Ford algorithm
      • Each router’s table is used by others
      • May have routing loops
      • Routing Information Protocol (RIP)
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 48. Link State vs. Distance Vector (cont’d)
      • Message complexity
      • LS: O(n 2 *e) messages
        • n: number of nodes
        • e: number of edges
      • DV: O(d*n*k) messages
        • d: node’s degree
        • k: number of rounds
      • Time complexity
      • LS: O(n*log n)
      • DV: O(n)
      • Convergence time
      • LS: O(1)
      • DV: O(k)
      • Robustness : what happens if router malfunctions?
      • LS:
        • node can advertise incorrect link cost
        • each node computes only its own table
      • DV:
        • node can advertise incorrect path cost
        • each node’s table used by others; error propagate through network
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 49. Routing in the Real World
      • scale: with 200 million destinations:
      • can’t store all dest’s in routing tables!
      • routing table exchange would swamp links!
      • administrative autonomy
      • internet = network of networks
      • each network admin may want to control routing in its own network
      Csci 232 – Computer Networks Routing and Network Layer Part II
      • Our routing study thus far - idealization
      • all routers identical
      • network “flat”
      • How to do routing in the Internet
      • scalability and policy issues
    • 50. Routing in the Internet
      • The Global Internet consists of Autonomous Systems (AS) interconnected with each other hierarchically:
        • Stub AS: small corporation: one connection to other AS’s
        • Multihomed AS: large corporation (no transit): multiple connections to other AS’s
        • Transit AS: provider, hooking many AS’s together
      • Two-level routing:
        • Intra-AS: administrator responsible for choice of routing algorithm within network
        • Inter-AS: unique standard for inter-AS routing: BGP
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 51. Internet Architecture Csci 232 – Computer Networks Routing and Network Layer Part II Internet: “networks of networks”! LANs International lines ISP ISP company university national network regional network NAP Internic on-line services company access via modem
    • 52. Internet AS Hierarchy Csci 232 – Computer Networks Routing and Network Layer Part II Inter-AS border (exterior gateway) routers Intra-AS interior (gateway) routers
    • 53. Intra-AS vs. Inter-AS Routing Csci 232 – Computer Networks Routing and Network Layer Part II Host h2 Intra-AS routing within AS A Intra-AS routing within AS B a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Inter-AS routing between A and B
    • 54. Why Different Intra- and Inter-AS Routing?
      • Policy:
      • Inter-AS: admin wants control over how its traffic routed, who routes through its net.
      • Intra-AS: single admin, so no policy decisions needed
      • Scale:
      • hierarchical routing saves table size, update traffic
      • Performance :
      • Intra-AS: can focus on performance
      • Inter-AS: policy may dominate over performance
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 55. Intra-AS and Inter-AS Routing Csci 232 – Computer Networks Routing and Network Layer Part II physical layer
      • “ Gateways”:
        • perform inter-AS routing amongst themselves
        • perform intra-AS routers with other routers in their AS
      inter-AS, intra-AS routing in gateway A.c network layer link layer a b b a a C A B d A.a A.c C.b B.a c b c
    • 56. Intra-AS Routing
      • Also known as Interior Gateway Protocols (IGP)
      • Most common Intra-AS routing protocols:
        • RIP: Routing Information Protocol
        • OSPF: Open Shortest Path First
        • IS-IS: Intermediate System to Intermediate System (OSI Standard)
        • EIGRP: Extended Interior Gateway Routing Protocol (Cisco proprietary)
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 57. RIP ( Routing Information Protocol)
      • Distance vector algorithm
      • Included in BSD-UNIX Distribution in 1982
      • Distance metric: # of hops (max = 15 hops)
        • Number of hops from source router A to various subnets:
      Csci 232 – Computer Networks Routing and Network Layer Part II D C B A u v w x y z destination hops u 1 v 2 w 2 x 3 y 3 z 2
    • 58. RIP advertisements
      • Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement )
      • Each advertisement: list of up to 25 destination nets within AS
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 59. RIP: Example Csci 232 – Computer Networks Routing and Network Layer Part II Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 … . …. .... w x y z A C D B Routing table in D
    • 60. RIP: Example Csci 232 – Computer Networks Routing and Network Layer Part II Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1 … . …. .... Routing table in D Dest Next hops w - - x - - z C 4 … . … ... Advertisement from A to D w x y z A C D B
    • 61. RIP: Link Failure and Recovery
      • If no advertisement heard after 180 sec --> neighbor/link declared dead
        • routes via neighbor invalidated
        • new advertisements sent to neighbors
        • neighbors in turn send out new advertisements (if tables changed)
        • link failure info quickly propagates to entire net
        • poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 62. RIP Table processing
      • RIP routing tables managed by application-level process called route-d (daemon)
      • advertisements sent in UDP packets, periodically repeated
      Csci 232 – Computer Networks Routing and Network Layer Part II physical link network forwarding (IP) table Transprt (UDP) physical link network (IP) Transprt (UDP) forwarding table routed routed
    • 63. OSPF (Open Shortest Path First)
      • “ open”: publicly available
      • Uses Link State algorithm
        • LS packet dissemination
        • Topology map at each node
        • Route computation using Dijkstra’s algorithm
      • OSPF advertisement carries one entry per neighbor router
      • Advertisements disseminated to entire AS (via flooding)
        • Carried in OSPF messages directly over IP (rather than TCP or UDP
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 64. OSPF “advanced” features (not in RIP)
      • Security: all OSPF messages authenticated (to prevent malicious intrusion)
      • Multi ple same-cost path s allowed (only one path in RIP)
      • For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time)
      • Integrated uni- and multicast support:
        • Multicast OSPF (MOSPF) uses same topology data base as OSPF
      • Hierarchical OSPF in large domains.
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 65. Hierarchical OSPF Csci 232 – Computer Networks Routing and Network Layer Part II
    • 66. Hierarchical OSPF
      • Two-level hierarchy: local area, backbone.
        • Link-state advertisements only in area
        • each nodes has detailed area topology; only know direction (shortest path) to nets in other areas.
        • Communications between areas via backbone
      • Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers.
      • Backbone routers: run OSPF routing limited to backbone.
      • Boundary routers: connect to other AS’s.
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 67. Inter-AS Routing in the Internet: BGP Csci 232 – Computer Networks Routing and Network Layer Part II
    • 68. Internet inter-AS routing: BGP
      • BGP (Border Gateway Protocol): the de facto standard
      • BGP provides each AS a means to:
        • Obtain subnet reachability information from neighboring ASs.
        • Propagate the reachability information to all routers internal to the AS.
        • Determine “good” routes to subnets based on reachability information and policy.
      • Allows a subnet to advertise its existence to rest of the Internet: “I am here”
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 69. BGP basics
      • Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP conctns: BGP sessions
      • Note that BGP sessions do not correspond to physical links.
      • When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix.
        • AS2 can aggregate prefixes in its advertisement
      Csci 232 – Computer Networks Routing and Network Layer Part II 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session
    • 70. Distributing reachability info
      • With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1.
      • 1c can then use iBGP to distribute this new prefix reach info to all routers in AS1
      • 1b can then re-advertise the new reach info to AS2 over the 1b-to-2a eBGP session
      • When router learns about a new prefix, it creates an entry for the prefix in its forwarding table.
      Csci 232 – Computer Networks Routing and Network Layer Part II 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session
    • 71. Path attributes & BGP routes
      • When advertising a prefix, advert includes BGP attributes.
        • prefix + attributes = “route”
      • Two important attributes:
        • AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17
        • NEXT-HOP: Indicates the specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.)
      • When gateway router receives route advert, uses import policy to accept/decline.
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 72. BGP route selection
      • Router may learn about more than 1 route to some prefix. Router must select route.
      • Elimination rules:
        • Local preference value attribute: policy decision
        • Shortest AS-PATH
        • Closest NEXT-HOP router: hot potato routing
        • Additional criteria
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 73. BGP messages
      • BGP messages exchanged using TCP.
      • BGP messages:
        • OPEN: opens TCP connection to peer and authenticates sender
        • UPDATE: advertises new path (or withdraws old)
        • KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request
        • NOTIFICATION: reports errors in previous msg; also used to close connection
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 74. BGP routing policy Csci 232 – Computer Networks Routing and Network Layer Part II
      • A,B,C are provider networks
      • X,W,Y are customer (of provider networks)
      • X is dual-homed: attached to two networks
        • X does not want to route from B via X to C
        • .. so X will not advertise to B a route to C
    • 75. BGP routing policy (2) Csci 232 – Computer Networks Routing and Network Layer Part II
      • A advertises to B the path AW
      • B advertises to X the path BAW
      • Should B advertise to C the path BAW?
        • No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers
        • B wants to force C to route to w via A
        • B wants to route only to/from its customers!
    • 76. Why different Intra- and Inter-AS routing ?
      • Policy:
      • Inter-AS: admin wants control over how its traffic routed, who routes through its net.
      • Intra-AS: single admin, so no policy decisions needed
      • Scale:
      • hierarchical routing saves table size, reduced update traffic
      • Performance :
      • Intra-AS: can focus on performance
      • Inter-AS: policy may dominate over performance
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 77. Multi-Protocol Label Switching (MPLS)
      • initial goal: speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding
        • borrowing ideas from Virtual Circuit (VC) approach
        • but IP datagram still keeps IP address!
      Csci 232 – Computer Networks Routing and Network Layer Part II PPP or Ethernet header IP header remainder of link-layer frame MPLS header label Exp S TTL 20 3 1 5
    • 78. MPLS Capable Routers
      • a.k.a. label-switched router
      • forwards packets to outgoing interface based only on label value (don’t inspect IP address)
        • MPLS forwarding table distinct from IP forwarding tables
      • signaling protocol needed to set up forwarding
        • RSVP-TE, LDP
        • forwarding possible along paths that IP alone would not allow (e.g., least cost path routing) !!
        • use MPLS for traffic engineering
      • must co-exist with IP-only routers
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 79. MPLS Forwarding Tables Csci 232 – Computer Networks Routing and Network Layer Part II R1 R2 D R3 R4 R5 0 1 0 0 A R6 in out out label label dest interface 6 - A 0 in out out label label dest interface 10 6 A 1 12 9 D 0 in out out label label dest interface 10 A 0 12 D 0 1 in out out label label dest interface 8 6 A 0 0 8 A 1
    • 80. Why Mobile IP?
      • Need a protocol which allows network connectivity across host movement
      • Protocol to enable mobility must not require massive changes to router software, etc.
      • Must be compatible with large installed base of IPv4 networks/hosts
      • Confine changes to mobile hosts and a few support hosts which enable mobility
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 81. Internet Protocol (IP)
      • Network layer, "best-effort" packet delivery
      • Supports UDP and TCP (transport layer protocols)
      • IP host addresses consist of two parts
        • network id + host id
      • By design, IP host address is tied to home network address
        • Hosts are assumed to be wired, immobile
        • Intermediate routers look only at network address
        • Mobility without a change in IP address results in un-route-able packets
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 82. IP Routing Breaks Under Mobility Csci 232 – Computer Networks Routing and Network Layer Part II Why this hierarchical approach? Answer: Scalability! Millions of network addresses, billions of hosts! 137.30.2.* .50 .52 .53 router router 139.20.3.* .200
    • 83. Mobile IP: Basics
      • Proposed by IETF (Internet Engineering Task Force)
        • Standards development body for the Internet
      • Mobile IP allows a mobile host to move about without changing its permanent IP address
      • Each mobile host has a home agent on its home network
      • Mobile host establishes a care-of address when it's away from home
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 84. Mobile IP: Basics, Cont.
      • Correspondent host is a host that wants to send packets to the mobile host
      • Correspondent host sends packets to the mobile host’s IP permanent address
      • These packets are routed to the mobile host’s home network
      • Home agent forwards IP packets for mobile host to current care-of address
      • Mobile host sends packets directly to correspondent, using permanent home IP as source IP
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 85. Mobile IP: Basics, Cont. Csci 232 – Computer Networks Routing and Network Layer Part II home agent correspondent host
    • 86. Mobile IP: Care-of Addresses
      • Whenever a mobile host connects to a remote network, two choices:
        • care-of can be the address of a foreign agent on the remote network
          • foreign agent delivers packets forwarded from home agent to mobile host
        • care-of can be a temporary, foreign IP address obtained through, e.g., DHCP
          • home agent tunnels packets directly to the temporary IP address
      • Regardless, care-of address must be registered with home agent
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 87. IP-in-IP Tunneling
      • Packet to be forwarded is encapsulated in a new IP packet
      • In the new header:
        • Destination = care-of-address
        • Source = address of home agent
        • Protocol number = IP-in-IP
      Csci 232 – Computer Networks Routing and Network Layer Part II IP header IP header data IP header data
    • 88. At the Other End...
      • Depending on type of care-of address:
        • Foreign agent or
        • Mobile host
      • … strips outer IP header of tunneled packet, which is then fed to the mobile host
      • Aside: Any thoughts on advantages of foreign agent vs. co-located (foreign IP) address?
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 89. Routing Inefficiency Csci 232 – Computer Networks Routing and Network Layer Part II Mobile host and correspondent host might even be on the same network!! home agent correspondent host
    • 90. Route Optimizations
      • Possible Solution:
        • Home agent sends current care-of address to correspondent host
        • Correspondent host caches care-of address
        • Future packets tunneled directly to care-of address
      • But!
        • An instance of the cache consistency problem arises...
        • Cached care-of address becomes stale when the mobile host moves
        • Potential security issues with providing care-of address to correspondent
      Csci 232 – Computer Networks Routing and Network Layer Part II
    • 91. Possible Route Optimization Csci 232 – Computer Networks Routing and Network Layer Part II
    • 92. Network Layer Part II Summary
      • Network Layer Routing
        • Basic Issues
        • Distributed Routing Algorithms: LS vs. DV
        • Link State (LS): How does it work?
        • Distance Vector (DV): How does it work? Issues?
        • Mobile IP: how does it work? Issues?
        • MPLS
      • Routing in the Internet
        • Intra-AS vs. Inter-AS routing
        • Intra-AS: RIP and OSPF
        • Inter-AS: BGP and Policy Routing
      • Things we didn’t cover: VPN, IP Multicast, IPv6 (but please read by yourself!)
      Csci 232 – Computer Networks Routing and Network Layer Part II