Skip to content

junos: add lab for BGP path-selection compare-cluster-length-before-originator-id - #238

Merged
dhalperi merged 1 commit into
mainfrom
junos-bgp-cluster-length-before-originator-id
Sep 30, 2026
Merged

dhalperi merged 1 commit into
mainfrom
junos-bgp-cluster-length-before-originator-id

Conversation

@dhalperi

@dhalperi dhalperi commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

vJunos-router 25.4R1.12 lab for the undocumented path-selection compare-cluster-length-before-originator-id statement. It is hidden
from set protocols bgp path-selection ? but accepted as a leaf in the
master instance, virtual-router and vrf instances, and logical systems;
path-selection does not exist at the group or neighbor level. dut
receives two reflected iBGP paths for 203.0.113.0/24 that tie until the
originator-ID step: A with a one-entry cluster list and originator
10.255.0.9, B with a two-entry cluster list and originator 10.255.0.1.
Without the statement Junos selects B ("Router ID"); with it, A
("Cluster list length"). Committing or deleting the statement on a
live session changes the selection without a session reset. dut runs
both states at once, in the master instance and a KNOB virtual-router.
The reflectors and originators are cEOS.

Batfish does not parse the statement and selects B in both instances;
test_bgp_rib_routes[dut] is sickbayed to batfish/batfish#10370 and to
#239, since JunosValidator drops Batfish's iBGP
routes in non-default VRFs before matching.

lab_builder: add a bgp_active_path check that asserts a Junos
prefix's active BGP path by originator ID and the inactive reason on
the other paths.

Junos BGP parser: accept the (Originator) flag and the Cluster list: and Originator ID: lines that reflected routes add to the
as-path field.

For batfish/batfish#10370 and #239.


Prompt:

• Create a public lab-validation experiment for Junos
  `compare-cluster-length-before-originator-id`.

  Use vJunos-router and anonymized addresses, ASNs, and hostnames. Validate:

  1. Whether this syntax commits:
     set protocols bgp path-selection compare-cluster-length-before-originator-id

  2. Whether it also commits under a routing instance. Check and document
     rejection at plausible unsupported levels such as group and neighbor.

  3. Its route-selection behavior. Advertise two otherwise equivalent iBGP
     routes for the same prefix:
     - one with a shorter cluster list but a larger originator ID
     - one with a longer cluster list but a smaller originator ID

  Arrange the attributes so the originator-ID and cluster-list comparisons
  prefer opposite paths. Record the selected path without the statement,
  then enable the statement and record whether the selected path changes.

  Capture the Junos version, commit results, relevant configuration, received
  BGP attributes, and selected-route output. Explain any lab limitations in
  the README and keep all committed artifacts suitable for a public GitHub
  repository.

Six vJunos-router VMs oversubscribed the lab host's CPU, so only dut
runs Junos and the other nodes are cEOS.

@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.59%. Comparing base (512d50c) to head (82e751b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   83.59%   83.59%           
=======================================
  Files          96       96           
  Lines        4705     4706    +1     
=======================================
+ Hits         3933     3934    +1     
  Misses        772      772           
Flag Coverage Δ
unittests 83.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…riginator-id

vJunos-router 25.4R1.12 lab for the undocumented `path-selection
compare-cluster-length-before-originator-id` statement. It is hidden
from `set protocols bgp path-selection ?` but accepted as a leaf in the
master instance, virtual-router and vrf instances, and logical systems;
`path-selection` does not exist at the group or neighbor level. dut
receives two reflected iBGP paths for 203.0.113.0/24 that tie until the
originator-ID step: A with a one-entry cluster list and originator
10.255.0.9, B with a two-entry cluster list and originator 10.255.0.1.
Without the statement Junos selects B ("Router ID"); with it, A
("Cluster list length"). Committing or deleting the statement on a
live session changes the selection without a session reset. dut runs
both states at once, in the master instance and a KNOB virtual-router.
The reflectors and originators are cEOS.

Batfish does not parse the statement and selects B in both instances;
test_bgp_rib_routes[dut] is sickbayed to batfish/batfish#10370 and to
#239, since JunosValidator drops Batfish's iBGP
routes in non-default VRFs before matching.

lab_builder: add a `bgp_active_path` check that asserts a Junos
prefix's active BGP path by originator ID and the inactive reason on
the other paths.

Junos BGP parser: accept the `(Originator)` flag and the `Cluster
list:` and `Originator ID:` lines that reflected routes add to the
`as-path` field.

For batfish/batfish#10370 and #239.

----

Prompt:
```
• Create a public lab-validation experiment for Junos
  `compare-cluster-length-before-originator-id`.

  Use vJunos-router and anonymized addresses, ASNs, and hostnames. Validate:

  1. Whether this syntax commits:
     set protocols bgp path-selection compare-cluster-length-before-originator-id

  2. Whether it also commits under a routing instance. Check and document
     rejection at plausible unsupported levels such as group and neighbor.

  3. Its route-selection behavior. Advertise two otherwise equivalent iBGP
     routes for the same prefix:
     - one with a shorter cluster list but a larger originator ID
     - one with a longer cluster list but a smaller originator ID

  Arrange the attributes so the originator-ID and cluster-list comparisons
  prefer opposite paths. Record the selected path without the statement,
  then enable the statement and record whether the selected path changes.

  Capture the Junos version, commit results, relevant configuration, received
  BGP attributes, and selected-route output. Explain any lab limitations in
  the README and keep all committed artifacts suitable for a public GitHub
  repository.
```

Six vJunos-router VMs oversubscribed the lab host's CPU, so only dut
runs Junos and the other nodes are cEOS.
@dhalperi
dhalperi force-pushed the junos-bgp-cluster-length-before-originator-id branch from 687dfdb to 82e751b Compare September 30, 2026 06:06
@dhalperi
dhalperi enabled auto-merge (squash) September 30, 2026 06:07
@dhalperi
dhalperi merged commit 4df60e7 into main Sep 30, 2026
147 checks passed
@dhalperi
dhalperi deleted the junos-bgp-cluster-length-before-originator-id branch September 30, 2026 06:23
dhalperi added a commit to batfish/batfish that referenced this pull request Sep 30, 2026
Extract the per-instance BGP path-selection setting and convert it to
the cluster-list-length tie-breaker. Make that tie-breaker compare
cluster-list length before originator ID.

Fixes #10370.
For batfish/lab-validation#238.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants