Version: v0.11.3 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 24 Imported by: 10



Package ping implements a fast ping prober. It sends ICMP pings to a list of targets and reports statistics on packets sent, received and latency experienced.

This ping implementation supports two types of sockets: Raw and datagram ICMP sockets.

Raw sockets require root privileges and all the ICMP noise is copied on all raw sockets opened for ICMP. We have to deal with the unwanted ICMP noise.

On the other hand, datagram ICMP sockets are unprivileged and implemented in such a way that kernel copies only relevant packets on them. Kernel assigns a local port for such sockets and rewrites ICMP id of the outgoing packets to match that port number. Incoming ICMP packets' ICMP id is matched with the local port to find the correct destination socket.

More about these sockets: Note: On some linux distributions these sockets are not enabled by default; you can enable them by doing something like the following:

sudo sysctl -w net.ipv4.ping_group_range="0 5000"



This section is empty.


View Source
var NativeEndian binary.ByteOrder

NativeEndian is the machine native endian implementation of ByteOrder.


This section is empty.


type Probe

type Probe struct {
	// contains filtered or unexported fields

Probe implements a ping probe type that sends ICMP ping packets to the targets and reports back statistics on packets sent, received and the rtt.

func (*Probe) Init

func (p *Probe) Init(name string, opts *options.Options) error

Init initliazes the probe with the given params.

func (*Probe) Start

func (p *Probe) Start(ctx context.Context, dataChan chan *metrics.EventMetrics)

Start starts the probe and writes back the data on the provided channel. Probe should have been initialized with Init() before calling Start on it.


Path Synopsis
This program implements a stand-alone ping prober binary using the cloudprober/ping package.
This program implements a stand-alone ping prober binary using the cloudprober/ping package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL