Wednesday, February 8, 2023

Open Shortest Path First (OSPF) Protocol

OSPF – Link State Routing Protocol
Link – Router Interface
State - Description of an interface and its relationship to neighboring routers

Overview of OSPF

  • OSPF is a link state routing protocol and will flood link state advertisement (LSA) throughout the network or area describing firstly link attached router, in other word routing interfaces and state of those link.
  • State meaning description of an interface and its relationship to the neighboring routers (is the interface up/down, and description will include for example IP address of the interface, the subnet mask, the top of network to which its connected, and the router that are connected to that network).
  • Collection of all these link state form topological database or link state database.
  • Router form neighbor relationship by sending out hello messages using either multicast address 224.0.0.5 or unicast.
  • LSA once again are flooded throughout the network or area, and link state database is created from these LSA.
  • OSPF is an open standard hence vendor neutral. It uses the Dijkstra’s shortest Path First Algorithm to choose the best route toward each destination.

  • Resides directly on top of IP
  • Does not use TCP or UDP (To transport or update any information)
  • Its reference under IP header with Protocol ID 89.
  • TCP is reference for protocol ID 6, and UDP Protocol ID 17, and thus some would debate that OSPF resides at Layer 4, but we can say that OSPF resides at Layer 3, directly on top of IP.
  • Router send LSA to advertise the state of the link when state changes or periodically.
  • By default, every 30 mins the databases will be synchronized with the state of the links.

 *Fun Fact – Dijkstra’s Shortest Path First Algorithm is also used in Map/GPS applications like Google Maps.

OSPF Tables

  • OSPF routers form neighbor relationships, and the list of neighbors is stored in the adjacency table or OSPF neighbor table
show ip ospf neighbors” – will show the OSPF adjacent neighbor
  • OSPF uses multicast addresses 224.0.0.5 and 224.0.0.6 which are link local multicast.
  • In other words, those multicasts cannot hop across a router, and routers have to be directly connected.
  • OSPF will install all routes learned in the OSPF topology database or link state database.
  • The link state database contains all routers and attached links in the area/network.
  • All OSPF routers in the same area share the same databases.
  • Best routes are then put into the routing table, also known as the forwarding table.

 OSPF PACKET TYPES

Hello – Type 1

  • Used to dynamically discover neighbors, and to form neighbor relationships and maintain those neighbor relationship.
  • Default Interval
10 secs on broadcast segments (Ethernet)
30 secs on non-broadcast segments (Serial NBMA)
  • Dead Timer:
4 times the hello interval by default

Database Description – Type 2

  • Used to exchange brief versions of each linked state advertisement.
  • When an initial relationship is formed between two OSPF routers, they will exchange database descriptions, giving each other an overview of what the database contains.

It Include

  • Interface MTU (2-Bytes): MTU value of the ongoing interface. For Virtual links, the field is set to 0x000
  • Options (1-Bytes): The local router advertises its capabilities in this field
  • I-Initial Bit (1-Bit): Indicates this is the first in the series of DBD packets
  • M-More Bit (1-Bit): Indicates whether the DBD packet is the last in the series of packets. Last packet has a value of 0, while all previous packet has value of 1
  • DD Sequence Number (4-Bytes): Used to sequence the collection of DBD packets
  • LSA Header (Variable Length): It describe the local router’s database

Link State Request – Type 3: 

  • If parts of the database are missing on one router, it will send a link state request requesting full LSA information from the neighboring router.

It include

  • LS Type (4-Bytes): Type of LSA requested
  • Link State ID (4-Bytes): Depends upon the type of LSA
  • Advertising Router (4-Bytes): Router ID of the requesting router

Link State Update – Type 4:

  • The neighboring router will send what's called a link state update, which is a packet that contains links state advertisements and as mentioned, is typically sent in response to a link state request.
  • This contains detailed information about the link state database rather than just an overview of it which was contained in the database description.

  • Each LSA comprises routing, metric, and Topology data to define a serving of OSPF network.
  • The local router presents LSA within an LSU packet to its neighboring routers.
  • In addition, the local router promotes the LSU packet with data in reply to an LSR packet.

Link State Acknowledgement – Type 5:

  • Links state acknowledgments acknowledge or confirm receipt of a link state update message.
  • OSPF needs acknowledgement for delivery of each LSA.
  • Multiple LSAs can be approved in a single LSAck packet

Note: Point to remember for OSPF Neighborship
To Bring OSPF neighborship up, following field should be matched:
Hello Interval, Dead Interval, Area ID, Network Mask, Option Field and Authentication, if any
Neighborship will not form via secondary address. Other words, router will not generate hello packet with SRC IP – secondary IP.

"Options field" in OSPF Hello , DBD and every LSA:
DN - Used in MPLS VPN to detect loop
O - Set to indicate routers' opaque LSA support
DC - OSPF over Demand circuit
EA - External attribute support
N/P Bit:
N bit in Hello: Set to indicate for NSSA external LSAs. Mismatch will not bring adjacency.
P bit in NSSA External LSA header: to inform ABR to translate T-7 to T-5 LSAs
MC - set to indicate multicast ospf capability
E bit = 0 to indicate stub area

MT - set to indicate Multi-topology OSPF support. Under development

OSPF Hierarchy

  • Autonomous system is a grouping of routers under a common administrative domain.
  • OSPF is an IGP or Interior Gateway protocol.
  • In other words, it's used within an autonomous system.
  • So, within your organization you may have multiple routers running OSPF within the same autonomous system.
  • OSPF Networks are broken up into areas.
  • Now there's debate about this, but Cisco would recommend never more than 50 routers within a single OSPF area.
  • OSPF uses a hierarchical model in that you always have OSPF Area 0.
  • When you have more than one area, it is possible to run OSPF in another area, let's say Area 1.
  • But that's only true if you have a single area.
  • If you've got multiple areas, you have to have Area 0, which is known as the Backbone Area.
  • All traffic from one area, let's say Area 1 to another area, let's say Area 2 will traverse the backbone area.
  • So, what you do is you break up your network into multiple areas following the physical topology with the view to optimize summarization and reduce routine table updates and link state advertisements.
  • Certain types of LSA can be contained within an area, so the flooding of LSAs throughout the network is stopped by breaking up the network into multiple areas.
  • Routers that border the backbone area and another area are known as Area Border Router (ABR).
  • One of the advantages of ABR is that they allow for summarization of routes.
  • Router that borders two autonomous systems is known as Autonomous System Border Router (ASBR).
  • In above case, we've got RIP on the left-hand side and OSPF on the right-hand side. Even if all of these routers, including the RIP router, were within your organization, this router would still be known as an ASBR because it's connecting one routing process rip to another routing process in this case OSPF.
  • When traffic is sent from one area to another area, it has to traverse the backbone to reach the destination. So, these three ABR routers in the backbone are used to allow the traffic to flow from Area 1 to Area 2.
  • OSPF once again requires a good design with all areas connecting to the backbone area as traffic flows from one area to another area through the backbone area.

NEIGHBOR ADJACENCIES HELLO PACKET

  • OSPF routers use Hello to form neighbor relationships or adjacencies.
  • The Hello protocol once again establishes and maintains neighbor relationships by ensuring bi-directional. In other words, two-way communication between neighbors.
  • Bidirectional communication occurs when a router recognizes itself listed in the packet received from a neighbor.
  • Hellos are sent using multicast address 224.0.0.5 and contain the following information for neighbor relationships to be formed.

  • It's important to remember that certain parameters have to match on both routers.
  • Now the first field containing a hello is the Router ID.
  • A router ID identifies this specific router and is used in various scenarios in OSPF, including the election of a designated router or backup designated router.
  • A router ID is chosen per router based on the highest IP address of any configured interface, when OSPF is enabled on the router or on the highest loopback interface active on the router when OSPF is enabled, or it can be manually specified using the router ID command.
  • The Hello packet then contains the hello and dead intervals, which must be the same on both routers. Otherwise, an adjacency or neighbor relationship will not be formed.
  • It then contains the list of neighbors that thereafter knows about.
  • That's how a router knows if there's two-way communication because it recognizes itself in the list of neighbors that it receives in the hello packet.
  • It then contains the area ID, which must also match on both routers.
  • It then contains a router priority which can be used in designated router and backup designated router elections.
  • It then contains the designated router or DR IP address, backup designated router or BDR IP address.
  • It then contains the authentication password. The authentication password needs to be the same. Otherwise, the relationship will not be formed.
  • And then lastly, the stub area flag needs to be the same. The stub area flag denotes whether this is a stub area or a normal area.

OSPF Designated and Backup Designated Router

  • In a multi-access Network, OSPF needs to select a DR (Designated Router) and BDR (Backup Designated Router). LAN is the best example of Multi-access Network type when OSPF DR and BDR routers are selected so that all OSPF specking routers in that LAN segment have complete OSPF Database.
  • Consider if there is no DR and BDR in the network elected. If any network goes down in multi-access network, their will be unnecessary duplicate traffic will be flowing updating the network down issue from every router in multi-access network.

                         

  • To send routing information to a DR or BDR the multicast address of 224.0.0.6 is used by other routers in the same LAN. DR sends routing updates to the multicast address of 224.0.0.5. If DR fails, BDR takes its role of distributing routing information.
  • Every router on a network segment establishes a full neighbor relationship with the DR and BDR. Non-DR and non-BDR routers establish a 2-way neighbor relationship between themselves.

DR and BDR Selection Rules:
Router with the highest OSPF priority will become a DR. (default priority is 1)
In case of tie, Router with highest router ID wins the election

Note: Router ID is the highest IP address on loopback interface. If no loopback interface, then it is highest IP address on non-loopback interface

  • DR/BDR election are non-preemptive, this means that once a DR and BDR is established, they keep their status despite of the new router becoming active in network having high priority or high router ID. So always start the router which must be DR and then BDR and then other routers.
  • Priority=0 means ineligible to become DR/BDR.
  • When interface comes up, it sets DR, BDR to 0.0.0.0 and wait for ‘wait timer’=router dead interval. Within that period, if it receives hello with DR/BDR filled, accept those. Else if the time period elapse, move to BDR and then to DR.

Designated Router (Overview)

  • Elected based on highest Priority
    • Range 0 to 255
    • Default is 1
    • 0 Disables
  • If same Priority
  • Elected based on highest router ID

Shortest Path First (SFP) Algorithm

The SPF algorithm places each router at the root of a tree and calculates the shortest path to each node using the Dijkstra's algorithm based on the cumulative cost that is required to reach that destination.

Let take an example as above.
If Router R1 want wants to get to a network behind Router R2, it’s going to determine the best route based on:

Cost = 10^8/Bandwidth

  • As in the example, Router R1 has T1 link to Router R2 and also it has 10 Mbps,10 Mbps link router R3. So, which link will R1 will take?
  • As for RIP routing protocol, it uses hop count, so it will directly send the traffic from R1 to R2.
  • But what would OSPF do?
  • OSPF by default uses a reference bandwidth of 10^8.
  • You can change this default reference bandwidth.
  • As OSPF has been around for many years and in the early days there were no speeds such as gig, ten gig and so forth. So today, if you've got gig and ten gig links, you're going to want to change this reference bandwidth.
  • So, Cost of the link = 10^8/bandwidth
Default reference bandwidth = 10^8
Cost of the link = 10^8/bandwidth
1 Kbps = 1000bps
1 Mbps = 1000000 bps
10 Mbps = 10000000 bps
Cost of 10 Mbps = 10^8/10000000 = 10
Cost of T1 1.544 Mbps = 10^8/1544000 = 64

  • So, the Cost of the link for R1 to reach R2 via R3 is 20, and directly to R2 is 64.
  • So, OSPF will choose the link for R1 to send traffic via R3 for destination R2.

Change Reference bandwidth – auto-cost reference-bandwidth X

  • X = specifying a value in megabits per second. Default is 100
  • In other words, the reference bandwidth is 100 megabits per second.
You can also change the cost on an interface.
So rather than OSPF calculating the cost of the link based on the bandwidth, you can set the OSPF cost.

Change cost on an interface – ip ospf cost X

So, in all OSPF select the path based on cost.
Higher the bandwidth, Lower the Cost.
Lower the Cost, Better the OSPF Path

OSPF Network Type

Point-to-Point:

  • Point-to-point network type does not maintain a DR/BDR relationship.
  • It is used between two directly connected router
  • It has a 10 second hello and 40 second dead timer.
  • All OSPF packets (traffic) are sent to Multicast address - 224.0.0.5

Broadcast: (ethernet, Token Ring, FDDI)

  • It is default behavior for an OSPF enabled Ethernet interface.
  • DR, BDR election occurs and communicates using 224.0.0.5 and 224.0.0.6
  • It has a 10 second hello and 40 second dead timer.

Non-Broadcast Multiple Access (NBMA): (Frame Relay, ATM)

  • It is default behavior for OSPF enabled frame relay physical interfaces.
  • It requires the manual configuration of neighbors as multicast Hello’s are not allowed.
  • All communication via Unicast.
  • OSPF will elect DRs and BDRs.

Point-to-Multipoint:
  • OSPF treats point-to-multipoint networks as a collective of point-to-point links.
  • It doesn’t maintain DR/BDR relationship.
  • It advertises the hot route for all frame-relay endpoints.
  • It has 30 second hello and 120 second dead timer.
  • Multicasts are still used to allow the neighbors to detect each other dynamically.
  • Each router will advertise its own IP address on the Point-to-Multipoint network with a netmask of /32.
  • All routers attached to a non-broadcast network must be manually configured to recognize it as a point-to-multipoint segment

Router(config-if)# ip ospf network point-to-multipoint [non-broadcast]

The "non-broadcast" parameter can be appended to the OSPF network type to force unicasting of packets rather than relying on multicast. This might be necessary when dynamic circuits are in use.

Virtual Link:
  • Packet are unicast
  • Must be configured between 2 ABRs alone
  • Transit area must have full routing information
  • Transit area cannot be stub
  • Usually it is the worst design and needs to be changed
  • Can temporarily deploy to avoid partitioned area.

How OSPF Converge?

  1. Neighbor Discovery
  2. Form Adjacencies
  3. Flood Link State Database
  4. Calculate Shortest Path
  5. Best route installed in the routing table
  6. Respond to changes in the network

OSPF Neighbor State

Down: NO OSPF neighbors detected at this moment.

In this state, no Hellos has been received from the neighbor, but hello packets can still be sent to the neighbor.
During the fully adjacent neighbor state, if a router doesn’t receive hello packet from a neighbor within the RouterDeadInterval time (RouterDeadInterval = 4*HelloInterval by default) or if the manually configured neighbor is being removed from the configuration, then the neighbor state changes from Full to Down.

Attempt: This state is only valid for manually configured neighbors in an NBMA environment. In Attempt state, the router sends unicast hello packets every poll interval to the neighbor, from which hellos have not been received within the dead interval.

Init: It specifies that the router has received a Hello packet from its neighbor, but the receiving router’s ID was not included in the hello packet. When a router receives a hello packet from a neighbor, it should list the sender’s router ID in its hello packet as an acknowledgement that it received a valid hello packet.

2-Way: This state designates that bi-directional communication has been established between two routers. Bi-directional means that each router has seen the other’s hello packet. This state is attained when the router receiving the hello packet sees its own Router ID within the received hello packet’s neighbor field. At this state, a router decides whether to become adjacent with this neighbor. On broadcast media and non-broadcast multiaccess networks, a router becomes full only with the designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. On point-to-point and point-to-multipoint networks, a router becomes full of all connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multiaccess networks are elected.
Note: Receiving a Database Descriptor (DBD) packet from a neighbor in the init state will also a cause a transition to 2-way state.

Exstart: This is the first step in creating an adjacency between the two neighboring routers.  The goal of this step is to decide which router is the master, and to decide upon the initial DD sequence number.  Neighbor conversations in this state or greater are called adjacencies.
In this state, the routers, and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number.
Note that one would logically conclude that the DR/BDR with the highest router ID will become the master during this process of master-slave relation. Remember that the DR/BDR election might be purely by virtue of a higher priority configured on the router instead of highest router ID. Thus, it is possible that a DR plays the role of slave. And note that master/slave election is on a per-neighbor basis.

Exchange: In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors contain link-state advertisement (LSA) headers only and describe the contents of the entire link-state database. Each DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave. Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state. The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.

Loading: In this state, the actual exchange of link state information occurs. Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets. During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state update packets are acknowledged.

Full: In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged, and the routers' databases are fully synchronized.

Full is the normal state for an OSPF router. If a router is stuck in another state, it is an indication that there are problems in forming adjacencies. The only exception to this is the 2-way state, which is normal in a broadcast network. Routers achieve the FULL state with their DR and BDR in NBMA/broadcast media and FULL state with every neighbor in the remaining media such as point-to-point and point-to-multipoint.

Note: The DR and BDR that achieve FULL state with every router on the segment will display FULL/DROTHER when you enter the show ip ospf neighbor command on either a DR or BDR. This simply means that the neighbor is not a DR or BDR, but since the router on which the command was entered is either a DR or BDR, this shows the neighbor as FULL/DROTHER.

OSPF LSA Types

  • Router LSA (Type-1)
  • Network LSA (Type-2)
  • Summary LSA (Type-3)
  • ASBR Summary LSA (Type-4)
  • ASBR External LSA (Type-5)
  • OSPF Group Membership LSA (Type-6)
  • Not So Stubby Area (NSSA) External LSA (Type-7)
  • OSPF External Attributes LSA for BGP (OSPFv2)/Link Local LSA (OSPFv3) (Type-8)
  • OSPF Link Scope Opaque (OSPFv2)/Intra Area Prefix LSA (OSPFv3) (Type-9)
  • OSPF Area Scope Opaque LSA (Type-10)
  • OSPF AS Scope Opaque LSA (Type-11) 

Router LSA (Type-1): 

  • Router LSA packets are sent between routers within same OSPF area and do not leave the area.
  • It describes its own interfaces but also carries information about its neighbors to adjacent routers in the same area.
  • It is identified by the Router ID or the originating router
  • It floods within an area and the LSA Type 1 does not cross the ABR.
  • We see this as “O” routes in the routing table

Network LSA (Type-2): 

  • Generated by the DR Router on the broadcast network
  • It includes the network ID, subnet mask and the list of attached routers in the transit
  • In OSPF we can have one Network LSA or Type 2 LSA for each transit broadcast of NBMA Network
  • This LSA also can be flooded only within the area and cannot cross the ABR
  • We see this as “O” routes in the routing table

Summary LSA (Type-3): 

  • The Type 3 LSA is used to share the network information with other areas. Inter-area (IA)
  • These LSAs are advertised by the ABR Router
  • These LSA are represented in the routing table as “O IA” routes
  • To flood the information through the Autonomous System, they are regenerated by the ABRs following subsequently
  • LSA 3 – O IA, Network Summary LSA describes network from another area, generated by ABR and is propagated between areas
  • It contains network ID and subnet mask

ASBR Summary LSA (Type-4): 

  • This LSA type is also known as summary ASBR LSA is used to advertise about the ASBR to other areas in the same autonomous system.
  • It is generated by the ABR of the originating area.
  • These LSA are represented in the routing table as “OIA” routes
  • These type of LSAs are flooded throughout the Autonomous System
  • Information inside LSA 4: Router ID of ASBR, ADVERTISING Router will be router ID of ABR

Suppose we have three Area

Area 1 ---- Area 0 ----------Area 2

When Redistribution happen on R1 in Area 1 , LSA 1 of Router R1 will reach to R2 (ABR ) with E bit set to 1 .R2 get to know it’s time to generate LSA 4

ASBR External LSA (Type-5): 

  • ASBR External LSA in OSPF LSA Types is generated by the ASBR to advertise external redistributed prefixes into the OSPF domain.
  • These external routes/prefixes are redistributed into the OSPF network by the ASBR and seen as either E1 or E2 entries in the routing tables of the routers.
  • These LSAs are used to advertise networks from other Autonomous systems
  • These LSAs are flooded throughout the entire Autonomous System
  • The advertising router ID is not changed throughout the AS when it is propagating.
  • An LSA Type 4 is used to find an ASBR
  • Routes are not summarized by default

Note: External LSA is domain-wide, meaning if we redistribute prefixes into OSPF, those redistributed prefixes are flooded everywhere, even if there are multiple areas in OSPF, every area receives them. Exceptions are Stub Area and its variations, such as Totally Stub Area, NSSA, and Totally NSSA Area.

OSPF Group Membership LSA (Type-6): OSPF Type 6 LSA was considered for the Multicast purpose, Multicast routing for OSPF but never implemented or deployed.

Not So Stubby Area (NSSA) External LSA (Type-7): 

  • NSSA External LSA is seen in NSSA and Totally NSSA Areas when there is redistribution.
  • Normally Stub Areas don’t allow redistribution, but as a Not So Stubby Area (NSSA), redistribution is allowed. But, redistributed prefixes are not seen as Type 5 LSA, they are seen as Type 7 LSA. Type 7 LSA is translated to Type 5 LSA to be sent into the OSPF Area 0/Backbone Area.
  • If there are two NSSA ABRs, they negotiate with each other and the NSSA ABR with the lower Router ID does the translation.
  • LSA 7 – O N1, O N2, NSSA External Link States, generated by ASBR into NSSA area and is propagated into area 0 as E1 or E2

OSPF External Attributes LSA for BGP (OSPFv2)/Link Local LSA (OSPFv3) (Type-8): 

  • Normally BGP prefixes are redistributed into OSPF or any other routing protocol, and BGP attributes are lost. But you may need to carry BGP attributes with your Autonomous System between the Routers.
  • Let’s say, for the given destination IP prefix, you have two exit points from your network, and for the outbound direction, you want to prefer one of those exit points as Primary. You can use this BGP Local Preference attribute.
  • Two Routers exchange the prefixes with each other, and when they check the BGP Local Preference attribute, which every Router has the higher Local Preference, that router is used as an exit point by both routers.
  • But BGP local preference e attributes cannot be carried in OSPF normally. Because of reachability, you need to redistribute from BGP to OSPF, and if you redistribute, attributes are lost.
  • Type 8 LSA in OSPF LSA Types, was considered for this purpose. BGP Attributes would be carried even if we would redistribute. But another LSA that we don’t use in computer networking. Instead of this LSA, IBGP – Internal BGP is used in the networks.

Opaque LSA:

  • OSPF Link Scope Opaque (OSPFv2)/Intra Area Prefix LSA (OSPFv3) (Type-9)
  • OSPF Area Scope Opaque LSA (Type-10)
  • OSPF AS Scope Opaque LSA (Type-11)

Opaque LSA are used to extend the capabilities of OSPF.

  • With these LSA Types, OSPF carries many other protocol capabilities. For example, RSVP Traffic Engineering and Segment Routing Traffic Engineering requires topology information, used bandwidth, available bandwidth, reserved bandwidth, link coloring information, delay, or other attributes, and so on.
  • BIER – Bit Indexed Explicit Replication, the newest and most scalable Multicast architecture information is conveyed with Opaque LSAs as well.
  • OSPF Graceful Restart/GR and many other use cases we have with Opaque LSAs. Think of it as a helper to the basic OSPF mechanism. In addition to carrying prefixes and cost, much other information can be carried with them. 

Type 9 LSA is link scope: For OSPFv3 it’s redefined to handle a communication prefix for a special area type called Stub Area.
Type 10 is Area scope: It is used for traffic engineering to advertise MPLS and other protocols.
Type 11 is AS scope: It serve the same purpose as LSA Type 10 packets but are not flooded into special area types (Stub areas).

Few Points to be remember for LSA packet:
Router LSA of ABR will have “B-Bit” set in router-lsa packet
Router LSA of ASBR will have “E-Bit” set in router-lsa packet
When NSSA ABR, translates type-7 LSA to type-5 LSA, it advertises with “Advertising Router” field to its own router ID, and it changes to ASBR. It could be confirmed by seeing “E Bit” set in router LSA packet.

OSPF Areas

Standard/Backbone Area:

  • Area-0 à Need for inter-area communication
  • If there is only one area, no need for Area-0
  • All Types of LSAs except type-7 can be seen

Stub Area:

  • OSPF stub allows the routers in an area to use default routes  for forwarding packets to ABRs, rather than more specific routes.
  • Reduce memory consumption and CPU processing time on the routers inside the area, because the routers in that area can have fewer LSAs in their LSDBs.
  • Singles exist point for inter-area communication. But still can have more than one ABR.
  • Have information about OSPF domain areas. Both intra and inter-area routes.
  • No information about external (other domain) routes. Hence, ABR sends a default route.
  • Type-1,2 and 3 LSAs can be seen
  • All the routers should have “E-bit” set to 0 in their hello packets to form adjacency.
  • Command “area x stub”

Totally Stub Area:

  • Router has information about its area alone. No information about inter-area routes.
  • Can see Type-1, Type-2 LSAs and a single default route Type-3 LSA by ABR.
  • Command “area x stub no-summary”

Not-So-Stubby-Area (NSSA):

  • Same property as stub area with exception of allowing other domain routes as Type-7 LSA.
  • No default route from ABR (unless “default-info originate” CLI configured where N2 default route (or) “area x nssa no-summary” configured. In later, IA routes will not be available and default route has IA tag)
  • When there are more than one ABR for NSSA, the ABR with highest router ID translate type-7 to type-5 LSA.
  • Can see Type-1,2,3,4 and Type-7 LSAs
  • Command “area x nssa”

Totally NSSA:

  • It is same as NSSA except one difference.
  • In Totally NSSA, summary LSA (Type-2 and Type-4) are also not accepted. It gets these with only one default route. And this is configured at ABR by “default-information-originate
  • Command “area x nssa no-summary”

OSPF Path Selection

OSPF will use cost as the metric to choose the shortest path for each destination, this is true but it’s not entirely correct. OSPF will first look at the “type of path” to decide and secondly look at the metric.

Preferred Path list that OSPF uses:

  1. Intra-Area (O)
  2. Inter-Area (O IA)
  3. External Type 1 (E1)
  4. NSSA Type 1 (N1)
  5. External Type 2 (E2)
  6. NSSA Type 2 (N2)
  7. Lowest cost path

E1 routes: The cost of E1 routes is the cost of the external metric with the addition of the internal cost within OSPF to reach that network.

E2 routes: The cost of E2 routes will always be the external metric, the metric will takes no notice of the internal cost to reach that network.

Notes: If 2 external type 2 routes exist with the same metric to the same destination the route with the lowest metric to the ASBR will is used. Also, if an E1 and E2 route exist to the same destination the E1 route will always be preferred irrespective of the metric.

Consider this example. ASBR, R1 R2 R3 are connected in line via Ethernet interface with cost of 10 each.

ASBR (default-metric 50) -------R1-----R2---R3

 The cost of routes redistributed at the ASBR into OSPF is set to 50 using "default-metric “command. The cost of the same route in routing table of R1, R2 and R3 will be 50 if the route is tagged as E2. (Same applies for N2)

 The cost of the same route in routing table of R1 will be 60, R2 will be 70, R3 will be 80, if the route is tagged as E1 (same applies for N1) The costs to reach the ASBR is cumulatively added to the cost of the route set at the ASBR.

No comments:

Post a Comment