You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as it requires an already established libp2p connection.
139
143
140
-
After the initial protocol negotiation, the dialing peer sends 32 bytes of random binary data. The listening
141
-
peer echoes the data back, and the dialing peer will verify the response and measure
142
-
the latency between request and response.
144
+
> ICMP Ping is a network utility that uses ICMP packets to
145
+
> check the connectivity and latency between two networked devices.
146
+
> It is typically used to check the reachability of a host on an IP network and
147
+
> to measure the round-trip time for messages sent from the originating host to a
148
+
> destination host.
149
+
150
+
A peer opens a new stream on an existing libp2p connection and sends a ping request with a random 32 byte payload. The receiver echoes these 32 bytes back on the same stream. By measuring the time between the
151
+
request and response, the initiator can calculate the round-trip time of the underlying libp2p connection.
152
+
The stream can be reused for future pings from the initiator.
153
+
154
+
#### Example
155
+
156
+
[Kubo](https://github.com/ipfs/kubo) exposes a command line interface to ping other peers, which uses the libp2p ping protocol.
32 bytes from QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG: time=11.34ms
163
+
```
164
+
165
+
{{< alert icon="💡" context="note" text="See the ping <a class=\"text-muted\" href=\"https://github.com/libp2p/specs/blob/master/ping/ping.md\">technical specification</a> for more details." />}}
0 commit comments