Lecture 4: Dynamic routing protocols

Slides:



Advertisements
Similar presentations
Border Gateway Protocol Ankit Agarwal Dashang Trivedi Kirti Tiwari.
Advertisements

Lecture 9 Overview. Hierarchical Routing scale – with 200 million destinations – can’t store all dests in routing tables! – routing table exchange would.
Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol –Datagram format.
COMS/CSEE 4140 Networking Laboratory Lecture 05 Salman Abdul Baset Spring 2008.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization –All routers are identical –Network is flat. Not true in Practice Hierarchical.
1 ELEN 602 Lecture 20 More on Routing RIP, OSPF, BGP.
TDC365 Spring 2001John Kristoff - DePaul University1 Interconnection Technologies Routing I.
RD-CSY3021 Comparing Routing Protocols. RD-CSY3021 Criteria used to compare routing protocols includes  Time to convergence  Proprietary/open standards.
RIP – Routing Information Protocol Syeda Momina Tabish MIT - 7.
CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim
CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim
1 Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol. Dynamic Routing Protocols II OSPF.
Unicast Routing Protocols: RIP, OSPF, and BGP
CSEE W4140 Networking Laboratory Lecture 5: IP Routing (OSPF and BGP) Jong Yul Kim
Routing.
14 – Inter/Intra-AS Routing
Dynamic Routing Distance Vector and Link State RIP OSPF.
W4140 Network Laboratory Lecture 6 Oct 16 - Fall 2006 Shlomo Hershkop Columbia University.
1 Dynamic Routing Protocols I RIP Relates to Lab 4. The first module on dynamic routing protocols. This module provides an overview of routing, introduces.
CS 356: Computer Network Architectures Lecture 12: Dynamic routing protocols: Link State Chapter Xiaowei Yang
RIP. A PPROACHES TO S HORTEST P ATH R OUTING There are two basic routing algorithms found on the Internet. 1. Distance Vector Routing Each node knows.
1 ECE453 – Introduction to Computer Networks Lecture 10 – Network Layer (Routing II)
1 Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol. Dynamic Routing Protocols II OSPF.
ROUTING PROTOCOLS PART II ET4187/ET5187 Advanced Telecommunication Network.
TCP/IP Protocol Suite 1 Chapter 14 Upon completion you will be able to: Unicast Routing Protocols: RIP, OSPF, and BGP Distinguish between intra and interdomain.
1 CS 4396 Computer Networks Lab Dynamic Routing Protocols - II OSPF.
1 Computer Communication & Networks Lecture 22 Network Layer: Delivery, Forwarding, Routing (contd.)
Dynamic Routing Protocols  Function(s) of Dynamic Routing Protocols: – Dynamically share information between routers (Discover remote networks). – Automatically.
1 Routing Protocols. 2 Distributed Routing Protocols Rtrs exchange control info Use it to calculate forwarding table Two basic types –distance vector.
CS 4396 Computer Networks Lab
Slide /2009COMM3380 Routing Algorithms Distance Vector Routing Each node knows the distance (=cost) to its directly connected neighbors A node sends.
Unicast Routing Protocols  A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes.
1 Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol. Dynamic Routing Protocols II OSPF.
Code : STM#520-1 Samsung Electronics Co., Ltd. OfficeServ7400 Router Operation Distribution EnglishED01.
Routing -2 Dynamic Routing
Review Routing fundamental W.lilakiatsakun. Review Routing Fundamental VLSM VLSM Route Summarization Route Summarization Static & Dynamic Routing Static.
Routing protocols Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF)
TCOM 515 Lecture 2. Lecture 2 Objectives Dynamic Routing Distance Vector Routing Link State Routing Interior vs Exterior RIP - Routing Information Protocol.
1. 2 Anatomy of an IP Packet IP packets consist of the data from upper layers plus an IP header. The IP header consists of the following:
Interior Gateway Protocol. Introduction An IGP (Interior Gateway Protocol) is a protocol for exchanging routing information between gateways (hosts with.
Chapter 9. Implementing Scalability Features in Your Internetwork.
1 Network Layer Lecture 13 Imran Ahmed University of Management & Technology.
RIP2 (Routing Information Protocol) Team Agile. Routing Protocols Link State – OSPF – ISIS Distance vector – RIP (version 1 and 2) – IGRP (Cisco Proprietary)
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Unicast Routing Protocols.
1 Module 4: Implementing OSPF. 2 Lessons OSPF OSPF Areas and Hierarchical Routing OSPF Operation OSPF Routing Tables Designing an OSPF Network.
Network Layer4-1 Intra-AS Routing r Also known as Interior Gateway Protocols (IGP) r Most common Intra-AS routing protocols: m RIP: Routing Information.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 06_a Routing Protocols: RIP, OSPF, BGP Instructor: Dr. Li-Chuan Chen Date: 10/06/2003 Based in part upon.
7400 Samsung Confidential & Proprietary Information Copyright 2006, All Rights Reserved. -0/35- OfficeServ 7x00 Enterprise IP Solutions Quick Install Guide.
 Development began in 1987  OSPF Working Group (part of IETF)  OSPFv2 first established in 1991  Many new features added since then  Updated OSPFv2.
TCOM 515 Lecture 2. Lecture 2 Objectives Dynamic Routing Distance Vectore Routing Link State Routing Interior vs Exterior RIP - Routing Information Protocol.
Chapter 14 1 Unicast Routing Protocols There isn’t a person anywhere that isn’t capable of doing more than he thinks he can. - Henry Ford.
Dynamic Routing Protocols II OSPF
TCP/IP Protocol Suite 1 Chapter 14 Upon completion you will be able to: Unicast Routing Protocols: RIP, OSPF, and BGP Distinguish between intra and interdomain.
Lecture 4: Dynamic routing protocols Today: 1.Overview of router architecture 2.RIP, OSPF, BGP 3.Notes on Lab 4 4.Midterm review.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
1 Chapter 14-16a Internet Routing Review. Chapter 14-16: Internet Routing Review 2 Introduction Motivation: Router performance is critical to overall.
RIP Routing Protocol. 2 Routing Recall: There are two parts to routing IP packets: 1. How to pass a packet from an input interface to the output interface.
1 Dynamic Routing Protocols I RIP Relates to Lab 4. The first module on dynamic routing protocols. This module provides an overview of routing, introduces.
1. 2  An autonomous system is a region of the Internet that is administered by a single entity.  Examples of autonomous regions are:  UVA’s campus.
Malathi Veeraraghavan (originals by Jörg Liebeherr) 1 Link State Routing Algorithm Use a routing protocol to collect the whole network topology Obtain.
1 Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol. Dynamic Routing Protocols II OSPF.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Dynamic Routing Protocols II OSPF
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Routing.
Dynamic Routing Protocols II OSPF
Computer Networks Protocols
Routing.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Presentation transcript:

Lecture 4: Dynamic routing protocols Tuesday: Overview of router architecture RIP Thursday: OSPF, BGP

Review of RIP A distance vector routing protocol

A router updates its distance vectors using bellman-ford equation Define dx(y) := cost of the least-cost path from x to y Then dx(y) = minv{c(x,v) + dv(y) }, where min is taken over all neighbors of node x

Distance vector algorithm: initialization Let Dx(y) be the estimate of least cost from x to y Initialization: Each node x knows the cost to each neighbor: c(x,v). For each neighbor v of x, Dx(v) = c(x,v) Dx(y) to other nodes are initialized as infinity. Each node x maintains a distance vector (DV): Dx = [Dx(y): y 2 N ]

Distance vector algorithm: updates Each node x sends its distance vector to its neighbors, either periodically, or triggered by a change in its DV. When a node x receives a new DV estimate from a neighbor v, it updates its own DV using B-F equation: If c(x,v) + Dv(y) < Dx(y) then Dx(y) = c(x,v) + Dv(y) Sets the next hop to reach the destination y to the neighbor v Notify neighbors of the change The estimate Dx(y) will converge to the actual least cost dx(y)

The Count-to-Infinity Problem A 1 B 1 C A's Routing Table B's Routing Table via via to cost to cost (next hop) (next hop) C B 2 C C 1 now link B-C goes down 1 C B 2 C - 1 C 2 C 1 C - C A 3 1 C C 3 1 C B 4 C - 1 C 4 C

Count-to-Infinity The reason for the count-to-infinity problem is that each node only has a “next-hop-view” For example, in the first step, A did not realize that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved?

Count-to-Infinity The reason for the count-to-infinity problem is that each node only has a “next-hop-view” For example, in the first step, A did not realize that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved? Solution 1: Always advertise the entire path in an update message to avoid loops (Path vectors) BGP uses this solution

Count-to-Infinity The reason for the count-to-infinity problem is that each node only has a “next-hop-view” For example, in the first step, A did not realize that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved? Solution 2: Never advertise the cost to a neighbor if this neighbor is the next hop on the current path (Split Horizon) Example: A would not send the first routing update to B, since B is the next hop on A’s current route to C Split Horizon does not solve count-to-infinity in all cases! You can produce the count-to-infinity problem in Lab 4.

RIP - Routing Information Protocol A simple intradomain protocol Straightforward implementation of Distance Vector Routing Each router advertises its distance vector every 30 seconds (or whenever its routing table changes) to all of its neighbors RIP always uses 1 as link metric Maximum hop count is 15, with “16” equal to “” Routes are timeout (set to 16) after 3 minutes if they are not updated

RIP - History Late 1960s : Distance Vector protocols were used in the ARPANET Mid-1970s: XNS (Xerox Network system) routing protocol is the ancestor of RIP in IP (and Novell’s IPX RIP and Apple’s routing protocol) 1982 Release of routed for BSD Unix 1988 RIPv1 (RFC 1058) - classful routing 1993 RIPv2 (RFC 1388) - adds subnet masks with each route entry - allows classless routing 1998 Current version of RIPv2 (RFC 2453)

RIPv1 Packet Format 1: RIPv1 1: request 2: response 2: for IP Address of destination Cost (measured in hops) One RIP message can have up to 25 route entries

RIPv2 RIPv2 is an extends RIPv1: Subnet masks are carried in the route information Authentication of routing messages Route information carries next-hop address Uses IP multicasting Extensions of RIPv2 are carried in unused fields of RIPv1 messages

RIPv2 Packet Format 2: RIPv2 1: request 2: response 2: for IP Address of destination Cost (measured in hops) One RIP message can have up to 25 route entries

RIPv2 Packet Format 2: RIPv2 Used to provide a method of separating "internal" RIP routes (routes for networks within the RIP routing domain) from "external" RIP routes Subnet mask for IP address Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0….0)

RIP Messages This is the operation of RIP in routed. Dedicated port for RIP is UDP port 520. Two types of messages: Request messages used to ask neighboring nodes for an update Response messages contains an update

Routing with RIP Initialization: Send a request packet (command = 1, address family=0..0) on all interfaces: RIPv1 uses broadcast if possible, RIPv2 uses multicast address 224.0.0.9, if possible requesting routing tables from neighboring routers Request received: Routers that receive above request send their entire routing table Response received: Update the routing table Regular routing updates: Every 30 seconds, send all or part of the routing tables to every neighbor in an response message Triggered Updates: Whenever the metric for a route change, send entire routing table.

RIP Security Issue: Sending bogus routing updates to a router RIPv1: No protection RIPv2: Simple authentication scheme 2: plaintext password

RIP Problems RIP takes a long time to stabilize Even for a small network, it takes several minutes until the routing tables have settled after a change RIP has all the problems of distance vector algorithms, e.g., count-to-Infinity RIP uses split horizon to avoid count-to-infinity The maximum path in RIP is 15 hops

Dynamic Routing Protocols II OSPF Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol.

Distance Vector vs. Link State Routing With distance vector routing, each node has information only about the next hop: Node A: to reach F go to B Node B: to reach F go to D Node D: to reach F go to E Node E: go directly to F Distance vector routing makes poor routing decisions if directions are not completely correct (e.g., because a node is down). If parts of the directions incorrect, the routing may be incorrect until the routing algorithms has re-converged. A B C D E F

Distance Vector vs. Link State Routing In link state routing, each node has a complete map of the topology If a node fails, each node can calculate the new route Difficulty: All nodes need to have a consistent view of the network A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F

Link State Routing: Properties Each node requires complete topology information Link state information must be flooded to all nodes Guaranteed to converge

Link State Routing: Basic principles 1. Each router establishes a relationship (“adjacency”) with its neighbors 2. Each router generates link state advertisements (LSAs) which are distributed to all routers LSA = (link id, state of the link, cost, neighbors of the link) Each router sends its LSA to all routers in the network (using a method called reliable flooding) 3. Each router maintains a database of all received LSAs (topological database or link state database), which describes the network has a graph with weighted edges 4. Each router uses its link state database to run a shortest path algorithm (Dijikstra’s algorithm) to produce the shortest path to each network

Link state routing: graphical illustration b 1 3 2 a c d 6 a’s view Collecting all pieces yield a complete view of the network! b 3 a 6 c d’s view b’s view 3 b 1 2 c d a c b c’s view 1 a c d 6

Operation of a Link State Routing protocol IP Routing Table Link State Database Dijkstra’s Algorithm Received LSAs LSAs are flooded to other interfaces

Dijkstra’s Shortest Path Algorithm for a Graph Input: Graph (N,E) with N the set of nodes and E the set of edges cvw link cost (cvw = 1 if (v,w)  E, cvv = 0) s source node. Output: Dn cost of the least-cost path from node s to node n M = {s}; for each n  M Dn = csn; while (M  all nodes) do Find w  M for which Dw = min{Dj ; j  M}; Add w to M; for each neighbor n of w and n  M Dn = min[ Dn, Dw + cwn ]; Update route; enddo

OSPF OSPF = Open Shortest Path First The OSPF routing protocol is the most important link state routing protocol on the Internet (another link state routing protocol is IS-IS (intermediate system to intermediate system) The complexity of OSPF is significant RIP (RFC 2453 ~ 40 pages) OSPF (RFC 2328 ~ 250 pages) History: 1989: RFC 1131 OSPF Version 1 1991: RFC1247 OSPF Version 2 1994: RFC 1583 OSPF Version 2 (revised) 1997: RFC 2178 OSPF Version 2 (revised) 1998: RFC 2328 OSPF Version 2 (current version)

Features of OSPF Provides authentication of routing messages Enables load balancing by allowing traffic to be split evenly across routes with equal cost Type-of-Service routing allows to setup different routes dependent on the TOS field Supports subnetting Supports multicasting Allows hierarchical routing

Hierarchical OSPF

Hierarchical OSPF Link-state advertisements only in area 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. Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. Backbone routers: run OSPF routing limited to backbone.

Example Network 10.1.7.6 10.1.1.1 10.1.1.2 10.1.4.4 3 4 2 5 1 Link costs are called Metric Metric is in the range [0 , 216] Metric can be asymmetric .1 .2 .2 .4 .4 .6 10.1.7.0 / 24 10.1.4.0 / 24 .1 10.1.1.0 / 24 .2 .4 Router IDs can be selected independent of interface addresses, but usually chosen to be the smallest interface address .6 10.1.3.0 / 24 10.1.6.0 / 24 10.1.2.0 / 24 10.1.8.0 / 24 .3 .5 .3 .5 .3 10.1.5.0/24 .5 10.1.2.3 10.1.5.5

Link State Advertisement (LSA) 10.1.1.0 / 24 .1 .2 10.1.1.1 10.1.4.0 / 24 10.1.2.0 / 24 .4 10.1.7.0 / 24 10.1.6.0 / 24 10.1.3.0 / 24 10.1.5.0/24 10.1.8.0 / 24 .3 .5 .6 10.1.1.2 10.1.4.4 10.1.7.6 10.1.2.3 10.1.5.5 4 3 2 The LSA of router 10.1.1.1 is as follows: Link State ID: 10.1.1.1 = Router ID Advertising Router: 10.1.1.1 = Router ID Number of links: 3 = 2 links plus router itself Description of Link 1: Link ID = 10.1.1.2, Metric = 4 Description of Link 2: Link ID = 10.1.2.3, Metric = 3 Description of Link 3: Link ID = 10.1.1.1, Metric = 0

Network and Link State Database 10.1.1.0 / 24 .1 .2 10.1.1.1 10.1.4.0 / 24 10.1.2.0 / 24 .4 10.1.7.0 / 24 10.1.6.0 / 24 10.1.3.0 / 24 10.1.5.0/24 10.1.8.0 / 24 .3 .5 .6 10.1.1.2 10.1.4.4 10.1.7.6 10.1.2.3 10.1.5.5 Each router has a database which contains the LSAs from all other routers LS Type Link StateID Adv. Router Checksum LS SeqNo LS Age Router-LSA 10.1.1.1 10.1.1.1 0x9b47 0x80000006 Router-LSA 10.1.1.2 10.1.1.2 0x219e 0x80000007 1618 Router-LSA 10.1.2.3 10.1.2.3 0x6b53 0x80000003 1712 Router-LSA 10.1.4.4 10.1.4.4 0xe39a 0x8000003a 20 Router-LSA 10.1.5.5 10.1.5.5 0xd2a6 0x80000038 18 Router-LSA 10.1.7.6 10.1.7.6 0x05c3 0x80000005 1680

Link State Database The collection of all LSAs is called the link-state database Each router has an identical link-state database Useful for debugging: Each router has a complete description of the network If neighboring routers discover each other for the first time, they will exchange their link-state databases The link-state databases are synchronized using reliable flooding

OSPF Packet Format OSPF packets are not carried as UDP payload! OSPF has its own IP protocol number: 89 TTL: set to 1 (in most cases) Destination IP: neighbor’s IP address or 224.0.0.5 (ALLSPFRouters) or 224.0.0.6 (AllDRouters)

OSPF Packet Format 2: current version is OSPF V2 ID of the Area from which the packet originated Message types: 1: Hello (tests reachability) 2: Database description 3: Link Status request 4: Link state update 5: Link state acknowledgement 0: no authentication 1: Cleartext password 2: MD5 checksum (added to end packet) Standard IP checksum taken over entire packet Authentication passwd = 1: 64 cleartext password Authentication passwd = 2: 0x0000 (16 bits) KeyID (8 bits) Length of MD5 checksum (8 bits) Nondecreasing sequence number (32 bits) Prevents replay attacks

OSPF LSA Format LSA Header Link 1 Link 2

Discovery of Neighbors Routers multicasts OSPF Hello packets on all OSPF-enabled interfaces. If two routers share a link, they can become neighbors, and establish an adjacency After becoming a neighbor, routers exchange their link state databases Scenario: Router 10.1.10.2 restarts

Neighbor discovery and database synchronization Scenario: Router 10.1.10.2 restarts Discovery of adjacency After neighbors are discovered the nodes exchange their databases Sends database description. (description only contains LSA headers) Sends empty database description Database description of 10.1.10.2 Acknowledges receipt of description

Regular LSA exchanges 10.1.10.1 10.1.10.2 10.1.10.2 explicitly requests each LSA from 10.1.10.1 Link State Request packets, LSAs = Router-LSA, 10.1.10.1, Router-LSA, 10.1.10.2, Router-LSA, 10.1.10.3, Router-LSA, 10.1.10.4, Router-LSA, 10.1.10.5, Router-LSA, 10.1.10.6, 10.1.10.1 sends requested LSAs Link State Update Packet, LSAs = Router-LSA, 10.1.10.1, 0x80000006 Router-LSA, 10.1.10.2, 0x80000007 Router-LSA, 10.1.10.3, 0x80000003 Router-LSA, 10.1.10.4, 0x8000003a Router-LSA, 10.1.10.5, 0x80000038 Router-LSA, 10.1.10.6, 0x80000005

Routing Data Distribution ACK Routing Data Distribution LSA-Updates are distributed to all other routers via Reliable Flooding Example: Flooding of LSA from 10.10.10.1 10.1.1.1 10.1.2.2 10.1.3.4 10.1.7.6 10.1.1.2 10.1.4.5 LSA LSA ACK LSA ACK Update database Update database Update database ACK

Dissemination of LSA-Update A router sends and refloods LSA-Updates, whenever the topology or link cost changes. (If a received LSA does not contain new information, the router will not flood the packet) Exception: Infrequently (every 30 minutes), a router will flood LSAs even if there are not new changes. Acknowledgements of LSA-updates: explicit ACK, or implicit via reception of an LSA-Update Question: If a new node comes up, it could build the database from regular LSA-Updates (rather than exchange of database description). What role do the database description packets play?

Border Gateway protocol (BGP)

BGP BGP = Border Gateway Protocol . Currently in version 4, specified in RFC 1771. (~ 60 pages) Interdomain routing protocol for routing between autonomous systems Uses TCP to establish a BGP session and to send routing messages over the BGP session BGP is a path vector protocol. Routing messages in BGP contain complete routes. Network administrators can specify routing policies

BGP policy routing BGP’s goal is to find any path (not an optimal one). Since the internals of the AS are never revealed, finding an optimal path is not feasible. Network administrator sets BGP’s policies to determine the best path to reach a destination network.

BGP basics A route is defined as a unit of information that pairs a destination with the attributes of a path to that destination. EBGP session is a BGP session between two routers in different ASes. IBGP session is a BGP session between internal routers of an AS.

EBGP and IBGP R3 R2 R1 R4 R6 R5 R7 R8 128.195.0.0/16 0 128.195.0.0/16 0 R2 AS 1 R1 AS 0 R4 128.195.0.0/16 1 0 R6 R5 AS 2 R7 128.195.0.0/16 2 1 0 R8 AS 3 IBGP is organized into a full mesh topology, or IBGP sessions are relayed using a route reflector.

Commonly BGP attributes Origin: indicates how BGP learned about a particular route IGP EGP Incomplete AS path : When a route advertisement passes through an autonomous system, the AS number is added to an ordered list of AS numbers that the route advertisement has traversed Next hop Multi_Exit_Disc (MED, multiple exit discriminator): -used as a suggestion to an external AS regarding the preferred route into the AS Local_pref: is used to prefer an exit point from the local autonomous system Community: apply routing decisions to a group of destinations

BGP route selection process Routes sent to peers Routes recved from peers Best routes Decision process Input Policy Engine Out Policy Enigne Input/output engine may filter routes or manipulate their attributes

Best path selection algorithm If next hop is inaccessible, ignore routes Prefer the route with the largest local preference value. If local prefs are the same, prefer route with the shortest AS path If AS_path is the same, prefer route with lowest origin (IGP < EGP < incomplete) If origin is the same, prefer the route with lowest MED IF MEDs are the same, prefer EBGP paths to IBGP paths If all the above are the same, prefer the route that can be reached via the closest IGP neighbor. If the IGP costs are the same, prefer the router with lowest router id.

Summary Router architectures Dynamic routing protocols: RIP, OSPF, BGP RIP uses distance vector algorithm, and converges slow (the count-to-infinity problem) OSPF uses link state algorithm, and converges fast. But it is more complicated than RIP. Both RIP and OSPF finds lowest-cost path. BGP uses path vector algorithm, and its path selection algorithm is complicated, and is influenced by policies.