Chapter 13 Routing Protocols RIP OSPF and BGP
Chapter 13 Routing Protocols (RIP, OSPF, and BGP) Prof. Choong Seon HONG Kyung Hee University 1
Introduction q An internet is a combination of networks connected by routers q A metric is a cost assigned for passing through a network. the total metric of a particular route is equal to the sum of the metrics of networks that comprise the router chooses the route with the shortest (smallest) metric q RIP (Routing Information Protocol) : treating each network equals. The cost of passing through each network is the same. l Kyung Hee University so if a packet passes through 10 networks to reach the destination, the total cost is hop counts. 2
Introduction q OSPF(Open Shortest Path First) allowing the administrator to assign a cost for passing through a network based on the type of service required. A route through a network can have different costs (metrics) q BGP (Border Router Protocol) Criterion is the policy, which can be set by the administrator. Policy defines what paths should be chosen. q Static and Dynamic tables q. Unicast Routing and Multicast Routing Kyung Hee University 3
13. 1 Interior and Exterior Routing q Because an internet can be so large, one routing protocol cannot handle the task of updating routing tables of all routers. q So, an internet is divided into autonomous systems. q An autonomous system (AS) is a group of networks and routers under the authority of a single administration. q Interior routing used for the routing inside an autonomous system q Exterior routing used for the routing between autonomous systems Kyung Hee University 4
Interior and Exterior Routing (Cont’d) q Popular routing protocols Kyung Hee University 5
Interior and Exterior Routing (Cont’d) q Autonomous systems Interior routing Kyung Hee University Exterior routing 6
13. 2 RIP (Routing Information Protocol) q is based on distance vector routing, which uses the Bellman-Ford algorithm for calculating the routing tables. q Distance Vector Routing each router periodically shares its knowledge about the entire internet with neighbors the operational principles of this algorithm 1. Sharing knowledge about the entire autonomous system 2. Sharing only with neighbors 3. Sharing at regular intervals (ex, every 30 seconds) Kyung Hee University 7
RIP (cont’d) q Routing Table Distance Vector Routing Table Kyung Hee University 8
RIP (cont’d) q The routing table is updated upon receipt of a RIP response message. 1. Replace entry in the routing table Kyung Hee University 9
RIP (cont’d) q Example of updating a routing table Kyung Hee University 10
RIP (cont’d) q Initializing the Routing Table When a router is added to a network, it initializes a routing table for itself using its configuration file. q Initial routing tables in a small autonomous system Kyung Hee University 11
RIP (cont’d) q Updating the Routing Table Final routing tables for the previous figure Kyung Hee University 12
RIP (cont’d) q RIP Message Format - Command : request (1) or response (2) Version Family : For TCP/IP the value is 2 Address : destination network address Distance : defining the hop count from the advertising router to the destination network * Part of the message (entry) is repeated for each destination network. Kyung Hee University 13
RIP (cont’d) q Requests and Response Request messages : sent by a router that has just come up or by a router that has some time-out entries. Kyung Hee University 14
RIP (cont’d) Response l solicited response – – l Kyung Hee University is sent only in answer to a request containing information about the destination specified in the corresponding request unsolicited response – is sent periodically, every 30 seconds – containing information covering the whole routing table 15
RIP (cont’d) q Example 1 What is the periodic response sent by router R 1 in Figure ? Assume R 1 knows about the whole autonomous system. Kyung Hee University 16
RIP (cont’d) q R 1 can advertise three networks 144. 2. 7. 0, 144. 2. 9. 0, and 144. 2. 12. 0. The periodic response (update packet) is shown in Figure Kyung Hee University 17
RIP (cont’d) q Timers in RIP Periodic timer : controlling the advertisements of regular update messages expiration timer : governing the validity of a route the garbage collection timer : advertising the failure of a route q Periodic timer controlling the advertising of regular update messages using random number between 25 to 35 seconds Kyung Hee University 18
RIP (cont’d) q Expiration timer In normal situation, the new update for a route occurs every 30 seconds But, if there is a problem on an Internet and no update is received within the allotted 180 seconds, the route is considered expired and the hop count of the route is set to 16. Each router has its own expiration timer. q Garbage Collection Timer When the information about a route becomes invalid, the router continues to advertise the route with a metric value of 16 and the garbage collection timer is set to 120 sec for that route When the count reaches zero, the route is purged from the table. Kyung Hee University 19
RIP (cont’d) q RIP timers Kyung Hee University 20
RIP (cont’d) Example 2 A routing table has 20 entries. It does not receive information about five routes for 200 seconds. How many timers are running at this time? The timers are listed below: Periodic timer: 1 Expiration timer: 20 - 5 = 15 Garbage collection timer: 5 Kyung Hee University 21
RIP (cont’d) q Slow convergence meaning that a change somewhere in the Internet propagates very slowly through the rest of the internet. For example, suppose there is a change in network 1. l Router R 1 updates itself immediately, since each router sends its periodic update every 30 seconds. It means an average of 15 seconds (range of 0 to 30 sec) R 1 Kyung Hee University R 2 22
RIP (cont’d) q Slow convergence (cont’d) One method to deal with RIP shortcoming is limiting the hop count to 15 An autonomous system using RIP is limited to a diameter of 15; l Kyung Hee University preventing data packets from wandering around forever 23
RIP (cont’d) q Instability happening when a packet could go from one router to another in a loop When access to Net 1 fails Think of back-door accessing Back and forth updating Kyung Hee University 24
RIP (cont’d) q Some Remedies for Instability Triggered Update : springing into action immediately by sending out router’s new table Split Horizons Kyung Hee University 25
RIP (cont’d) Poison Reverse : a variation of split horizons Kyung Hee University 26
RIP Version 2 q Designed for overcoming some of the shortcomings of version 1 q Replaced fields in version 1 that were filled with 0 s for the TCP/IP protocols with some new fields Kyung Hee University 27
RIP Version 2 (cont’d) q RIP version 2 format Route Tag : carrying information such as the autonomous system number Subnet mask : carrying the subnet mask Next-hop address : showing the next hop l Kyung Hee University In case that shares a network backbone by two ASs, the message can define the router to which the packet should go next 28
RIP Version 2 (cont’d) q Authentication added to protect the message against unauthorized advertisement Value of FFFF 16 is entered in the family field Kyung Hee University 29
RIP Version 2 (cont’d) q Multicasting Using the multicast address 224. 0. 0. 9 to multicast RIP messages only to RIP routers in the network q Encapsulation of RIP messages encapsulated in UDP user datagram not included a field that indicates the length of the message Well-known port assigned to RIP in UDP is port 520 Kyung Hee University 30
OSPF (Open Shortest Path First) q An interior routing protocol q Dividing an AS into areas to handle routing efficiently and in a timely manner Kyung Hee University 31
OSPF (cont’d) q Areas Is a collection of networks, hosts, and routers in AS AS can be divided into many different areas. All networks inside an area must be connected. Routers inside an area flood the area with routing information. q Area Border Router Summarizes the information about the area and sends it to other areas q Backbone All of the areas inside an AS must be connected to the backbone Serving as a primary area Consisting of backbone routers Back bone routers can be an area border router Kyung Hee University 32
OSPF (cont’d) q Areas in an AS Kyung Hee University 33
OSPF (cont’d) q Metric OSPF protocol allows the administrator to assign a cost, called the metric, to each route Based on a type of service (minimum delay, maximum throughput, and so on) A router can have multiple routing tables, each based on a different type of service. q Link State Routing OSPF uses Link State Routing to update the routing tables in an area Each router shares its knowledge about its neighborhood with every router in the area. Kyung Hee University 34
OSPF (cont’d) 1. Sharing knowledge about the neighborhood 2. Sharing with every other router by flooding 3. Sharing when there is a change cf. Distance Vector Routing : sending the information at regular intervals regardless of change q So, every router can calculate the shortest path between itself and each network Kyung Hee University 35
OSPF (cont’d) q Types of Links In OSPF terminology, a network is called a link. Kyung Hee University 36
OSPF (cont’d) q Point-to-point Link Routers are represented by nodes and the link is represented by a bidirectional edge connecting the nodes. Each router has only one neighbor at the other side of the link. Kyung Hee University 37
OSPF (cont’d) q Transient Link a network with several routers attached to transient Link (network) Kyung Hee University 38
OSPF (cont’d) q In “C”, each router has only one neighbor, the designated router (network) The designated router has five neighbors. Number of neighbor announcements is reduced from 20 to 10 There is no metric from the designated router to any other node. l Kyung Hee University Because the designated router represents the network. 39
OSPF (cont’d) q Stub Link is a network that is connected to only one router is a special case of transient network The link is only one-directional, from the router to the network. Kyung Hee University 40
OSPF (cont’d) q Virtual Link When the link between two routers is broken, the administration may create a virtual link between them using a longer path q Graphical Representation An internet with 7 networks Kyung Hee University 41
OSPF (cont’d) q Graphical Representation (cont’d) having 3 stubs using square nodes for the routers and ovals for the networks Kyung Hee University 42
OSPF (cont’d) q Link State Advertisements to share information about neighbors, each router distributes link state advertisements (LSAs) Kyung Hee University 43
OSPF (cont’d) q Router Link defining the links of a true router A true router uses the advertisement to announce information about all of its links and what is at the other side of the link (neighbors) Kyung Hee University 44
OSPF (cont’d) q Network Link defines the links of a network A designated router distributes this type of LSA packet. The packet announces the existence of all of the routers connected to the network. Kyung Hee University 45
OSPF (cont’d) q Summary Link to Network An border router is active in more than one area and creates routing table for each area. Router R 1 floods area 1 with information about how to reach a network located in area 0. Kyung Hee University 46
OSPF (cont’d) q Summary Link to AS Boundary Router providing the information of the route to an autonomous boundary router used for a router that sends a packet outside the autonomous system Kyung Hee University 47
OSPF (cont’d) q External Link used to know which networks are available outside the autonomous system Kyung Hee University 48
OSPF (cont’d) q Link State Database Every router in an area receives the router link and network link LSAs from every other router and forms database Kyung Hee University 49
OSPF (cont’d) q Dijkstra Algorithm calculating the shortest path between two points on a network using a graph made up of nodes and edges Kyung Hee University 50
OSPF (cont’d) q. Dijkstra Algorithm Kyung Hee University 51
OSPF (cont’d) q Dijkstra Algorithm (cont’d) Kyung Hee University 52
OSPF (cont’d) q. Dijkstra Algorithm (cont’d) Kyung Hee University 53
OSPF (cont’d) q Routing Table Each router uses the shortest path tree method to construct its routing table Showing the cost of reaching each network in the area To find the cost of reaching networks outside of the area, the routers use the summary link to network, the summary link to boundary router, and the external link advertisements. Kyung Hee University 54
OSPF (cont’d) q Link state routing table for router A Kyung Hee University 55
OSPF (cont’d) q Types of OSPF Packets Kyung Hee University 56
OSPF (cont’d) q Packet Format Message length Type Version Source router IP address Area ID Checksum Authentication type Authentication ( carrying password, etc) - authentication type : 0 for none, 1 for password - packet type : five types Kyung Hee University 57
OSPF (cont’d) q Hello Message used for creating neighborhood relationships and to test the reachability of neighbors before flooding information q Database Description Message used when a router is connected to the system for the first time or after a failure l l After a router is connected to the system, the router sends hello packets to greet its neighbor. If it is first time that neighbors hear from the router, they send a database description packet – l Kyung Hee University The packet does not contain complete database information Then, the router sends one or more link state request packets to get full information about that particular link 58
OSPF (cont’d) q Link State Request Packet a packet that is sent by a router that needs information about a specific route or routers q Link State Update Packet used by a router to advertise the states of its links q Link State Acknowledgment Packet OSPF makes more reliable by forcing every router to acknowledge the receipt of every link state update packet q Encapsulation OSPF packets are encapsulated in IP datagram l Kyung Hee University Do not need a transport layer protocol to provide these services 59
13. 4 BGP q is inter-autonomous system routing protocol q based on a routing method called path vector routing q distance vector routing and link state routing distance vector routing : just considering the number of hops link state routing : requiring each router to have a huge link state database q Path Vector Routing Each entry in the routing table contains the destination network, the next router, and the path to reach the destination The path is usually defined as an ordered list of autonomous systems that a packet should travel through to reach the destination Kyung Hee University 60
BGP (cont’d) q Path vector routing table Kyung Hee University 61
BGP (cont’d) q Path Vector Messages The autonomous boundary routers that participate in path vector routing advertise the reachability of the networks in their own autonomous systems to neighbor autonomous boundary routers An autonomous boundary router receives its information from an interior routing algorithm such as RIP or OSPF Each router that receives a path vector message verifies that the advertised path is in agreement with its policy. l Kyung Hee University Then, the router updates its routing table and modifies the message before sending it to the next neighbor. 62
BGP (cont’d) q Path vector packets Kyung Hee University 63
BGP (cont’d) q Policy Routing If one of the autonomous systems listed in the path is against its policy, it can ignore that path and that destination l so, path vector routing are not based on the smallest hop count or the minimum metric; it is based on the policy imposed on the router by the administration q Path Attributes Divided into two broad categories; well-known and optional attributes l l l Kyung Hee University Each attribute gives some information about the path. Well-known attribute is one that every BGP router should recognize. Optional attribute is one that need not be recognized by every router. 64
BGP (cont’d) q Well-known attributes Mandatory l ORIGIN (RIP, OSPF, and so on), AS_PATH, NEXT-HOP discretionary l It must be recognized by each router, but is not required to be included in every update message. q Optional attributes transitive attribute l must be passed to the next router by the router that has not implemented this attribute nontransitive attribute Kyung Hee University l should be discarded if the receiving router has not implemented it 65
BGP (cont’d) q Types of Packets q Packet Format (common header) Reserved for authentication Total message including the header Kyung Hee University 66
BGP (cont’d) q Open message To create a neighborhood relationship, a router running BGP opens a TCP connection with a neighbor and sends an open message q Update message used by a router to withdraw destinations that have been advertised previously, announce a route to a new destination, or both q Keepalive message exchange keepalive messages regularly (before their hold time expires) to tell each other that routers are alive q Notification message sent by a router whenever an error condition is detected or a router wants to close the connection Kyung Hee University 67
BGP (cont’d) q Encapsulation BGP messages are encapsulated in TCP segments using the well-known port 179 Kyung Hee University 68
13. 5 Multicast Routing q DVMRP (Distance Vector Multicast Routing Protocol) used in conjunction with IGMP to handle multicast routing is a simple protocol based on distance vector routing and the idea of MBONE. q MOSPF (Multicast Open Shortest Path First) An extension of the OSPF protocol added a new type of the packet called the group membership packet to the list of link state advertisement packet uses the configuration of MBONE and islands Each island uses one multicast router that is connected through tunnels to multicast routers in other islands. Kyung Hee University 69
- Slides: 69