[SNMP4J] pdu size

PHIL BERGSTRESSER phil.bergstresser at adtran.com
Tue Jun 3 16:12:34 CEST 2008


Tjip,
    The problem is not just in the Get PDU size. Since all the value
fields are null, the response PDU will likely be much larger once the
values are inserted. Common limitations are the MTU on the transmission
paths, and the ability of the agent to handdle the size. The SNMP
standard only specifies a minimum of 485 bytes that an agent must
support, but the maximum is indefinite. The agent has control over this
to some extent on getBulk requests because it can terminate early, but
fixed requests like gets and sets are not as flexible. It's a tricky
situation that requires practical experience. 
    It would be interesting to hear from others of their experiences. We
try to stay under 1500 bytes and that works pretty well.
    HTH
Phil

> -----Original Message-----
> From: snmp4j-bounces at agentpp.org 
> [mailto:snmp4j-bounces at agentpp.org] On Behalf Of Tjip Pasma
> Sent: Tuesday, June 03, 2008 8:41 AM
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] pdu size
> 
> Hi
> 
> During system test of my snmp manager implementation i ran 
> into a problem with the pdu size. My application creates a 
> snmp get request containing 55 get's resulting in a packet 
> length of 2000+ bytes. 
> I've been using the
> "target.setMaxSizeRequestPDU(SnmpConstants.MIN_PDU_LENGTH);" 
> setting and thus expected that pdu packets never excedded 
> this value. But now that i've investigated my problem, i see 
> that the max-size value only is used by TableUtils.
> 
> At the moment I'm assuming that i need to make something like 
> the code snippet below to solve my problem. Is there a 
> simpler solution than this ? 
> Somehow i expected that this would be handled by snmp4j since 
> it it is possible to configure max size. Maybe at least an 
> exception should be thrown id a pdu is exceeding the configured size ?
> 
> Kind Regards
> Tjip Pasma
> System Engineer - Ericsson Diax
> 
> Code snippet:
> ------------------------------------------------------------
> 
> Vector<PDU> pduList = new Vector<PDU>(); PDU pdu = 
> createPDU(); pduList.add(pdu);
>                         
> for (int i = 0; i < params.size(); i++)
> {
> 	VariableBinding vb = new VariableBinding(new 
> OID(params.getParams(i).getParamIdAndInstance()));
> 	pdu.add(vb);
> 	if (pdu.getBERLength() > target.getMaxSizeRequestPDU()) 
> 	{
> 		pdu.trim(); //removes previous added vb
>                                 
> 		pdu = m_snmpInfo.createPDU(); //create new pdu
> 		pduList.add(pdu);
> 		pdu.add(vb);
> 	}
> }
> 
> for (int n = 0; n < pduList.size(); n++) {
> 	m_snmp.get(pdu, target, r.getSyncObject(n), r); // 
> using asyncroneous calls }
> 
> 
> ------------------------------------------------------------
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 



More information about the SNMP4J mailing list