Re: Size of traps
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 22/02/2008, Raghavendra Prasad <[email protected]> wrote: > I have a requirement to precisely know about the size of trap > message because we have hardware memory restriction to log all > incoming traps, hence we plan store upto 1000 log messages - this > calls for good understanding about size of traps(in bytes). Are you talking about storing the incoming traps, or the messages triggered by these traps? How predictable are the range of traps that you are likely to receive? (Different traps will include different varbind payloads, and hence be different sizes!) > I want to know the maximum size of this kind of basic traps(in Bytes). The basic structure of an SNMPv1 trap is: version(0) - single integer community - string [1] enterprise - OID (<=128 subidentifiers) agent-address - IP Address (4 octets) generic-trap - single integer (0-6) specific-trap - single integer (0-2^31) timestamp - single integer (0-2^32) Varbinds [2] [1] in principle, the community string can be up to 65565 characters, though > 255 would probably break things elsewhere. Typically <= 32 characters or so. [2] The size of the varbind list is unpredictable - it depends on the trap(s) being received, and hence what varbinds they will contain. We can make some assumptions about the typical size of community string (<=32 chars) and enterprise OID (say 3 levels below the private enterpise #), and that most integers and OID subidentifiers are held as 32-bit values (except for version and generic trap fields where one byte is sufficient). That gives a basic trap size of 1+32+(10*4)+4+1+4+4=86 bytes Plus whatever you wish to allow for a typical varbind list. SNMPv2 traps have a different structure (basically a sequence of varbinds, rather than dedicated fields), but you could probably save the information in a similar format to the above. If you work on the basis of 100 bytes + varbind lists, you're going to be in the right general ballpark. Hope this helps. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users