Skip to content
Roberto D'Auria edited this page Jun 16, 2023 · 6 revisions

UDP Latency

sequenceDiagram
    Client->>+HTTP Server: /authorize?access_token=<...>
    HTTP Server->>HTTP Server: Verify access_token
    HTTP Server-->>-Client: {"Type": "c2s","Seq":0,"ID":"<mid>"}
    Note over Client,UDP Server: Kickoff message
    Client->>+UDP Server: {"Type": "c2s","Seq":0,"ID":"<mid>"}
    par Send ping packets for 5s
        loop Every ~25ms
            UDP Server->>+Client: Send Seq=N with LastRTT
        end
    and Reply to ping packets
        Client-->>Client: (optional) Read LastRTT
        Client-->>-UDP Server: Send ping back as-is
        activate UDP Server
        UDP Server-->>-UDP Server: Update LastRTT
    end
    Note over UDP Server: Stop sending after 5s
    Note over Client: Wait for min(3 * LastRTT, 2 seconds)
    Client->+HTTP Server: /result?access_token=<...>
    HTTP Server-->>HTTP Server: Verify access_token
    HTTP Server-->>-Client: Send JSON summary
Loading
Clone this wiki locally