-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection abort by the error "DCID not found" #176
Comments
The "DCID not found" error message comes from this code: if (cce >= END_OF_CCES(lconn))
{
ABORT_WARN("DCID not found");
return -1;
} This is in function parse_regular_packet(conn, packet_in);
if (saved_path_id == conn->ifc_cur_path_id)
{
if (conn->ifc_cur_path_id != packet_in->pi_path_id)
on_new_or_unconfirmed_path(conn, packet_in);
else if (!LSQUIC_CIDS_EQ(CN_SCID(&conn->ifc_conn),
&packet_in->pi_dcid))
{
if (0 != on_dcid_change(conn, &packet_in->pi_dcid))
return -1;
}
} This means that the incoming packet has DCID that this end point has not issued! This results in a connection error. This may be a bug in the server. Do you know which server implementation this is you're connecting to? Why do you think it's If |
this is the detail log. please help to have a look. this is my analysis.
some more other question about lsquic |
Thank you for the logs! Your analysis is very good -- and the bug is indeed in lsquic. Here we are tripped up by something unusual that lsquic client does behind the scenes in some circustances. Explanation follows. Because all non-deprecated, non-experimental gQUIC and IETF QUIC versions are enabled by default, lsquic has to cope with the odd property of Q046 and Q050 versions. In these versions, the server never includes a CID into the packets its sends to the client. This means that a client would not be able to differentiate between two connections by CID when a packet is received. To work around this, lsquic identifies connections by the local port number instead of the connection ID. It uses the following code to decide which to pick: static int
hash_conns_by_addr (const struct lsquic_engine *engine)
{
if (engine->flags & ENG_SERVER)
return 0;
if (engine->pub.enp_settings.es_versions & LSQUIC_FORCED_TCID0_VERSIONS)
return 1;
if ((engine->pub.enp_settings.es_versions & LSQUIC_GQUIC_HEADER_VERSIONS)
&& engine->pub.enp_settings.es_support_tcid0)
return 1;
if (engine->pub.enp_settings.es_scid_len == 0)
return 1;
return 0;
} (As you can see, Q043 has the same issue when Thus, after CID The proper way to fix it is to perform a check -- only when connections are identified by port number -- whether any SCID matches DCID that's in the incoming packet. If there are no matching SCID, discard the packet immediately and not give it to the connection. This will mimic the normal behavior when the connections are looked up in a hash by DCID. To answer your questions:
|
now I only use LSQVER_ID24 on client and server side. So if i want to fix or avoid this bug happened, Is it ok to force set es_versioins = 1 << LSQVER_ID24 to make the lsquic not use address to find connection( use dcid to find connection)? lsquic_engine_init_settings(&settings_, flags); |
Yes, this will work. |
- [FEATURE] IETF Client 0-RTT support. - [BUGFIX] Do not schedule MTU probe on first tick. - [BUGFIX] Parsing DATAGRAM frame. - [BUGFIX] If push promise fails, do not invoke hset destructor. - [BUGFIX] Client: When connections are IDed by port number, check DCID. Fixes issue #176. - Revert the 2.22.1 lsquic_is_valid_hs_packet change. All that was necessary is a change to the way we call it in lsquic_engine. No change to the function itself is required.
Fixed in 2.23.1 -- closing. |
hi @dtikhonov , i have a problem when use lsquic to connect to server.
sometimes client will receive a retry packet, and than raise an error
"conn: Abort connection: DCID not found"
it will cause quic connection broken.
i ever think that whether there is something wrong about this api "iquic_esfi_reset_dcid”。。。
i'm trying to reproduce...
do you have some ideas about it?
lsquic version is 2.7.0
The text was updated successfully, but these errors were encountered: