Can an LLM Reason About BGP Route-Reflector Loop Prevention? Blind Test, Corrected to 5/5
Small, real, reproducible test run 16 November 2026 - BGP route-reflector (RFC 4456) loop-prevention logic across a redundant-RR topology, graded blind against an independently computed ground truth. Disclosure: this article was drafted with AI assistance; the test itself was run against a second, independent model instance so the author's own writing didn't also grade its own homework. Correction (20 November 2026): our original ground truth for two of the five questions was wrong. Re-checked against RFC 4456, the model scored 5 out of 5 - see the correction box below.
The first ten tests in this series all landed at or near 100% against their ground truth - BGP best-path, LPM, LDP/LFIB, SPF, ACL ordering, CIDR summarization, STP election, route redistribution, VRRP/HSRP, and a QoS token-bucket policer. That streak invites a question worth asking directly: is the model actually reliable, or have ten tests simply not yet found its blind spot? This eleventh test went looking for one on purpose, using BGP route-reflector CLUSTER_LIST and ORIGINATOR_ID loop prevention (RFC 4456) - a mechanism with subtle, easy-to-misremember mechanics that doesn't behave like the more famous AS_PATH loop prevention it superficially resembles. The original write-up reported 3 out of 5 with two misses; after re-checking RFC 4456, both "misses" turned out to be errors in our own ground truth, and the model was correct on all 5.
Two of our ground-truth answers were wrong, so the two misses originally reported here were not model errors.
- Q_D: RFC 4456 section 8: "When an RR reflects a route, it MUST prepend the local CLUSTER_ID to the CLUSTER_LIST." The RFC's change log notes the switch from "append" to "prepend" to reflect deployed code. Correct answer: [20,10] - the model's answer.
- Q_E: RFC 4456 section 9 inserts a rule between steps f) and g) of the BGP decision process: "a BGP Speaker SHOULD prefer a route with the shorter CLUSTER_LIST length." Correct answer: true - the model's answer.
- Corrected score: 5 of 5. The lesson changes but stays useful: a deterministic checker is only as good as the rules typed into it - verify the checker against the primary source, not memory.
- Tested RFC 4456 route-reflector loop prevention across a topology with a REDUNDANT pair of route reflectors sharing the same configured cluster-id - a realistic HA design, not an edge case invented for the test.
- The model correctly caught the hardest trap: a route reflector must reject an inbound update whose CLUSTER_LIST already contains its OWN cluster-id, even when that specific copy was never personally sent by this router before (the check is on cluster-id identity, shared by the redundant pair, not per-router identity).
- The model correctly caught the ORIGINATOR_ID trap: a route reflector must not forward a route back to the client whose router-id matches the route's ORIGINATOR_ID.
- CLUSTER_LIST direction: the model answered that the reflecting router prepends its own cluster-id ([20,10]). That is correct per RFC 4456 section 8; our original ground truth ([10,20], append) was wrong.
- CLUSTER_LIST length as a tie-breaker: the model answered true, which is correct - RFC 4456 section 9 adds "prefer the shorter CLUSTER_LIST length" to the decision process as a late tie-breaker (after the lowest BGP Identifier / ORIGINATOR_ID comparison). Our original ground truth said false.
- Actionable conclusion: the model went 5/5, our checker went 3/5. A deterministic ground-truth script is only as reliable as the rules encoded in it - check the script line by line against the RFC text before using it to grade anyone, human or model.
Why route-reflector loop prevention is a good test · The test: a redundant-RR topology with 5 questions · What came back - and what didn't · Citations · Eleven tests, and a lesson about the checker · FAQ
Why route-reflector loop prevention is a good test
BGP route reflectors (RFC 4456) exist to avoid the full-mesh iBGP scaling problem, but removing the full mesh also removes the loop-prevention guarantee that a full mesh gives for free. RR deployments substitute two different attributes for that guarantee: CLUSTER_LIST (a list of cluster-ids a route has been reflected through, checked against the receiving router's own cluster-id) and ORIGINATOR_ID (the router-id of whoever first injected the prefix, checked against the client it's about to be sent back to). Both mechanisms are well documented, but they get mixed up with the much more famous AS_PATH loop-prevention mechanism in ways that produce specific, predictable mistakes: assuming CLUSTER_LIST behaves like AS_PATH for path selection (it doesn't - it's not a best-path criterion at all), or assuming a loop check is tied to a physical router's identity rather than its configured cluster-id (it isn't, which matters a lot once you add redundant RRs sharing a cluster-id, a very common production design for HA).
The test: a redundant-RR topology with 5 questions
Topology: client C1 (router-id 1.1.1.1) is a direct iBGP client of route reflector RR_A (cluster-id 10). RR_B and RR_C are a REDUNDANT PAIR of route reflectors sharing the SAME configured cluster-id 20 - a standard HA design where either box can serve the same set of clients. RR_A, RR_B and RR_C all peer with each other as non-client iBGP ("RR mesh").
Q_A: C1 -> RR_A -> RR_B, update at RR_B carries CLUSTER_LIST=[10].
RR_B's own cluster-id is 20. ACCEPT or REJECT?
Q_B: RR_B (having accepted Q_A) reflects onward to its peer RR_C.
Update at RR_C carries CLUSTER_LIST=[10,20]. RR_C's own
cluster-id is also 20 (redundant pair, SAME cluster-id as RR_B).
ACCEPT or REJECT?
Q_C: RR_A later receives (via RR_C) an update for this prefix with
ORIGINATOR_ID=1.1.1.1 - C1's own router-id. Should RR_A forward
this update back to client C1? true/false.
Q_D: RR_B (cluster-id 20) reflects a route with incoming
CLUSTER_LIST=[10]. What is the correct outgoing CLUSTER_LIST?
Q_E: Two otherwise fully-tied iBGP paths differ only in CLUSTER_LIST
length (1 vs 3). Is CLUSTER_LIST length a best-path tie-breaker,
the way AS_PATH length is? true/false.
Ground truth was computed independently in Python, encoding RFC 4456's rules directly rather than hand-checking (ops/rr_cluster_test_calc.py → ops/rr_cluster_test_ground_truth.json): Q_A ACCEPT (RR_B's cluster-id 20 not yet in [10]), Q_B REJECT (RR_C's cluster-id 20 is already in [10,20] - the redundant pair's shared cluster-id makes RR_C's own earlier-in-time direct copy and RR_B's reflected copy collide at the loop check even though RR_C personally never touched this specific copy), Q_C false (ORIGINATOR_ID matches C1's own router-id, so RR_A must not send the prefix back to its originator), Q_D [20,10] and Q_E true (corrected 20 November 2026 - the original script encoded [10,20] and false, which contradicts RFC 4456 sections 8 and 9).
What came back - and what didn't
| Question | Ground truth | Why it's notable | Model's answer | Match? |
|---|---|---|---|---|
| A (control) | ACCEPT | Straightforward - RR_B's cluster-id isn't in the list yet | ACCEPT | Yes |
| B (redundant-RR trap) | REJECT | Hardest trap - loop check is on shared cluster-id, not per-router identity | REJECT | Yes |
| C (ORIGINATOR_ID trap) | false (don't forward to C1) | A route reflector must not return a prefix to its originator | false | Yes |
| D (append direction) | [20,10] (corrected) | Own cluster-id is PREPENDED (RFC 4456 section 8) | [20,10] (prepended) | Yes |
| E (best-path criterion) | true (corrected) | Shorter CLUSTER_LIST is preferred as a late tie-breaker (RFC 4456 section 9) | true | Yes |
5 of 5 correct after correction. The original version of this article scored Q_D and Q_E as misses and explained them as a "mechanical detail" and a "false analogy to AS_PATH". Both explanations were ours, not the model's: RFC 4456 says the RR MUST prepend its CLUSTER_ID, and it explicitly adds shorter-CLUSTER_LIST preference to the BGP decision process. The false analogy was in our grading script.
Citations
Unlike the pure-arithmetic tests (SPF, LPM, CIDR, STP cost math, the QoS policer), this test deals with named, documented protocol mechanics, and the model's reply carried no citation links in its raw JSON-only answer (the prompt explicitly asked for JSON only, no explanation) - consistent with earlier tests where a tightly-scoped, closed-form question produces no visible citation trail even when the underlying knowledge is clearly document-sourced (RFC 4456 for CLUSTER_LIST/ORIGINATOR_ID, Cisco's RR configuration guide for the operational behavior). The two sources backing this article's own ground-truth claims are listed below and were both re-verified live before publishing.
Eleven tests, and a lesson about the checker
Eleven tests now. The original version reported this as the first sub-100% score; after correction it is another clean pass - and the more useful data point is that our own deterministic checker was wrong on two of five rules. The workflow below still holds, with one addition: the ground-truth script must itself be checked against the primary source (the RFC text), because a wrong checker will confidently mark correct answers as failures.
| Step | Who does it | How you check it |
|---|---|---|
| 1. RR topology/update attributes → structured input | LLM | Schema check against actual cluster-ids, CLUSTER_LIST contents and ORIGINATOR_ID values in the real config/update |
| 2. Per-question ACCEPT/REJECT, forward/no-forward, append order, best-path-criterion verdicts | LLM, or your own code | Diff against a deterministic script implementing RFC 4456's literal rules - don't assume a list attribute used for loop prevention also behaves like AS_PATH for path selection |
| 3. Present the result | LLM, fed the already-verified decision | Specifically re-check any topology with redundant route reflectors sharing a cluster-id, and any claim that an attribute used in loop detection is ALSO used in best-path selection |
For the earlier tests in this series, see Can an LLM Run a Token-Bucket QoS Policer?, Can an LLM Get VRRP/HSRP Master Election Right?, and Can an LLM Get Route Redistribution Right?. For keeping an AI agent bounded and read-only around real device state more generally, see our piece on a read-only network change reviewer.
Frequently asked questions
Why must a route reflector reject an update whose CLUSTER_LIST already contains its own cluster-id?
Because that means the route has already passed through a router (or a router sharing that cluster-id) in this reflection path, so accepting and re-reflecting it again would create a routing-information loop. CLUSTER_LIST is BGP's loop-prevention mechanism for route reflectors, analogous in purpose to how AS_PATH prevents eBGP loops, but checked against cluster-id rather than AS number.
If two route reflectors share the same cluster-id for redundancy, does the loop check still work correctly between them?
Yes, and in fact the loop check treats them as interchangeable on purpose: because the check compares a receiving router's OWN cluster-id against the CLUSTER_LIST already on the route, a redundant pair sharing one cluster-id will correctly reject a route that already passed through either member of the pair, even if this exact router never personally touched that specific copy before.
Is CLUSTER_LIST length used as a BGP best-path tie-breaker, like AS_PATH length?
Yes, as a late tie-breaker. RFC 4456 section 9 inserts a rule between steps f) and g) of the BGP decision process: a BGP speaker SHOULD prefer the route with the shorter CLUSTER_LIST (length zero when the attribute is absent). It ranks far below AS_PATH length, after the lowest BGP Identifier comparison (where ORIGINATOR_ID stands in for the router-id of reflected routes).
When a route reflector adds its cluster-id to CLUSTER_LIST, does it go at the front or the back of the list?
The front. RFC 4456 section 8: when an RR reflects a route it MUST prepend its local CLUSTER_ID to the CLUSTER_LIST, creating the list if it is empty; it never replaces the existing list. The older RFC 2796 text said append - RFC 4456 changed it to prepend to match deployed code.
Sources
Checked 16 November 2026.
- IETF, RFC 4456 "BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)" - the normative definition of CLUSTER_LIST and ORIGINATOR_ID loop prevention this test implements - rfc-editor.org/rfc/rfc4456.html
- Cisco, "BGP Route Reflectors" support document - operational cluster-id, CLUSTER_LIST and redundant-RR configuration guidance as implemented on real routers - cisco.com/.../13762-40.html
- Ground-truth script and raw model reply:
ops/rr_cluster_test_calc.py,ops/rr_cluster_test_ground_truth.json, full exchange logged inops/szafa_log.md(2026-11-16T20:15).
Try it: BGP Route Lookup - free, runs in your browser. Also try: CIDR to IP Range - free, runs in your browser.
Related reading
- Can an LLM Pick the Right EIGRP Feasible Successor? DUAL's Strict-Inequality Trap
- Claude Fable 5.2: Six Useful Projects Beyond the Viral Demos
- Build a Read-Only Network Change Reviewer with Claude Fable 5.2
- GPT-6 Cyber and Prompt Injection: How Untrusted Text Reaches Agent Tools
- BGP Route-Map Order Troubleshooting: Fix Policies That Match the Wrong Prefix
- BGP Max-Prefix and Prefix-Limit: Stop Route Leaks Before They Take Down Peering
Comments
Post a Comment