Skip to content

gnpsi fixes#5094

Open
mnp-juniper wants to merge 3 commits intoopenconfig:mainfrom
mnp-juniper:sample
Open

gnpsi fixes#5094
mnp-juniper wants to merge 3 commits intoopenconfig:mainfrom
mnp-juniper:sample

Conversation

@mnp-juniper
Copy link
Copy Markdown
Contributor

@mnp-juniper mnp-juniper commented Feb 17, 2026

** Added vendor-specific sflow frame size adjustments - stripping 4byte FCS as per our architecture
** Skipping gnpsi configuration for juniper vendor since its implicitly enabled with sflow configs.
** Added gNPSI service mapping (svcsproxy) for Juniper devices.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mnp-juniper, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces enhancements to the gNPSI (gRPC Network Packet Sampling Interface) test suite to better accommodate vendor-specific behaviors, particularly for Juniper devices. It refines how SFlow packet sizes are verified and how gNPSI is configured, ensuring more accurate and compatible testing across different network equipment vendors.

Highlights

  • Vendor-specific SFlow frame size adjustments: The adjustedFrameSizeMap has been refactored to support different frame size calculations based on the device vendor, specifically adding entries for Juniper devices and a general fallback.
  • Conditional gNPSI configuration for Juniper: The configureDUT function now skips explicit gNPSI configuration for Juniper devices, as it's implicitly handled with sFlow on those platforms.
  • Juniper gNPSI service mapping: Added the GNPSI service mapping (svcsProxy) for Juniper devices in the GNOI configuration.
  • Improved SFlow packet verification: The verifySFlowPacket function was updated to correctly apply vendor-specific frame size adjustments when validating SFlow packet sizes.
Changelog
  • feature/gnpsi/otg_tests/sampling_test/sampling_and_subscription_check_test.go
    • Introduced a vendorFallback constant for default vendor behavior.
    • Restructured adjustedFrameSizeMap to support vendor-specific frame size adjustments, including new entries for Juniper and a fallback.
    • Updated verifySFlowPacket to use the new vendor-aware frame size lookup logic.
    • Modified configureDUT to prevent redundant gNPSI configuration for Juniper devices.
  • internal/gnoi/gnoi.go
    • Added the GNPSI service mapping for Juniper devices, pointing to "svcsProxy".
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Feb 17, 2026

Pull Request Functional Test Report for #5094 / 28128e0

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
gNPSI-1: Sampling and Subscription Check
Cisco 8000E status
gNPSI-1: Sampling and Subscription Check
Cisco XRd status
gNPSI-1: Sampling and Subscription Check
Juniper ncPTX status
gNPSI-1: Sampling and Subscription Check
Nokia SR Linux status
gNPSI-1: Sampling and Subscription Check
Openconfig Lemming status
gNPSI-1: Sampling and Subscription Check

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
gNPSI-1: Sampling and Subscription Check
Cisco 8808 status
gNPSI-1: Sampling and Subscription Check
Juniper PTX10008 status
gNPSI-1: Sampling and Subscription Check
Nokia 7250 IXR-10e status
gNPSI-1: Sampling and Subscription Check

Help

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces fixes for gNPSI tests, primarily by adding vendor-specific handling for Juniper devices. This includes adding a process name for the gNPSI daemon on Juniper, skipping gNPSI configuration when sFlow is configured, and providing vendor-specific frame size adjustments for sFlow packet verification. A fallback mechanism for frame sizes is also introduced for unknown vendors. The changes improve the test's adaptability to different vendor platforms. I've suggested a small refactoring to improve code clarity and reduce duplication in the frame size lookup logic.

Comment on lines +531 to 543
if vendorMap, found := adjustedFrameSizeMap[vendor]; found {
if adjustedValues, found := vendorMap[flowConfig.frameSize]; found {
if size, found := adjustedValues[flowConfig.ipType]; found {
adjustedSize = size
}
}
} else if fallbackMap, found := adjustedFrameSizeMap[vendorFallback]; found {
if adjustedValues, found := fallbackMap[flowConfig.frameSize]; found {
if size, found := adjustedValues[flowConfig.ipType]; found {
adjustedSize = size
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for looking up the adjusted frame size is duplicated for the vendor-specific case and the fallback case. This can be simplified to reduce duplication and improve readability.

	vendorMap, ok := adjustedFrameSizeMap[vendor]
	if !ok {
		vendorMap = adjustedFrameSizeMap[vendorFallback]
	}

	if frameMap, ok := vendorMap[flowConfig.frameSize]; ok {
		if size, ok := frameMap[flowConfig.ipType]; ok {
			adjustedSize = size
		}
	}

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 22108615141

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 10.091%

Totals Coverage Status
Change from base Build 22106454291: 0.0%
Covered Lines: 2300
Relevant Lines: 22792

💛 - Coveralls

@mnp-juniper mnp-juniper marked this pull request as ready for review February 18, 2026 04:36
@mnp-juniper mnp-juniper requested a review from a team as a code owner February 18, 2026 04:36
@Shridhevi
Copy link
Copy Markdown

Changes made on this commit : [increasing traffic volume] 15fed9e

============================
** Increased traffic duration and packet rate in order to generate higher traffic volume so as to achieve better consistency and accuracy in sampling count measurements
** Sampling rate updated proportionally to maintain expected sampled packet count (~100)
Total packets sent (n): 1,000,000,000
Sampling rate i.e. sampling probability (p): 1/10,000,000
Expected sampled packets i.e. mean (e) = n*(1/p) = 100

Variance = np(1-p) = 99.99999 ≈ 100
Standard deviation (σ) = sqrt(variance) = 10
Using a tolerance of ±2σ in order to have 95%+ confidence interval in the measured sample count, acceptable range is e±2σ = 100 ± 2*10, i.e. 80–120 sampled packets.

** Added handling for Juniper's "gNPSI client subscribe request is closed by server" error message during gNPSI service restarts

============================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants