Commit graph

240 commits

Author SHA1 Message Date
Marten Seemann
7bf5cb6e2a
Merge pull request #1487 from lucas-clemente/version-negotiate-ietf-and-gquic
allow version negotiation between IETF QUIC and gQUIC, and vice versa
2018-08-15 19:47:35 +07:00
Marten Seemann
c840bd4177 allow version negotiation between IETF QUIC and gQUIC, and vice versa 2018-08-15 17:10:05 +07:00
Marten Seemann
9608e8563f only accept 3 retries
While the server is allowed to perform multiple Retries, the client
should impose a limit in order to avoid being caught in an endless loop.
2018-08-14 18:35:25 +07:00
Marten Seemann
872e1747f4 always use connection IDs longer than 8 bytes when sending a Retry
A server is allowed to perform multiple Retries. There's little to gain
from doing so, but it's something our API allows. If a server performs
multiple Retries, it must use a connection ID that's at least 8 bytes
long. Only if it doesn't perform any further Retries it is allowed to
use shorter IDs. Therefore, we're on the safe side by always using a
long connection ID.
This shouldn't have a performance impact, since the server changes the
connection ID to a short value with the first Handshake packet it sends.
2018-08-14 17:34:21 +07:00
Marten Seemann
829edc04ab accept multiple Retries 2018-08-14 17:18:44 +07:00
Marten Seemann
f88b7bb175 implement the new Retry mechanism 2018-08-13 08:47:29 +07:00
Marten Seemann
ad5a3e2fa0 also use the multiplexer for the server 2018-08-08 10:03:22 +07:00
Marten Seemann
c8d20e86d7 move listening from the multiplexer to the packet handler map 2018-08-08 10:03:20 +07:00
Marten Seemann
7e2adfe19d rename the clientMultiplexer to connMultiplexer 2018-08-08 09:49:49 +07:00
Marten Seemann
a654e7600a move cutting of packets at the payload length to the multiplexer 2018-08-08 09:49:12 +07:00
Marten Seemann
cfa55f91bc close connections created by DialAddr when the session is closed 2018-08-08 08:45:47 +07:00
Marten Seemann
e265abb8cb fix populating the client config when dialing an address 2018-08-06 16:15:09 +07:00
Marten Seemann
8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 2018-07-06 15:51:35 +07:00
Marten Seemann
f806f9146b also use the multiplexer when dialing an address 2018-07-04 10:38:40 +07:00
Marten Seemann
f02dc92a32 make the connection ID length configurable 2018-07-03 18:34:31 +07:00
Marten Seemann
73f7636537 use a random length destination connection ID on the Initial packet
The destination connection ID on the Initial packet must be at least 8
bytes long. By using all valid values, we make sure that the everything
works correctly. The server chooses a new connection ID with the Retry
or Handshake packet it sends, so the overhead of this is negligible.
2018-07-03 18:01:41 +07:00
Marten Seemann
0bd7e744ff implement parsing of headers with different connection ID lengths 2018-07-03 18:01:41 +07:00
Marten Seemann
0928e91e4d remove closed clients from the multiplexer 2018-07-03 17:30:49 +07:00
Marten Seemann
6e299157d4 implement the disable_migration transport parameter and use it 2018-07-02 22:18:28 +07:00
Marten Seemann
4109c85c8a refactor header parsing in a version independent and dependent part 2018-07-01 09:01:30 +07:00
Marten Seemann
7b96d158d2 remove the OmitConnectionID field from the Header struct
Instead, just look at the length of the destination connection ID.
2018-06-24 17:21:41 +07:00
Marten Seemann
2c05dbff07 multiplex multiple clients on one packet conn 2018-06-23 08:35:11 +07:00
Marten Seemann
97e734e973 refactor packet handling functions in the client 2018-06-23 08:20:27 +07:00
Marten Seemann
b3fd768a61 use a smaller packetHandler interface
The packetHandler interface just needs two methods: one for handling
packets, and one for closing.
2018-06-23 08:16:51 +07:00
Marten Seemann
b28615125d only accept authenticated Retry packets 2018-06-19 22:06:38 +07:00
Marten Seemann
3601f06aed only accept a single Retry packet for a connection 2018-06-19 21:49:59 +07:00
Marten Seemann
54d0a0e7e9 remove stray debug statement when handling packets in the client 2018-06-18 13:29:19 +07:00
Marten Seemann
f26a68d45c implement dial functions that use a context 2018-06-14 16:15:32 +07:00
Marten Seemann
d7dee33bc7 change the source connection ID when creating a new IETF QUIC session 2018-05-30 21:37:05 +08:00
Marten Seemann
733e2e952b use callbacks for signaling the session status
Instead of exposing a session.handshakeStatus() <-chan error, it's
easier to pass a callback to the session which is called when the
handshake is done.
The removeConnectionID callback is in preparation for IETF QUIC, where a
connection can have multiple connection IDs over its lifetime.
2018-05-29 21:27:08 +08:00
Marten Seemann
c7119b2adf move logging of connection closing to the session 2018-05-29 21:24:24 +08:00
Marten Seemann
6b82e46e0c use the prefix logger for client, server and proxy 2018-05-29 20:52:54 +08:00
Marten Seemann
5142b73ac3
Merge pull request #1370 from lucas-clemente/client-header-parsing
parse headers sent by the server without knowing the version
2018-05-29 16:43:52 +08:00
Marten Seemann
372463db49 don't pass the client's version to the header parser 2018-05-21 11:27:15 +08:00
Marten Seemann
c98afd6625 simplify version negotiation in the client 2018-05-15 11:02:21 +09:00
Marten Seemann
8f2fed1b10 parse IETF headers independent of the sender's perspective
The IETF header format allows parsing of the header without knowing
which peer sent the packet.
2018-05-09 13:28:30 +09:00
Marten Seemann
683b5823e4 handle gQUIC and IETF QUIC packets separately in the client 2018-05-08 15:17:16 +09:00
Marten Seemann
cc536fb895 cut packets at the payload length when receiving 2018-04-23 17:47:17 +09:00
Marten Seemann
fae32101a0 use different source and destination connection IDs 2018-04-23 15:23:01 +09:00
Marten Seemann
dd5d376d94 improve packet handling in the client 2018-04-23 11:40:25 +09:00
Marten Seemann
d47124d14d add more methods to the protocol.ConnectionID
This will make it easier to change the underlying type of the connection
ID (potentially an array is faster than a byte slice).
2018-04-19 16:08:06 +09:00
Marten Seemann
52d31dd7ef implement the new header format
Currently, we're only sending and accepting packets with matching source
and destination connection IDs.
2018-04-19 13:46:54 +09:00
Marten Seemann
1a035a265c change the type of Connection ID to byte slice 2018-04-18 22:41:24 +09:00
Marten Seemann
af8971d8c9 move connection ID generation from the utils to the protocol package 2018-04-17 20:21:06 +09:00
Marten Seemann
948eef3e42 create a logger interface and use it everywhere 2018-04-04 13:03:28 +07:00
Marten Seemann
b40942d39e send stream counts, not stream IDs, in the transport parameters 2018-03-16 17:41:21 +00:00
Marten Seemann
624ac61412 reject unknown versions in the quic.Config 2018-02-26 11:07:06 +08:00
Marten Seemann
58b20c6009 make the number of incoming streams configurable, for IETF QUIC 2018-02-23 22:15:31 +08:00
Marten Seemann
07b8821ef7 use pointer to byte slices in the buffer pool
https://staticcheck.io/docs/staticcheck#SA6002 suggests to use pointers
to objects in the sync.Pool.
2018-02-23 18:57:12 +08:00
Marten Seemann
ce01e99ba1 log version negotiation packets 2018-02-21 14:55:33 +08:00