Skip to content

Enhancement: Use separate ICMP identifier and sequence to remove 65k ping limit #385

@greenlms

Description

@greenlms

Enhancement: Support for extended ICMP (identifier + sequence) tracking to overcome 65k sequence limit

Currently, fping uses a single global 16-bit sequence map (FPING_SEQMAP_SIZE) to track ICMP responses. This imposes a hard limit of approximately 65,535 total hosts × count combinations per run.

For example, it is possible to monitor up to 65,535 hosts with -C1, but increasing to -C2 immediately exceeds this limit.


However, the ICMP Echo protocol defines two separate 16-bit fields:

  • identifier (typically per host)
  • sequence (typically per probe)

By assigning a unique identifier per target host and using the sequence field per probe (e.g., for -C count), it becomes possible to scale host × count combinations into the range of 2³², fully within the ICMP specification.


This change would allow monitoring up to 65,535 hosts with options like -C60 or higher — a major benefit for ISPs and large-scale network monitoring systems.

Suggested implementation:

  • Assign a unique ICMP identifier (16-bit) to each target host.
  • For each repeated probe (e.g. with -C), increment only the sequence field (also 16-bit).
  • Internally, match ICMP responses using a composite key made from both fields, for example: (identifier << 16) | sequence.

This replaces the current single 16-bit sequence-based tracking, and enables proper handling of 65,000+ targets even with repeated pings (e.g. -C60).

I'd be happy to help test this in a high-scale environment or submit a prototype patch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions