12PING(1) 2ping 2PING(1)
2
3
4
6 2ping - A bi-directional ping utility
7
9 2ping [options] --listen | host/IP
10
12 2ping is a bi-directional ping utility. It uses 3-way pings (akin to
13 TCP SYN, SYN/ACK, ACK) and after-the-fact state comparison between a
14 2ping listener and a 2ping client to determine which direction packet
15 loss occurs.
16
17 To use 2ping, start a listener on a known stable network host. The
18 relative network stability of the 2ping listener host should not be in
19 question, because while 2ping can determine whether packet loss is oc‐
20 curring inbound or outbound relative to an endpoint, that will not help
21 you determine the cause if both of the endpoints are in question.
22
23 Once the listener is started, start 2ping in client mode and tell it to
24 connect to the listener. The ends will begin pinging each other and
25 displaying network statistics. If packet loss occurs, 2ping will wait
26 a few seconds (default 10, configurable with --inquire-wait) before
27 comparing notes between the two endpoints to determine which direction
28 the packet loss is occurring.
29
30 To quit 2ping on the client or listener ends, enter ^C, and a list of
31 statistics will be displayed. To get a short inline display of statis‐
32 tics without quitting, enter ^\ or send the process a QUIT signal.
33
35 ping-compatible options (long option names are 2ping-specific):
36
37 --audible, -a
38 Audible ping.
39
40 --adaptive, -A
41 Adaptive ping. A new client ping request is sent as soon as a
42 client ping response is received. If a ping response is not re‐
43 ceived within the interval period, a new ping request is sent.
44 On networks with low rtt this mode is essentially equivalent to
45 flood mode.
46
47 --count=count, -c count
48 Stop after sending count ping requests.
49
50 --flood, -f
51 Flood ping. For every ping sent a period "." is printed, while
52 for ever ping received a backspace is printed. This provides a
53 rapid display of how many pings are being dropped. If interval
54 is not given, it sets interval to zero and outputs pings as fast
55 as they come back or one hundred times per second, whichever is
56 more.
57
58 2ping-specific notes: Detected outbound/inbound loss responses
59 are printed as ">" and "<", respectively. Receive errors are
60 printed as "E". Due to the asynchronous nature of 2ping, suc‐
61 cessful responses (backspaces) may overwrite these loss and er‐
62 ror characters.
63
64 --interval=interval, -i interval
65 Wait interval seconds between sending each ping. The default is
66 to wait for one second between each ping normally, or not to
67 wait in flood mode.
68
69 --interface-address=address, -I address
70 Set source IP address. When in listener mode, this option may
71 be specified multiple to bind to multiple IP addresses. When in
72 client mode, this option may only be specified once, and all
73 outbound pings will be bound to this source IP.
74
75 2ping-specific notes: This option only takes an IP address, not
76 a device name. Note that in listener mode, if the machine has
77 an interface with multiple IP addresses and an request comes in
78 via a sub IP, the reply still leaves via the interface's main
79 IP. So either this option or --all-interfaces must be used if
80 you would like to respond via an interface's sub-IP.
81
82 --preload=count, -l count
83 If specified, 2ping sends that many packets not waiting for re‐
84 ply.
85
86 --pattern=hex_bytes, -p hex_bytes
87 You may specify up to 16 "pad" bytes to fill out the packets you
88 send. This is useful for diagnosing data-dependent problems in
89 a network. For example, --pattern=ff will cause the sent packet
90 pad area to be filled with all ones.
91
92 2ping-specific notes: This pads the portion of the packet that
93 does not contain the active payload data. If the active payload
94 data is larger than the minimum packet size (--min-packet-size),
95 no padding will be sent.
96
97 --quiet, -q
98 Quiet output. Nothing is displayed except the summary lines at
99 startup time and when finished.
100
101 --packetsize-compat=bytes, -s bytes
102 ping compatibility; this will set --min-packet-size to this plus
103 8 bytes.
104
105 --verbose, -v
106 Verbose output. In 2ping, this prints decodes of packets that
107 are sent and received.
108
109 --version, -V
110 Show version and exit.
111
112 --deadline=seconds, -w seconds
113 Specify a timeout, in seconds, before 2ping exits regardless of
114 how many pings have been sent or received. Due to blocking,
115 this may occur up to one second after the deadline specified.
116
117 2ping-specific options:
118
119 --help, -h
120 Print a synposis and exit.
121
122 --ipv4, -4
123 Limit binds to IPv4. In client mode, this forces resolution of
124 dual-homed hostnames to the IPv4 address. (Without --ipv4 or
125 --ipv6, the first result will be used as specified by your oper‐
126 ating system, usually the AAAA address on IPv6-routable ma‐
127 chines, or the A address on IPv4-only machines.) In listener
128 mode, this filters out any non-IPv4 --interface-address binds,
129 either through hostname resolution or explicit passing.
130
131 --ipv6, -6
132 Limit binds to IPv6. In client mode, this forces resolution of
133 dual-homed hostnames to the IPv6 address. (Without -4 or -6,
134 the first result will be used as specified by your operating
135 system, usually the AAAA address on IPv6-routable machines, or
136 the A address on IPv4-only machines.) In listener mode, this
137 filters out any non-IPv6 --interface-address binds, either
138 through hostname resolution or explicit passing.
139
140 --all-interfaces
141 In listener mode, listen on all possible interface addresses.
142 If used, this will override any addresses given by --inter‐
143 face-address. This functionality requires the netifaces module
144 to be installed.
145
146 --auth=key
147 Set a shared key, send cryptographic hashes with each packet,
148 and require cryptographic hashes from peer packets signed with
149 the same shared key.
150
151 --auth-digest=digest
152 When --auth is used, specify the digest type to compute the
153 cryptographic hash. Valid options are hmac-md5 (default),
154 hmac-sha1, hmac-sha256 and hmac-sha512.
155
156 --debug
157 Print (lots of) debugging information.
158
159 --encrypt=key
160 Set a shared key, encrypt 2ping packets, and require encrypted
161 packets from peers encrypted with the same shared key. Requires
162 the PyCrypto module.
163
164 --encrypt-method=method
165 When --encrypt is used, specify the method used to encrypt pack‐
166 ets. Valid options are hkdf-aes256-cbc (default).
167
168 --fuzz=percent
169 Simulate corruption of incoming packets, with a percent proba‐
170 bility each bit will be flipped. After fuzzing, the packet
171 checksum will be recalculated, and then the checksum itself will
172 be fuzzed (but at a lower probability).
173
174 --inquire-wait=secs
175 Wait at least secs seconds before inquiring about a lost packet.
176 Default is 10 seconds. UDP packets can arrive delayed or out of
177 order, so it is best to give it some time before inquiring about
178 a lost packet.
179
180 --listen
181 Start as a listener. The listener will not send out ping re‐
182 quests at regular intervals, and will instead wait for the far
183 end to initiate ping requests. A listener is required as the
184 remote end for a client.
185
186 --min-packet-size=min
187 Set the minimum total payload size to min bytes, default 128.
188 If the payload is smaller than min bytes, padding will be added
189 to the end of the packet.
190
191 --max-packet-size=max
192 Set the maximum total payload size to max bytes, default 512,
193 absolute minimum 64. If the payload is larger than max bytes,
194 information will be rearranged and sent in future packets when
195 possible.
196
197 --nagios=wrta,wloss%,crta,closs%
198 Produce output suitable for use in a Nagios check. If --count
199 is not specified, defaults to 5 pings. A warning condition (ex‐
200 it code 1) will be returned if average RTT exceeds wrta or ping
201 loss exceeds wloss%. A critical condition (exit code 2) will be
202 returned if average RTT exceeds crta or ping loss exceeds
203 closs%.
204
205 --no-3way
206 Do not perform 3-way pings. Used most often when combined with
207 --listen, as the listener is usually the one to determine
208 whether a ping reply should become a 3-way ping.
209
210 Strictly speaking, a 3-way ping is not necessary for determining
211 directional packet loss between the client and the listener.
212 However, the extra leg of the 3-way ping allows for extra
213 chances to determine packet loss more efficiently. Also, with
214 3-way ping disabled, the listener will receive no client perfor‐
215 mance indicators, nor will the listener be able to determine di‐
216 rectional packet loss that it detects.
217
218 --no-match-packet-size
219 When sending replies, 2ping will try to match the packet size of
220 the received packet by adding padding if necessary, but will not
221 exceed --max-packet-size. --no-match-packet-size disabled this
222 behavior, always setting the minimum to --min-packet-size.
223
224 --no-send-version
225 Do not send the current running version of 2ping with each pack‐
226 et.
227
228 --notice=text
229 Send arbitrary notice text with each packet. If the remote peer
230 supports it, this may be displayed to the user.
231
232 --packet-loss=out:in
233 Simulate random packet loss outbound and inbound. For example,
234 25:10 means a 25% chance of not sending a packet, and a 10%
235 chance of ignoring a received packet. A single number without
236 colon separation means use the same percentage for both outbound
237 and inbound.
238
239 --port=port
240 Use UDP port port, either a numeric port number of a service
241 name string. With --listen, this is the port to bind as, other‐
242 wise this is the port to send to. Default is UDP port 15998.
243
244 --send-monotonic-clock
245 Send a monotonic clock value with each packet. Peer time (if
246 sent by the peer) can be viewed with --verbose. Only supported
247 if the system is capable of generating a monotonic clock.
248
249 --send-random=bytes
250 Send random data to the peer, up to bytes. The number of bytes
251 will be limited by other factors, up to --max-packet-size. If
252 this data is to be used for trusted purposes, it should be com‐
253 bined with --auth for HMAC authentication.
254
255 --send-time
256 Send the host time (wall clock) with each packet. Peer time (if
257 sent by the peer) can be viewed with --verbose.
258
259 --srv In client mode, causes hostnames to be looked up via DNS SRV
260 records. If the SRV query returns multiple record targets, they
261 will all be pinged in parallel; priority and weight are not con‐
262 sidered. The record's port will be used instead of --port.
263 This functionality requires the dnspython module to be in‐
264 stalled.
265
266 --stats=interval
267 Print a line of brief current statistics every interval seconds.
268 The same line can be printed on demand by entering ^\ or sending
269 the QUIT signal to the 2ping process.
270
272 None known, many assumed.
273
275 2ping was written by Ryan Finnie <ryan@finnie.org>.
276
278 Ryan Finnie.
279
280
281
282 2PING(1)