Study guides · Intermediate

Trace routes while old and new forwarding tables coexist

Use a four-router link failure to examine transient loops, installation order, return paths and the limits of a forwarding model.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Follow mixed forwarding states during a change
  2. Construct the transient two-router loop
  3. Separate advertisements, selection and forwarding
  4. Bound the forwarding model’s execution
  5. Check the return path independently
  6. Decompose detection, calculation and installation time
  7. Extend into an isolated experiment deliberately
  8. Keep longest-prefix matching separate from route cost
  9. Exercise: combine old and new tables by hand
  10. Ask Logeia about this articleCheck your understanding

Follow mixed forwarding states during a change

A route that works after convergence does not prove every packet works during change. The earlier forwarding guide covered choosing a next hop by longest-prefix matching. Here a link fails and routers update at different times. Study intermediate combinations of old and new tables, not only the final correct state.

Use A, B, C and destination-side D. Link costs are one for A–B, one for B–D, two for A–C and one for C–D. Initially A forwards through B and B directly to D. After B–D fails, the eventual routes can send A through C and B through A. Route computation and installation into forwarding state are distinct events. Their timing matters even when every final route is individually reasonable.

Construct the transient two-router loop

Let B install its new route before A. B now forwards D-bound packets to A, while old A still sends them to B. The path loops A–B–A. Once A installs its C route, traffic follows A–C–D and B can use B–A–C–D. Both initial and final states work, yet the mixed intermediate state does not. One router finishing calculation is therefore not global convergence.

A missing usable next hop instead creates a black hole, which differs from repeated forwarding. A caller timeout alone does not distinguish them. Record table versions, link state, observation times and forwarding traces. Keep routing-control information exchange separate from application-data forwarding in the diagram; they are related processes, not one identical sequence of packets.

Table combinationForwarding from AResult
OldA → B → DDelivered
Only B updatedA → B → A…Model step limit
All updatedA → C → DDelivered

Separate advertisements, selection and forwarding

A routing protocol defines what information is exchanged, how stale information is treated and which candidate is preferred. Link-state and distance-vector descriptions use different information, but the small forwarding-table model implements neither complete protocol. It does not verify all convergence behavior of one named routing implementation.

Policy-driven selection such as BGP is not simply shortest-distance choice. Longest-prefix matching also selects forwarding behavior from installed entries; it is not the entire route-learning procedure. Distinguish control calculation, chosen routes, installed forwarding tables and individual forwarding events. Those stages help locate which part of a change is delayed. Connect to the existing BGP and IP readings at that boundary rather than using their names as unexplained substitutes for the modeled update sequence.

Bound the forwarding model’s execution

The code maps each point to a next hop for destination D and compares old, mixed and final tables. With a modeled budget of four forwards, the mixed table follows A,B,A,B,A and expires; the final table reaches A,C,D. A finite budget prevents the model itself from looping forever.

The variable named ttl is a teaching bound, not a complete implementation of IPv4 header processing, decrement placement or ICMP generation. No real packet is created or observed. Missing next-hop state produces a separate no-route result. The script changes no router configuration and sends nothing externally. Reproducing its paths validates the table model, not an actual deployment's routing-protocol convergence or packet-loss recovery.

python
def forward(table,start,ttl):
    path=[start]
    while path[-1]!='D' and ttl>0:
        current=path[-1]
        if current not in table:return path,'no-route'
        path.append(table[current]);ttl-=1
    return path,'delivered' if path[-1]=='D' else 'ttl-expired'
old={'A':'B','B':'D','C':'D'};transient={'A':'B','B':'A','C':'D'};new={'A':'C','B':'A','C':'D'}
assert forward(old,'A',4)==(['A','B','D'],'delivered')
assert forward(transient,'A',4)==(['A','B','A','B','A'],'ttl-expired')
assert forward(new,'A',4)==(['A','C','D'],'delivered')
print('old=A-B-D; transient=A-B-A-B-A ttl-expired; converged=A-C-D')
print('forwarding-table model; no live router configuration changes')

Check the return path independently

Delivery toward D does not establish a working return path to A. Policies, filtering, NAT and asymmetric routes can separate one-way from round-trip success. The model only forwards toward D, so its delivered result does not prove a complete HTTP request succeeds. Record direction and observation time explicitly.

Missing traceroute or mtr responses also do not alone prove all application traffic is dropped at that point. Response generation and return routing can differ from the application's packets. Identify whether the diagnostic flow receives the same treatment. This guide performs no external path probing; it teaches selecting observation points. Separate a plausible table, one-way delivery, round-trip delivery and completed application work before interpreting a network diagnosis.

Decompose detection, calculation and installation time

Convergence includes failure detection, information propagation, route computation and forwarding-table installation. Shortening a timer does not necessarily improve the complete system; false detection, flapping and concentrated update work may also change. Actual experiments should measure loss and latency during transition separately from time to a stable final state.

Ordered updates and alternate paths can reduce some transient problems but require their own assumptions and state. Sending one configuration to every router does not make installation simultaneous. Rollback can also recreate mixed old/new states. As with data rebalancing, distinguish correctness of the final arrangement from behavior during cutover. Enumerating which router updates first in the four-point example is a useful planning exercise before attributing a stronger guarantee to a real deployment.

Extend into an isolated experiment deliberately

A real protocol exercise needs isolated namespaces or VMs, a recorded implementation version, controlled links, observation clocks and installed routes. Without privileges or packet visibility, keep unperformed items separate from a passing model. There is no need to change public network routing to learn this example.

Such an exercise also needs cleanup for its own interfaces, namespaces and services without deleting unrelated VPN or business-network configuration. The supplied code creates none of those resources, so only source and results remain. A future real-network extension should distinguish observations of the model, routing protocol and actual packet forwarding. Keep diagrams and empirical evidence aligned at the same layer rather than using one successful layer to imply the others were tested.

Keep longest-prefix matching separate from route cost

Consider a forwarding table where 192.0.2.0/24 uses B, 192.0.0.0/16 uses C and the default uses D. Destination 192.0.2.10 matches the /24 most specifically. Do not place different-length matching prefixes into one cost ranking merely because the default route appears cheaper. Forwarding first depends on the applicable longest-prefix rule.

Choosing among candidates for the same prefix depends on routing policy and protocol information. That selection differs from looking up the longest match in the resulting forwarding table. Calculating a lower OSPF cost does not imply that every destination always uses that next hop, independently of more specific entries.

Removing only the /24 makes the /16 route through C apply in this example. Losing one route therefore does not necessarily produce no-route. Conversely, an aggregate route can lead toward a destination that is not actually reachable beyond it. Extending the model with these conditions requires destination-dependent prefix lookup. The published program fixes next hops for D alone and does not execute a prefix-search algorithm. This boundary keeps a forwarding-table example from claiming a complete router implementation.

Exercise: combine old and new tables by hand

If old A sends to B and new B sends to A, D-bound traffic repeats between A and B until the model's forwarding budget expires. After A switches to C, a valid C-to-D route permits delivery. B having a locally updated route did not prevent a loop while A still held old state.

One-way delivery to D does not prove the response returns to A; inspect reverse routes and filtering separately. Likewise a missing diagnostic-hop reply is not conclusive evidence that application forwarding stopped. Explain possible differences in diagnostic response treatment. Distinguish control information, installed tables, packet path and round-trip completion. Those stages provide a useful analysis framework without claiming the small model measured a live protocol.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Understand the systems behind the web · STEP 9

Choose a learning path