Unicast Routing Protocols RIP OSPF and BGP 1
Unicast Routing Protocols (RIP, OSPF, and BGP) 1 By: Muhammad Hanif To: BS CS 5 th Semester Subject: Internet Architecture and protocols
2 Unicast Routing Protocols (RIP, OSPF, and BGP) Chapter No. 11 TCP/IP Protocol Suite (Fourth Edition) Behrouz A. Forouzan
3 Quote of The Day To handle yourself, use your head; to handle others, use your heart. - Eleanor Roosevelt People rarely succeed unless they have fun in what they are doing. -Dale Carnegie Dear Past, Thanks for all the lessons, Dear Future, I’m ready.
4 INTRA- AND INTER-DOMAIN ROUTING PROTOCOLS We will discuss two intra-domain routing protocols: 1. Distance vector and 2. Link state. We will also discuss one inter-domain routing protocol: 1. Path vector
5 Routing Protocols � Routing Information Protocol (RIP) is the implementation of the distance vector protocol. � Open Shortest Path First (OSPF) is the implementation of the link state protocol. � Border Gateway Protocol (BGP) is the implementation of the path vector protocol. � RIP and OSPF are interior routing protocols; � BGP is an exterior routing protocol.
6 Popular Routing Protocols
7 Routing Algorithm Distance Vector Routing Protocol RIP Based on distance vector
8 Distance Vector
9 Network as a graph In Order to make routing algorithms general, a network is shown as a graph A graph is specified by A set of nodes A set of edges (links)
10 Network as a graph: example
11 Routing algorithm basics Each edge of the graph is assigned a cost. Example 1: Unit cost per edge. Example 2: The cost of an edge can also be express by its bandwidth. E. g. high bandwidth low cost. The cost of a route is the sum of costs of total cost of the sub links. The aim of both distance vector and link state routing algorithms is to find the least cost path or shortest path.
12 Example: Cost of edges and routes Two possible routes from A to E Cost of route A →B →C →E is 2+3+1 = 6 Cost of route A → D → E is 1 + 1 = 2
13 Distance vector routing algorithm Messages exchanged between routers have two components: destination network (vector) cost to destination (distance) Also known as Bellman‐Ford Algorithm Proposed in the 1960’s
14 Distance Vector Algorithm Bellman‐Ford Equation dx(y) : = cost of least‐cost path from x to y Then dx(y) = min {c(x, v) + dv(y) } where min is taken over all neighbors of x (i. e. all v)
15 Bellman-Ford example Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 B-F equation says: du(z) = min { c(u, v) + dv(z), c(u, x) + dx(z), c(u, w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path -> forwarding table
16 Initialisation ‐ Distance. Vector Routing Algorithm
17 Example
18 Example
19 Note: In distance vector routing, each node shares its routing table with its immediate neighbors periodically and when there is a change.
20 So Far……. . We talked about A routing algorithm: distance vector Next: RIP – a routing protocol which uses distance vector
21 Routing Information Protocol (RIP)
22 Routing Information Protocol (RIP) Implements distance vector routing Each router shares routing information with its neighbors Sharing at regular interval Versions: RIP 1, RIP 2 Note that : RIP uses the services of UDP on well-known port 520.
23 Example
24 Limitations of RIP Network span limited by maximum hop limit 16 Note that actual number of networks can be less than 16 Slow convergence Large update message Size of update message proportional to the number of networks RIP can only be applied to small Autonomous Systems
25 Popular Routing Protocols
26 Link State Routing Protocols
27 Link State Routing The network is given by a graph A set of nodes A set of edges/links Cost is assigned to each link The aim of link state routing is to find the least cost path or shortest path
28 Link State “Link state” refers to whether a link is up or down Convention: Finite cost for a link which is up
29 Key ideas behind link state routing (1) The link states of each router is distributed throughout the network As a result, each router has the complete topology of the network Exercise: Given the following link states: A↔B, cost = 3 B↔C, cost = 2 C↔D, cost = 1 D↔B, cost = 4 Can you draw the graph for the network?
30 Solution The given link states are: A↔B, cost = 3 B↔C, cost = 2 C↔D, cost = 1 D↔B, cost = 4 The graph is:
31 Key ideas behind link state routing (2) By using the complete topology information Nodes, Link costs Each router computes the shortest path from itself to all the other nodes (destinations)
32 A Link-State Routing Algorithm Dijkstar’s Algorithm Link costs known to all nodes Computes least cost paths form one node (“source”) to all other nodes. Notations: c(x, y): link cost from node x to y: = ∞ if no direct neighbors D(V): current value of cost of path from source to dest: v P(V): predecessor node along path from source to v N’: set nodes whose least cost path definitively known
33 Dijkstra’s algorithm: example
34 Dijkstra’s algorithm: example
35 Open Shortest path First (OSPF)
36 Open shortest path first (OSPF) Developed in the late 1980 s An implementation of link state algorithm Link state – a generic routing algorithm
37 Key ideas behind OSPF Each router maintains its link states and distributes them throughout the network As a result, each router has the complete topology of the network Each router computes the shortest path to all destinations by applying Dijkstra algorithm to the topology knowledge that it has
38 Key ideas behind OSPF When a router detects a change in link state, it sends out a link state advertisement which is distributed throughout the network So that each router has the up-do-date network topology Each router re-computes the shortest paths using the updated topology knowledge
39 Summary Distance Vector Routing Bellman Ford Algorithm RIP Linkstate Routing Dijkstra Algorithm OSPF
- Slides: 39