An issue about snmpset in SNMPv3

Hi Frank,
I meet an issue about snmpset in SNMPv3.
I have override the commit function of a scalar, add some handling functions there. the handling function will usually cost more than 1 second.
If user use snmpset in SNMPv3 like this:
”snmpset -v3 -u snmpuser2 -l authNoPriv -a sha -A 12345abcde 10.10.20.1 1.3.6.1.4.1.44886.10.13.1.5.2.0 x e4a1e68a2f13“
The request will always fail.

because the user don’t set “-t” and “-r” param of snmpset, it will retry every 1 second as default.

Therefore, when the first try timed out, our handling function has not finished yet. when it finished and snmp4j-agent return response to net-snmp, the second request try is on.
and because the msgID in response is the first try’s, can’t match the second try’s msgID, net-snmp droped this “success” response.
then in third try, because the action can’t do twice in our logic, so we return “fail” response immediately, then the final result showed in net-snmp is “failed”.



In this scenario, if user don’t adjust “-t”, and the handling need take more than 1 second indeed, could Snmp4j-Agent return the response to net-snmp with the msgID in current on-going try?
Thanks.

BR,
Terry

Hi Terry,

What you described is the expected behaviour according to the SNMP(v3) standard.

The SNMPv3 msgID must be unique for all messages send by an entity. That is required by the standard.

Nevertheless, you are allowed to (and should) send retries with the same Request-ID (which is in the Scoped PDU, not in the SNMPv3 header). The logic to align the possibly different responses for the same Request-ID is left to the command sender (your NET-SNMP tool).

Best regards,
Frank