[SNMP4J] SNMP4J Version 3 SecurityLevel.AUTH_PRIV example

Frank Fock fock at agentpp.com
Wed Nov 16 00:40:23 CET 2005


Hi Jack,

Yes, the behavior you outlined is intended. If the target engine ID is
not known to SNMP4J it tries to discover it by a message with security
level noAuthNoPriv. Once the engine ID is available the authPriv level
will be used to exchange the real data.

You can check out MIB Explorer 2 Lite's Packet Analyzer to analyze
the packet exchanged during SNMPv3 engine ID discovery and USM
time synchronization. MIB Explorer 2 Lite uses SNMP4J and can be
downloaded for evaluation from http://www.mibexplorer.com

For more information on the background, see the RFC 3414.

Best regards,
Frank

Houghton, Jack SPAWAR wrote:

>Hi:
>I'm new to SNMP4J. First of all, congratulations on your work and thanks
>for making it available. I have been tracing through the code and don't
>understand one section. Let's say we want to send a SNMPv3 message
>(GETNEXT) with authentication and privacy as illustrated in the javadoc
>for the Snmp class. After performing the necessary initialization this
>call is made:
> 
>ResponseEvent response = snmp.send(pdu, target);
>
>This results in a call to
>Snmp.send( PDU              pdu,
>           Target           target,
>           TransportMapping transport ), which in turn calls
> 
>Snmp.sendMessage( PDU              pdu,
>                  Target           target,
>                  TransportMapping transport ), which in turn calls
> 
>MessageDispatcherImpl.sendPdu( TransportMapping transport,
>                               Address          transportAddress,
>                               int              messageProcessingModel,
>                               int              securityModel,
>                               byte[]           securityName,
>                               int              securityLevel,
>                               PDU              pdu,
>                               boolean          expectResponse ),
> 
>which in turn calls 
> 
>MPv3.prepareOutgoingMessage( Address         transportAddress,
>                             int             maxMessageSize,
>                             int             messageProcessingModel,
>                             int             securityModel,
>                             byte[]          securityName,
>                             int             securityLevel,
>                             PDU             pdu,
>                             boolean         expectResponse,
>                             PduHandle       sendPduHandle,
>                             Address         destTransportAddress,
>                             BEROutputStream outgoingMessage )
>
>In the body of this method, although securityLevel is input as
>SecurityLevel.AUTH_PRIV, because the MPv3 Hashtable variable engineIDs
>doesn't have any elements, securityLevel will be reset to
>SecurityLevel.NOAUTH_NOPRIV. Is this the desired behavior? Or have I
>missed something?
> 
>Thanks,
>Jack Houghton
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>
>  
>


-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com





More information about the SNMP4J mailing list