Commit Graph

514 Commits

Author SHA1 Message Date
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
Marten Seemann
02949853f7 use the new stream maps for the IETF QUIC streams map 2018-02-06 07:53:34 +08:00
Marten Seemann
3b82628dbe internalize ackhandler and congestion 2018-02-02 08:40:56 +08:00
Marten Seemann
fbeba1f73a make sure that at least every 20th ACK is retransmittable
This is important because we need to make sure that we can remove old
ACK ranges from the received packet history. The logic we implemented
before was not correct, since we only made sure that every 20th packet
would be retransmittable, but we didn't have any guarantee that this
packet would also contain an ACK frame.
2018-02-01 17:11:05 +08:00
Marten Seemann
9ef3a47da5 send multiple packets at once, if the pacing delay is very small
This is an optimization to avoid waking of the run loop every couple of
microseconds.
2018-01-23 09:13:44 +11:00
Marten Seemann
5ef89733ae implement packet pacing 2018-01-21 14:27:37 +11:00
Marten Seemann
f33243fb41 Merge pull request #1114 from lucas-clemente/connection-state
expose the ConnectionState in the Session
2018-01-12 17:09:52 +07:00
Marten Seemann
9b3139a1d6 use the packet receive time in the receivedPacketHandler
By passing the packet receive time to the receivedPacketHandler we can
get rid of two time.Now() syscalls.
2018-01-12 11:30:39 +07:00
Marten Seemann
66fd3b5195 expose the ConnectionState in the Session
The ConnectionState contains basic details about the QUIC connection.
2018-01-11 16:27:42 +07:00
Marten Seemann
3818fa16b3 make the client send a packet when the handshake completes (in gQUIC)
In gQUIC, there's no equivalent to the Finished message in TLS. The
server knows that the handshake is complete when it receives the first
forward-secure packet sent by the client. If the protocol demands that
the server sends the first data, this would never happen. We need to
make sure that the client actually sends such a packet. Queueing a PING
frame is an easy way to do so.
2018-01-10 19:25:41 +07:00
Marten Seemann
a20e94ee16 use separate streamsMaps for gQUIC and IETF QUIC
This is a lot of duplicate code for now, but it will make moving towards
the new stream ID mapping in IETF QUIC (and unidirectional streams) much
easier.
2018-01-10 08:56:15 +07:00
Marten Seemann
69437a0e78 introduce a streamManager interface for the streamsMap 2018-01-10 08:56:15 +07:00
Marten Seemann
e802491a8f create internal interfaces for send and receive streams
And use those for handling frames.
2018-01-10 08:56:13 +07:00
Marten Seemann
b0ab718c7a delete non-forward-secure retransmissions when the handshake completes 2018-01-09 17:16:27 +07:00
Marten Seemann
3e2faa45a6 refactor sending such that session.sendPacket only sends one packet 2018-01-09 16:42:44 +07:00
Marten Seemann
46384c4845 refactor sending of ACK-only packets in a separate function
No functional change expected.
2018-01-09 16:42:44 +07:00
Marten Seemann
b687dd774f remove the Range method in the streamsMap
streamsMap.Range was only used to pass the stream flow control window to
all open streams after receiving the peer's transport parameters. It's
easier to pass the transport parameters to the streamsMap directly.
2018-01-03 16:18:53 +07:00
Marten Seemann
8a3f807a12 immediately delete a stream when it is completed
By introducing a callback to the stream, which the stream calls as soon
as it is completed, we can get rid of checking every single open stream
if it is completed.
2018-01-03 10:30:20 +07:00
Marten Seemann
091b6b2602 Merge pull request #1087 from lucas-clemente/remove-non-forward-secure-dialing
remove non forward-secure dialing
2018-01-02 23:48:00 +07:00
Marten Seemann
99a2853e7d remove non forward-secure dialing
This was broken for a long time, and won't be available when using the
TLS 1.3 handshake.
2018-01-02 23:26:55 +07:00