ASN.1 definitions for basic SNMP exchanges - snmp

What online resource is the authority for the complete set of ASN.1 definitions for the SNMP data structures used to request and respond with information? I am interested in versions 2c and version 3.
In RFC 3416 Section 3, I have found most of the definitions needed to use version 2c. However, the document has no mention of something that I have found on other resources referred to as the "snmpv2 message". For example, this shows up in the SNMP Programmers Reference Wiki and in the blog post Simple? Network Management Protocol. It's the data structure that contains the community string, so it's role is essential, but I cannot find where the authoritative source (probably an RFC) with an ASN.1 definition.
Similarly, I cannot find any authoritative ASN.1 definitions of SNMPv3 data structures. I found an ASN file in a github repo's test suite, but I cannot find where this information was taken from.
I would appreciate any help locating these. I'm usually a pretty good Googler, but my usual strategies are not turning anything up beyond what I've already linked to.

SNMP v3 message format is defined in RFC3412 page 19 as section 6 as ASN.1.
SNMP v2c reuses most of v1 message format, except defining new message body (PDU). I think that's why in RFC 3416 you don't see all details, because it only mentions the new PDU definitions for simplicity.

You might want to dig ASN.1 documents out of SNMP RFCs:
Base data types, RFC2578
SNMP v2c message, RFC3416
SNMP v3 message, RFC3412
SNMP v3 USM, RFC3414

Related

A nested net-snmp snmptrap message sending example

Most of the examples provided for sending SNMP traps are simple ones like the one below.
snmptrap -v 1 -c public host TRAP-TEST-MIB::demotraps localhost 6 17 '' \
SNMPv2-MIB::sysLocation.0 s "Just here"
Take any MIB file, they contain many complex object groups, for example, systemGroup contains sysLocation, sysName, etc.
Could someone help in bringing out examples to show the way how to send snmp traps which includes such OBJECT-GROUPS. Adding one more question here, Does SNMPTRAPD support internationalization?
It is really bad practice to define the SNMP notification (trap or inform) the way that it contains the entire OBJECT GROUP or even worse the entire SNMP table. The reason is that you don't really need all these variables anyway. The other reason is that the packet/PDU is limited by MTU size. So it is possible that you'll not be able to send the data within single UDP packet due to its size.
The proper scenario would be to have few varbinds and you could also initiate some polling cycle to find out what happens if you need more details when you receive such trap.
SNMPTRAPD and NET-SNMP library in general do not support internationalization (UNICODE). The library is limited to ASCII charset only.
There are commercial products on the market including NetDecision TrapVision and some other that fully support UTF-8 internationalization.

Better Compatible version of Hl7, v2 or v3?

I am going to implement a generic HMIS with true implementation of HL7. I have studied all the advantages and disadvantages of both versions of HL7 i.e v2 and v3. But still the confusion exists that which version is better to go with implementation either it is v2 for its stability or v3 for its plug and play compatibility. Need your opinion.
The HL7 is the organization but also is a set of interoperability standards. It means it is not a function in your system that operates on its own, it is a way that your system communicates with other systems. So the interface that you need to implement in your system - HL7v2 or HL7v3 or HL7 FHIR – is actually dictated by your counterparts.
For example, if you are in US, most likely you'll end up with HL7v2 for messaging, HL7v3 CDA for documents (better know as a separate C-CDA standard) and HL7 FHIR for SMART initiatives. (Let's assume we are not talking about IHE profiles with "v3" suffix.) For Canada and UK it will be the same with the only difference that these countries are using HL7v2 and HL7v3 for messaging.
I would like to answer your question based on Implementation and Data consumption.
HL7v2 is pipe delimited and v3 is of XML, FHIR comes in JSON and XML flavors. Before discussing advantage and disadvantage, it is essential to understand how the end system consumes data. What provision they have, and based on that you can proceed further.
If this question is regarding how efficiently all patient data can be captured in a message format? . I will go with both V2 and V3. V3 is much more standardized, gives more specifications and descriptions. V2 is also has HL7 specific standards for it, if you think that specific message format of yours (ADT/ORU/DFT) lacks specific features to capture, you can use Z-segment or NTE. V3 CDA standards makes sure (upto what I have used), covers most information with its specification itself.
For (Eg:consider CDA standards) Based on the needs CDA can come with its own flavor, as of HL7 standards there are separate Progress notes C-CDA, Procedure notes C-CDA, Transition of Care C-CDA, Diagnostic Imaging Report C-CDA and so on.

defining private MIB under experimental node

Any samples on how to define a private MIB containing some x objects? how do I register these MIBs and handle get requests to it?
You could start by reading something like Net-SNMP's tutorial about agent coding tutorials. But in the long run, if you need to write about MIBs you should probably also read either the SMIv2 RFCs (RFC2578 to get started) or a good book on SNMP and MIBs ("Understanding SNMP MIBs" is the classically referred to book).

SNMP MIB Structure Conventions for nodes below the Enterprise Identifier

I have developed a Linux/Umbutu program running on what will be an imbedded P-based device. I wish for that piece of code to be able to send and receive the SNMP data for the entire product. So, I know the OID down to the company level, 1.3.6.1.4.1.34843, and I further know that the two SNMP enabled products we sell are 1.3.6.1.4.1.34843.1 and 1.3.6.1.4.1.34843.2. Pretty sure mine will be .3.
The question is, is there a known structure/convention for the nodes below this point? What I read seems to imply that I can use whatever structure I want. Would ...34843.1.0 exist? Is it a node to fetch (get) the list or max-count of same-level nodes? Would ...34843.1.0.0 exist? Would it make any sense? The guy who developed the first two MIBs is out of town for a while and I can't really ask him, and I'd like to make sure I understand his answer when he gives it to me.
Is there a document that describes the required/suggested organization? Probably some RFC, right. So, is there a document in a language spoken by humans?
Thanks in advance.
The most popular resource is the understanding SNMP MIBs book by Perkins and McGinnis. It describes MIBs in a more readable format. The Net-SNMP tutorials online might be helpful too, as they discuss a lot about MIBs. If you want the RFC, then RFC2578 is the right thing to read.
The quick hierarchy guidance would be something along the lines of:
Use 3 sections: one for objects, one for notifications, and one for conformance information
For notifications, root them at the .0 (see RFC3584 for details on why)
For each table, you might want a scalar showing the number of objects in a table and potentially a LastChanged object for showing how frequently configuration within the table might have changed).
There is a lot more guidance that can be found in the books and other sources listed above than can be repeated here, of course. RFCs 4181, and 5249 may be helpful as well.

What are some good resources for understanding SNMP MIBs?

I know a little about SNMP, but not enough. I need to develop an application that can read standard SNMP MIBs and read/write the various properties. The network end is no problem, but the actual MIBs and exactly what they may contain is something of a black art to me.
I believe I should be able to use LIBSMI to 'parse' the MIBs, but I don't really understand what the output of the 'parser' is going to be, and how best to use it.
All suggestions welcome...
At the risk of throwing you in the deep end, you might want to take a look at net-snmp. The default installation contains a number of standard mibs with their associated implementation. It also contains a utility (mib2c) that will generate boilerplate code from your mib files.
Once you've read your way through a couple of mibs you should have no trouble familiarising yourself with the way that snmp does things.
Most standard MIB documents were defined in corresponding RFCs published at IETF.
http://www.ietf.org/
Please go to this site to find more details.
Muonics Mib Smithy User Guide provides a good overview of how to build a MIB, which can help you understand the necessary elements for parsing.
You should also look at the ASN.1 ITU specification X.690, because that is the language SNMP is defined in. It also helps if you scour the SNMP RFCs for any Bachus-Naur formatting in the SNMP RFCs. I'm going to suggest you start with RFC3642 and RFC2252.

Resources