Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement the datagram draft #2162

Merged
merged 15 commits into from
Dec 17, 2020
Merged

implement the datagram draft #2162

merged 15 commits into from
Dec 17, 2020

Conversation

marten-seemann
Copy link
Member

@marten-seemann marten-seemann commented Oct 6, 2019

Implements draft-01 of https://datatracker.ietf.org/doc/draft-ietf-quic-datagram/.

Open questions:

  • how to expose the maximum DATAGRAM frame size (which is announced by peer in its transport parameters)
  • how to handle messages larger than the maximum size (at the moment we just return an error)

Note that the maximum datagram size can change at any moment (in theory, not as it's implemented right now): The path MTU could change, or we could use a connection ID with a different length, leaving more / less space in the packet for the payload.

Idea: Return a quic.ErrMessageTooLarge error. Callers of SendMessage are required to check for this error and should not propagate this error, but repackage the message into smaller pieces.

@codecov-io
Copy link

codecov-io commented Oct 6, 2019

Codecov Report

Merging #2162 (1728a6c) into master (deacefd) will decrease coverage by 0.14%.
The diff coverage is 77.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2162      +/-   ##
==========================================
- Coverage   86.22%   86.08%   -0.14%     
==========================================
  Files         132      134       +2     
  Lines        9141     9265     +124     
==========================================
+ Hits         7881     7975      +94     
- Misses        910      934      +24     
- Partials      350      356       +6     
Impacted Files Coverage Δ
internal/protocol/protocol.go 100.00% <ø> (ø)
session.go 77.33% <10.34%> (-2.08%) ⬇️
packet_packer.go 84.50% <90.00%> (+0.08%) ⬆️
datagram_queue.go 93.33% <93.33%> (ø)
internal/wire/datagram_frame.go 95.12% <95.12%> (ø)
config.go 100.00% <100.00%> (ø)
http3/client.go 86.92% <100.00%> (ø)
internal/logutils/frame.go 100.00% <100.00%> (ø)
internal/wire/frame_parser.go 97.70% <100.00%> (+0.20%) ⬆️
internal/wire/transport_parameters.go 88.43% <100.00%> (+0.10%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deacefd...1728a6c. Read the comment docs.

@marten-seemann
Copy link
Member Author

Updated to the new draft version: https://tools.ietf.org/html/draft-pauly-quic-datagram-04.

@apmattil
Copy link
Contributor

I hope this is merged to master.

@marten-seemann marten-seemann marked this pull request as ready for review November 27, 2020 10:12
@@ -44,11 +44,14 @@ const (
)

// A ByteCount in QUIC
type ByteCount uint64
type ByteCount int64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems scary to me :S Are we sure this doesn't break any assumptions around non-negative numbers sprinkled throughout the codebase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did uncover a uint underflow, fortunately it was just in test code (in the flow controller). I'm not sure why this is scary, as QUIC's varint encoding makes sure that all numbers that can practically be used are limited to MaxUint64 / 4.

return f
default:
return nil
}
}

// HandleDatagramFrame handles a received DATAGRAM frame.
func (h *datagramQueue) HandleDatagramFrame(f *wire.DatagramFrame) {
data := make([]byte, len(f.Data))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a buf here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STREAM frames use frame-specific buffer pools, so maybe we need a DATAGRAM-pool here? Anyway, let's keep this for a future PR.

@marten-seemann marten-seemann merged commit 9693a46 into master Dec 17, 2020
@marten-seemann marten-seemann deleted the datagram branch December 17, 2020 04:24
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants