Port Number

 

The management applications communicate with the SNMP agents in the managed node in a particular port number. This remote port number is the UDP port 161. By default, all the SNMP request messages are received in this port. Sometimes, the agent may also be configured to receive messages in ports other than 161. The management applications normally have the provision to send request to the default port and also the option to set different port numbers.

 

The following table lists the methods that need to be used for setting the Port Number rameters.

 

API Name Class/Component Name API Methods Remarks

High Level

SnmpTarget
SnmpRequestServer
SnmpPoller
SnmpTable

setTargetPort(int)

The default port number is "161". This method can be used to set the port number to other than 161.

Low Level

UDPProtocolOptions

setRemotePort(int)

This method sets the remote port on the peer to which the SNMP packets are sent.

RMI

SnmpTarget
SnmpRequestServer

setTargetPort(int)

The default port number is "161". This method can be used to set the port number to other than 161.

CORBA

SnmpTarget
SnmpRequestServer

setTargetPort(int)

- same as above -

EJB

SnmpTargetEJB

setTargetPort(int)

- same as above -

 

Note: In the low-level API, the remotePort parameter in the SnmpPDU overrides the one in Snmpsession. It is a good practice to set remotePort in session to the port to which messages are often sent. When remotePort in SnmpPDU is 0, the message is sent to remotePort specified in the session.



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.