Hi, I am new to SNMP and SNMP4j library. We have a simple SNMP agent (supporting both snmpv2c and v3 over UDP) written using SNMP4j library. And there is an NMS that sends GetBulk requests for a set of OIDs towards agent. But there is a restriction at the NMS that it has the MTU set to 1500 bytes and the ‘don’t fragment’ bit is set to true. We don’t have an option to change the MTU size or the ‘don’t fragment’ bit.
So, I wanted to know if there is some option/feature in the SNMP4j library where I can set the max packet size for GetBulk PDU responses and still handle the lexicographic ordering of the response PDUs.
You can use DefaultUdpTransportMapping.setMaxInboundMessageSize the set the maximum message size you want to support (use) with that transport mapping.
Thanks Frank for your response! Actually, my request was from SNMP agent point of view. We need to limit the size of the outgoing GetBulkResponse message size to something like <=1500 bytes, so that it doesn’t undergo fragmentation (eth0 interface). Please correct me if my understanding is not right here.
I have tired the above suggested solution, but still the GetBulk Response message got fragmented as the generated message size was >1500 bytes