Response to lag measurement challenge
The PONG should be sent immediately in response to the PING tag. The resulting round-trip time can be measured to determine the player's lag. When the server sends the ping, the lag measurement is tracked and reported to all players in the room (including that player). But for a lagging client - or one that is not in a room - this is not helpful. Thus the client can also send a ping to determine its own latency.