• Home
  • Docs
  • About
  • Resume
  • Services
    • Testimonials
    • Leave A Testimonial
  • Stack Exchange
    • Android
      • Spanish
      • French
      • German
    • Apple
      • Spanish
      • French
      • German
    • Ask Ubuntu
      • Spanish
      • French
      • German
    • Bicycles
      • Spanish
      • French
      • German
    • Cooking
      • Spanish
      • French
      • German
    • CrossValidated
      • Spanish
      • French
      • German
    • Database Administrator
      • Spanish
      • French
      • German
    • Drupal
      • Spanish
      • French
      • German
    • Electronics
      • Spanish
      • French
      • German
    • Game Development
      • Spanish
      • French
      • German
    • Gaming
      • Spanish
      • French
      • German
    • GIS
      • Spanish
      • French
      • German
    • Home Improvement
      • Spanish
      • French
      • German
    • Mathematics
      • Spanish
      • French
      • German
    • Photography
      • Spanish
      • French
      • German
    • Physics
      • Spanish
      • French
      • German
    • Programmers
      • Spanish
      • French
      • German
    • Stack Overflow
      • Spanish
      • French
      • German
Humbug
Bah! Humbug!
Home 2009 Linear Backoff for Net SNMP retries
  • Email
  • Share

Linear Backoff for Net SNMP retries

  • Leave a comment
  • Tweet
Pratik Sinha | June 8, 2009

By default, all snmp retries are transmitted at the same interval. However, we don’t want that to happen when the client is on a vpn connection or the network is flaky and the responses to snmp requests reach later than the timeout period. In such cases, we would want an increasing timeout value to accommodate snmp entities which cannot respond within the timeout interval.

Does that sound too complicated? In fact, this can be done very easily. Here’s a little tip.

All this needs is a one line change in the snmp code.

Download the net-snmp code either from the Net Snmp website or from you Linux distribution website.

For Ubuntu, you can use the following command.

apt-get source snmp

Now, look up the function snmp_resend_request present in snmp_api.c

static int
snmp_resend_request(...)
{

.

.

rp->retries++;
result = transpor->f_send(...);

.

.

gettimeofday(&now, (struct timezone *) 0);
tv = now;
rp->time = tv;
tv.tv_usec += rp->timeout;
tv.tv_sec += tv.tv_usec / 1000000L;
tv.tv_usec %= 1000000L;
rp->expire = tv;
}
return 0;
}

In the code above change, tv.tv_usec += rp->timeout to tv.tv_usec += rp->timeout*(rp->retries+1);

This would change the timeout values to multiples of the original timeout value, for the nth retries the timeout value would be n*(default timeout value).

The above change isn’t really ‘exponential’ backoff, but you could use your own formula to implement the real exponential backoff mechanism.

Posted in Tips-N-Tricks | Tagged Exponential backoff, Net-SNMP, Network management, retries, Simple Network Management Protocol, SNMP | Leave a response

  • Tweet

Logging In...

Reply Click here to cancel reply.

Sign in with Twitter Sign in with Facebook
or

« Previous Next »

Recommend on Google
  • RSS
  • Facebook
  • Twitter

Subscribe

Get the latest posts delivered straight to your inbox.

Chatter Away

Recently Popular

  • Make English the Default Language for Google Chrome Search
  • Kill/Quit and Restart Plasma on KDE
  • Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes
  • Bash Tricks: Split / Cut a String with Multi Character Delimiters
  • Utility to Send Commands or Data to Other Terminals (tty/pts)
  • Make English the Default Language for Mozilla Firefox Search
  • A Sample Loop in XSL, Alternative for While, For Loops
  • Bash Tricks: Split / Cut a String with Multi Character Delimiters Using AWK
  • Bash Tricks: Create variables dynamically using some eval magic
  • Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison

Latest Tweets

  • Ruby on Rails Debugging Techniques: Nice succinct blog on ROR debugging techniques, saving it for future reference... http://t.co/36mceCNP 2 hours ago
  • Get Android Remote Notifier to work with Unity on Ubuntu Natty (11.04) and Oneiric (11.10): Ubuntu Natty onwards, ... http://t.co/c3rLfD27 3 days ago
  • Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic: Jotting down an easy recipe to get a 802.11 ... http://t.co/rZqwjVE5 1 week ago
  • RT @MaheshNBhatt: Mukul Sinha from Jansangharsh Manch called to say that the police are denying the riot victims the permission to hold ... 4 months ago
  • RT @MaheshNBhatt: They have just informed me that they will court arrest and begin to fast if the Gujarat govt denies them their constit ... 4 months ago

Services Offered

  • Embedded Linux Systems and Services
  • Gateway Routers (Frontend and Backend)
  • Free and Open Source Software Solutions
  • Network Monitoring Solutions
  • Device Driver Development

Recent Comments

  • buckley commented on Utility to Send Commands or Data to Other Terminals (tty/pts)
    (1 weeks ago)
  • Arup Kumar Kabi commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)
  • Varun V Nair commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)
  • Ajit Bhat commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)

Categories

  • As An Aside
  • Code-Snippets
  • Software
  • Testimonials
  • Tips-N-Tricks

Copyright © 2012 Humbug.

Powered by WordPress and Hybrid.