Re: [SNMP4J] V2 Trap Packet Fragmentation

2012-04-23 Thread Amol Rao
Thanks for the response, Frank. I was bit surprised by NPE since we
are getting it only on one system. I fixed the SNMP4J code in our
environment for Null check and the problem went away.

We are investigating our code in more detail and initial investigation
reveals that there is SNMP get request coming almost at the same time,
which could be causing the NPE here, its not clear how the PDUs (trap
and get) are clashing at this point though.

Isnt it safe to check Null at line 499?

Thanks.

On Wed, Apr 18, 2012 at 6:50 PM, Frank Fock f...@agentpp.com wrote:
 Hi,

 Another user pointed me to the fact that you
 probalby using SNMP4J 1.x. In that case
 line 499 uses the variable binding list Vector
 of the PDU. If you get a NPE there, then
 you have set the list to null. You will have
 to fix that.

 Best regards,
 Frank

 Am 17.04.2012 23:20, schrieb Frank Fock:
 Hi,

 A NullPointerException at that location can be caused
 only by a NULL request ID. How you managed to
 be NULL - I don't know.
 Normally, SNMP4J takes care to set it. So you must have
 done something special.

 A SNMP packet fragementation does not exists on UDP
 level in the way you described it (two packets with their
 own header).

 Best regards,
 Frank

 Am 17.04.2012 00:12, schrieb Amol Rao:
 ...any thoughts? anyone?

 On Mon, Apr 16, 2012 at 4:09 PM, Amol Raoxamol...@gmail.com   wrote:
 I see the following exception when trap is being sent out. Any pointers?


 java.lang.NullPointerException
          at org.snmp4j.PDU.getBERPayloadLengthPDU(PDU.java:499)
          at org.snmp4j.PDU.getBERLength(PDU.java:436)
          at org.snmp4j.mp.MPv2c.prepareOutgoingMessage(MPv2c.java:118)
          at 
 org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:444)
          at org.snmp4j.Snmp.sendMessage(Snmp.java:1078)
          at org.snmp4j.Snmp.send(Snmp.java:878)
          at org.snmp4j.Snmp.send(Snmp.java:871)
          at org.snmp4j.Snmp.send(Snmp.java:836)
          at org.snmp4j.Snmp.notify(Snmp.java:780)


 Cheers,
 Amol

 On Mon, Apr 16, 2012 at 1:05 PM, Amol Raoxamol...@gmail.com   wrote:
 Hi All:
    Just wanted to reach out and see if anyone encountered this situation.

 I am sending out an SNMP trap (~1K size) from an agent system. When
 manager receives the trap, its observe that its divided into multiple
 traps and each trap carries one variable binding - which leads to
 conclusion that the packets are getting fragmented at the SNMP level,
 I wonder why this happens.

 I did wireshark and realized that there is no UDP level fragmentation.

 Both source (trap generation) and Destination (trap receiver) uses
 snmp4j-1.11.jar but since on the receiving side, I have logic that
 expects the trap to come in as one UDP packets, the whole thing breaks
 apart. Moreover, I observed that its happening on only one system, the
 same code works on another identical system.

 Any pointers as to why this could be happening and what is the way around?

 I am pretty sure that we are not crossing UDP packet limit, not that
 it would matter at SNMP layer.

 Thanks.

 Cheers,
 Amol
 ___
 SNMP4J mailing list
 SNMP4J@agentpp.org
 http://lists.agentpp.org/mailman/listinfo/snmp4j

 --
 ---
 AGENT++
 Maximilian-Kolbe-Str. 10
 73257 Koengen, Germany
 https://agentpp.com
 Phone: +49 7024 8688230
 Fax:   +49 7024 8688231

 ___
 SNMP4J mailing list
 SNMP4J@agentpp.org
 http://lists.agentpp.org/mailman/listinfo/snmp4j
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


[SNMP4J] V2 Trap Packet Fragmentation

2012-04-16 Thread Amol Rao
Hi All:
  Just wanted to reach out and see if anyone encountered this situation.

I am sending out an SNMP trap (~1K size) from an agent system. When
manager receives the trap, its observe that its divided into multiple
traps and each trap carries one variable binding - which leads to
conclusion that the packets are getting fragmented at the SNMP level,
I wonder why this happens.

I did wireshark and realized that there is no UDP level fragmentation.

Both source (trap generation) and Destination (trap receiver) uses
snmp4j-1.11.jar but since on the receiving side, I have logic that
expects the trap to come in as one UDP packets, the whole thing breaks
apart. Moreover, I observed that its happening on only one system, the
same code works on another identical system.

Any pointers as to why this could be happening and what is the way around?

I am pretty sure that we are not crossing UDP packet limit, not that
it would matter at SNMP layer.

Thanks.

Cheers,
Amol
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


Re: [SNMP4J] V2 Trap Packet Fragmentation

2012-04-16 Thread Amol Rao
...any thoughts? anyone?

On Mon, Apr 16, 2012 at 4:09 PM, Amol Rao xamol...@gmail.com wrote:
 I see the following exception when trap is being sent out. Any pointers?


 java.lang.NullPointerException
        at org.snmp4j.PDU.getBERPayloadLengthPDU(PDU.java:499)
        at org.snmp4j.PDU.getBERLength(PDU.java:436)
        at org.snmp4j.mp.MPv2c.prepareOutgoingMessage(MPv2c.java:118)
        at 
 org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:444)
        at org.snmp4j.Snmp.sendMessage(Snmp.java:1078)
        at org.snmp4j.Snmp.send(Snmp.java:878)
        at org.snmp4j.Snmp.send(Snmp.java:871)
        at org.snmp4j.Snmp.send(Snmp.java:836)
        at org.snmp4j.Snmp.notify(Snmp.java:780)


 Cheers,
 Amol

 On Mon, Apr 16, 2012 at 1:05 PM, Amol Rao xamol...@gmail.com wrote:
 Hi All:
  Just wanted to reach out and see if anyone encountered this situation.

 I am sending out an SNMP trap (~1K size) from an agent system. When
 manager receives the trap, its observe that its divided into multiple
 traps and each trap carries one variable binding - which leads to
 conclusion that the packets are getting fragmented at the SNMP level,
 I wonder why this happens.

 I did wireshark and realized that there is no UDP level fragmentation.

 Both source (trap generation) and Destination (trap receiver) uses
 snmp4j-1.11.jar but since on the receiving side, I have logic that
 expects the trap to come in as one UDP packets, the whole thing breaks
 apart. Moreover, I observed that its happening on only one system, the
 same code works on another identical system.

 Any pointers as to why this could be happening and what is the way around?

 I am pretty sure that we are not crossing UDP packet limit, not that
 it would matter at SNMP layer.

 Thanks.

 Cheers,
 Amol
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j