{"id":980,"date":"2024-06-10T20:12:21","date_gmt":"2024-06-10T20:12:21","guid":{"rendered":"https:\/\/www.spktechfit.com\/?p=980"},"modified":"2024-06-14T03:19:39","modified_gmt":"2024-06-14T03:19:39","slug":"11-ospfv2-single-area","status":"publish","type":"post","link":"https:\/\/www.spktechfit.com\/?p=980","title":{"rendered":"11. OSPFv2 Single Area"},"content":{"rendered":"<h2>OPFv2 Router ID and Messaging<\/h2>\n<p>OSPFv2 is the most popular option for corporations to route traffic within their networks.<\/p>\n<h3>OSPF Introduction<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-982 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.1.png\" alt=\"\" width=\"619\" height=\"354\" \/><\/p>\n<p>OSPF does not use UDP or TCP. OSPF advertisements are placed directly in an IP packet, therefore it does not have a TCP or UDP port number. It has IP protocol number 89.<\/p>\n<p><strong>NOTE: The IP protocol number is a number associated to that protocol that is in use in Layer 4. It is included as a field in the L3 header. The announcement in L3 helps network devices to be aware of the L4 protocol that is in use without decapsulating the packet. TCP uses protocol number 6 and UDP used protocol number 7.<\/strong><\/p>\n<h3>Router ID Overview and Selection Criteria<\/h3>\n<p>All OSFP routers require a unique Router Identifier (RID). This is a 32 bit IP address in dotted decimal notation. Routers send this ID in all their OSPF packets.\u00a0Routers can automatically assign their own RID or you can do it manually. Manual is recommended for ease of management and troubleshooting.<\/p>\n<p><strong>Process for assigning ID in AOS-CX:<\/strong><br \/>\n1. If you manually specify the RID then that is what it uses<br \/>\n2. If not, the loopback interface with the highest IP address becomes the RID<br \/>\nIf no loopback interfaces exist, the regular interface with the highest IP address becomes the RID. Non-functional interfaces in a down state are not considered.<\/p>\n<h3>Loopback Interface<\/h3>\n<p><a href=\"https:\/\/techhub.hpe.com\/eginfolib\/networking\/docs\/switches\/common\/15-18\/5998-8158_bog\/content\/ch06s03.html\" target=\"_blank\" rel=\"noopener\">https:\/\/techhub.hpe.com\/eginfolib\/networking\/docs\/switches\/common\/15-18\/5998-8158_bog\/content\/ch06s03.html<\/a><\/p>\n<p>By default, each switch has an internal loopback interface (<code class=\"command\">lo0<\/code>) with the IP address 127.0.0.1. This IP address is used only for internal traffic transmitted within the switch and is not used in packet headers in egress traffic sent to network devices.<\/p>\n<p><a id=\"v21259447\"><\/a>You can configure up to seven other loopback interfaces (<code class=\"command\">lo1<\/code>,\u00a0<code class=\"command\">lo2<\/code>,\u00a0<code class=\"command\">lo3<\/code>, and so on) on the switch to use to transmit network across the network. Each loopback interface can have multiple IP addresses. Routing protocols, such as RIP and OSPF, advertise the configured loopback addresses throughout a network or autonomous system.<\/p>\n<p><a id=\"v21259448\"><\/a>User-defined loopback addresses provide the following benefits:<\/p>\n<div class=\"itemizedlist\">\n<ul type=\"disc\">\n<li>A loopback interface is a virtual interface that is always up and reachable as long as at least one of the IP interfaces on the switch is operational. As a result, a loopback interface is useful for debugging tasks since its IP address can always be pinged if any other switch interface is up.<\/li>\n<li>You can use a loopback interface to establish a Telnet session, ping the switch, and access the switch through SNMP, SSH, and HTTP (WebAgent).<\/li>\n<li>A loopback IP address can be used by routing protocols. For example, you can configure the loopback IP address as the router ID used to identify the switch in an OSPF area. Because the loopback interface is always up, you ensure that the switch&#8217;s router ID remains constant and that the OSPF network is protected from changes caused by downed interface.<\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/p>\n<h3>OSPF General Operation Overview<\/h3>\n<h4>Phase 1: Build a neighbour Table<\/h4>\n<p>Directly connected OSPF neighbours introduce themselves to one another. They do this by sending OSPF Hello packets out each OSPF interface. If the parameters match the routers form an OSPF neighbour relationship.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-983 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.2.png\" alt=\"\" width=\"633\" height=\"238\" \/><\/p>\n<h4>Phase 2: Build a Topology database<\/h4>\n<p>The topology database is also called a link state database (LSDB). This is where routers share known subnets with other routers. The objective is to build a database of every single link (subnet), every single router, and how those routers and subnets are interconnected. They do this by sending multicast Link State Advertisements (LSAs).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-984 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.3.png\" alt=\"\" width=\"604\" height=\"292\" \/><\/p>\n<p>Once every router has received LSAs from every other router, the routers have a full topology database. Each router has an identical topology database.<\/p>\n<p><strong>NOTE: routers advertise the entire contents of their topology database to other routers. This includes what they have learned from other routers, not just what is directly connected to them.<\/strong><\/p>\n<h4>Phase 3: Build the OSPF Table<\/h4>\n<p>In this phase the router builds the best paths for each destination. It does this by running the SPF (Dijkstra) algorithm on the topology database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-985 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.4.png\" alt=\"\" width=\"637\" height=\"283\" \/><\/p>\n<h4>Phase 4: Build a routing Table<\/h4>\n<p>This phase publishes the best paths (discovered in Phase 3) to the routing table (FIB).<\/p>\n<p>&nbsp;<\/p>\n<h2>OSPFv2 Neighbours<\/h2>\n<p>Hello Messages<\/p>\n<ul>\n<li>Directly connected OSPF routers send hello packets to ensure 2 way communication and detect any failures<\/li>\n<li>By default these are sent every 10 seconds<\/li>\n<li>They are sent to multicast address 224.0.0.5, this is a reserved &#8220;attention all OSPF routers&#8221; multicast address<\/li>\n<\/ul>\n<p>Hello packets are used to build a neighbour table. Routers form a neighbour relationship if they are compatible. They must have the:<\/p>\n<ul>\n<li>Same subnet and subnet mask<\/li>\n<li>Same area and area type<\/li>\n<li>Same timers (e.g.: 10 seconds)<\/li>\n<li>Same authentication type<\/li>\n<\/ul>\n<p>To verify the hello interval you can use the command: <em><strong>sh IP OSPF neighbor detail<\/strong><\/em><\/p>\n<h3>OSPF Neighbour States<\/h3>\n<p>OSPF uses a Finite State Machine (FSM) to process neighbour state transitions between routers when certain conditions are satisfied. This is divided into 2 phases:<\/p>\n<p><strong> 1. Establish Neighbour Adjacencies<\/strong><\/p>\n<ul>\n<li>Both routers start in the DOWN neighbour state<\/li>\n<li>Core 1 goes to INIT state and sends the first Hello message<\/li>\n<li>Core 2 received the Hello message and response, indicating that the message as been seen and values are compatible. Core 2 goes to INIT state<\/li>\n<li>Core 1 receives the Hello message and goes to the 2-WAY state. It sends Hello message again but this time includes both Router IDs<\/li>\n<li>Core 2 receives this message and moves to the 2-WAY state<\/li>\n<\/ul>\n<p><strong> 2. Synchronise OSPF Database<\/strong><\/p>\n<p>In this example Core 1 and Core 2 are the only routers in the network so they continue to the database synchronisation process:<\/p>\n<ul>\n<li>Core 1 initiates the sync by sending a Database Description packet. It transits to the EXSTART neighbour state<\/li>\n<li>Core 2 sends a Database Description packet. It transits to the EXSTART neighbour state<\/li>\n<li>The goal of the EXSTART is to see which router will become the MASTER<\/li>\n<li>Core 2 sends another Database Description packet and moves to the EXCHANGE state. Core 2 is now sharing the contents of its LSDB<\/li>\n<li>Core 1 sends another Database Description packet and moves to the EXCHANGE state. Core 1 is now sharing the contents of its LSDB<\/li>\n<li>after several packets each router will have copy of the others LSDB<\/li>\n<li>Core 1 and Core 2 move to the FULL state when there is no more information to be exchanged<\/li>\n<\/ul>\n<p>You can verify the state by using the command <em><strong>show IP OSPF neighbors<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<h2>OSPFv2 Operations<\/h2>\n<h3>OSPF Network Types<\/h3>\n<p>2 options exist for network types<\/p>\n<ol>\n<li>Point to Point Networks: only 2 peers are on the link. Recommended to set to this if you only have 2 routers<\/li>\n<li>Broadcast networks: two ore more peers on the link. This is the default mode<\/li>\n<\/ol>\n<p>To verify the type of network use the command:\u00a0 <strong>show IP OSPF interface<\/strong><\/p>\n<h3>Broadcast Network Scalable Problem<\/h3>\n<p>In a large Broadcast Network type with lots of routers, the routers could be sending hundreds or thousands of routes for each OSPF peer. This could impact performance of the routers.<br \/>\nTo solve this scalability challenge, OSPF uses a Designated Router (DR) in the broadcast domain. This router maintains a full neighbour state of each device, however, the non-designated routers do not exchange database information with each other.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-986 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.5.png\" alt=\"\" width=\"618\" height=\"306\" \/><\/p>\n<p>To maintain high availability you can elect a Backup Designated Router (BDR) to avoid a single point of failure. This maintains a full database of each router but only advertises information when the primary DR is no longer available.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-987 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.6.png\" alt=\"\" width=\"630\" height=\"300\" \/><\/p>\n<p><strong>Designated Router Election<\/strong><br \/>\nDR and BDR is based on priority value assigned to an interface, the highest priority wins the election. In the case of a tie the router with the higher router ID becomes the DR.<\/p>\n<ul>\n<li>Priority values can be between 0-255<\/li>\n<li>Default value is 1<\/li>\n<li>0 means the router will not participate in router election<\/li>\n<\/ul>\n<p>To set the priority value:<br \/>\n<em><strong>Interface &lt;interface-id&gt;<\/strong><\/em><br \/>\n<em><strong>IP OSPF priority &lt;priory-value&gt;<\/strong><\/em><\/p>\n<p>To verify the priority value use the command:<br \/>\n<em><strong>Show IP OSPF interface<\/strong><\/em><br \/>\nOr<br \/>\n<em><strong>Show IP OSPF neighbors<\/strong><\/em><\/p>\n<h3>OSPF Area<\/h3>\n<p>In OSFP every router sends LSAa that advertise the entire contents of their LSDB to every other router. With hundreds of thousands of routers this can consume considerable bandwidth and the topology database can grow very large which consumes memory and CPU cycles on the routers.<br \/>\nTo fix this issue we split the network into Areas.<\/p>\n<p>An area is a group of OSPF routers that share the same Link State database. All routers must be part of an area.<\/p>\n<p>When you split a large network in separate areas it has the following advantages:<\/p>\n<ul>\n<li>Reduce LSDB size<\/li>\n<li>Lower CPU utilisation<\/li>\n<li>Increased overall network stability<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-988 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.7.png\" alt=\"\" width=\"615\" height=\"336\" \/><\/p>\n<p><strong>Normal Areas<\/strong><\/p>\n<p>In Figure 11-15, SW1 and SW2 are &#8220;Internal routers&#8221;. All their interfaces are in a single area. If they need to route outside their area they forward the packets to the Area Border Router (ABR). In this case the ABR is SW3. It has an interface in Area 10 and Area 0.<br \/>\nAll normal areas must connect to area 0 as they cannot communicate directly with other areas without going through area 0.<\/p>\n<p><strong>Backbone Areas<\/strong><\/p>\n<p>Routers with interfaces in Area 0 are called backbone routers. If routers only have an interface in area 0 (SW4,5,6) they are called &#8220;Internal Backbone Routers&#8221;.<br \/>\nYou assign interfaces to an area by assigning them to an area ID<br \/>\n<em><strong>This course focuses only on single-area designs in which all router interfaces are in Area 0.<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<h3>OSPF LSA Type 1<\/h3>\n<p>OSPF routers generate different types of Link State Advertisements (LSAs) each with a different purpose.<\/p>\n<p>Type 1 Overview:<\/p>\n<ul>\n<li>Router LSA<\/li>\n<li>All routers announce their existence and functional interfaces<\/li>\n<li>Generated by all routers in the area<\/li>\n<li>Scope: area wide<\/li>\n<li>Link Data depends on the Link Type<\/li>\n<\/ul>\n<p>LSA Type 1 are for routers to announce themselves. They say &#8220;Hi, I am RID 10.1.100.1, and I have 3 different interfaces that are functional and are participating in this area&#8221;.<\/p>\n<p><strong>Link Types<\/strong><\/p>\n<p><strong>Stub Link:<\/strong> used when OSPF is enabled on an interface and no OSPF neighbour exists on the interface. EG: loopback interface<br \/>\n<strong>Transit link:<\/strong> Used in a broadcast network with 2 or more OSPF neighbours<br \/>\n<strong>Point-to-Point link:<\/strong> Used in point-to-point networks, only one OSPF neighbour is expected on the link<\/p>\n<p>You can verify the link type information by using the command:<br \/>\n<em><strong>Show IP OSPF LSDB<\/strong><\/em><\/p>\n<p>The image shows an example output from this command for different link types:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-989 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.8.png\" alt=\"\" width=\"685\" height=\"352\" \/><\/p>\n<h3>Path Selection<\/h3>\n<p>After all routers have successfully exchanged LSAa, they all have an identical LSDB. Now the routers run the Shortest Path First (SPF) (Dijkstras algorithm) to find the best paths to each destination subnet. The best path is the one with the lowest cost, and the cost is based on bandwidth.<\/p>\n<p>Cost for each interface is calculated using the formula:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-995\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.14.png\" alt=\"\" width=\"220\" height=\"49\" \/><\/p>\n<p>AOS-CX uses a default reference value of 100000 Mbps.<\/p>\n<p><strong>Configuring Cost Value<\/strong><br \/>\nYou can modify the cost of an interface in two different ways:<br \/>\n1. Modifying the reference bandwidth. This applies to the entire OSPF process which means it will affect all interfaces. To do this:<br \/>\n<em><strong>conf<\/strong><\/em><br \/>\n<em><strong>router OSPF &lt;process id&gt;<\/strong><\/em><br \/>\n<em><strong>reference-bandwidth &lt;1-4000000&gt;<\/strong><\/em><br \/>\n2. Modifying the cost associated with a single interface:<br \/>\n<em><strong>conf<\/strong><\/em><br \/>\n<em><strong>interface &lt;interface id&gt;<\/strong><\/em><br \/>\n<em><strong>IP OSPF cost &lt;Cost value&gt;<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-991 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.10.png\" alt=\"\" width=\"583\" height=\"340\" \/><\/p>\n<h3>OSPF Convergence<\/h3>\n<p>There are 2 components to OSPF routing convergence:<\/p>\n<ol>\n<li><strong>Detect topology changes<\/strong><br \/>\nThis happens in 2 ways:<br \/>\n&#8211; a failure or change of status on the physical interface.<br \/>\n&#8211; a timeout of the OSPF hello timer. A neighbour is deemed dead if the wait time for the hello packet exceeds the dead timer. The default dead timer is four times the value of the hello timer. The default hello timer is 10 seconds.<\/li>\n<li><strong>Recalculate routes<\/strong><br \/>\nWhen a change is detected an LSA is sent to all routers in the OSPF area to signal the change. The routers then re-run the SPF algorithm to calculate their new best paths<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-992 aligncenter\" src=\"https:\/\/www.spktechfit.com\/wp-content\/uploads\/2024\/06\/11.11.png\" alt=\"\" width=\"685\" height=\"407\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Passive Interface<\/h3>\n<p>When an interface is set as passive it will not send or accept OSPF packets on that interface. This might be used for an interface that only connects to a subnet with hosts, not other routers.<br \/>\nTo set an interface as passive:<br \/>\n<em><strong>Conf<\/strong><\/em><br \/>\n<em><strong>Int &lt;interface-id&gt;<\/strong><\/em><br \/>\n<em><strong>IP ospf passive<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OPFv2 Router ID and Messaging OSPFv2 is the most popular option for corporations to route traffic within their networks. OSPF Introduction OSPF does not use UDP or TCP. OSPF advertisements are placed directly in an IP packet, therefore it does not have a TCP or UDP port number. It has IP protocol number 89. NOTE: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[17],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/posts\/980"}],"collection":[{"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=980"}],"version-history":[{"count":3,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/posts\/980\/revisions"}],"predecessor-version":[{"id":998,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=\/wp\/v2\/posts\/980\/revisions\/998"}],"wp:attachment":[{"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spktechfit.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}