-
Notifications
You must be signed in to change notification settings - Fork 75
Latency is not working properly #1488
Description
I'm setting up a test plan where I measure the time it takes for one libp2p host to connect to another host.
The latency of the link is set via:
initCtx.NetClient.MustConfigureNetwork(ctx, &network.Config{
Network: "default",
Enable: true,
Default: network.LinkShape{Latency: latency},
CallbackState: sync.State("network-configured"),
CallbackTarget: runenv.TestInstanceCount,
})
In my case, latency = 25 * time.Millisecond, thus the RTT should be 50 ms.
By recording a qlog I can see when exactly a packet was sent. Interestingly, the first flight takes 100ms, not 50ms:
What you can see is that the client sends the first packet (initial: 0) to the server, and the server responds with a packet (initial: 0, acknowledging the client's first packet).
Interestingly, things change for the second flight:
The client sends a whole bunch of packets, which are received by the server and responded to. The response to these packets arrives at t = 157 ms, so after just 54 ms.
It looks like the RTT for the first flight is twice the RTT for the second flight. I'm also not sure if the link simulated here is actually symmetric: The packet from the client is received after 77ms, suggesting that the it took the clients first flight 3*latency to reach the server.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

