Files
specs/ping/ping.md
Marco Munizaga 8383370a89 Add ping spec
2022-11-04 17:55:21 -07:00

1.5 KiB

Ping

Lifecycle Stage Maturity Status Latest Revision
1A Candidate Recommendation Active r0, 2022-11-04

Authors: @marcopolo

Interest Group: @marcopolo, @mxinden, @marten-seemann

Table of Contents

Protocol

The ping protocol is a simple request response protocol. The client sends a payload of 32 random bytes, and the server responds with the same 32 bytes. The client then measures the RTT from the time it wrote the bytes to the time it received the bytes. The client may repeat the process by sending another payload with random bytes, so the server should loop and echo the next payload. The client may close the write side of the stream after sending a payload, the server should finish writing the echoed payload and then exit the loop and close the stream.

The protocol id is /ipfs/ping/1.0.0.

Diagram

Ping Protocol Diagram

Instructions to reproduce diagram

From the root, run: plantuml -tsvg ping/ping.md

@startuml
skinparam backgroundColor white

entity Client
entity Server

== /ipfs/ping/1.0.0 ==
loop until Client closes write
    Client -> Server: 32 random bytes
    Client <- Server: Same 32 random bytes
end
@enduml