r4 - 19 May 2008 - 15:25:46 - SimonLeinenYou are here: TWiki >  PERTKB Web  > FpingTool

fping

fping is a ping like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion. If a host replies, it is noted and removed from the list of hosts to check. If a host does not respond within a certain time limit and/or retry limit it will be considered unreachable.

Unlike ping, fping is meant to be used in scripts and its output is easy to parse.

Simple example of usage:

# fping -c 3 -s www.man.poznan.pl www.google.pl
www.man.poznan.pl : [0], 84 bytes, 1.44 ms (1.44 avg, 0% loss)
www.google.pl     : [0], 84 bytes, 126 ms (126 avg, 0% loss)
www.man.poznan.pl : [1], 84 bytes, 1.12 ms (1.28 avg, 0% loss)
www.google.pl     : [1], 84 bytes, 126 ms (126 avg, 0% loss)
www.man.poznan.pl : [2], 84 bytes, 2.18 ms (1.58 avg, 0% loss)
www.google.pl     : [2], 84 bytes, 126 ms (126 avg, 0% loss)

www.man.poznan.pl : xmt/rcv/%loss = 3/3/0%, min/avg/max = 1.12/1.58/2.18
www.google.pl     : xmt/rcv/%loss = 3/3/0%, min/avg/max = 126/126/126

       2 targets
       2 alive
       0 unreachable
       0 unknown addresses

       0 timeouts (waiting for response)
       6 ICMP Echos sent
       6 ICMP Echo Replies received
       0 other ICMP received

 1.12 ms (min round trip time)
 64.0 ms (avg round trip time)
 126 ms (max round trip time)
        2.548 sec (elapsed real time)

IPv6 Support

Jeroen Massar has added IPv6 support to fping. This has been implemented as a compile-time variant, so that there are separate fping (for IPv4) and fping6 (for IPv6) binaries. The IPv6 patch has been partially integrated into the fping version on www.fping.com as of release "2.4b2_to-ipv6". Unfortunately his modifications to the build routine seem to have been lost in the integration, so that the fping.com version only installs the IPv6 version as fping. Jeroen's original version doesn't have this problem, and can be downloaded from his IPv6 Web page.

ICMP Sequence Number handling

Current versions of fping uses the Sequence Number field in ICMP ECHO requests in a peculiar way. RFC 792 explains that the sequence number can be used to match responses to requests. Therefore it would make sense to use different sequence numbers for different ECHO requests to the same host - responses from different hosts can be disambiguated easily by looking at the source address. Instead, fping uses a different sequence number for each destination host, but uses the same sequence number for all requests to a specific hosts. For example, fping -c 3 hostA hostB would send the following ICMP packets

ICMP ECHO -> hostA, seq# 0
ICMP ECHO -> hostB, seq# 1
ICMP ECHO -> hostA, seq# 0
ICMP ECHO -> hostB, seq# 1
ICMP ECHO -> hostA, seq# 0
ICMP ECHO -> hostB, seq# 1

instead of, e.g.

ICMP ECHO -> hostA, seq# 0
ICMP ECHO -> hostB, seq# 0
ICMP ECHO -> hostA, seq# 1
ICMP ECHO -> hostB, seq# 1
ICMP ECHO -> hostA, seq# 2
ICMP ECHO -> hostB, seq# 2

There have been reports of specific systems that suppress (or rate-limit) ICMP ECHO requests with repeated sequence numbers, which causes high loss rates reported from tools that use fping, such as SmokePing. Another issue is that fping cannot distinguish a perfect link from one that drops every other packet and that duplicates every other.

References

-- BartoszBelter - 26 Jul 2005 - 14 Jul 2005
-- SimonLeinen - 19 May 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions


 
GÉANT
Copyright © 2004-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.