RFC 3416 does not list the ‘tooBig’ error code for SNMP GetBulkRequest. Instead, the SNMP agent should return a set of variables that fits into the buffer and does not take too long to process. The SNMP agent is not required to return as many sets of variables as requested in the ‘max-repetitions’ parameter; this parameter sets the upper limit, not the lower limit. The SNMP agent must not return the ‘tooBig’ error if the number of sets of variables requested in ‘max-repetitions’ is too big and cannot be returned for some reason.
This is how Net-SNMP and Huawei routers work, for example. The size of the response to GetBulkRequest is variable and cannot be calculated by the requester. It is the lack of risk of getting the ‘tooBig’ error that makes GetBulkRequest so useful and attractive.
However, MikroTik returns the ‘tooBig’ error for GetBulkRequest if max-repetitions > 50.
$ snmpbulkget -Cr50 -On -v 2c -c ruter 192.168.88.1 .1 .1 .1 | wc -l
150
$ snmpbulkget -Cr50 -On -v 2c -c ruter 192.168.88.1 .1 | wc -l
50
$ snmpbulkget -Cr51 -On -v 2c -c ruter 192.168.88.1 .1 | wc -l
Error in packet.
Reason: (tooBig) Response message would have been too large.
0
In order to be compliant with RFC 3416, MirkoTik should, for example, execute 50 iterations instead of 51 and gracefully return the same response packet as with -Cr50.
It might even be better to copy the behaviour of Net-SNMP, which does not formally limit the number of iterations, but limits the total number of returned repeated variables to one hundred, and never returns a tooBig for GetBulkRequest. If the next iteration exceeds the limit, the iterations simply stop and the current result is returned. (The number of non-repeatable variables can be quite large, but the restriction is not affected.)
$ snmpbulkget -On -Cr1000 -v2c -c local 127.0.0.1 .1 | wc -l
100
$
This is the correct behaviour according to RFC 3416.