To understand the use of SNMP ports , one must first have an understanding of the Simple Network Management Protocol (SNMP). Thankfully, a complete introduction of SNMP is included in SNMPcenter that explains what is SNMP and how this protocol is used for network management, i.e. to monitor and configure devices on IP networks.

Technically speaking, SNMP:

  • is an application–layer protocol defined by the Internet Architecture Board of the Internet Engineering Task Force (IETF).
  • is a term used to refer to all parts required for exchanging management information between network devices. These parts include an application layer protocol, a database schema, and a set of data objects.
  • is part of the Transmission Control Protocol ⁄ Internet Protocol (TCP⁄IP) protocol suite.

Assuming you understand the basics (ow you have read the SNMP introduction article by SNMPcenter), let’s discuss SNMP ports.

SNMP ports

What are the SNMP ports?

Being the part of IP protocol suite, the SNMP messages are wrapped as User Datagram Protocol (UDP) and intern wrapped and transmitted in the Internet Protocol.
The default SNMP ports are:

  • UDP port 161.
  • UDP port 162 (for traps).

This is how the SNMP Manager uses the default ports during communication:

  • Sends requests from any available source port (GET, GETNEXT, GETBULK, SET)
  • Sends requests to UDP port 161 in the Agent (GET, GETNEXT, GETBULK, SET).
  • Receives responses on the same source port he send the request (RESPONSE).
  • Receives notifications on UDP port 162 (TRAPS and INFORM).

This is how the SNMP Agent uses the default ports during communication:

  • Receives requests on UDP port 161 (GET, GETNEXT, GETBULK, SET).
  • Sends responses back to the source port of the manager (RESPONSE).
  • Generates notifications from any available port (TRAPS and INFORM).
  • Sends the notifications  to UDP port 162 of the Manager (TRAPS and INFORM).

Note that when used with Transport Layer Security or Datagram Transport Layer Security requests are received on port 10161 and traps are sent to port 10162.

Non-default SNMP ports

For SNMP Agents that support non-default ports, alternative solutions must be implemented, such as SNMP proxies that listen at non-default ports and forward the communication to the default ports given above.

What are the Basic Commands of SNMP?

The success and popularity of this protocol must be attributed at least partly to the simplicity in information exchange. The basic set of commands is simple and concise, as you can see below.

Commands that a SNMP-Manager can send:

  • GET: The GET operation is a request sent by the Manager to the Agent. It is performed to retrieve one or more values from the Network Element.
  • GET NEXT: This operation is similar to the GET. The significant difference is that the GET NEXT operation retrieves the value of the next OID in the MIB tree.
  • GET BULK: The GETBULK operation is used to retrieve voluminous data from large MIB tables.
  • SET: This operation is used by the Managers to modify or assign the value of a variable in the MIB of the Network Element. The SET operation is sent from the Manager to Agent.

Commands that a SNMP Agent can send:

  • TRAPS: Unlike the above commands which are initiated from the SNMP Manager, TRAPS are initiated by the Agents. It is a signal to the Manager by the Agent on the occurrence of an event.
  • INFORM: This command is similar to the TRAP initiated by the SNMP Agent. The difference is that INFORM includes confirmation from the Manager on receiving the message.
  • RESPONSE: It is the command used to carry back the value(s) or signal of actions directed by the SNMP Manager.