Network Architect

Service Provider IGP Design: IS-IS, OSPF and ECMP

The interior gateway protocol is the foundation every MPLS, segment routing and BGP service rides on. Learn why carriers favour IS-IS, link-state basics and shortest path first, metric design and reference bandwidth, areas and levels, equal-cost multipath, fast convergence and a safe change approach. Then compute shortest paths and ECMP counts in code.

55 min

1. Executive summary and objective

Every service in this course sits on an underlay: the IGP (interior gateway protocol) that gives each router in the network a loopback address and the shortest way to reach every other router. MPLS labels, segment routing SIDs, iBGP sessions and EVPN VTEPs all depend on it. If the IGP is wrong, everything built on top is wrong too, and an IGP outage is a network-wide outage.

Objective: you can explain why carriers choose IS-IS or OSPF, how link-state routing and SPF work, design sensible metrics, structure areas or levels, use ECMP, tune convergence safely, and avoid the classic IGP mistakes.

In a link-state protocol every router:

  1. Discovers neighbours with hellos.
  2. Floods a description of its own links (its link-state advertisement or PDU) to every router in the area.
  3. Builds the same link-state database (LSDB): a map of the whole topology.
  4. Runs shortest path first (SPF, Dijkstra’s algorithm) on that map, with itself as the root, to find the lowest-cost route to every node.
  5. Installs the next hops in the routing table.

Because everyone computes from the same map, the network converges to loop-free routes. When a link fails, the neighbours flood the change, everyone re-runs SPF and traffic moves, typically in well under a second when tuned.

3. IS-IS versus OSPF

IS-IS OSPF
Runs over Layer 2 (CLNS) directly IP (protocol 89)
Address families One instance carries IPv4 and IPv6 (multi-topology optional) OSPFv2 (IPv4) and OSPFv3 (IPv6)
Hierarchy Level 1 (inside an area) and Level 2 (backbone); the boundary is the link, so routers sit in an area or between them Areas joined at area 0 through ABRs
Extensibility TLVs make new features (segment routing, traffic engineering, flex-algo) easy Opaque LSAs and extensions
Typical home Carrier and large data-centre cores Enterprise and campus; also used in carriers
Skill pool Smaller Larger

Neither is “better”. IS-IS is popular in providers because it is stable, scales with fewer moving parts, and does not depend on IP to form adjacencies. OSPF is perfectly fine where staff and tooling favour it. Choose one IGP and run it consistently across the core.

4. Metric design

The metric (cost) decides the path. Good metric design is the single most important IGP decision.

  • Reference bandwidth: OSPF cost is reference / link bandwidth, with a minimum of 1. With the old 100 Mbps reference every link at 100 Mbps and above costs 1, so 1G, 10G and 100G links look identical. Raise the reference (for example 100 Gbps or 1 Tbps) on all routers, or set explicit metrics.
  • Many providers set metrics by design, not by speed: proportional to latency (so voice and gaming take the geographically shortest path) or a formula that mixes distance and capacity.
  • Keep metrics consistent in both directions of a link unless you intend asymmetric routing.
  • Use small, sensible ranges (for example 10 to 10,000 on wide-metric IS-IS). IS-IS needs wide metrics enabled to use more than 63 per link.
  • Maintenance: raise a link’s metric (or use the overload bit) to drain traffic before working on it. Setting it to the maximum does not remove it from the topology, it just makes it a last resort.
router isis CORE
 net 49.0001.0100.0000.0001.00
 is-type level-2-only
 metric-style wide
 address-family ipv4 unicast
  mpls traffic-eng level-2
 !
interface HundredGigE0/0/0/1
 point-to-point
 address-family ipv4 unicast
  metric 50

5. Areas and levels

Flooding scales poorly if thousands of routers share one database. Hierarchy limits it, but modern routers cope with several thousand nodes in one flat area or level, so do not add hierarchy without a reason. Common choices:

  • Flat Level-2 core with a few hundred nodes: simple, fast convergence.
  • Level 1 / Level 2 (or OSPF areas) for geographic regions, with summarisation at the boundary. Remember that MPLS LDP and some traffic engineering want /32 loopbacks to be visible everywhere, which hierarchy can hide. Segment routing and BGP-based designs (seamless MPLS) solve this.

Always advertise loopbacks as /32 (and IPv6 /128), set links to point-to-point so there is no designated router election, and keep the IGP carrying only infrastructure prefixes. Customer and internet routes belong in BGP.

6. ECMP: using every equal path

When two or more paths share the lowest total cost, routers install them all and spread traffic by hashing packet fields (addresses, ports, sometimes labels), keeping each flow on one path so packets stay in order.

  • Benefits: more usable capacity and automatic resilience.
  • Cautions: hashing is per flow, so a few large flows can still unbalance links; make sure link speeds are alike; keep the maximum-paths setting high enough for your fabric (data-centre fabrics often use 64 or more).
  • In data-centre spine-leaf fabrics, ECMP is the whole point of the design.

7. Convergence and fast reroute

How quickly does traffic recover after a failure? Contributions: failure detection (BFD gives sub-second, much faster than hello timers), flooding, SPF run (use throttle timers: a short initial wait, then back-off), FIB update.

For millisecond recovery, add IP fast reroute with loop-free alternates (LFA) or TI-LFA (topology-independent LFA with segment routing): the router pre-computes a backup path and switches to it as soon as the link fails, before the IGP finishes converging.

Protect stability as well as speed: aggressive timers on a flapping link cause repeated recalculations. Use exponential back-off for SPF and LSA generation and link-flap dampening.

8. Operating the IGP safely

  • Authenticate adjacencies (IS-IS HMAC-SHA hello and LSP authentication, OSPF keychains).
  • Passive interfaces by default; enable the IGP only on intended links.
  • Monitor LSDB size, SPF run counts, flooding, and adjacency flaps.
  • Change metrics in a maintenance window with a rollback plan. A wrong metric can attract traffic onto a thin link.
  • Use the overload bit when a router boots or reloads so it does not black-hole traffic before BGP and LDP are ready.
  • Keep the IGP small: do not redistribute the internet table into it.

9. Hands-on: shortest paths, ECMP and metrics

Implement a small SPF calculator for a weighted graph given as {node: {neighbour: cost}}.

  • shortest_path(graph, src, dst) returns (total_cost, path_as_list).
  • count_ecmp_paths(graph, src, dst) counts how many distinct paths share the lowest cost.
  • ref_metric(bandwidth_mbps, ref_mbps=100000) returns the OSPF-style cost, never below 1.
SPF, ECMP and reference bandwidth — Python 3
YOUR CODE (edit here, then press Run)
Ctrl/⌘ + Enter
OUTPUT
After a hardware refresh, 10G and 100G links all show IGP cost 1 and traffic starts taking odd paths. What happened and how do you fix it?

The reference bandwidth is still at its low default, so every fast link is clamped to cost 1 and SPF treats them as equal. Fix it by setting the same, larger reference bandwidth (or explicit per-link metrics) on every router, in a maintenance window, and verify the resulting costs and the expected paths before and after, since changing metrics shifts traffic.

Can You Explain It?

Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.

  • Explain how a link-state protocol builds routes, from hello to SPF.
  • Give two reasons carriers choose IS-IS and one reason OSPF is also a good choice.
  • Describe how you would drain traffic from a router before maintenance.

10. Key takeaways

  • The IGP is the foundation under MPLS, segment routing, BGP and EVPN: keep it small, stable and consistent.
  • Link-state routers share one map and each run SPF; metrics decide paths.
  • Set reference bandwidth or explicit metrics so fast links differ from slow ones.
  • Use ECMP to use equal paths, BFD and fast reroute for quick recovery, and back-off timers for stability.
  • Put infrastructure in the IGP and everything else in BGP; use the overload bit and metrics for safe maintenance.

🧪 Want to practise this on your own computer? See how to set up your lab →

📝

Knowledge Check

1 of 4

Why do many service providers choose IS-IS as their IGP?

Report a problem

About: /lessons/sp-igp-underlay-isis-ospf-design