Re: [tkined] [Q] About agent mode coding

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Thu, 13 Nov 1997 13:20:19 +0100

Bae Young Ho <yhbae@rcunix.kotel.co.kr> said:

Bae> Followings are the packet dumps of my program using snmp watch on.

[snip]

Bae> But, when I sent getRequest again for all objects in systems
Bae> group, there are some bizarre result. Yes, sysLocation.0 is
Bae> not changed to "under the sea", but it remains to "over the
Bae> rainbow".

Thanks for the detailed description of your problem. Here is what is
happening: The scotty agent tries to cache responses in order to
reduce the overhead introduced by procecssing packets that are
retransmissions because the manager had a timeout.

The problem is that the decision whether the cached value is valid or
not is a bit too simple because it relies to a large extend on the
request-id. Your manager is using the request-id 1 for the set-request
and the request-id 2 for the get-request. Scotty sees that the second
get-request is identical to the first one and sends back the cached
result.

A simple work-around is to change the function CacheHit() in
tnmSnmpAgent.c to always return NULL. (This actually disables the
cache.) A more sophisticated fix would invalidate cache entries
whenever the agent processes a set-request and automatically after
some time (e.g. 5 seconds) has passed.
Juergen

-- 
Juergen Schoenwaelder  schoenw@ibr.cs.tu-bs.de http://www.cs.tu-bs.de/~schoenw
Technical University Braunschweig, Dept. Operating Systems & Computer Networks
Bueltenweg 74/75, D-38106 Braunschweig, Germany.     (Tel. +49 531 / 391-3283)
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.