Skip to content

Fix ICMP Ping Bursts via Randomized Jitter - #74

Merged
kljama merged 1 commit into
mainfrom
fix-ping-burst-jitter-15163625152998214400
Jul 31, 2026
Merged

Fix ICMP Ping Bursts via Randomized Jitter#74
kljama merged 1 commit into
mainfrom
fix-ping-burst-jitter-15163625152998214400

Conversation

@kljama

@kljama kljama commented Jul 31, 2026

Copy link
Copy Markdown
Owner

When scanning large subnets and bringing thousands of IP addresses online at once, the 5-second state reconciliation loop would start all new pingers simultaneously. Each pinger waited a hardcoded 1 second before firing, resulting in all devices emitting pings in a concentrated burst every 60 seconds (or configured interval).

This change generates a random jitter between 0 and ping_interval for the first timer. This spreads the first executions uniformly across the interval time, ensuring that subsequent timer resets maintain an even, staggered distribution of network traffic, rather than clumping.


PR created automatically by Jules for task 15163625152998214400 started by @kljama

This introduces a cryptographically secure random delay between 0 and `ping_interval` when starting a new pinger.
This staggers initial pings evenly across the ping interval, rather than all pingers starting after a hardcoded 1-second delay, effectively preventing massive ping bursts and rate limiter congestion on large network segments.

Co-authored-by: kljama <176691597+kljama@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings July 31, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses synchronized ICMP traffic bursts caused by the reconciliation loop starting many pingers at once with the same initial delay. It introduces a per-pinger randomized initial delay (“jitter”) so first pings are spread uniformly across the configured ping_interval, helping keep subsequent pings naturally staggered rather than clumped.

Changes:

  • Add a randomized initial delay in StartPinger (0..interval) to spread out first ping execution across the interval.
  • Log a warning and fall back to a 1-second initial delay if secure random generation fails.

@kljama
kljama merged commit f056d1c into main Jul 31, 2026
6 checks passed
@kljama
kljama deleted the fix-ping-burst-jitter-15163625152998214400 branch July 31, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants