More precise language

This commit is contained in:
Marco Munizaga
2022-11-05 05:45:03 -07:00
parent 8383370a89
commit 8af5686ad9
2 changed files with 16 additions and 8 deletions

View File

@@ -18,14 +18,20 @@ Interest Group: [@marcopolo], [@mxinden], [@marten-seemann]
# 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 ping protocol is a simple request response protocol. The client opens a
stream, sends a payload of 32 random bytes, and the server responds with the
same 32 bytes on that stream. 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 on the same stream, so the
server SHOULD loop and echo the next payload. The client SHOULD close the write
side of the stream after sending the last payload, and the server SHOULD finish
writing the echoed payload and then exit the loop and close the stream.
The client MUST NOT keep more than one outbound stream for the ping protocol per
peer. The server SHOULD accept at most 2 streams per peer since cross stream
behavior is not linearizable for client and server. In other words, the client
closing stream A and then opening stream B, might be perceived by the server as
the client opening stream B and then closing stream A.
The protocol id is `/ipfs/ping/1.0.0`.