On Thu, Mar 5, 2015 at 1:39 PM, Thomas Besemer <thomas.bese...@gmail.com>
wrote:

>
>
> On Thu, Mar 5, 2015 at 7:37 AM, Bill Fenner <fen...@gmail.com> wrote:
>
>> On Wed, Mar 4, 2015 at 11:51 AM, Thomas Besemer <thomas.bese...@gmail.com
>> > wrote:
>>
>>> I am working with net-snmp 5.7.3, and will be using several Sub-Agents
>>> in my project, with fairly large amounts of data.  I have noted that
>>> issuing a 'snmpbulkwalk' to Master Agent results in this broken down into
>>> GETNEXT requests to the Sub-Agent.  This results in a lot of network
>>> traffic, as well as a tremendous number of context switches (everything
>>> running on same host).
>>>
>>> Is there support in the Sub-Agent to accept GETBULK requests from the
>>> Master?  I have looked at the code, their appears to be some infrastructure
>>> in place, but it is not clear to me if it is fully functional.
>>>
>>
>>> More so, is there a means to configure the Master to send GETBULK
>>> requests to the Sub-Agent?
>>>
>>
>> This is something that I've been working on a little.  Both of these are
>> relatively small tweaks.  However, the bigger problem is that while the
>> subagent is processing the request, it's basically lost the scoping info
>> that the master agent has sent it, and so the response from the subagent
>> can include info from subtrees that the master didn't ask for.  There's
>> code in the subagent to handle this for getnext, and we could do the same
>> for getbulk, except I was also concerned about the overhead of fetching
>> this data within the subagent - I wanted to find a way to retain the
>> scoping info while processing the request so that request processing could
>> be stopped.
>>
>> I'd be happy to share what I have; if you're up for hacking too maybe we
>> should create a branch on github?
>>
>>
>>
>
> Hi Bill -
>
> I'd be more than happy to work with you on this, and perhaps do a github
> branch so that when we get it working, we can generate a patch set for
> review by community.
>
> My early investigation shows that Sub-Agent Doesn't handle anything but
> GETNEXT, per handle_subagent_response() - perhaps this can be confirmed?
> I have not looked at Master side, so it seems to me part of this could be
> updating handle_subagent_response() to at least return some data set, if
> this makes sense, and then have Master send OID down in PDU, and deal with
> return data.  I am assuming that a return packet from a GETBULK should be a
> complete data set?
>

Yes, my changes include handle_subagent_response and code in the subagent
itself.


>
> From what I can tell, a GETBULK PDU only contains OID, so any filtering
> would have to be on Master side?
>

The GETNEXT and GETBULK PDUs contain SearchRangeList, which scopes the
request.  The master sends SearchRangeList for each tree that the subagent
supports, e.g., if you have registrations of

x.1 - master agent
x.2 - subagent 1
x.3 - subagent 2
x.4 - subagent 1

the master agent will send subagent 1 a request for x.2, scoped to [ x.2,
x.3 ), then will ask subagent 2, then will ask subagent 1 again about [
x.4, x.5 ).  The problem with the current code in my branch is that
subagent 1 can respond with x.2.1, x.2.2, x.4.1, x.4.2.  There are two
problems with this:
1) it may be expensive for the subagent to fetch x.4.1 and x.4.2 and
they're not relevant
2) without filtering, the master agent will get confused by this response.

We can fix 2 by filtering it, just like we already filter getnext.  I
haven't pursued this path yet because I wanted to also address 1.

See https://github.com/fenner/net-snmp/tree/agentx-getbulk for my code so
far.

  Bill
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to