Fwd: Re: [SNMP4J] Broadcast snmp request with snmp4j.

kapay kapay666 at yahoo.com
Fri Jan 27 00:58:52 CET 2006


i forgot to mention that i am using snmp4j v1.5. Thank you.

kapay <kapay666 at yahoo.com> wrote:  Date: Thu, 26 Jan 2006 15:22:44 -0800 (PST)
From: kapay <kapay666 at yahoo.com>
Subject: Re: [SNMP4J] Broadcast snmp request with snmp4j.
To: Frank Fock <fock at agentpp.com>

  Hi Frank,
   
  Thank you for your response.
  I tried using MultiThreadedMessageDispatcher to wrap MessageDispatcherImpl but my program did not show any improvement. I am running on a single processor machine.
   
  Increasing the ReceiveBufferSize allows it to receive more response packets but it is always limited to the value of net.core.rmem_max in linux which by default, on kernel 2.6.9, is 108544 bytes.
   
  Thanks again for your suggestions.
  kapay.
   
  
Frank Fock <fock at agentpp.com> wrote:
  Hello Kapay,

You can wrap the mesage disptacher in a MultiThreadedMessageDispatcher.
On a multi core or HT system, this will improve the behavior. You can also
try to increase the ReceiveBufferSize.
Please let us know if this improved the situation on you Linux machine.

Thanks in advance,
Frank

he he wrote:

> Hello,
> 
> What is the best method of sending snmp packet broadcast with SNMP4j to discover devices in a network?
> 
> i have the following codes;
> 
> ----------------
> DefaultUdpTransportMapping defaultTransport = new DefaultUdpTransportMapping();
>defaultTransport.setReceiveBufferSize(65535);
>TransportMapping transport = defaultTransport;
>Snmp asyncsnmp = new Snmp(transport);
> 
>MessageDispatcher md = asyncsnmp.getMessageDispatcher();
> 
>md.removeCommandResponder(asyncsnmp);
>md.addCommandResponder(this);
>md.addCommandResponder(asyncsnmp);
> 
>asyncsnmp.listen();
> 
>PduHandle reqHandle = md.sendPdu(null, ctarget.getAddress(), ctarget.getVersion(),
> SecurityModel.SECURITY_MODEL_SNMPv1, ctarget.getCommunity().getValue(),
> SecurityLevel.NOAUTH_NOPRIV, pdu, true);
> 
> // the asyncsnmp session is close by a separate timer thread on timeout.
> 
> .........
> 
> // then i declared the processPdu() method on this same class to receive responses.
> 
> public void processPdu(CommandResponderEvent e) {
> ....
> }
> 
> ------------ 
> 
> My codes above work fine but i am having problem handling a large number of responses since all response packets are accumulated within a single socket. The receive buffer of the socket easily overflows after like 70+ response packets on a linux system.
> 
> What is the best method of sending and handling broadcast request with a large number of responses using snmp4j? Is it possible for every broadcast response to use a new socket thereby eliminating the socket receive buffer overflow problem?
> 
> i know that i can increase the maximum receive buffer size of linux by changing some /proc/sys/net/core/* files but as much as possible i would like to avoid this approach if there is a more elegant solution.
> 
> Thank you.
> kapay
> 
>
>
> 
>---------------------------------
>Bring words and photos together (easily) with
> PhotoMail - it's free and works with Yahoo! Mail.
>_______________________________________________
>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


  

    
---------------------------------
  Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.


		
---------------------------------
Bring words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.


More information about the SNMP4J mailing list