Closed huitema closed 2 months ago
@huitema thanks for writing this down. Given we have issue #328 can we close this issue now and have the discussion there? Or is there anything else that is missing in #328 from this issue?
Let's continue this discussion in issue #328.
We have a lingering issue of whether to support sender-initiated paths or not. We have dodged this issue so far, because clients will often be located behind NAT or firewalls, which would cause server packets to be dropped if they did not match a 4-tuple previously used by the client. In that case, the server would not directly try to open paths, but might instead suggest IP addresses and port numbers that the client could use in path openings. But there are scenarios in which the client is not behind a firewall, and in which sender initiated path could be a performance improvement.
In the "unique path ID" scenario, we risk a collision if the sender and the client try to initiate different paths at the same time. Suppose that the client has addresses C1 and C2, the server addresses S1 and S2. The client is not yet aware of S2, and the server is not yet aware of S1. Path 0 has been established with the tuple C1-S1. The peers have both provided CID for Path-ID=1. The collision happens if, at the same time, client and server try to open path 1 as follow:
What follows depends on transmission order and local decisions, but is essentially non-deterministic. We might get a new path 1 with tuples C2-S1, C1-S2, or maybe C2-S2 or C1-S1.
We have discussed ways to avoid that, by splitting the "path ID" space in two. When the the client starts a path, it should use a CID with an even sequence number path, and the server should pick an odd sequence number space. The example above would become:
This becomes deterministic, which we like, but it makes the management of path numbers more complex. If we follow the rules set for MAX_STREAMS, we would need the following behavior:
We need to decide now whether we want to do that. A fall back position would be to state that "this version of multipath only support even numbered path ID, odd numbers will be used if and when we support server initiated path-ID."