Testing Made Easy

When do I use GETBULK versus GETNEXT?

Posted by: Munda Sanichari on: October 7, 2008

You use GETNEXT, typically, to get selected columns from one or more rows of a table. If you want the values for columns S(1)..S(s) from columns C(1)..C(c) (where s<c (and there are N rows), you would make N+1 GETNEXT requests. (This assumes that the varBinds for columns S(1)..S(s) will fit in a request and response message.)

You use GETBULK, typically, as an optimisation of GETNEXT, and you would not typically know how many rows will be in the table. You just issue GETBULKs until you get all of the rows, just like using GETNEXT.

With GETNEXT, you know when you are done when the response is not the next row. Likewise, with GETBULK. However, instead of getting a single set of extra varBinds, you get upto the the value of maxRepeaters. This behavior is called “overshoot”. If the agent and manager support large max message sizes, and the maxRepeaters
is large, then you will have many extra varBinds in the last reponse to GETBULK. Typically, this is not too bad.

Leave a Reply