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

UDP Latency

sequenceDiagram
    Note over Client,UDP Server,HTTP Server: Authenticate to start session
    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: Client sends kickoff UDP packet
    Client->>+UDP Server: {"Type": "c2s","Seq":0,"ID":"<mid>"}
    Note over Client,UDP Server: Server sends packets for 5s
    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