Hi,

SNMP uses the connectionless User Datagram Protocol (UDP) service[1] to
transmit SNMP messages. SNMP uses the simple UDP transport service, which
guarantees neither delivery nor correct sequencing of delivered packets, so
that SNMP can continue functioning after many other network services have
failed.

​
For a stateless protocol (ie UDP), there is no problem because
"connections" don't exist - multiple people can send packets to the same
port, and their packets will arrive in whatever sequence. Nobody is ever in
the "connected" state[2]
.


[1] https://www.manageengine.com/network-monitoring/what-
is-snmp.html#typical-snmp-communication
[2]
http://stackoverflow.com/questions/1694144/can-two-applications-listen-to-the-same-port

Thanks,
Vivek

Vivekananthan Sivanayagam
Associate Software Engineer | WSO2
E:[email protected]
M:+94752786138

On Tue, Mar 7, 2017 at 6:05 PM, Vivekananthan Sivanayagam <
[email protected]> wrote:

> Hi Malaka,
>
> I moved the listener part from the init to each operation and I made
> concurrent test, we are able to get back the response for most of the
> requests while getting the empty ("Response PDU is null.") response from
> rest of them. That means we are able to successfully send the request to
> the network device using the connector, it might depend on the network
> device how many requests it can be handled and respond.
>
> For testing the concurrent, as Nadeesan and Kevin suggested, I added[1]
> log before and after sending PDU to the device where I had to make changes
> in the configuration using a connector. I got the log value[2] for error
> case also.
>
> [1]
>
> ......
>
> log.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" + pdu.toString());
> //sending data to the Agent
> ResponseEvent response = snmp.send(pdu, SNMPUtils.getTarget(messageContext));
>
> log.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + 
> pdu.toString());
> if (response != null) {
>    if (log.isDebugEnabled()) {
>       log.debug("Got SNMPSet Response from the Agent.");
>    }
>    PDU responsePDU = response.getResponse();
>    log.info("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" + pdu.toString());
>    if (responsePDU != null) {
>
> ........
>
> [2]
>
> [2017-03-07 17:36:13,552] DEBUG - wire HTTP-Listener I/O dispatcher-3 << 
> "{"Response":"OIDs successfully updated with [1.3.6.1.2.1.1.5.0 = vives, 
> 1.3.6.1.2.1.1.5.0 = vives, 1.3.6.1.2.1.1.5.0 = vives]"}[\r][\n]"
> [2017-03-07 17:36:13,552] DEBUG - wire HTTP-Listener I/O dispatcher-3 << 
> "0[\r][\n]"
> [2017-03-07 17:36:13,552] DEBUG - wire HTTP-Listener I/O dispatcher-3 << 
> "[\r][\n]"
> [2017-03-07 17:36:13,573]  INFO - SNMPSet 
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!SET[requestID=1771846864, 
> errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.5.0 = vives; 
> 1.3.6.1.2.1.1.5.0 = vives; 1.3.6.1.2.1.1.5.0 = vives]]
> [2017-03-07 17:36:13,574]  INFO - SNMPSet 
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$SET[requestID=1771846864, 
> errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.5.0 = vives; 
> 1.3.6.1.2.1.1.5.0 = vives; 1.3.6.1.2.1.1.5.0 = vives]]
> [2017-03-07 17:36:13,574] ERROR - *SNMPSet Response PDU is null.*
>
> Thanks,
> Vivek.
>
> Vivekananthan Sivanayagam
> Associate Software Engineer | WSO2
> E:[email protected]
> M:+94752786138 <+94%2075%20278%206138>
>
> On Tue, Mar 7, 2017 at 1:22 PM, Malaka Silva <[email protected]> wrote:
>
>> Hi Vivekananthan,
>>
>> AFAIK this communication is asynchronous and we may not get the response
>> on the same path.
>>
>> So we have to design properly when implementing the listener since we can
>> maintain listener per message flow?
>>
>> [1] http://www.jitendrazaa.com/blog/java/snmp/create-snmp-
>> client-in-java-using-snmp4j/
>>
>> On Tue, Mar 7, 2017 at 11:18 AM, Vivekananthan Sivanayagam <
>> [email protected]> wrote:
>>
>>> Hi Malaka,
>>>
>>> We are using snmp4j[1] library to implement the connector.
>>>
>>> SNMP Communication:
>>>
>>> [image: Inline image 1]
>>>
>>> Let see how SNMPSet operation works, The set operation is used to
>>> change[2] the value of a managed object or to create a new row in a table.
>>> Objects that are defined in the MIB as read-write or write-only can be
>>> altered or created. The Manager sends the SET request to Agent and Agent
>>> will receive the request and will respond with a GetResponse message
>>> indicating the change has been made or an error indication as to why the
>>> change cannot be made.
>>>
>>> Layered communication:
>>> ​
>>> [image: Inline image 2]
>>>
>>> [1] http://www.snmp4j.org/html/download.html
>>> [2] https://en.wikipedia.org/wiki/Simple_Network_Management_
>>> Protocol#Overview_and_basic_concepts
>>>
>>> Vivekananthan Sivanayagam
>>> Associate Software Engineer | WSO2
>>> E:[email protected]
>>> M:+94752786138 <075%20278%206138>
>>>
>>> On Tue, Mar 7, 2017 at 8:55 AM, Malaka Silva <[email protected]> wrote:
>>>
>>>> Hi Vivekananthan,
>>>>
>>>> I guess here ESB acts as the SNMP Manager? Also can you explain how the
>>>> communications happens, protocol details, are you planning to use any libs
>>>> etc,
>>>>
>>>> Perhaps a flow diagram will help.
>>>>
>>>> On Mon, Mar 6, 2017 at 10:01 PM, Vivekananthan Sivanayagam <
>>>> [email protected]> wrote:
>>>>
>>>>> ​​
>>>>> ​​
>>>>> H
>>>>> ​
>>>>> i All,
>>>>>
>>>>> Currently, I am implementing the SNMP connector which used to monitor
>>>>> and configure the network components such as servers, routers, switches or
>>>>> printers through the WSO2 ESB and supports SNMP Version 2.
>>>>>
>>>>> *​​About SNMP:*
>>>>>
>>>>> Simple Network Management Protocol (SNMP) is an Internet-standard
>>>>> protocol for managing devices on IP networks. Using SNMP, the Network
>>>>> operators can be able to manage their network elements, identify the
>>>>> problem and can configure the remote system.
>>>>>
>>>>> Let us take a simple example to understand SNMP, consider a Network
>>>>> with four printers, and we need to shut down the Printer 1(P1), using a
>>>>> management protocol like SNMP we can easily figure out the right device 
>>>>> and
>>>>> do shut down. For that, we can succeed with SNMPSet operation which is 
>>>>> used
>>>>> to set/write values in the Managed Device. Basically, it is used to
>>>>> configure Network Elements.
>>>>>
>>>>> There are two major things we need to get to know when talking about
>>>>> SNMP.
>>>>>
>>>>> *​​SNMP Manager:*  A manager or management system is a separate
>>>>> entity that is responsible for communicating with the SNMP agent
>>>>> implemented network devices.
>>>>>
>>>>> *​​SNMP Agent:* The agent is a program that is packaged within the
>>>>> network element. Enabling the agent allows it to collect the management
>>>>> information database from the device locally and makes it available to the
>>>>> SNMP manager.
>>>>>
>>>>> *​​Note*: If we assign the SNMP Manager to write permission for the
>>>>> SNMP Agent, the SNMP Manager can also send a configuration request to the
>>>>> Agent (using a Set message) to change a local parameter.
>>>>>
>>>>> *​​Understanding the Management Information Base (MIB)*
>>>>>
>>>>> When an SNMPManager requests information from an SNMPAgent, the SNMP
>>>>> Agent retrieves the current value of the requested information from the
>>>>> Management Information Base (MIB). The MIB defines the managed objects 
>>>>> that
>>>>> an SNMP manager monitors (or sometimes configures) on an SNMP agent.
>>>>>
>>>>> *​​SNMP Connector Operation:*
>>>>>
>>>>> snmpGet: The GET operation is a request sent by the manager to the
>>>>> managed device. It is performed to retrieve one or more values from the
>>>>> managed device.
>>>>> SnmpGetBulk: The GETBULK operation is used to retrieve voluminous data
>>>>> from large MIB table.
>>>>> snmpGetNext :
>>>>> ​ ​
>>>>> The
>>>>> GET NEXT operation retrieves the value of the next OID in the MIB tree.
>>>>> snmpSet: This operation is used by the managers to modify or assign
>>>>> the value of the Managed device.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Vivek.
>>>>>
>>>>> Vivekananthan Sivanayagam
>>>>> Associate Software Engineer | WSO2
>>>>> E:[email protected]
>>>>> M:+94752786138 <075%20278%206138>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Best Regards,
>>>>
>>>> Malaka Silva
>>>> Associate Director / Architect
>>>> M: +94 777 219 791 <+94%2077%20721%209791>
>>>> Tel : 94 11 214 5345
>>>> Fax :94 11 2145300 <011%202%20145300>
>>>> Skype : malaka.sampath.silva
>>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>>> Blog : http://mrmalakasilva.blogspot.com/
>>>>
>>>> WSO2, Inc.
>>>> lean . enterprise . middleware
>>>> https://wso2.com/signature
>>>> http://www.wso2.com/about/team/malaka-silva/
>>>> <http://wso2.com/about/team/malaka-silva/>
>>>> https://store.wso2.com/store/
>>>>
>>>> Don't make Trees rare, we should keep them with care
>>>>
>>>
>>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Associate Director / Architect
>> M: +94 777 219 791 <+94%2077%20721%209791>
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> https://wso2.com/signature
>> http://www.wso2.com/about/team/malaka-silva/
>> <http://wso2.com/about/team/malaka-silva/>
>> https://store.wso2.com/store/
>>
>> Don't make Trees rare, we should keep them with care
>>
>
>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to