Commit Graph

533 Commits

Author SHA1 Message Date
Marten Seemann
ec6118f7a0 use the connection ID provided by the server in first Handshake packet 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
02db7817fb make the peer completing the handshake last send a forward-secure packet
In gQUIC, the server completes the handshake first (after sending the
SHLO). In TLS 1.3, the client completes the handshake first (after
sending the CFIN).
They need to have some way to learn that the peer successfully completed
the handshake, so they can stop retransmitting the handshake packets
containing the SHLO or the CFIN, respectively. To achieve that, the peer
finishing the handshake last will send a PING frame in a forward-secure
packet.
2018-05-29 20:51:29 +08:00
Marten Seemann
bd483c75e5 don't save anything about a packet before authenticating it 2018-05-16 18:59:43 +09:00
Marten Seemann
d1dd2a4a60 add logging to the ackhandler 2018-05-14 11:05:37 +09:00
Marten Seemann
08160ab18f queue connection-level window updates from the flow controller directly
It is not sufficient to check for connection-level window updates every
time a packet is sent. When a connection-level window update needs to be
sent, we need to make sure that it gets sent immediately (i.e. call
scheduleSending() in the session).
2018-05-08 15:17:45 +09:00
Marten Seemann
2e8a5807ba queue stream-level window updates from the flow controller directly 2018-05-08 15:17:45 +09:00
Marten Seemann
903747fdc7 remove stray commented code in the session 2018-04-29 20:48:03 +09:00
Marten Seemann
1420b138d5 implement TLPs 2018-04-25 20:47:18 +09:00
Marten Seemann
0c014c0aff fix deadlock when receiving two packets with diversification nonces 2018-04-24 21:14:58 +09:00
Marten Seemann
0e58a679d6 Merge pull request #1319 from lucas-clemente/fix-1307
use different source and destination connection IDs
2018-04-23 17:29:45 +09:00
Marten Seemann
e813d41376 handle PATH_CHALLENGE frames, reject PATH_RESPONSE frames 2018-04-23 16:41:06 +09:00
Marten Seemann
fae32101a0 use different source and destination connection IDs 2018-04-23 15:23:01 +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
f052861775 only allow sending of retransmissions if these are RTO probe packets 2018-04-17 19:58:53 +09:00
Marten Seemann
a23c94dd87 fix race condition when the handshake completes
When the handshake completes, the crypto setup closes the handshakeEvent
channel. We need to make sure that the session run loop immediately
selects this case, and not any other case (especially the packet
reception case). Otherwise, the server crypto setup will deadlock,
because the sentSHLO channel won't be closed, and opening of
forward-secure packets will block indefinitely on that channel.
2018-04-16 13:36:06 +09:00
Marten Seemann
948eef3e42 create a logger interface and use it everywhere 2018-04-04 13:03:28 +07:00
Marten Seemann
302d2a1715 don't use trial decryption for IETF QUIC 2018-03-31 14:29:44 +07:00
Marten Seemann
6c1eba5848 generate the diversification nonce when creating the server crypto setup 2018-03-31 14:29:44 +07:00
Marten Seemann
69f6427d3c refactor session to use a much smaller crypto setup 2018-03-31 14:29:44 +07:00
Marten Seemann
c6526ad927 replace the SetDiversificationNonce crypto setup method by a chan 2018-03-31 14:29:44 +07:00
Marten Seemann
2fbc994d29 move the unencrypted STREAM frame check from the unpacker to the session 2018-03-31 14:29:44 +07:00
Marten Seemann
fed3bf503e keep track of which packets were sent as retransmissions
When an ACK for a packet that was retransmitted arrives, we don't need
to retransmit the retransmission, even if it was lost.
2018-03-16 16:54:39 +01:00
Marten Seemann
56720edc34 report retransmissions separately to the sent packet handler 2018-03-14 11:15:52 +01:00
Marten Seemann
555fa8ec8e Merge pull request #1232 from lucas-clemente/packet-sending-modes
implement packet send modes to determine what kind of packets are sent
2018-03-13 17:39:20 +01:00
Marten Seemann
b5977236ff implement packet send modes to determine what kind of packets are sent 2018-03-13 14:49:48 +01:00
Marten Seemann
9d18d30931 use the peer's max_packet_size when packing packets 2018-03-10 14:27:07 +07:00
Marten Seemann
6ccc76a130 send packets with maximum IPv4 and IPv6 packet size 2018-03-09 22:36:44 +07:00
Marten Seemann
abf57a5551 calculate the packet number length in the sent packet handler 2018-03-07 15:56:18 +07:00
Marten Seemann
ca2471e78d remove explicit error for duplicate or out of order ACKs 2018-03-07 09:30:05 +07:00
Marten Seemann
5c98332e90 implement ACK decimation
ACK generation closely follows Chrome's QuicConnection::MaybeQueueAck()
in ACK_DECIMATION_WITH_REORDERING mode.
2018-03-05 19:56:19 +07:00
Marten Seemann
41d7cbb014 Merge pull request #1219 from lucas-clemente/max-tracked-error-check
remove incorrect error check when sending a packet
2018-03-05 19:34:00 +07:00
Marten Seemann
2d64953e0e remove incorrect error check when sending a packet
There's no need for a check if more than protocol.MaxTrackedSentPackets
packets were sent. There are certain situations where we allow (via
SendingAllowed()) sending of more packets, and we shouldn't throw an
error when the session then actually sends these packets.
2018-03-05 17:08:18 +07:00
Marten Seemann
6f03b3a44a refactor sending of retransmission in the session 2018-03-04 22:16:25 +07:00
Marten Seemann
656dff6163 introduce a UsesStopWaitingFrames() method for version numbers 2018-03-02 16:00:11 +07:00
Marten Seemann
ca7291e8cf send retransmission as separate packets 2018-02-26 22:22:17 +08:00
Marten Seemann
11af98e338 run misspell in gometalinter 2018-02-23 22:39:08 +08:00
Marten Seemann
2f157769c0 Merge pull request #1197 from lucas-clemente/fix-523
make the number of incoming streams configurable
2018-02-23 22:37:25 +08:00
Marten Seemann
245af2c596 make the number of incoming streams configurable, for gQUIC 2018-02-23 22:15:31 +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
8fd7219bfc delete handshake packets from history when receiving a forward-secure packet 2018-02-23 22:15:10 +08:00
Marten Seemann
c65b1aca4e Merge pull request #1187 from lucas-clemente/buffer-pool-pointer
use pointer to byte slices in the buffer pool
2018-02-23 20:50:24 +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
26013b8d64 don't retransmit Initial packets after receiving the first packet 2018-02-23 17:57:42 +08:00
Marten Seemann
da49295b52 expose methods for opening and accepting unidirectional streams 2018-02-21 22:19:37 +08:00
Marten Seemann
0f334e000c don't send an ACK frame for Retry packets 2018-02-18 14:17:51 +08:00
Marten Seemann
1ec720f2f2 implement sending of STREAM_ID_BLOCKED frames 2018-02-06 10:04:40 +08:00
Marten Seemann
46e20ce8c9 implement handling of MAX_STREAM_ID frames 2018-02-06 08:30:58 +08:00