All Projects → mitinarseny → pingo

mitinarseny / pingo

Licence: MIT license
Ping library for Golang with multi-host support

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to pingo

ComputerNetworks-unipd2018
Tips and resources to easily pass the "Computer Networks" practical exam ("Reti di calcolatori") in Padua
Stars: ✭ 21 (-41.67%)
Mutual labels:  ping, icmp
Fping
High performance ping tool
Stars: ✭ 652 (+1711.11%)
Mutual labels:  ping, icmp
ddos
Simple dos attack utility
Stars: ✭ 36 (+0%)
Mutual labels:  ping, icmp
icmpmon
A simple ICMP monitor with web interface.
Stars: ✭ 33 (-8.33%)
Mutual labels:  ping, icmp
kping
Large Scale, High Performance flood ping.
Stars: ✭ 16 (-55.56%)
Mutual labels:  ping, icmp
BackToTheFuture
Respond to pings before they even arrive at the server
Stars: ✭ 18 (-50%)
Mutual labels:  ping, icmp
Pingtop
🏓Ping multiple servers and show results in a top-like terminal UI.
Stars: ✭ 328 (+811.11%)
Mutual labels:  ping, icmp
gen icmp
ICMP protocol implementation for Erlang without NIFs
Stars: ✭ 26 (-27.78%)
Mutual labels:  ping, icmp
Pingtunnel
ping tunnel is a tool that advertises tcp/udp/socks5 traffic as icmp traffic for forwarding.
Stars: ✭ 1,904 (+5188.89%)
Mutual labels:  ping, icmp
Networkmanager
A powerful tool for managing networks and troubleshoot network problems!
Stars: ✭ 1,296 (+3500%)
Mutual labels:  ping, icmp
pexpo
💻 Terminal sending ping tool written in Go.
Stars: ✭ 89 (+147.22%)
Mutual labels:  ping, icmp
Go Ping
A simple ping library using ICMP echo requests.
Stars: ✭ 158 (+338.89%)
Mutual labels:  ping, icmp
Icmplib
Easily forge ICMP packets and make your own ping and traceroute.
Stars: ✭ 58 (+61.11%)
Mutual labels:  ping, icmp
Ping exporter
Prometheus exporter for ICMP echo requests using https://github.com/digineo/go-ping
Stars: ✭ 134 (+272.22%)
Mutual labels:  ping, icmp
ICMP-server
simple web app that use icmp protocol to check some devices if there are up or not
Stars: ✭ 16 (-55.56%)
Mutual labels:  ping, icmp
webping.cloud
Test your network latency to the nearest cloud provider in AWS, Azure, GCP, Alibaba Cloud, IBM Cloud, Oracle Cloud and DigitalOcean directly from your browser.
Stars: ✭ 60 (+66.67%)
Mutual labels:  ping
ping-multi
Interactively ping multiple hosts from one location
Stars: ✭ 15 (-58.33%)
Mutual labels:  ping
dstp
🧪 Run common networking tests against any site.
Stars: ✭ 919 (+2452.78%)
Mutual labels:  ping
gansoi
👽 Awesome Infrastructure Monitoring and Alerting
Stars: ✭ 31 (-13.89%)
Mutual labels:  ping
ping-exporter
Prometheus Ping exporter
Stars: ✭ 60 (+66.67%)
Mutual labels:  ping

pingo Go Reference Go

Fast and lightweight ping library for Golang with multi-host support.

Features

  • ICMP sockets:
    • UDP port 0 means "let the kernel pick a free number"
    • ICMP Echo Message ID is UDP port, so multiple instances of Pinger do not collide
  • Support for custom setsockopt(2) and sendmsg(2) options
  • Support for Linux kernel RX and TX timestamps with SO_TIMESTAMPING
  • IPv4 and IPv6 support
  • ICMP sequence numbers manager (no random): O(1) time, 256kB of memory
  • Context awareness

Requirements

  • go >= 1.18
  • Linux kernel >= 3.11

You may need to adjust ping_group_range sysfs to allow the creation of ICMP sockets:

$ echo 0 2147483647 > /proc/sys/net/ipv4/ping_group_range

Example

Here is a simple traceroute(8) implementation:

dst := net.IPv4(8, 8, 8, 8)

p, err := New(nil)
if err != nil {
	fmt.Println(err)
	return
}
defer p.Close()

ctx, cancel := context.WithCancel(context.Background())
var g errgroup.Group
g.Go(func() error {
	return p.Listen(ctx)
})
defer func() {
	cancel()
	if err := g.Wait(); !errors.Is(err, context.Canceled) {
		fmt.Println(err)
	}
}()

for ttl := uint8(1); ttl < math.MaxUint8-1; ttl++ {
	fmt.Printf("%3d: ", ttl)
	r, err := p.PingContextTimeout(ctx, dst, 1*time.Second, TTL(ttl))
	if errors.Is(err, context.DeadlineExceeded) {
		// no answer from current hop
		fmt.Println("...")
		continue
	}
	from := dst
	switch err := err.(type) {
	case nil:
	case TimeExceededError:
		from = err.From()
	default:
		fmt.Println(err)
		return
	}
	fmt.Printf("%-15s %s\n", from, r.RTT)
	if err == nil {
		return
	}
}
fmt.Println("TTL maxed out")
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].