OSPF Operation - Learn about Open Shortest Path First (OSPF) Protocol PDF
Document Details

Uploaded by HappierStar
TU Dublin
Keith Smyth
Tags
Summary
This document focuses on OSPF operation for industrial networks. It explains key concepts like autonomous systems, dynamic routing protocols, and routing tables in the context of OSPF and is likely intended for individuals studying for a networking certification. OSPF uses link state protocols and employs a Shortest Path First algorithm, to determine the best paths.
Full Transcript
OSPF operation Industrial Networks II OSPF DOES NOT Keith Smyth TAIE In TO...
OSPF operation Industrial Networks II OSPF DOES NOT Keith Smyth TAIE In TO CONSIDERATION CONGESTION ON Very good YouTube videos on OSPF: OSPF Explained | Step by Step by CertBros THE NETWORK OSPF multi area by CertBros OSPF seven stages by Sikandar Shaik Free CCNA | OSPF Part 1 | Day 26 by Jeremy’s IT Lab What is an autonomous system? AS DO NOT NEED TO BE GEOGRAPHICAL The Internet is a network of networks, and autonomous systems are the big networks that make up the Internet. More specifically, an autonomous system (AS) is a large network or group of networks that has a unified routing policy. Every computer or device that connects to the Internet is connected to an AS Typically, each AS is operated by a single large organization, such as an Internet service provider (ISP), a large enterprise technology company, a university, or a government agency. AS 4315 - Google Irl AS15751- Meteor Mobile Communications Ltd. AS15502 - Vodafone Ireland Limited What is an autonomous system? Each autonomous system is assigned a globally unique number called an Autonomous System Number (ASN). The number serves as an identifier for the AS and is used when exchanging routing information with other autonomous systems. ASNs are available in both 16-bit and 32-bit format, although ASNs issued before 2007 were all 16-bit. Autonomous System Number The Irish government have several ASN’s AS15805 AS24675 etc Each autonomous system is assigned a globally unique number called an Autonomous System Number (ASN). The number serves as an identifier for the AS and is used when exchanging routing information with other autonomous systems. ASNs are available in both 16-bit and 32-bit format, although ASNs issued before 2007 were all 16-bit. Types of dynamic routing protocols DISTANCE - HOP Count VECTOR : DIRECTION GATE PROTOCOL = BOARDER OBSOLETE OBSOLETE Types of dynamic routing protocols INTERIOR GATEWAY PROTOCOL EXTERNAL GATEWAY PROTOCOL ↳ ALL ISP's use BGP Open Shortest Path First (OSPF) OSPF stands for Open shortest Path First  Open standard protocol  It is a link State protocol  > - INTERESTEDIn THEDANDWIDTH It uses a Shortest Path First (SPF) algorithm (Dijkistra algorithm)  Metric is cost (reference BW [100Mb/s] / interface BW) NEED  To know TMIS Administrative distance is 110  ↳ CHANGE REFERENCE Bu TO 1 GB/S ↳ Higher the By ANYS It is a classless routing algorithm  THE LOWERTHE It supports equal cost load balancing * EXAM Q Supports  COST 4(D) to 16 Introduces the concept of Area’s (reduce the amount of Link State  Advertisements [LSA’s]  All routers have the same information ↳ LSA > - : IDENTIAL ON EVERY ROUTER  Updates are sent using 224.0.0.5 ↳ MULTICAST Exam Open Shortest Path First L MAKE THE A DR ROUTER - (OSPF) BDR RECOME Become Neighbours – Routers running OSPF on the same segment form neighbour relationships. DR = Designated Route [PtP segment – Master/Slave, Broadcast segment - DR/BDR/Drother.] BDR/ - = Backup DR ↳ 1x EACH ROCTER I EVERY OTHER Exchange database information – the neighbour routers A DROTHER exchange their LSDB data with each other using LSA’s. Choose the best routes – each router adds the best routes to its routing table based on the results of running the SPF algorithm on the LSDB. LSA > LINC STATE ADVERTISEMENT LSDB =S LING STATE DATABASE Open Shortest Path First (OSPF) OSPF operates in 7 stages  Down (No info has been exchanged or retained)  Init (A hello packet has been received, but hasn’t gone to two way yet) )  Two way (establishment of a bidirectional conversation between two routers)  Exstart (first step of adjacency, decide on Master Slave) DP/BDP/BROTHER +  Exchange (exchange LSDB’s ) > - use LSA's  Loading (requests the most recent link-state advertisements (LSA’s) from its neighbour)  Full (when the routers are fully adjacent, and the state appears in all router- and network-LSA’s) o NEED TO know OSPF – Process ID Foc EXAM * Command - Carlow (config)#router ospf↑100 The router ospf process-id command is the beginning of any Cisco IOS OSPF configuration (16 bit value 1 - 65,535). It is used to create or modify an existing OSPF routing process and enters the user into OSPF router configuration mode. Process ID – allows a router to run multiple instances of OSPF. (e.g. router connecting to 3 different customers) These OSPF process IDs are only locally significant and do not have to match from one OSPF device to another NOT An IPrH ADDRESS BUT OSPF – Router ID (RID) IS IN THE FORM OF AN 1Pr4 ADDRESS. Command - Carlow(config)#router ospf 100 PROCESS > - ID r Carlow(config-router)#router-id 10.10.10.10 ROUTER > - ID The router-id command is used to statically configure the OSPF router-id; this router-id (RID) is used to identify the OSPF device to the other devices in the OSPF network. This router-id must be unique for each OSPF device; without the configuration of the NEET TO ↳ router-id, it will be selected based on the following order: highest KNOW loopback interface, highest active (up/up) physical interface. The configuration of either a loopback interface or the use of the router-id command is very common in OSPF implementations as it makes the identification of specific OSPF devices easier. FORGET OSPF – Router priority DON'T IT IS PER INTERFACE I Command - Carlow(config)#interface g0/0/0 Carlow(config-if)#ip ospf priority 10 In multi-access networks the router with the highest priority value is chosen as the DR which acts as the central point of LSAs exchange. The priority command is assigned on an interface. ↳ NOTE NEED TO Default priority for an OSPF interface is 1. The range is from 0 to know 255. 0 means that the interface does not get involved in the DR election. - The router with the highest OSPF priority will become a DR. By default, all routers have a priority of 1. If there is a tie, a router with the highest router ID wins the election. The router with the second highest OSPF priority or router ID will become a BDR. ROUTERS WITHIN An OSPF – AREA ID AcEf HAVE INFORMATION. IDENTICAL WILD CARD must nee Command - Carlow(config)#router ospf 100 MASK * Carlow(config-router)#network 192.168.10.0 0.0.0.255 area - 0 In OSPF, a single autonomous system (AS) can be divided into smaller groups called areas. This reduces the number of link-state advertisements (LSAs) and other OSPF overhead traffic sent on the network, and it reduces the size of the topology database that each router must maintain. Open Shortest Path First (OSPF) OSPF Tables Neighbor table (spelling)  Also known as the adjacency database  Contains a list of directly connected routers. * Carlow# sh ip ospf neighbor * Database table  Link State Database (LSDB)  Contains information about all the possible routes to the networks within the area Carlow# sh ip ospf database Routing Table  Contains a list of best paths to each destination Carlow# sh ip route Adjusting the reference bandwidth The auto-cost reference-bandwidth command allows you to change the reference bandwidth that OSPF uses to calculate its metrics: To adjust the reference bandwidth, use the auto-cost reference- bandwidth Mb/s router ⑧ configuration command. This command must be configured on Now Fast Ethernet interfaces every router in the OSPF domain. will have a cost of 10 You can also adjust the OSPF cost of a single interface with the ip ospf cost configuration command: Hello message content The hello and dead interval values can be different depending on the OSPF network type. On Ethernet interfaces you will see a 10 second hello interval and a 40 second dead interval by default. Hello message content Other Router ID > - HOW ROOTERS TACK TO EACH Hello & Dead interval timers * > - SAME ON BOTH ENDS Area ID * > - SAME On BOTH END DR Router Priority Highest > - = DR (IP Add) => Must BE The Same BDR (IP Add) > - 4 AspeCTY Authentication * > - A = AREA ID Password * > - P = Dasswor AUTHENTICATION Stub area flag * > = - A 3 AREA FLAC = STUB * = (must match at both ends) Becoming neighbors Adjacency state machine Each OSPF router within a network communicates with other neighbouring routers on each connecting interface to establish the states of all adjacencies. Every such communication sequence is a separate conversation identified by the pair of router IDs of the communicating neighbours. 1. Down: The state down represents the initial state of a conversation when no information has been exchanged and retained between routers with the Hello Protocol. 2. Init: The Init state indicates that a HELLO packet has been received from a neighbor, but the router has not established a two-way conversation. 3. 2-Way: The 2-Way state indicates the establishment of a bidirectional conversation between two routers. This state immediately precedes the establishment of adjacency. This is the lowest state of a router that may be considered as a Designated Router. 4. ExStart: The ExStart state is the first step of adjacency of two routers. 5. Exchange: In the Exchange state, a router is sending its link-state database information to the adjacent neighbor. At this state, a router is able to exchange all OSPF routing protocol packets. 6. Loading: In the Loading state, a router requests the most recent link-state advertisements (LSAs) from its neighbor discovered in the previous state. 7. Full: The Full state concludes the conversation when the routers are fully adjacent, and the state appears in all router- and network-LSAs. The link state databases of the neighbors are fully synchronized. Becoming neighbours In the form of an IPv4 address Becoming neighbours no NEIGHBOURS & Becoming neighbours Requirements that must be met to form neighbour relationships Note: Most common reasons why routers cant form adjacencies - Hello timer Default is 10 sec. Dead interval default is 40 sec Becoming neighbours R2 moves to init state and sends its own hello message to R1 Becoming neighbours When R1 receives the hello message it sees itself as a known neighbour and moves to the 2 way state R1 sends another hello message listing R2 as a known neighbour Becoming neighbours When R2 receives the hello message and sees itself listed as a neighbour it now moves to the two way state also DR’s and BDR’s are not elected on PtP links Becoming neighbours Multiple routers connected on the same segment. All routers ignore updates unless they come from the DR Election based on highest OSPF priority Priority is set to 1 by default If the priorities are equal then election is based on highest router ID When on the same segment routers will only become full neighbours with DR’s and BDR’s. This minimises traffic, when a change occurs, if a link goes down on a router, that router will flood updates. All non-designated routers will ignore the update. Each router forms a full relationship (neighbour state) with the Designated and Backup Designated Routers. Non-DR and Non-BDR’s on the other hand, form the 2-way neighbour state. This means that they both send/receive each other's HELLO’s, but no routing updates are exchanged between each other. DROTHERS ONLY SEND HELLO MESSAGES Becoming neighbours PtP link In the previous slide both routers had moved to the 2-way state. The routers now prepare to exchange information about their LSBD’s. Must choose which router will initiate the exchange. This is done in the exstart state Exstart State Elect a master and slave based on the router ID The router with the higher RID will become the master and will control the sequence numbers and start the process Exchange state Next we move to the Exchange state, both routers send each other a list of their LSA’s this is called a database description (DBD) Exchange database information Exchange database information Loading state Next we move to the Loading state, Each router will examine the Data Base Description (DBD’s) and request any information it doesn't already have. This prevents loops by requiring the routers to request the information rather than just sending updates. Exchange database information R1 sees that R2 has the LSA for 192.168.3.0/24 R1 requests that LSA in a Link State Request (LSR) Exchange database information R1 sees that R2 has the LSA for 192.168.3.0/24 R1 requests that LSA in a Link State Request (LSR) R2 replies with a Link State Update (LSU) Exchange database information R1 sees that R2 has the LSA for 192.168.3.0/24 R1 requests that LSA in a Link State Request (LSR). R2 replies with a Link State Update (LSU) R1 replies with a Link State Ack Exchange database information The process repeats for router 2. R2 sends a LSR for the subnet 192.168.1.0 Exchange database information Once the exchange of LSA’s takes place, both routers enter the Full neighbour state On a broadcast network, like we saw earlier, a router will only form a neighbour relationship with the DR and the BDR Adding the best routes to the routing table The final Step Any interface operating faster than 100Mb/s will still have a cost of 1 You should change the reference bandwidth R1 wants to get to the 10.0.0.0 Network COST iS CALCULATED OUT THE INTERFACE DON'T FORGET E THE LAST LOS T OSPF Neighbors – Full state In the full state, the routers have full OSPF adjacency and identical LSDB’s. They will continue to send and listen for Hello packets (every 10 seconds by default on an Ethernet interface, 30 sec on serial links) to maintain the neighbour adjacency LOT BANDL ITh Every time a hello packet is received the dead timer (40 seconds by default) is reset back to 40 sec. If the Dead timer counts down to 0 and NO Hello message is received, the neighbour is removed. The routers will continue to send LSA’s as the network changes to ensure each router has a complete and accurate map of the network (LSDB) OSPF Neighbors – Full state Carlow#sh ip ospf int brief Carlow#sh ip ospf neighbors t Tell me about me Tell me about my neighbors * Neighbor relationship on a serial link 8 Priority= Same A RID = NiL Highest Interface = 20. 0. 8. Neighbor relationship on a serial link MASTER IS THE HIGHEST RID Master / Slave Dead timer counts down from 40, resets after it receives a new Hello message OSPF Neighbors – Full state Example of configuration (Broadcast network) Example of configuration Router 4# Route 4r#conf t Enter configuration commands, one per line. End with CNTL/Z. Router 4(config)#router ospf 100 Router 4(config-router)#router-id 4.4.4.4 Router 4 (config-router)#network 50.0.0.0 0.255.255.255 area 0 Router 4(config-router)#network 40.0.0.0 0.255.255.255 area 0 00:22:24: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done 00:22:24: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on GigabitEthernet0/0 from LOADING to FULL, Loading Done From Router 1’s perspective From Router 2’s perspective From Router 3’s perspective This is the BDR From Router 4’s perspective This is the DR Graphics taken from - Free CCNA | OSPF OSPF Areas Part 1 | Day 26 | CCNA 200-301 Complete Course This video from Jeremy’s IT Lab is well Large OSPF network (one area) worth viewing Area 0 OSPF Areas OSPF uses areas to divide up the network Small networks can be single area without any negative effects on performance (20 routers max. depends on organisation) In larger networks, a single-area design can have negative effects The SPF algorithm takes more time to calculate The SPF algorithm uses a lot more processing power on each router The larger LSDB takes up more memory on the routers The routing table will be huge, router may have to search through hundreds of entries Any small change in the network, causes every router to flood LSA’s and run the SPF algorithm again. i.e. adding a new interface to a router, cable plugged in, cable plugged out, etc. By dividing a large OSPF network into smaller areas, these negative effects can be avoided or at least minimised. OSPF Areas Large OSPF network (broken into 4 areas) OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers OSPF Areas Internal Routers Routers with all interfaces in the same area are called internal routers OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers Routers with interfaces in multiple areas are called Area Border Routers (ABRs) OSPF Areas Area Border Router (ABR) Routers with interfaces in multiple areas are called Area Border Routers (ABRs) OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers Routers with interfaces in multiple areas are called Area Border Routers (ABRs) Routers connected to the backbone are called Backbone routers OSPF Areas Backbone routers Routers connected to the backbone are called Backbone routers Area border router & Internal router & Backbone router Backbone router OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers Routers with interfaces in multiple areas are called Area Border Routers (ABRs) Routers connected to the backbone are called Backbone routers An intra-area route is a route to a destination inside the same OSPF area OSPF Areas intra-area route An intra-area route is a route to a destination inside the same OSPF area The destination subnet is in the same area as the router OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers Routers with interfaces in multiple areas are called Area Border Routers (ABRs) Routers connected to the backbone are called Backbone routers An intra-area route is a route to a destination inside the same OSPF area An interarea route is a route to a destination in a different OSPF area OSPF Areas interarea route An interarea route is a route to a destination in a different OSPF area The destination subnet is in a different area to the router OSPF Areas Naming conventions when using areas An area is a set of routers and links that share the same LSDB (our network has 4 areas, each area maintains a unique LSDB The Backbone area (area 0) is an area that all other areas must connect to. Routers with all interfaces in the same area are called internal routers Routers with interfaces in multiple areas are called Area Border Routers (ABRs) Routers connected to the backbone are called Backbone routers An intra-area route is a route to a destination inside the same OSPF area An interarea route is a route to a destination in a different OSPF area A router with links outside the OSPF routing domain is called an autonomous system boundary router (ASBR). OSPF Areas Autonomous system boundary router (ASBR) A router with links outside the OSPF routing domain is called an autonomous system boundary router (ASBR).