← Back
Home › Systems › Telecom

ip-backbone

Carries internet traffic between cities for an internet service provider by finding shortest paths, forwarding at line rate and rerouting quickly around failures.

MPLS backbones

Open the ip-backbone pageip-backbone Count-min sketchdata-structures: d rows of w counters estimate any item's frequency in a stream, overestimating by at most ε·N with probability 1-δ, in fixed tiny memory.›Dijkstra's algorithmgraphs: Single-source shortest paths with non-negative edge weights by settling vertices in order of distance with a priority queue.›Max flow (Dinic)graphs: Maximum s-t flow by BFS level graphs and blocking flows; also gives the min cut, bipartite matching and assignment with capacities.›Active queue managementnetworking: RED, CoDel and PIE: drop or ECN-mark early to keep switch and router queues shortBfdnetworking: Bidirectional Forwarding Detection: sub-second link/path failure detection with tight hello timersBgpnetworking: BGP sessions, UPDATE messages, path attributes and best-path selectionEcmpnetworking: Equal-cost multipath: hash flows across next hops; resilient hashing on changesFair queuingnetworking: Deficit round robin / weighted fair queuing to share capacity among tenants or flowsFast reroutenetworking: Precomputed loop-free alternates (LFA, TI-LFA) for sub-50 ms failoverLink state routingnetworking: OSPF/IS-IS link-state flooding and SPF route computationLongest prefix matchnetworking: IP prefix lookup structures (DIR-24-8, Poptrie, LC-trie) for routes, ACLs and geo-IPMpls label switchingnetworking: MPLS label push/swap/pop forwarding and label distributionRpki route origin validationnetworking: RPKI ROAs and route origin validation to reject hijacked BGP announcementsSegment routingnetworking: Source routing with segment lists (SR-MPLS, SRv6) for traffic steeringTraffic engineeringnetworking: Constrained SPF and centralized path computation to place traffic under capacity limitsSimplex methodoptimization: Solves linear programs by walking along the edges of the feasible polytope from vertex to vertex, one basis swap (pivot) at a time; the workhorse behind MIP solvers.›Token bucketsystems: A bucket of up to b tokens refilled at rate r; requests spend tokens, enforcing an average rate while allowing bursts of b.›Fast hash functionsdata-structures: Non-cryptographic hashes built from 64×64→128-bit multiplies and xor-shifts; pick by key size, trust level and whether the hash is persisted.›d-ary heapdata-structures: Array heap with d children per node (d = 4 typical): half the binary heap's depth, siblings in one cache line, faster priority queues.›BFS and DFSgraphs: The two basic graph traversals; BFS gives hop distances and levels, DFS gives discovery/finish order for cycles, components and topological order.›Packet header parsingnetworking: Parse graph state machines for Ethernet, IP, TCP and UDP headers in hardware and softwarePRNGs (PCG, xoshiro)numerics: Small, fast, statistically strong non-cryptographic generators: PCG32 and xoshiro256**, with seeding, parallel streams and unbiased ranges.›Exponential smoothing (ETS,Holt-Winters)statistics: Forecast by keeping a few running states (level, trend, seasonal) updated by a fraction of each forecast error; O(1) memory per series and a strong baseline.›Message sequence numbersdistributed: A per-stream counter on every message lets the receiver detect loss, duplicates and reordering, ack cheaply and resume after reconnect with "send from N".›IP multicastnetworking: Send each datagram once to a class D group address; the network copies it to every joined receiver, and sequence numbers let receivers find loss.›Floating-point errornumerics: How IEEE 754 rounding error accumulates and how to contain it: compensated (Kahan/Neumaier) and pairwise summation, error-free transformations with FMA, ULP comparisons.›LU and Cholesky factorizationnumerics: Factor A = PLU (any square matrix, partial pivoting) or A = LLᵀ (SPD) once in O(n³), then solve each right-hand side in O(n²).›Sparse matrices (CSR)numerics: Compressed sparse row stores only nonzeros as row pointers, column indices and values; SpMV streams them once, so it is memory-bandwidth bound.›

How it is built

Architecture overview

An ISP backbone carries the traffic of millions of customers between cities and to the rest of the internet. It is a set of routers joined by long, expensive links, and it has three jobs: always know the shortest working path between any two routers, forward packets along it at line rate, and keep traffic flowing when a link or router fails, all without a human in the loop. The idea that makes it work is a layered control plane over a simple forwarding plane. A link-state routing protocol (IS-IS or OSPF) gives every router the same map of the network; BGP adds the routes learned from customers and other networks; both are compiled into a forwarding table that the line cards use for every packet. Labels (MPLS or segment routing) let the network carry traffic along a chosen path that is not simply the shortest one.

The core routers (P) only forward labelled packets; the edge routers (PE) face customers and peers, hold the BGP routes and map customer traffic onto the label paths. Reliability comes from detecting a failure in milliseconds, switching to a pre-computed repair path before routing has reconverged, and only then recomputing the best paths.

Parts:

        customers / peers                                        customers / peers
              │ eBGP                                                   │ eBGP
         ┌────┴────┐  iBGP via route reflectors (BGP)            ┌────┴────┐
         │   PE    │◄───────────────────────────────────────────►│   PE    │
         └────┬────┘                                             └────┬────┘
              │  IS-IS/OSPF (link-state) + MPLS or segment routing    │
         ┌────┴────┐        ┌─────────┐        ┌─────────┐       ┌────┴────┐
         │   P     │════════│    P    │════════│    P    │═══════│   P     │
         └─────────┘  ECMP  └────┬────┘  FRR   └─────────┘       └─────────┘
                                 │ BFD on each link
           control plane: LSDB → SPF → RIB (+BGP) → FIB ─► line cards (LPM, labels, queues)

How the parts fit together

Interior routing

Link-state routing (no page yet) floods each router's links and metrics to all others, so every router holds the same database and runs the same computation. IS-IS (RFC 1195, ISO 10589) and OSPF version 2 (RFC 2328) differ in encoding and some details, not in the idea. Flooding must be reliable and ordered: every advertisement has a sequence number and a lifetime (Message sequence numbers); a router accepts only a higher number and reflects it to its neighbours. On a change, the router runs Dijkstra's algorithm from itself, with a priority queue (d-ary heap) as the standard implementation choice, and installs the next hops. The computation is throttled with an initial delay and exponential back-off so a flapping link does not keep the CPU in SPF. The result is the router's view of how to reach every loopback address, which BGP and the labels then build on. The IGP also carries traffic-engineering attributes and segment-routing labels (RFC 5305 for IS-IS, RFC 3630 for OSPF, RFC 8667 and RFC 8665 for segment routing).

Exterior routing

BGP (RFC 4271) is a path-vector protocol: each announcement carries the list of networks it passed through, and each router selects one best path per prefix by a fixed order of attributes and policy, then passes it on. Inside the backbone, iBGP carries the externally learned routes between the edge routers; a full mesh does not scale, so routers peer with a few route reflectors (RFC 4456). Multiprotocol extensions (RFC 4760) carry other address families, among them customer VPN routes (RFC 4364). A full internet table is of order 10⁶ IPv4 prefixes, so BGP (no page yet) implementations need compact attributes sharing and incremental updates.

Anyone can announce anything, so the backbone checks origins. RPKI route origin validation (no page yet) uses signed statements (route origin authorisations) held in a public-key infrastructure (RFC 6480). A validator outside the router checks them and feeds the routers a list of valid prefix and origin-AS pairs over the RPKI-to-Router protocol (RFC 8210). The router classifies each received route as valid, invalid or not-found (RFC 6811), and policy typically rejects invalid ones.

Forwarding plane

Everything the control plane computes ends in a forwarding table (FIB) that a line card consults per packet. Packet header parsing (no page yet) extracts the fields; Longest-prefix match (no page yet) finds the most specific route (a multibit trie in software, a TCAM or algorithmic memory in hardware); the entry yields a set of next hops. When there are several equal-cost paths, ECMP (no page yet) picks one by hashing the flow's header fields with a Fast hash functions-style function, so packets of one flow stay in order while flows spread (analysis in RFC 2992). Two details matter. Hash polarization: every router using the same hash function and field set sends the same flows the same way and unbalances the later stages, so each router mixes in its own seed (drawn from a PRNGs (PCG, xoshiro)). Resilient hashing: when one next hop disappears only its flows move. A single huge flow cannot be split by ECMP at all, so it caps the benefit. Multicast traffic (streaming, market data, IPTV) is replicated in the network by IP multicast, driven by reverse-path checks against the unicast table.

Label paths

MPLS label switching (no page yet) (RFC 3031) puts a short label in front of the IP packet. The ingress router pushes labels, core routers swap and look up an exact label instead of a prefix, and the egress pops. The path is whatever the label distribution made it: LDP (RFC 5036) follows the IGP's shortest path; RSVP-TE (RFC 3209) sets up explicitly routed, bandwidth-reserving paths. Segment routing (no page yet) (RFC 8402) removes the per-path signalling: the ingress encodes the path as a list of segment identifiers that the IGP already advertised, and core routers keep no per-path state. It runs on an MPLS data plane (RFC 8660) or on IPv6 (RFC 8986), and RFC 9256 defines policies that bind a path (a list of segments) to a service. Customer VPNs ride on these paths: the transport label gets the packet across the core, an inner label tells the egress PE which customer table to use.

Traffic engineering

Shortest paths alone leave some links full and others idle. Traffic engineering (no page yet) places traffic on non-shortest paths under constraints, using link attributes the IGP advertises (reservable bandwidth, administrative colours). A router can compute a constrained shortest path itself (CSPF), or a central path computation element can see the whole network, solve the placement problem and push the paths to routers (PCEP, RFC 5440, topology via BGP-LS, RFC 7752). The central version formulates demand placement as a flow problem: a Simplex method minimises the highest link utilisation subject to capacities; Max flow (Dinic) tells how much traffic a pair of sites can exchange and where the minimum cut (the bottleneck) sits, which is also the planning check for survivability; reachability and hop-count checks use BFS and DFS. The requirements for TE over MPLS are written in RFC 2702.

Fast recovery

When a link fails, routing needs hundreds of milliseconds to seconds to reconverge, and voice and financial traffic must not wait. Two pieces solve it. BFD (no page yet) (RFC 5880) is a lightweight hello protocol that runs per link (or per path) at short fixed intervals with a multiplier, so a failure is detected in tens of milliseconds (order of), long before the IGP's own timers; it is typically offloaded to the line card. Fast reroute (no page yet) pre-computes, for each destination, a backup next hop that is already installed in the forwarding table: loop-free alternates (RFC 5286) when a neighbour that does not loop back exists, remote alternates (RFC 7490) when it does not, and topology-independent LFA over segment routing (RFC 9855), which covers any single-link or node failure by steering the packet through the post-convergence path. Switchover is a local table swap, with a target of under 50 ms. The IGP then reconverges, and the repair is withdrawn.

Queues and QoS

Even a well-provisioned backbone has short congestion. DiffServ (RFC 2475) marks packets into classes at the edge; policing uses a Token bucket to keep each customer to its contract. In the core, Fair queuing (no page yet) (deficit round robin, with a strict-priority queue for the expedited class, RFC 3246) shares link capacity by weight so one class or flow cannot starve the others. Active queue management (no page yet) drops or ECN-marks (RFC 3168) packets before the buffer fills so TCP slows down early: RED uses a smoothed queue length (Exponential smoothing (ETS, Holt-Winters)) and random drops; CoDel (RFC 8289) and PIE (RFC 8033) react to delay instead. RFC 7567 sets the general recommendations.

Measurement

Operations need to know which flows or prefixes dominate and when load departs from normal. Counting every flow needs too much memory, so routers export sampled records and collectors keep a Count-min sketch: a few rows of counters estimate any key's volume, overestimating a little, and a small heap (d-ary heap) keeps the current top talkers. The same pipeline watches for sudden volume to one destination (a likely denial-of-service attack) against a smoothed baseline.

Data and control flow

Flow 1: one customer packet across the backbone (L3VPN).

  1. The ingress PE receives the packet on a customer-facing interface and looks up the destination in that customer's table.
  2. The result gives a BGP next hop (the egress PE) and a VPN label; the IGP/label layer gives the transport label for that egress.
  3. The PE pushes both labels and hashes the flow to choose one of the equal-cost paths.
  4. Each P router swaps the outer label by exact match; the penultimate router pops it.
  5. The egress PE reads the VPN label, finds the customer table and forwards the plain packet. Per hop the work is one table lookup and a queue; time in the network is dominated by link propagation (about 5 µs per km in fibre, order of).

Flow 2: a core link fails.

  1. BFD declares the link down within tens of milliseconds, or the interface signals loss of light faster.
  2. The line card switches every affected entry to its pre-installed backup next hop; traffic flows again.
  3. The router floods a new advertisement; every router runs SPF after its throttle delay and installs new best paths.
  4. Backup entries are replaced by the post-convergence primaries. Ordered updates avoid a transient loop between routers that switch at different times.

Flow 3: a new route is announced by a neighbour.

  1. The BGP session receives the update; inbound policy filters by prefix, AS path and origin validation state.
  2. The best-path selection compares it with the existing routes; if it wins, it is installed and advertised to peers and reflectors.
  3. The FIB is updated incrementally on the line cards.

Scaling

  1. Table size. The IPv4 table keeps growing; levers are compact FIB structures, hierarchical FIBs so a next-hop change touches one entry rather than a million routes, and filtering what the core needs (default routes at the edge).
  2. Convergence. Bound by detection, flooding and SPF time. Levers: BFD, fast reroute, prefix-independent convergence, incremental SPF and LSP pacing.
  3. Control-plane state. Route reflector hierarchies, IGP levels or areas, and segment routing (no per-path state in the core) keep each router's workload bounded.
  4. Link utilisation. First ECMP, then traffic engineering via a central controller; capacity is added when the optimiser cannot find room.
  5. Packet rate. Hardware forwarding chips; software routers need Kernel-bypass networking style packet I/O to reach even a fraction of that.

Failure modes

FailureSymptomCauseFix
Microloopbrief loss or latency spike after a changerouters switch to new paths at different timesordered FIB updates, segment-routing microloop avoidance
Route hijack or leaktraffic diverted through a wrong networkmissing origin validation or filtersRPKI validation, max-prefix limits, customer prefix filters
ECMP imbalanceone link full, another idlepolarised hash, one large flowper-device hash seeds, more entropy fields, flow-aware load balancing
Gray failurepartial loss that BFD does not seefaulty line card, one-direction loss, MTU black holeend-to-end probes, interface error counters, path MTU monitoring
BFD flaprepeated switchoversintervals too aggressive for a loaded CPUoffload BFD, tune multiplier, damping
SPF stormhigh CPU, slow convergencea flapping link causes repeated recomputationSPF throttling with back-off, dampening of unstable links
FIB exhaustionnew routes not installed, traffic droppedtable exceeds hardware capacityaggregation, filters, larger TCAM partition
Backup path overloadloss during a failurerepair path has no spare capacityplan capacity with failure scenarios (max flow with a link removed)

Real implementations

namewhat it isrepolicencenotes
FRRoutingrouting protocol suite: BGP, OSPF, IS-IS, LDP, BFD, PIM and moreFRRouting/frrGPL-2.0-or-later (per COPYING; mixed per file)control plane on Linux and BSD, uses the kernel forwarding plane
BIRDrouting daemon (BGP, OSPF and others)gitlab.nic.cz/labs/birdGPL (per README)widely used at internet exchanges
OpenBGPDBGP daemon from OpenBSD with a portable editionopenbgpd-portable/openbgpd-portablesee repoportable edition of the OpenBSD BGP daemon
GoBGPBGP implementation in Go with an APIosrg/gobgpApache-2.0library and daemon
SONiCopen network operating system for switchessonic-net/sonic-buildimageApache-2.0separates the control plane (containers) from the switch ASIC
RoutinatorRPKI validator and RTR serverNLnetLabs/routinatorBSD-3-Clausefeeds origin validation to routers
VPPuser-space packet forwarding frameworkFDio/vppApache-2.0software data plane

The alternative: a centralised, software-defined network where one controller computes all paths and programs simple switches, instead of distributed routing protocols. It gives global optimisation and simpler failure policy but makes the controller a critical dependency; large operators use a hybrid, with distributed protocols for basic connectivity and a central computation for traffic engineering.

Sources

  • IETF RFCs: 4271 (BGP-4), 4456 (route reflection), 4760 (multiprotocol BGP), 4364 (BGP/MPLS IP VPNs), 2328 (OSPFv2), 1195 (IS-IS for IP), 5305 and 3630 (TE extensions), 3031 (MPLS architecture), 5036 (LDP), 3209 (RSVP-TE), 8402 (segment routing), 8660 (SR with MPLS), 8986 (SRv6 network programming), 9256 (SR policy), 5440 (PCEP), 7752 (BGP-LS), 5880 (BFD), 5286 and 7490 (LFA, remote LFA), 9855 (TI-LFA), 6480, 6811, 8210 (RPKI, origin validation, RTR), 2992 (ECMP analysis), 2475, 3246 (DiffServ, EF), 3168 (ECN), 8289 (CoDel), 8033 (PIE), 7567 (AQM recommendations). All at rfc-editor.org (replace the number in the URL).
  • S. Floyd and V. Jacobson, Random Early Detection Gateways for Congestion Avoidance, IEEE/ACM Transactions on Networking, 1993. M. Shreedhar and G. Varghese, Efficient Fair Queuing Using Deficit Round-Robin, 1995/96.
  • G. Cormode and S. Muthukrishnan, An Improved Data Stream Summary: The Count-Min Sketch and its Applications, Journal of Algorithms, 2005.
  • FRRouting documentation: docs.frrouting.org; BIRD: bird.network.cz; SONiC: sonic-net.github.io/SONiC.

Similar systems

Share the most building blocks with this one.

In-house systems

Named systems of this kind at large companies, with their paper or write-up.