Re: A manager using a single socket and multiple agents?

Ed Fair <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <CAK3Sf8hgtMU9tyMQ-aEa4Q2B4Ak1T=Dy6=jGTPe-smyj3N7h+Q@mail.gmail.com>
Thanks for the reply.  The Simple_Async_Application in your link uses one
session/socket/SRC port per agent.  I've compiled and run this sample
successfully, but I haven't been able to modify it to use a single
session/socket/SRC port.

I understand "don't hammer agents" but I don't understand your "one query
per agent" limit - is this a limitation of the API?

I'm new to this API, I might be missing key concepts... but I am confused
by the "traditional vs single" distinction, and I'm curious what
"subsessions" are.







On Tue, Jan 5, 2021, 4:26 PM Craig Small <[email protected]> wrote:

> Hi,
>   Wouldn't asynchronous queries do what you need? See
> http://net-snmp.sourceforge.net/wiki/index.php/TUT:Simple_Async_Application
>
> I've written something similar but was using pysnmp and it seemed to do
> the job.  The trick is you also have to make sure you don't hammer the
> agent; most agents are pretty awful and lock up if you hammer them too
> much.  For the reuse of the UDP port, you might need to go to socket level
> ioctls and use SO_REUSEPORT. The danger is you can have only one and only
> one query per agent.
>
>  - Craig
>
>
> On Sat, 2 Jan 2021 at 12:32, Ed Fair <[email protected]> wrote:
>
>> I'm trying to write an SNMP manager using the net-snmp API.  The manager
>> will use UDP in IPv4 and IPv6, and will be sending get-requests (and
>> getbulk, and getnext) to 10000 agents (arbitrary number, but you get the
>> idea - a relatively large number).  Is there any way to do this using just
>> a single session?
>>
>> I've compiled and experimented with the demo apps, they seem to use one
>> session per agent.
>>
>> Creating 10000 separate sessions seems excessive (as I understand, this
>> would consume 10000 sockets and 10000 distinct SRC PORTS from my host).
>>
>> Creating/using/closing 10000 sessions seems excessive as well.
>>
>> The reason I'm going here:  my manager must interact with a firewall
>> before sending any requests to any agents; a single firewall interaction
>> identifying a single UDP source port would be much more desirable than
>> 10000 firewall interactions identifying 10000 different UDP source ports.
>>
>> Thanks in advance for your comments.
>> _______________________________________________
>> Net-snmp-coders mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>
>

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.