Closed hasheddan closed 1 year ago
Patch coverage: 84.39%
and project coverage change: +0.53%
:tada:
Comparison is base (
f1d8b0a
) 76.98% compared to head (29202df
) 77.52%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
558 added support for DTLS 1.2 Connection IDs, but because the underlying routing mechanism in
pion/transport/udp
only accommodates associating packets to connection by the remote address, we are not yet able to actually receive packets on the connection with which the connection ID is associated. This patchset adds a newdtls/net/udp
package that we consume by default indtls.NewListener
, which allows for customized routing. It closely resemblesnet/transport/udp
, but allows for adding alternate IDs for a single connection.This functionality is implemented through the use of two configuration options:
DatagramRouter
: when provided, the UDP listener will apply the function to each incoming packet, and use the returned identifier for routing.ConnectionIdentifier
: when provided, the UDP listener will apply the function to each outgoing packet. If an identifier is returned that is not already associated with the connection, a new entry in the routing table will be added that associates the connection to that identifier.Reference issue
Fixes #568
Benchmarks
The same benchmarks, which are not necessarily the most realistic, are copied from
pion/transport/packetio
topion/dtls/pkg/net
. Running them on my local machine provided the following results.pion/transport/packetio
pion/dtls/pkg/net
We are clearly paying a performance penalty with the new buffer strategy. However, given that we are keeping this package internal and users can opt to keep using the existing
udp
/packetio
packages if they don't care about clients being able to update remote address, this may be acceptable for the time-being with the knowledge that we can continue improving it without breaking users.