SNMPv3 defines a new packet format, as shown in Figure 1.
The following describes the fields in an SNMPv3 packet:
SNMPv3 provides SNMPv3 entities through which all SNMP-enabled NMSs can manage SNMP-enabled network elements. An SNMPv3 entity consists of SNMPv3 engines and applications, which in turn consist of multiple modules.
USM: provides a shared key between the NMS and agents to authenticate user identities and encrypt data.
Identity authentication: a process in which an agent (or NMS) determines whether a received message is from an authorized NMS (or agent) and whether the message is modified during transmission. RFC 2104 defines Keyed-Hashing for Message Authentication Code (HMAC), which is a tool that uses the security hash function and key to generate message authentication codes and is widely used on the Internet. HMAC mechanisms that SNMP uses include HWAC-MD5-96 and HWAC-SHA-96. The hash function of HWAC-MD5-96 is MD5, which uses a 128-bit authKey to generate keys. The hash function of HWAC-SHA-96 is SHA-1, which uses a 160-bit authKey to generate keys.
Data encryption: Like identity authentication, data encryption also requires the network management station and the agent to use a shared key for encryption or decryption. ESP encrypts the IP packet contents to prevent them from being intercepted during transmission. Encryption algorithms are implemented using a symmetric key system, which uses the same key to encrypt and decrypt data. SNMP uses the following encryption algorithms:
The following are the three encryption algorithms, listed from most to least secure: AES, 3DES, and DES. A more secure encryption algorithm requires more system resources, which slows down the computing speed. To ensure device security, it is advised to use the more secure encryption algorithms AES.
VACM: controls access of user groups or community names based on views. You must pre-configure a view and specify its authority. Then, when you configure a user, user group, or community, you must load this view to implement read/write restrictions or Inform/trap functions.
SNMPv3 has a similar mechanism to SNMPv1 and SNMPv2c. The only difference is that SNMPv3 supports identity authentication and encryption. The following uses the Get operation as an example to describe the SNMPv3 mechanism.
The NMS sends a GetRequest packet without security parameters to the agent and requests the values of Context EngineID, Context Name, and security parameter.
The agent returns a response that contains the requested parameters.
The agent authenticates the GetRequest packet sent from the NMS. If authentication is successful, the agent decrypts the PDU. If decryption is successful, the agent obtains the value of sysContact and encapsulates it in the PDU of the response packet. The agent encrypts the PDU and sends the response packet to the NMS. If the query, authentication, or encryption operation fails, the agent sends an error message to the NMS.