Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SNMPv3 Packet Header (Data Plane Only) #366

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

biplamal
Copy link
Contributor

@biplamal biplamal commented Mar 20, 2024

Redocly View:
ReDoc Interactive Demo (redocly.github.io)
( New object at : set_config/flows/packet/snmpv3 )

SNMPv3-RFC3412
USM-RFC2274
USM-SNMPv3-RFC2574

Requirement:
The user able to define SNMPv3 data plane packet headers. Purpose is to flood DUT with SNMPv3 request and responses. The user should be able to configure different fields in Global Data, Security Parameters and Data with ability to specify Increment/Decrement operations on certain applicable fields in the specified fields.

Example usage:

        f1 := config.Flows().Items()[0]
	f1.SetName("flow-snmpv3").
		TxRx().Port().SetTxName("port1").SetRxName("port2")

	f1.Duration().FixedPackets().SetPackets(100)
	f1.Rate().SetPps(10)

	f1.Packet().Add().Ethernet()
	f1.Packet().Add().Ipv4()
	f1.Packet().Add().Tcp()

	// SNMPv3 Header
	flowSnmpv3 := f1.Packet().Add().Snmpv3()

	// Version
	flowSnmpv3.Version().SetValue(3)

	// Global Data
	globalData := flowSnmpv3.GlobalData()
	globalData.Id().SetValue(1)
	globalData.MaxSize().SetValue(100)
	globalData.Flags().
		SetReportable(true)
	globalData.SecurityModel().SetValue(1)

	// Security Parameters

	// No Authentication
	securityParams := flowSnmpv3.SecurityParameters()
	securityParams.SetAuthoritativeEngineId("80004f4db1aadcadbc89affa118dbd53824c6b05")
	securityParams.AuthoritativeEngineBoots().SetValue(3)
	securityParams.AuthoritativeEngineTime().SetValue(68125)
	securityParams.SetUserName("tchyon")

	// Data
	plainText := flowSnmpv3.ScopedData()
	plainText.SetContextName("tchyon")
	plainText.SetContextEngineId("80004f4db1aadcadbc89affa118dbd53824c6b05")
	pdu := plainText.Data().GetRequest()
	pdu.RequestId().SetValue(722681733)
	pdu.SetErrorStatus(gosnappi.FlowSnmpv2CPDUErrorStatus.WRONG_VALUE)
	pdu.ErrorIndex().SetValue(0)
	varBinds := pdu.VariableBindings().Add()
	varBinds.SetObjectIdentifier("0.1")
	varBinds.Value().TimeticksValue().SetValue(20)

	// Authentication

	md5 := securityParams.AuthenticationParameters().Md5()
	md5.SetPassword("abcd")

@biplamal biplamal added the enhancement New feature or request label Mar 20, 2024
@biplamal biplamal linked an issue Mar 20, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for SNMPv3 data plane packet header
3 participants