3 ms·
It is common for ping-pong protocols to allow to specify some data in the ping packet that is returned in the pong packet. It allows to build more abstractions
by antirez 13y ago
It is common for ping-pong protocols to allow to specify some data in the ping packet that is returned in the pong packet.
It allows to build more abstractions in the client side without the server realizing it at all. For example:
* Setting as payload the time at which the packet was sent allows to calculate client-side the round-trip-time without adding complexity (you don't need to remember the sent time client side).
* Setting as payload an unique incremental ID allows an event-driven client that may have application side reordering of packets to understand the order of the arriving replies.
* Setting the payload to a client-known pattern is useful to detect server-side or network data corruption.
And so forth... ICMP ping-pong packets use the same mechanism.