quiche icon indicating copy to clipboard operation
quiche copied to clipboard

How to mitigate packet drops during connection handshake

Open bijanebrahimi opened this issue 1 year ago • 0 comments

Hello there,

I'm implementing a QUIC capable client/server application using quiche's C API following the client/server example applications. I'm just trying to figure out what is the proper way to handle packet drops from either sides of the connection.

Considering the handshake process, if the client or server doesn't receive any of the specific packets due to packet-drops in the network, it seems calling the quiche_conn_send on the timeout callback doesn't produce any further packets to be send. This will result in either side to sit still indefinitely which I'm trying to resolve.

I can imagine for the Initial packets destined to the server, It is the responsibility of the client to re-transmit the Initial packet, But how is the proper way to do that with the C API? Is it acceptable to call quiche_connect to create a new connection object and free the previous one just to resend the Initial packet from the client side? I would have imagined calling the quiche_conn_send on timeout should produce packet re-transitions but it seems it doesn't.

And how about packet re-transmission from the server side?

P.S: To simulate the packet-drop scenario, I have a condition to selectively drop the received packet after calling recvfrom syscall and return early which actually matches what we observe from real packet drops in the network:

        ssize_t read = recvfrom(conn_io->sock, buf, sizeof(buf), 0,
                                (struct sockaddr *) &peer_addr,
                                &peer_addr_len);
        /* Drop received packets randomly to simulate the network packet-drop rates */

bijanebrahimi avatar Jun 16 '23 12:06 bijanebrahimi