OSPFv2 Theory - connorethanjay/Champlain-College-CNCS-Notes GitHub Wiki

OSPFv2 Theory / Introduction

OSPF is a link-state routing protocol that was developed as an alternative for the distance vector Routing Information Protocol (RIP). RIP was an acceptable routing protocol in the early days of networking and the internet. However, the RIP reliance on hop count as the only metric for determining best route quickly became problematic.

OSPF offers faster convergence and scales much better with larger (much larger!) networks.

Terminology before delving in

  • Backbone area = The central area of an OSPF routing domain, where all other areas must connect to. When traffic must pass from one area to another, it must traverse the backbone.

  • ABR or Area Border Router - An Area Border router is a router with interfaces in two (or more) different areas. In other words, it connects one or more areas to the OSPF backbone area (Central area, area 0).

  • ASBR or autonomous system boundary router - The ASBR is a router that serves as a gateway for routers outside the OSPF domain, as well as those running with specific protocols such as EIGRP, BGP, and many others. This router must be capable of importing and translating different protocol routes into OSPF through "route redistribution".

  • Route redistribution - The idea of two or more routing protocols sharing routing information, which is often used when connecting networks that use different routing protocols.

image

  • Metric - A routing metric is the value or criteria to compare and select the best route. In the case of OSPF, OSPF "cost" is a metric used to calculate the best path, and is determined by adding up the cost in terms of Bandwidth of individual links that make up the path. image

  • Stub Areas - A stub area is shielded from external routes but still receive information about networks that belong to other areas of the same OSPF domain.

  • NSSA Areas - Used to import BGP prefixes as a type 7 LSA instead of a type 5 LSA. All the routers in the area must be configured as NSSA

OSPF Routing Protocol Messages

  • Hello packet - OSPF-enabled routers send hello packets out all OSPF-enabled interfaces to determine if a neighbor is present. If a neighbor is present, the routers will attempt to establish a neighbor adjacency.

  • Database Description packet - Contains an abbreviated list of the link-state database, and is used by receiving routers to check against their own local LSDB. The database must be identical on all routers within an OSFP area to construct an accurate SPF tree.

  • Link-state request packet - Receiving routers can then request more information about an entry in the Database Description packet by sending an LSR packet.

  • Link-state update packet - Used to reply to an LSR (for announcing new information, contains several different types of advertisement packets.)

  • Link-state acknowledgement packet - Once an LSU is received, the router sends an LSAck packet to confirm the receipt of the LSU. The LSAck data field is empty.

Link-state updates

  • Routers initially exchange type 2 DBD packets carrying an abbreviated list of the database. It is used by the receiving router to check against their own database.

  • A type 3 LSR packet is used to request more information from an entry in the database description.

  • A type 4 LSU packet is used to reply to an LSR packet.

  • A type 5 packet is used to acknowledge the receipt of a type 4 LSU.


  • There are various LSA (advertisement) packets

  • LSA Type 1 = Router LSA

  • Can be used to identify a link using the IP prefix on an interface and the link type (Point to point, stub, etc)

  • LSA Type 2 = Network LSA

  • Contains the list of routers connected to the network. The ID of the LSA is the originating interface IP address of the DR.

  • LSA Type 3 = Summary LSA

  • Generated by an Area Border Router (A router attached to multiple areas of an OSPF network). A border router takes information it has learned in one area, summarizes it, and then will send it to a different area that it is connected to. This summarization removes topology information for other areas (The routing information is summarized into just an address prefix and metric/cost).

  • LSA Type 4 = ASBR-Summary LSA

  • This is needed since type 5 LSAs are flooded to all areas with the ID of the ASBR. However, router IDs are not advertised between areas. This is solved by an Area Border Router flooding the information of the ASBR where the type 5 originated. The link-state ID is the router ID of the described ASBR for type 4 LSAs.

  • LSA Type 5 = AS-external-LSA

  • Contains information imported into OSPF from other routing processes. These are flooded to all areas unchanged (excluding stub and NSSA areas).

  • LSA Type 6 = Group Membership LSA

  • Not in current use. This LSA is defined for multicast extensions to OSPF.

  • LSA Type 7 = NSSA External Link-State Advertisements

  • Type 7-LSAs are identical to type-5 LSAs. however these are only flooded in NSSA areas.

  • LSA Type 8 = External Attributes LSA for Border Gateway Patrol

  • This LSA carries information about external routes, including their destination network addresses, path costs, and external route tags. When an OSPF router receives routing information from an external routing protocol, such as BGP (Border Gateway Protocol), it generates an LSA Type 5 called External LSA.

  • LSA Type 9 = OSPF Link Scope Opaque (OSPFv2)

  • OSPF LSA Type 9 is used in OSPFv2 to carry non-standardized or proprietary information within the OSPF domain. LSA Type 9 enables OSPF routers to exchange opaque data, allowing for custom extensions and additional functionality beyond the standard OSPF protocol.

  • LSA Type 10 = OSPF Area Scope Opaque LSA

  • OSPF LSA Type 10, known as OSPF Area Scope Opaque LSA, is used to carry opaque data specific to a particular OSPF area, enabling the transmission of custom information within that specific area.

  • LSA Type 11 = OSPF AS (Autonomous System) Scope Opaque LSA

  • OSPF LSA Type 11, referred to as OSPF AS (Autonomous System) Scope Opaque LSA, is utilized to transmit opaque data throughout the entire OSPF Autonomous System, allowing the exchange of custom information across the entire OSPF domain.


LSA Header

image

  • The 20-byte LSA header section contains the following fields:

  • LS Age: The number of seconds that have passed since the LSA was created (in seconds), indicating when the first LSA id was created and when it will be promoted.

  • Options: Indicates the OSPF features like tables.

  • LS Type: Defines the LSA types, like where which LSA is being used.

  • Link State ID: Identifies the network link between OSPF routers; mostly, we got to know about the IP Identification used by the OSPF process.

  • Advertising Router: It displays the origin router’s ID through which we can identify which process of OSPF is running on which router.

  • LS Sequence Number: A unique numeral to filter out outdated and redundant LS on each LSA packet.

  • LS Checksum: A specific digit supplied to LS for comparison and error detection.

  • Length: Represents LSA packet length, which means the actual size of that LSA is whichever the LSA is being generated.