FpingSharp 0.1.0

dotnet add package FpingSharp --version 0.1.0
                    
NuGet\Install-Package FpingSharp -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FpingSharp" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FpingSharp" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FpingSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FpingSharp --version 0.1.0
                    
#r "nuget: FpingSharp, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FpingSharp@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FpingSharp&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FpingSharp&version=0.1.0
                    
Install as a Cake Tool

FpingSharp

Note: This project was developed with AI assistance (Claude, Anthropic). Architecture design, code implementation, documentation, and benchmarks were produced through human-AI collaboration.

A pure C# high-performance parallel ping library inspired by fping. No native dependencies required.

Features

  • Async and synchronous ICMP ping
  • IPv4 and IPv6 support
  • CIDR range scanning (e.g. 192.168.1.0/24)
  • Parallel pinging of thousands of hosts
  • Per-host and global RTT statistics (min/max/avg)
  • Real-time event callbacks for replies, timeouts, and periodic stats
  • Configurable retry, backoff, TTL, ToS, packet size, and more

Requirements

  • .NET Standard 2.1+ (.NET Core 3.0+, .NET 5+)
  • Linux: raw sockets require CAP_NET_RAW or root privileges, or DGRAM sockets are used automatically
  • Windows: requires Administrator privileges for raw ICMP sockets

Installation

dotnet add package FpingSharp

Quick Start

using FpingSharp;

// Simple ping
using var client = new FpingClient();
var result = client.Run(new[] { "8.8.8.8", "1.1.1.1" });

foreach (var host in result.Hosts)
{
    Console.WriteLine($"{host.Name}: {(host.IsAlive ? "alive" : "unreachable")} " +
                      $"({host.Received}/{host.Sent}, avg={host.AvgRtt.TotalMilliseconds:F1}ms)");
}

With Options

using var client = new FpingClient(new FpingOptions
{
    Count = 5,            // 5 pings per host
    TimeoutMs = 1000,     // 1s timeout
    IntervalMs = 20,      // 20ms between pings
    Retry = 2,            // 2 retries
    AddressFamily = FpingAddressFamily.IPv4
});

var result = client.Run(new[] { "google.com", "github.com" });

CIDR Range Scanning

var hosts = CidrRange.Expand("192.168.1.0/24");
var result = client.Run(hosts);

Console.WriteLine($"Alive: {result.AliveCount}, Unreachable: {result.UnreachableCount}");

Real-time Event Callbacks

using var client = new FpingClient(new FpingOptions { Count = 10 });
client.OnReply += (sender, reply) =>
    Console.WriteLine($"{reply.HostName}: seq={reply.SequenceNumber} time={reply.RoundTripTime?.TotalMilliseconds:F1}ms");
client.OnTimeout += (sender, reply) =>
    Console.WriteLine($"{reply.HostName}: seq={reply.SequenceNumber} timeout");

client.Run(new[] { "8.8.8.8" });

Async Usage

var result = await client.RunAsync(new[] { "8.8.8.8" }, cancellationToken);

FpingOptions Reference

Property Default Description
Count 1 Number of pings per host (-c)
Loop false Continuous ping mode (-l)
IntervalMs 10 Min interval between any ping in ms (-i)
PerHostIntervalMs 1000 Interval between pings to same host in ms (-p)
TimeoutMs 500 Per-ping timeout in ms (-t)
Retry 3 Number of retries (-r)
Backoff 1.5 Retry backoff factor (-B)
PacketSize 56 ICMP payload size in bytes (-b)
Ttl null IP Time-To-Live
Tos null IP Type-Of-Service
DontFragment false Set the DF bit
AddressFamily IPv4 IPv4, IPv6, or Both
SourceAddress null Source address to bind (-S)
InterfaceName null Network interface to bind (-I, Linux only)
StatsIntervalMs null Periodic stats interval in ms (-Q)

License

MIT

This project includes code derived from fping (BSD-4-Clause). See THIRD-PARTY-NOTICES for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 118 3/10/2026