Commit Graph

10 Commits

Author SHA1 Message Date
Jeff 95efe8f4e5 bump ngtcp2 to v0.1.0 tag 2022-01-31 13:05:03 -05:00
Jeff Becker 9c37e0146e
make it compile again 2021-09-24 17:15:50 -04:00
Jason Rhinelander 7982581cfd
Revisit/reduce quic logging
Demote many things to Trace.
2021-04-19 06:59:05 -04:00
Jason Rhinelander 183abd58aa
Add more checks and logging
Most of the logging here is Trace level so needs a Debug build to not
get compiled away.
2021-04-19 06:59:04 -04:00
Jeff Becker 59891d5d5f
wire up snode traffic to quic 2021-04-19 06:58:36 -04:00
Jason Rhinelander 752879d712
QUIC lokinet integration refactor
Refactors how quic packets get handled: the actual tunnels now live in
tunnel.hpp's TunnelManager which holds and manages all the quic<->tcp
tunnelling.  service::Endpoint now holds a TunnelManager rather than a
quic::Server.  We only need one quic server, but we need a separate quic
client instance per outgoing quic tunnel, and TunnelManager handles all
that glue now.

Adds QUIC packet handling to get to the right tunnel code.  This
required multiplexing incoming quic packets, as follows:

Adds a very small quic tunnel packet header of 4 bytes:

    [1, SPORT, ECN] for client->server packets, where SPORT is our
    source "port" (really: just a uint16_t unique quic instance
    identifier)

or

    [2, DPORT, ECN] for server->client packets where the DPORT is the SPORT
    from above.

(This also reworks ECN bits to get properly carried over lokinet.)

We don't need a destination/source port for the server-side because
there is only ever one quic server (and we know we're going to it when
the first byte of the header is 1).

Removes the config option for quic exposing ports; a full lokinet will
simply accept anything incoming on quic and tunnel it to the requested
port on the the local endpoint IP (this handler will come in a following
commit).

Replace ConvoTags with full addresses: we need to carry the port, as
well, which the ConvoTag can't give us, so change those to more general
SockAddrs from which we can extract both the ConvoTag *and* the port.

Add a pending connection queue along with new quic-side handlers to call
when a stream becomes available (TunnelManager uses this to wire up
pending incoming conns with quic streams as streams open up).

Completely get rid of tunnel_server/tunnel_client.cpp code; it is now
moved to tunnel.hpp.

Add listen()/forget() methods in TunnelManager for setting up quic
listening sockets (for liblokinet usage).

Add open()/close() methods in TunnelManager for spinning up new quic
clients for outgoing quic connections.
2021-04-19 06:58:36 -04:00
Jeff Becker 4446f2fc16
fix and format.
* start moving quic code to use lokinet internals
2021-04-19 06:57:46 -04:00
Jason Rhinelander 818b4042e9
Migrate plainquic logging to llarp logging 2021-04-19 06:57:46 -04:00
Jason Rhinelander 5d897781ef
Replace custom random with llarp/sodium random 2021-04-19 06:57:45 -04:00
Jason Rhinelander aa0f54fa07
WIP plainquic tunnels 2021-04-19 06:57:45 -04:00