Skip to content

junos: add lab for BGP receive-buffer and send-buffer - #242

Merged
dhalperi merged 1 commit into
mainfrom
junos-bgp-socket-buffers
Oct 2, 2026
Merged

dhalperi merged 1 commit into
mainfrom
junos-bgp-socket-buffers

Conversation

@dhalperi

@dhalperi dhalperi commented Oct 2, 2026

Copy link
Copy Markdown
Member

vJunos-router 25.4R1.12 lab for the undocumented receive-buffer and
send-buffer statements. Both are hidden from set protocols bgp ?
but accepted at the protocol, group, and neighbor levels, in the
master instance, virtual-router and vrf instances, and logical
systems; they are rejected under family, multihop, traceoptions,
and routing-options. The value is a byte count from 0 to 4294967295
with an optional k, m, or g suffix (powers of 1024); hex and
leading-zero octal forms are accepted. Junos displays the value with
the largest suffix that divides it exactly and leaves a quotient below
1024, otherwise as plain bytes: 65536 and 0x10000 show as 64k,
1536k as 1572864, and 010 as 8. show bgp neighbor reports the
effective sizes (neighbor over group over protocol, per direction), and
changing them resets the session. dut peers with a cEOS peer in the
master instance and a VR1 virtual-router, each with all three levels
configured.

Batfish does not parse either statement. In display set form the
buffer lines are dut's only neighbor lines, so Batfish has no BGP peers
on dut; test_main_rib_routes[dut] and test_bgp_rib_routes[dut] are
sickbayed to batfish/batfish#10375.

lab_builder: add a bgp_peer_bufsize check that asserts the buffer
sizes show bgp neighbor reports. _junos_commit_check now also
treats a ^ marker line in response to a set line as a rejection;
invalid numeric values print no error or syntax error text.

For batfish/batfish#10375.


Prompt:

  Create a Junos lab validation for the undocumented BGP commands:

  set protocols bgp receive-buffer 64k
  set protocols bgp send-buffer 64k
  set protocols bgp group TEST receive-buffer 128k
  set protocols bgp group TEST send-buffer 128k
  set protocols bgp group TEST neighbor 192.0.2.1 receive-buffer 256k
  set protocols bgp group TEST neighbor 192.0.2.1 send-buffer 256k

  Determine which scopes and value formats Junos accepts. Also test within a routing instance if practical. Record the platform
  and exact Junos version, commit-check results, and normalized configuration output.

  Use anonymized names and documentation addresses. Restore the lab afterward. Add the results to batfish/lab-validation and
  open a PR.

vJunos-router 25.4R1.12 lab for the undocumented `receive-buffer` and
`send-buffer` statements. Both are hidden from `set protocols bgp ?`
but accepted at the protocol, group, and neighbor levels, in the
master instance, virtual-router and vrf instances, and logical
systems; they are rejected under `family`, `multihop`, `traceoptions`,
and `routing-options`. The value is a byte count from 0 to 4294967295
with an optional k, m, or g suffix (powers of 1024); hex and
leading-zero octal forms are accepted. Junos displays the value with
the largest suffix that divides it exactly and leaves a quotient below
1024, otherwise as plain bytes: `65536` and `0x10000` show as `64k`,
`1536k` as `1572864`, and `010` as `8`. `show bgp neighbor` reports the
effective sizes (neighbor over group over protocol, per direction), and
changing them resets the session. dut peers with a cEOS peer in the
master instance and a VR1 virtual-router, each with all three levels
configured.

Batfish does not parse either statement. In `display set` form the
buffer lines are dut's only neighbor lines, so Batfish has no BGP peers
on dut; test_main_rib_routes[dut] and test_bgp_rib_routes[dut] are
sickbayed to batfish/batfish#10375.

lab_builder: add a `bgp_peer_bufsize` check that asserts the buffer
sizes `show bgp neighbor` reports. `_junos_commit_check` now also
treats a `^` marker line in response to a `set` line as a rejection;
invalid numeric values print no `error` or `syntax error` text.

For batfish/batfish#10375.

----

Prompt:
```
  Create a Junos lab validation for the undocumented BGP commands:

  set protocols bgp receive-buffer 64k
  set protocols bgp send-buffer 64k
  set protocols bgp group TEST receive-buffer 128k
  set protocols bgp group TEST send-buffer 128k
  set protocols bgp group TEST neighbor 192.0.2.1 receive-buffer 256k
  set protocols bgp group TEST neighbor 192.0.2.1 send-buffer 256k

  Determine which scopes and value formats Junos accepts. Also test within a routing instance if practical. Record the platform
  and exact Junos version, commit-check results, and normalized configuration output.

  Use anonymized names and documentation addresses. Restore the lab afterward. Add the results to batfish/lab-validation and
  open a PR.
```
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.59%. Comparing base (a5bf02f) to head (3d3e070).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #242   +/-   ##
=======================================
  Coverage   83.59%   83.59%           
=======================================
  Files          96       96           
  Lines        4706     4706           
=======================================
  Hits         3934     3934           
  Misses        772      772           
Flag Coverage Δ
unittests 83.59% <ø> (ø)

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.

@dhalperi
dhalperi merged commit 2b79b9e into main Oct 2, 2026
148 checks passed
@dhalperi
dhalperi deleted the junos-bgp-socket-buffers branch October 2, 2026 00:27
dhalperi added a commit to batfish/batfish that referenced this pull request Oct 2, 2026
Parse and extract `receive-buffer` and `send-buffer` at the protocol,
group, and neighbor hierarchies. Apply Junos inheritance to both
settings.

Fixes #10375.
For batfish/lab-validation#242.
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