TTR Networks

What is OSPF?

Open Shortest Path First

OSPF (Open Shortest Path First) is a link-state routing protocol that routers within one network use to map their links and find the shortest paths.

OSPF is an interior gateway protocol: it runs within a single organisation's network, while BGP connects networks to each other. Routers discover neighbours by sending Hellos on each interface (by default every 10 seconds, with a 40-second dead interval on Ethernet) to the multicast address 224.0.0.5. Neighbours that agree on area, subnet, timers and authentication form an adjacency, moving through the states Init, 2-Way, ExStart, Exchange and Loading until they reach Full. Each router describes its links in LSAs, floods them to the whole area, and stores everything it receives in its LSDB. Every router in the area ends up with the same map and runs Dijkstra's SPF algorithm over it, picking paths with the lowest total cost, where each interface's cost is usually derived from its bandwidth. OSPF runs directly over IP as protocol 89, not over TCP or UDP. OSPFv2 (RFC 2328) carries IPv4; OSPFv3 (RFC 5340) was designed for IPv6 and runs over link-local addresses.

In practice OSPF is the most common IGP in enterprise and many service-provider networks, and its usual job under BGP is to carry loopback and infrastructure addresses so iBGP sessions and next hops resolve. Large networks split it into areas around a backbone, area 0, joined by ABRs. Common problems include mismatched timers or MTU, Ethernet links left as the broadcast network type when point-to-point was intended, and the default reference bandwidth of 100 Mbit/s, which gives every link of 100 Mbit/s or faster the same cost of 1. Related terms include LSA, SPF, DR and IS-IS, its closest alternative. The OSPF Fundamentals lesson builds a working FRR lab, and OSPF on VyOS covers costs and OSPFv3.

Lessons that use OSPF

  • OSPF FundamentalsTeaches this term · Beginner · 70 min

    The link-state IGP that runs inside most networks: neighbour adjacencies, LSA flooding, SPF, costs, DR/BDR, areas and LSA types, a hands-on FRR lab, and how OSPF underpins BGP.

  • Edge and core: building out a VyOS networkIntermediate · 60 min

    Split one BGP router into edge routers that face the outside world and a core that carries traffic inside: loopbacks, OSPF for infrastructure, iBGP between loopbacks, next-hop-self, and what happens when a link fails. Built and broken on three real VyOS routers.

  • OSPF on VyOS: costs and OSPFv3Intermediate · 30 min

    OSPF the VyOS way: interface-based configuration, reading the interface and database output, steering traffic with costs (and the asymmetric routing that follows), and OSPFv3 for IPv6 over link-local addresses. Captured on the three-router edge/core lab.

  • BGP on loopbacks vs interface addressesIntermediate · 45 min

    Why BGP sessions between loopbacks survive link failures and use parallel links, and what they need to work: an IGP or static routes, update-source, the eBGP connected check, and BFD. Every failure is reproduced on two real VyOS routers.

  • Site-to-site VPN with WireGuard on VyOSIntermediate · 35 min

    Join two sites' private LANs across the internet with WireGuard on VyOS: keys and peers, the AllowedIPs mistake and what it teaches, what the internet actually sees, and the tunnel's smaller MTU.

  • BGP FundamentalsIntermediate · 75 min

    How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.

  • Setting up VyOS with basic BGPIntermediate · 50 min

    Build a VyOS edge router from scratch: one upstream transit provider, one Internet Exchange route server, and the import and export policy that keeps both safe. Every command and output comes from a real VyOS lab.

Related terms