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

UDP Latency

sequenceDiagram
    Note over Client,UDP 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 Client,UDP Server: Client receives summary results
    Client->+HTTP Server: /result?access_token=<...>
    HTTP Server-->>HTTP Server: Verify access_token
    HTTP Server-->>-Client: Send JSON summary
Loading
Clone this wiki locally