Repository navigation
Commit cdc1547
committed
Send UDP as QUIC DATAGRAMs, and keep the packet boundaries
Section 9's arithmetic has been checked against the specification's own fixture
since before there was a connection to use it on. What was missing was the
transport: nothing had ever put one of those frames on a wire. Now a UDP packet
crosses as a DATAGRAM, a packet too large for the path is fragmented and
reassembled, and three packets arrive as three packets.
The echo comes from a service on the Portal's loopback, which this device cannot
reach, so a packet that returns has crossed the carrier and nothing else. The
fragmenting case derives its size from what ngtcp2 reports for the current path
rather than from a constant — a constant that happened to fit would exercise the
unfragmented path and pass, which is the failure the case exists to avoid.
UDP needed an interface it did not have. Over TLS a packet is length-prefixed
inside a byte stream and the caller does the framing; over QUIC each packet is
its own DATAGRAM, unreliable and unordered, which is what UDP is. Expressing
that as "some bytes" would frame it twice — once for a stream that is not being
used and once for the datagram that is. So PacketFlow exists, UdpRelay asks for
one, and falls back to framing when it does not get one.
The opening write changed with it. A UDP flow's control stream carries the
FlowHeader and the Target and stops there; the first packet leaves as a DATAGRAM
once the Portal has answered, because that is what section 9 says and because
bytes after the Target would be read as a second one.
Row 15 is closed, and by construction rather than by a check: the reassembler
refuses payload until markReady, and the carrier calls it only when a Portal has
answered a flow. A datagram arriving before any flow exists is discarded rather
than queued for one that may never open.
A UDP flow over a connection whose peer did not enable RFC 9221 is refused. The
alternative — quietly using the TLS carrier's framing on a QUIC stream — would
be framing nobody is listening for.
One defect, and it is a Kotlin one. NowhereSession wrapped every flow in
`Flow by delegate` to release its id on close, and that implements exactly Flow:
a PacketFlow handed through came out the other side as an ordinary flow, so the
caller framed the packet for a stream it was not using. Every datagram case
failed on "a QUIC UDP flow must take packets". There are two wrappers now, and
the reason is in the comment on them.
L3: nineteen covered, one partly, seven blocked. All seven now wait on the same
two things — split flows and a physical device.
Gates green; device suite 43 cases.1 parent 7e60475 commit cdc1547
10 files changed
Lines changed: 975 additions & 17 deletions
File tree
- app/src
- androidTest/kotlin/eu/nodepass/somewhere/quic
- main
- jni/quic
- kotlin/eu/nodepass/somewhere
- protocol/session
- quic
- vpn
- test/kotlin/eu/nodepass/somewhere/protocol/session
- conformance/cases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
0 commit comments